Browse Source

update kilometer mapping and login logo

master
Ubuntu 3 years ago
parent
commit
a56372428b
  1. 5
      smart_service/apis/addon_api.py
  2. 4
      smart_service/apis/transaction_api.py
  3. 3
      smart_service/apis/update_validation.py
  4. 10
      smart_service/fixtures/client_script.json
  5. 32
      smart_service/hooks.py
  6. BIN
      smart_service/public/images/Logo Fav Icon.png
  7. BIN
      smart_service/public/images/Mahindra and SS.png
  8. BIN
      smart_service/public/images/SS Alone.png
  9. BIN
      smart_service/public/images/SS and Mahindra.png
  10. 12
      smart_service/templates/includes/login/_login.js
  11. 20
      smart_service/transactions/doctype/kilometer_mapping/kilometer_mapping.py
  12. 10
      smart_service/transactions/doctype/publish/publish.py

5
smart_service/apis/addon_api.py

@ -57,7 +57,7 @@ def addon(args):
except:
api = {"isSuccessful": False}
return api
@ -165,7 +165,8 @@ def feedback(args, request):
except:
return {"isSuccessful": False}
@frappe.whitelist()
def model_hit(args, request):
try:

4
smart_service/apis/transaction_api.py

@ -13,8 +13,8 @@ base_url = os.path.expanduser("~") + "/frappe-bench/sites/"+site_name+"/public"
@frappe.whitelist()
def get_technical_manual(args):
try:
manual_out=frappe.db.sql('''SELECT parent as variant, language, attach_file as file, active_status FROM {1}.`tabVariant Mapping_Assets` where parent='{0}' and category='Technical Manual'
and parentfield = 'assets';'''.format(args,current_db_name), as_dict=True)
manual_out=frappe.db.sql('''SELECT parent as variant, language, attach_file as file, active_status FROM {0}.`tabVariant Mapping_Assets` where parent='{1}' and category='Technical Manual'
and parentfield = 'assets';'''.format(current_db_name,args), as_dict=True)
for i in manual_out:
try:

3
smart_service/apis/update_validation.py

@ -285,12 +285,13 @@ def check_vehicle_update(vehicle_list):
@frappe.whitelist()
def update_completed(FileName):
try:
os.remove(base_url+ FileName)
os.remove(base_url+FileName)
return {'isSuccessful':True}
except:
return {'isSuccessful':False}
@frappe.whitelist()
def delete_complete(doc=None,method=None):

10
smart_service/fixtures/client_script.json

File diff suppressed because one or more lines are too long

32
smart_service/hooks.py

