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: except:
api = {"isSuccessful": False} api = {"isSuccessful": False}
return api return api
@ -165,7 +165,8 @@ def feedback(args, request):
except: except:
return {"isSuccessful": False} return {"isSuccessful": False}
@frappe.whitelist() @frappe.whitelist()
def model_hit(args, request): def model_hit(args, request):
try: 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() @frappe.whitelist()
def get_technical_manual(args): def get_technical_manual(args):
try: 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' 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(args,current_db_name), as_dict=True) and parentfield = 'assets';'''.format(current_db_name,args), as_dict=True)
for i in manual_out: for i in manual_out:
try: try:

3
smart_service/apis/update_validation.py

@ -285,12 +285,13 @@ def check_vehicle_update(vehicle_list):
@frappe.whitelist() @frappe.whitelist()
def update_completed(FileName): def update_completed(FileName):
try: try:
os.remove(base_url+ FileName) os.remove(base_url+FileName)
return {'isSuccessful':True} return {'isSuccessful':True}
except: except:
return {'isSuccessful':False} return {'isSuccessful':False}
@frappe.whitelist() @frappe.whitelist()
def delete_complete(doc=None,method=None): 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_color = "#E31A37"
app_email = "siva@hnsonline.com" app_email = "siva@hnsonline.com"
app_license = "MIT" 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" # app_logo_url = "/assets/smart_service/images/ic_app_icon1.png"
# ic_app_icon.png # ic_app_icon.png
@ -19,7 +20,7 @@ web_include_css = ["/assets/css/smart_service.min.css"]
# Icons # Icons
website_context = { 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/Mahindra_NewSplash.png",
# "splash_image": "/assets/smart_service/images/ic_app_icon1.png", # "splash_image": "/assets/smart_service/images/ic_app_icon1.png",
"app_name" : "smart service" "app_name" : "smart service"
@ -192,18 +193,21 @@ user_data_fields = [
# "smart_service.auth.validate" # "smart_service.auth.validate"
# ] # ]
fixtures = [ fixtures = [
#"doctype": "Notification", # {
#"filters": [{"is_standard":0}] # "doctype": "Notification",
"Custom Field", # "filters": [{"is_standard":0}]
"Property Setter", # }
"Client Script", #"Custom Field",
"Server Script", #"Property Setter",
"Workflow", #"Client Script",
"Workflow Action Master", #"Server Script",
"Workflow State", #"Workflow",
"Role", #"Workflow Action Master",
"Workspace", #"Workflow State",
"Custom DocPerm" #"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; return json;
} }
isSubmit = 1; 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 rawResponse = await fetch("http://www.mahindramile.com/WindowAuth/Service.asmx/ValidateCredential?LoginID=" + args.usr + "&Password=" + btoa(getPass));
const resStr = await rawResponse.text(); const resStr = await rawResponse.text();
login.set_status('{{ _("Verifying...") }}', 'blue'); login.set_status('{{ _("Verifying...") }}', 'blue');
@ -138,7 +146,7 @@ login.bind_events = function () {
return false; 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): class KilometerMapping(Document):
def validate(self): 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() @frappe.whitelist()
def get_vm_asset(doc): def get_vm_asset(doc):
doc = frappe.get_doc("Variant Mapping",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 return vm_assets
@frappe.whitelist() @frappe.whitelist()
def get_sm_asset(doc): 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: if system_map:
for s in system_map: for s in system_map:
doc = frappe.get_doc("System Mapping",s.name) 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 return system_asset
@frappe.whitelist() @frappe.whitelist()
def get_system(doc): 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: if system_map:
for s in system_map: for s in system_map:
doc = frappe.get_doc("System Mapping",s.name) 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 return system

Loading…
Cancel
Save