Merge branch 'main' of https://github.com/itsdave-de/msp into main

This commit is contained in:
Beate Trzensiok 2022-06-21 13:19:53 +02:00
commit e6f93eaa0d
19 changed files with 602 additions and 31 deletions

View File

@ -16,7 +16,7 @@ app_license = "GPLv3"
# include js, css files in header of desk.html
# app_include_css = "/assets/msp/css/msp.css"
# app_include_js = "/assets/msp/js/msp.js"
app_include_js = "/assets/msp/js/customer_quick_entry.js"
# include js, css files in header of web template
# web_include_css = "/assets/msp/css/msp.css"
@ -79,13 +79,11 @@ app_license = "GPLv3"
# ---------------
# Hook on document methods and events
# doc_events = {
# "*": {
# "on_update": "method",
# "on_cancel": "method",
# "on_trash": "method"
# }
# }
doc_events = {
"Customer": {
"on_update": "msp.msp.customer_quick_entry.custom_customer_info"
}
}
# Scheduled Tasks
# ---------------

View File

@ -1,4 +1,5 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:IP-{ip_address}-{it_landscape}",
"creation": "2021-03-18 03:15:11.235106",
@ -53,7 +54,8 @@
"reqd": 1
}
],
"modified": "2021-03-24 00:15:34.341218",
"links": [],
"modified": "2022-06-17 11:21:47.850521",
"modified_by": "Administrator",
"module": "MSP",
"name": "IP Address",
@ -70,6 +72,30 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@ -1,4 +1,5 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "format:NET-{network_address}/{cidr_mask}-{it_landscape}",
"creation": "2021-03-18 03:13:40.772882",
@ -147,7 +148,8 @@
"label": "Aditional Data"
}
],
"modified": "2021-03-29 15:19:10.791248",
"links": [],
"modified": "2022-06-17 11:20:37.093173",
"modified_by": "Administrator",
"module": "MSP",
"name": "IP Network",
@ -164,6 +166,30 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "ITCL-.#####",
"creation": "2021-03-18 02:30:47.686842",
"doctype": "DocType",
@ -34,7 +35,8 @@
"label": "Completed on"
}
],
"modified": "2021-03-18 02:30:47.686842",
"links": [],
"modified": "2022-06-17 11:22:55.055154",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT Checklist",
@ -51,6 +53,30 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "ITCLT-.###",
"creation": "2021-03-18 02:27:40.328506",
"doctype": "DocType",
@ -14,7 +15,8 @@
"label": "Title"
}
],
"modified": "2021-03-18 02:27:40.328506",
"links": [],
"modified": "2022-06-17 11:21:13.492067",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT Checklist Template",
@ -31,6 +33,28 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1
}
],
"sort_field": "modified",

View File

@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "ITCON-.#####",
"creation": "2021-03-18 02:54:42.727620",
"doctype": "DocType",
@ -8,7 +9,14 @@
"title",
"customer",
"it_landscape",
"it_contract_type"
"it_contract_type",
"sla_details_section",
"html_10",
"reaction_time_emergeny",
"reaction_time_urgent",
"reaction_time_issue",
"reaction_time_change",
"column_break_11"
],
"fields": [
{
@ -33,9 +41,44 @@
"fieldtype": "Link",
"label": "IT Contract Type",
"options": "IT Contract Type"
},
{
"fieldname": "sla_details_section",
"fieldtype": "Section Break",
"label": "SLA Details"
},
{
"fieldname": "reaction_time_emergeny",
"fieldtype": "Data",
"label": "Reaction Time Emergeny"
},
{
"fieldname": "reaction_time_urgent",
"fieldtype": "Data",
"label": "Reaction Time Urgent"
},
{
"fieldname": "reaction_time_issue",
"fieldtype": "Data",
"label": "Reaction Time Issue"
},
{
"fieldname": "reaction_time_change",
"fieldtype": "Data",
"label": "Reaction Time Change"
},
{
"fieldname": "html_10",
"fieldtype": "HTML",
"options": "Reaktion Times May be written Hours like \"4H\" or in Business Days Like \"1BD\""
},
{
"fieldname": "column_break_11",
"fieldtype": "Column Break"
}
],
"modified": "2021-03-23 21:04:54.623670",
"links": [],
"modified": "2022-06-17 11:19:34.968766",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT Contract",
@ -52,6 +95,29 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "field:title",
"creation": "2021-03-23 21:03:02.275205",
"doctype": "DocType",
@ -15,7 +16,8 @@
"unique": 1
}
],
"modified": "2021-03-23 21:03:02.275205",
"links": [],
"modified": "2022-06-17 11:20:18.380840",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT Contract Type",
@ -32,6 +34,28 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1
}
],
"sort_field": "modified",

View File

