import{r as e,o as t,c as a,a as n,w as o,v as l,F as c,d as r,m as s,A as u,t as p}from "./index.js";let y={id:"SystemIndex",class:"page-container"},k={class:"panel-container"},L=n("h3",{class:"panel-title"},"FTP Upgrade URL",-1),S={class:"panel-content"},U={class:"panel-container"},F=n("h3",{class:"panel-title"},"Diagnostics Logs Upload URL",-1),R={class:"panel-content"},w={class:"panel-container"},I=n("h3",{class:"panel-title"},"Esc Routine PCBA Code",-1),P={class:"panel-content"},A={class:"panel-group span-8"},T={class:"panel-title"},x={class:"panel-content"},B=["onClick"],H={__name:"system",setup(i){let d=e({ftp_upgrade_url:"",ftp_upload_url:"",esc_pcba:""}),f=[{title:"Reboot Device",data:"Reset",btn:"Reboot"},{title:"Restore Factory Settings",data:"factoryChargePoint",btn:"Factory Reset"},{title:"Self Check",data:"selfcheckChargePoint",btn:"Enable"},{title:"Reset Lcd",data:"resetHmiPower",btn:"Reset"},{title:"Lock Connector1",data:"LockerConnectorId1",btn:"Lock Connector1"},{title:"UnLock Connector1",data:"UnLockerConnectorId1",btn:"UnLock Connector1"},{title:"Rfu Func",data:"RfuFunc",btn:"Rfu Func"},{title:"Lock Connector2",data:"LockerConnectorId2",btn:"Lock Connector2"},{title:"UnLock Connector2",data:"UnLockerConnectorId2",btn:"UnLock Connector2"},];function b(){if(""==d.value.ftp_upgrade_url)return s.warning("The url is empty.");u.System.upgrade_url({url:d.value.ftp_upgrade_url}).then(()=>{s.success("Success")}).catch(()=>{s.error("Failure")})}
function h(){if(""==d.value.ftp_upload_url)return s.warning("The url is empty.");u.System.upload_url({url:d.value.ftp_upload_url}).then(()=>{s.success("Success")}).catch(()=>{s.error("Failure")})}
function m(){if(""==d.value.esc_pcba)return s.warning("The PCBA code is empty.");u.Common.keySet({EcsRoutinePcbaCode:d.value.esc_pcba}).then(()=>{s.success("Success")}).catch(()=>{s.error("Failure")})}
return(e,i)=>(t(),a("div",y,[n("div",k,[L,n("div",S,[o(n("input",{"onUpdate:modelValue":i[0]||(i[0]=(e)=>(d.value.ftp_upgrade_url=e)),placeholder:"ftp://user[:password]@host[:port]/path/firmware.bin","onLoad:window":(d.value.ftp_upgrade_url="ftp://duo_power:ZuXjPTJtXjAW1VDA@ocpp.em2go.de/firmware/latest/mbed-os-ocpp_update.bin"),},null,512),[[l,d.value.ftp_upgrade_url]]),n("button",{type:"button",class:"primary",onClick:b},"Upgrade Firmware"),]),]),n("div",U,[F,n("div",R,[o(n("input",{"onUpdate:modelValue":i[1]||(i[1]=(e)=>(d.value.ftp_upload_url=e)),placeholder:"ftp://user[:password]@host[:port]/path/","onLoad:window":(d.value.ftp_upload_url="ftp://duo_power_logs:N4xRWqXNINHbM!y8@ocpp.em2go.de/"),},null,512),[[l,d.value.ftp_upload_url]]),n("button",{type:"button",class:"primary",onClick:h},"Upload diagnostic log"),]),]),n("div",w,[I,n("div",P,[o(n("input",{"onUpdate:modelValue":i[2]||(i[2]=(e)=>(d.value.esc_pcba=e)),placeholder:"202208151011123456"},null,512),[[l,d.value.esc_pcba]]),n("button",{type:"button",class:"primary",onClick:m},"Set"),]),]),n("div",A,[(t(),a(c,null,r(f,(e,t)=>n("div",{class:"panel-container",key:t},[n("h3",T,p(e.title),1),n("div",x,[n("button",{type:"button",class:"primary",onClick:(t)=>(function e(t){if("selfcheckChargePoint"!=t||!1!==confirm("Only run the Self Check if our support has informed you to do so. Self Check can be deactivated by pressing the K1 button on the EVSE once. Do you want to Continue?"))
u.System.datatransfer({vendorId:"EM2GO",messageId:"vendorCommand",data:t}).then(()=>{s.success("Success")}).catch(()=>{s.error("Failure")})})(e.data),},p(e.btn),9,B),]),])),64)),]),]))},};export{H as default}