@ -8,7 +8,8 @@ app_icon = ""
app_color = "#E31A37"
app_email = "siva@hnsonline.com"
app_license = "MIT"
app_logo_url = "/assets/smart_service/images/Mahindra_NewSplash.png"
# app_logo_url = "/assets/smart_service/images/SS Alone.png"
app_logo_url = "/assets/smart_service/images/SS and Mahindra.png"
# app_logo_url = "/assets/smart_service/images/ic_app_icon1.png"
# ic_app_icon.png
@ -19,7 +20,7 @@ web_include_css = ["/assets/css/smart_service.min.css"]
# Icons
website_context = {
"favicon": "/assets/smart_service/images/Smart_service_logo.png",
"favicon": "/assets/smart_service/images/Logo Fav Icon.png",
"splash_image": "/assets/smart_service/images/Mahindra_NewSplash.png",
# "splash_image": "/assets/smart_service/images/ic_app_icon1.png",
"app_name" : "smart service"
@ -192,18 +193,21 @@ user_data_fields = [
# "smart_service.auth.validate"
# ]
fixtures = [
#"doctype": "Notification",
#"filters": [{"is_standard":0}]
"Custom Field",
"Property Setter",
"Client Script",
"Server Script",
"Workflow",
"Workflow Action Master",
"Workflow State",
"Role",
"Workspace",
"Custom DocPerm"
# {
# "doctype": "Notification",
# "filters": [{"is_standard":0}]
# }
#"Custom Field",
#"Property Setter",
#"Client Script",
#"Server Script",
#"Workflow",
#"Workflow Action Master",
#"Workflow State",
#"Role",
#"Workspace",
#"Custom DocPerm"
#"Dashboard Chart"
]

BIN
smart_service/public/images/Logo Fav Icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 821 B

BIN
smart_service/public/images/Mahindra and SS.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
smart_service/public/images/SS Alone.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

BIN
smart_service/public/images/SS and Mahindra.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

12
smart_service/templates/includes/login/_login.js

@ -68,7 +68,15 @@ login.bind_events = function () {
return json;
}
isSubmit = 1;
(async () => {
args.pwd = getPass;
args.device = "desktop";
login.call(args);
isSubmit = 0;
$("button").css("cursor", "pointer");
$("body").css("cursor", "default");
$('.login-captcha-refresh').css('z-index', '2');
$('.toggle-password').css('z-index', '2');
/*(async () => {
const rawResponse = await fetch("http://www.mahindramile.com/WindowAuth/Service.asmx/ValidateCredential?LoginID=" + args.usr + "&Password=" + btoa(getPass));
const resStr = await rawResponse.text();
login.set_status('{{ _("Verifying...") }}', 'blue');
@ -138,7 +146,7 @@ login.bind_events = function () {
return false;
})();
})();*/

20
smart_service/transactions/doctype/kilometer_mapping/kilometer_mapping.py

@ -6,4 +6,22 @@ from frappe.model.document import Document
class KilometerMapping(Document):
def validate(self):
pass
pass
@frappe.whitelist()
def get_system(doc):
current_db_name = frappe.conf.get("db_name")
system_map = frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping='{1}'""".format(current_db_name,doc),as_dict=True)
if system_map:
for s in system_map:
doc = frappe.get_doc("System Mapping",s.name)
system = frappe.db.sql("""select sub_systems,mat from {0}.`tabSystem Mapping_Sub System` where parent = '{1}' and procedure_is_published = '0'""".format(current_db_name,s.name),as_dict=True)
return system
@frappe.whitelist()
def get_subsystem(doc):
current_db_name = frappe.conf.get("db_name")
system_map = frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping='{1}'""".format(current_db_name,doc),as_dict=True)
if system_map:
for s in system_map:
doc = frappe.get_doc("System Mapping",s.name)
sub_system = frappe.db.sql("""select sub_systems,mat,idx from {0}.`tabSystem Mapping_Sub System` where parent = '{1}' and procedure_is_published = '0'""".format(current_db_name,s.name),as_dict=True)
return sub_system

10
smart_service/transactions/doctype/publish/publish.py

@ -172,22 +172,22 @@ def update_mapping(variant_mapping,doc):
@frappe.whitelist()
def get_vm_asset(doc):
doc = frappe.get_doc("Variant Mapping",doc)
vm_assets = frappe.db.sql("""select category,language,attach_file,active_status from `tabVariant Mapping_Assets` where parent = %s and published = '0'""",doc.name,as_dict=True)
vm_assets = frappe.db.sql("""select category,language,attach_file,active_status from {0}.`tabVariant Mapping_Assets` where parent = '{1}' and published = '0'""".format(current_db_name,doc.name),as_dict=True)
return vm_assets
@frappe.whitelist()
def get_sm_asset(doc):
system_map = frappe.db.sql("""select name from `tabSystem Mapping` where variant_mapping=%s""",doc,as_dict=True)
system_map = frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping='{1}'""".format(current_db_name,doc),as_dict=True)
if system_map:
for s in system_map:
doc = frappe.get_doc("System Mapping",s.name)
system_asset = frappe.db.sql("""select systems,language,active_status,system_asset from `tabSystem Mapping_System Assets` where parent = %s and published = '0'""",s.name,as_dict=True)
system_asset = frappe.db.sql("""select systems,language,active_status,system_asset from {0}.`tabSystem Mapping_System Assets` where parent = '{1}' and published = '0'""".format(current_db_name,s.name),as_dict=True)
return system_asset
@frappe.whitelist()
def get_system(doc):
system_map = frappe.db.sql("""select name from `tabSystem Mapping` where variant_mapping=%s""",doc,as_dict=True)
system_map = frappe.db.sql("""select name from {0}.`tabSystem Mapping` where variant_mapping='{1}'""".format(current_db_name,doc),as_dict=True)
if system_map:
for s in system_map:
doc = frappe.get_doc("System Mapping",s.name)
system = frappe.db.sql("""select systems,sub_systems,active_status,symptom,component,estimated_time,rts,component,mat,procedure_status,`procedure` from `tabSystem Mapping_Sub System` where parent = %s and procedure_is_published = '0'""",s.name,as_dict=True)
system = frappe.db.sql("""select systems,sub_systems,active_status,symptom,component,estimated_time,rts,component,mat,procedure_status,`procedure` from {0}.`tabSystem Mapping_Sub System` where parent = '{1}' and procedure_is_published = '0'""".format(current_db_name,s.name),as_dict=True)
return system

Loading…
Cancel
Save