@ -4,7 +4,20 @@
frappe.ui.form.on('IT Landscape', {
refresh: function(frm) {
frm.add_custom_button('Copy SSH Keys', () => frm.trigger('copy_ssh_keys'), 'Actions');
if (frm.doc.ticket_system_link) {
frm.add_custom_button('Open Ticket System', () => frm.trigger('open_ticket_system'), 'Actions');
};
if (frm.doc.monitoring_link) {
frm.add_custom_button('Open Monitoring', () => frm.trigger('open_monitoring'), 'Actions');
}
},
open_ticket_system: function(frm) {
window.open(frm.doc.ticket_system_link, '_blank').focus();
},
open_monitoring: function(frm) {
window.open(frm.doc.monitoring_link, '_blank').focus();
},
copy_ssh_keys: function(frm) {
frappe.call({
"method": "msp.whitelisted_tools.get_ssh_keys_for_landscape",

View File

@ -8,11 +8,18 @@
"engine": "InnoDB",
"field_order": [
"title",
"abbreviation",
"customer",
"customer_name",
"abbreviation",
"column_break_5",
"operating_mode",
"contract",
"description_section",
"description",
"section_break_6"
"section_break_6",
"landscape_image",
"monitoring_link",
"ticket_system_link"
],
"fields": [
{
@ -53,11 +60,49 @@
},
{
"fieldname": "section_break_6",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"label": "Aditional Data"
},
{
"fieldname": "landscape_image",
"fieldtype": "Attach Image",
"label": "Landscape Image"
},
{
"fieldname": "column_break_5",
"fieldtype": "Column Break"
},
{
"fieldname": "operating_mode",
"fieldtype": "Select",
"label": "Operating Mode",
"options": "\nSLA\nHosting\nown IT with Support Contract\nself maintained\nneglected"
},
{
"fieldname": "description_section",
"fieldtype": "Section Break",
"label": "Description"
},
{
"fieldname": "contract",
"fieldtype": "Link",
"label": "Contract",
"options": "IT Contract"
},
{
"fieldname": "monitoring_link",
"fieldtype": "Data",
"label": "Monitoring Link"
},
{
"fieldname": "ticket_system_link",
"fieldtype": "Data",
"label": "Ticket System Link"
}
],
"image_field": "landscape_image",
"links": [],
"modified": "2022-01-27 23:36:00.711074",
"modified": "2022-06-17 12:03:50.957612",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT Landscape",
@ -74,6 +119,29 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@ -2,7 +2,19 @@
// For license information, please see license.txt
frappe.ui.form.on('IT Object', {
// refresh: function(frm) {
refresh: function(frm) {
if (frm.doc.admin_interface_link) {
frm.add_custom_button('Open Admin Interface', () => frm.trigger('open_admin_interface'), 'Actions');
};
if (frm.doc.monitoring_link) {
frm.add_custom_button('Open Monitoring', () => frm.trigger('open_monitoring'), 'Actions');
};
},
open_admin_interface: function(frm) {
window.open(frm.doc.admin_interface_link, '_blank').focus();
},
open_monitoring: function(frm) {
window.open(frm.doc.monitoring_link, '_blank').focus();
},
// }
});

View File

@ -21,7 +21,10 @@
"description",
"image",
"network_config_section",
"ip_adresses"
"ip_adresses",
"external_links_section",
"monitoring_link",
"admin_interface_link"
],
"fields": [
{
@ -118,11 +121,27 @@
"fieldtype": "Table",
"label": "IP Adresses",
"options": "IT Object IP Address"
},
{
"collapsible": 1,
"fieldname": "external_links_section",
"fieldtype": "Section Break",
"label": "External Links"
},
{
"fieldname": "monitoring_link",
"fieldtype": "Data",
"label": "Monitoring Link"
},
{
"fieldname": "admin_interface_link",
"fieldtype": "Data",
"label": "Admin Interface Link"
}
],
"image_field": "image",
"links": [],
"modified": "2022-01-27 22:39:21.190206",
"modified": "2022-06-17 11:43:07.550361",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT Object",
@ -139,6 +158,29 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@ -0,0 +1,19 @@
frappe.listview_settings['IT Object'] = {
get_indicator: function (doc) {
if (doc.status === "in Production") {
return [__("in Production"), "green", "status,=,in Production"];
}
else if (doc.status === "Implementation") {
return [__("Implementation"), "blue", "status,=,Implementation"];
}
else if (doc.status === "in Maintenance") {
return [__("in Maintenance"), "orange", "status,=,in Maintenance"];
}
else if (doc.status === "failed") {
return [__("failed"), "red", "status,=,failed"];
}
else if (doc.status === "Decommissioned") {
return [__("Decommissioned"), "grey", "status,=,Decommissioned"];
}
}
}

View File

@ -1,4 +1,5 @@
{
"actions": [],
"allow_rename": 1,
"autoname": "field:title",
"creation": "2021-03-18 01:31:27.823964",
@ -30,7 +31,8 @@
"label": "Default Image"
}
],
"modified": "2021-03-23 21:09:27.176989",
"links": [],
"modified": "2022-06-17 11:20:57.722192",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT Object Type",
@ -47,6 +49,29 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

View File

@ -3,10 +3,21 @@
frappe.ui.form.on('IT User Account', {
refresh: function(frm) {
frm.add_custom_button('Copy PW', () => frm.trigger('get_pw'));
frm.add_custom_button('Generate PW', () => frm.trigger('generate_new_pw'));
frm.add_custom_button('Copy PW', () => frm.trigger('get_pw'),"Actions");
frm.add_custom_button('Show PW', () => frm.trigger('show_pw'),"Actions");
frm.add_custom_button('Generate PW', () => frm.trigger('generate_new_pw'),"Actions");
},
show_pw: function(frm) {
frm.call('copy_pw', {
'user_agent': navigator.userAgent,
'platform': navigator.platform,
},
(r) => {
frappe.msgprint(r.message)
}
);
},
get_pw: function(frm) {
frm.call('copy_pw', {
'user_agent': navigator.userAgent,

View File

@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "ITUACC-.#####",
"creation": "2021-03-18 02:43:33.591837",
"doctype": "DocType",
@ -54,7 +55,8 @@
"label": "UPN"
}
],
"modified": "2021-03-24 13:31:10.543697",
"links": [],
"modified": "2022-06-17 11:22:18.100486",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT User Account",
@ -71,6 +73,29 @@
"role": "IT User Account Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

View File

@ -1,4 +1,5 @@
{
"actions": [],
"autoname": "field:title",
"creation": "2021-03-18 02:44:48.527444",
"doctype": "DocType",
@ -15,7 +16,8 @@
"unique": 1
}
],
"modified": "2021-03-18 02:44:48.527444",
"links": [],
"modified": "2022-06-17 11:22:39.857595",
"modified_by": "Administrator",
"module": "MSP",
"name": "IT User Account Type",
@ -32,6 +34,28 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"quick_entry": 1,

View File

@ -87,7 +87,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2022-01-27 23:40:39.860991",
"modified": "2022-06-17 11:19:58.666409",
"modified_by": "Administrator",
"module": "MSP",
"name": "SSH Public Key",
@ -104,6 +104,30 @@
"role": "System Manager",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP User",
"share": 1,
"write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "MSP Admin",
"share": 1,
"write": 1
}
],
"sort_field": "modified",

View File

@ -0,0 +1,118 @@
frappe.provide('frappe.ui.form');
frappe.ui.form.CustomerQuickEntryForm = frappe.ui.form.QuickEntryForm.extend({
init: function(doctype, after_insert, init_callback, doc, force) {
this._super(doctype, after_insert, init_callback, doc, force);
this.skip_redirect_on_error = true;
},
render_dialog: function() {
this.mandatory = this.mandatory.concat(this.get_variant_fields());
this._super();
console.log("hi")
let me = this
console.log(me)
me.dialog.fields_dict.customer_name.$input[0].onchange = function() {
me.inputHandler(this)
}
},
inputHandler: function(obj) {
console.log("test")
console.log(obj.value)
},
get_variant_fields: function() {
var variant_fields = [{
fieldtype: "Section Break",
label: __("Primary Contact Details"),
collapsible: 1
},
{
label: __("Salutation"),
fieldname: "contact_salutation",
fieldtype: "Link",
options: "Salutation"
},
{
label: __("First Name"),
fieldname: "first_name",
fieldtype: "Data"
},
{
label: __("Last Name"),
fieldname: "last_name",
fieldtype: "Data"
},
{
fieldtype: "Column Break"
},
{
label: __("Mobile Number"),
fieldname: "mobile_no",
fieldtype: "Data"
},
{
label: __("Phone Number"),
fieldname: "phone",
fieldtype: "Data"
},
{
label: __("Email Id"),
fieldname: "email_id",
fieldtype: "Data"
},
{
fieldtype: "Section Break",
label: __("Primary Address Details"),
collapsible: 1
},
{
label: __("Address Line 1"),
fieldname: "address_line1",
fieldtype: "Data"
},
{
label: __("Address Line 2"),
fieldname: "address_line2",
fieldtype: "Data"
},
{
label: __("ZIP Code"),
fieldname: "pincode",
fieldtype: "Data"
},
{
fieldtype: "Column Break"
},
{
label: __("City"),
fieldname: "city",
fieldtype: "Data"
},
{
label: __("State"),
fieldname: "state",
fieldtype: "Data",
hidden: 1
},
{
label: __("Country"),
fieldname: "country",
fieldtype: "Link",
options: "Country",
default: "Germany"
},
{
label: __("Customer POS Id"),
fieldname: "customer_pos_id",
fieldtype: "Data",
hidden: 1
}];
return variant_fields;
},
})

0
msp/public/v Normal file
View File