From 71a47523c74aa094c90d782071ab17616fc82999 Mon Sep 17 00:00:00 2001 From: ninioe Date: Sun, 7 Aug 2016 11:37:33 +0300 Subject: add language files back --- web/app.min.js | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ar.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/bg.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/bn.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/cs.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/da.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/de.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/el.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/es.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/fa.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/fi.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/fr.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/he.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/hi.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/hr.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/hu.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/hy.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/id.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/it.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ja.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ka.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ku.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/lo.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/lt.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ml.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ms.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/nb.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ne.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/nl.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/nn.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/pl.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/pt.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/pt_BR.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ro.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ru.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/si.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/sk.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/sl.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/sr.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/ta.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/th.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/tr.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/uk.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/vi.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ web/l10n/zh.json | 136 +++++++++++++++++++++++++++++++++++++++++++++++ 45 files changed, 6134 insertions(+) create mode 100644 web/app.min.js create mode 100644 web/l10n/ar.json create mode 100644 web/l10n/bg.json create mode 100644 web/l10n/bn.json create mode 100644 web/l10n/cs.json create mode 100644 web/l10n/da.json create mode 100644 web/l10n/de.json create mode 100644 web/l10n/el.json create mode 100644 web/l10n/es.json create mode 100644 web/l10n/fa.json create mode 100644 web/l10n/fi.json create mode 100644 web/l10n/fr.json create mode 100644 web/l10n/he.json create mode 100644 web/l10n/hi.json create mode 100644 web/l10n/hr.json create mode 100644 web/l10n/hu.json create mode 100644 web/l10n/hy.json create mode 100644 web/l10n/id.json create mode 100644 web/l10n/it.json create mode 100644 web/l10n/ja.json create mode 100644 web/l10n/ka.json create mode 100644 web/l10n/ku.json create mode 100644 web/l10n/lo.json create mode 100644 web/l10n/lt.json create mode 100644 web/l10n/ml.json create mode 100644 web/l10n/ms.json create mode 100644 web/l10n/nb.json create mode 100644 web/l10n/ne.json create mode 100644 web/l10n/nl.json create mode 100644 web/l10n/nn.json create mode 100644 web/l10n/pl.json create mode 100644 web/l10n/pt.json create mode 100644 web/l10n/pt_BR.json create mode 100644 web/l10n/ro.json create mode 100644 web/l10n/ru.json create mode 100644 web/l10n/si.json create mode 100644 web/l10n/sk.json create mode 100644 web/l10n/sl.json create mode 100644 web/l10n/sr.json create mode 100644 web/l10n/ta.json create mode 100644 web/l10n/th.json create mode 100644 web/l10n/tr.json create mode 100644 web/l10n/uk.json create mode 100644 web/l10n/vi.json create mode 100644 web/l10n/zh.json (limited to 'web') diff --git a/web/app.min.js b/web/app.min.js new file mode 100644 index 000000000..a9e78cbcd --- /dev/null +++ b/web/app.min.js @@ -0,0 +1,150 @@ +Ext.define("Traccar.Style",{singleton:!0,panelPadding:10,windowWidth:640,windowHeight:480,dateTimeFormat24:"Y-m-d H:i:s",dateTimeFormat12:"Y-m-d g:i:s a",timeFormat24:"H:i",timeFormat12:"g:i a",dateFormat:"Y-m-d",weekStartDay:1,deviceWidth:350,reportHeight:250,reportTime:100,mapDefaultLat:51.507222,mapDefaultLon:-0.1275,mapDefaultZoom:6,mapRouteColor:"rgba(21, 127, 204, 1.0)",mapRouteWidth:5,mapArrowStrokeColor:"rgba(50, 50, 50, 1.0)",mapArrowStrokeWidth:2,mapTextColor:"rgba(50, 50, 50, 1.0)",mapTextStrokeColor:"rgba(255, 255, 255, 1.0)", +mapTextStrokeWidth:2,mapTextOffset:10,mapTextFont:"bold 12px sans-serif",mapColorOnline:"rgba(77, 250, 144, 1.0)",mapColorUnknown:"rgba(250, 190, 77, 1.0)",mapColorOffline:"rgba(255, 84, 104, 1.0)",mapColorReport:"rgba(21, 127, 204, 1.0)",mapColorOverlay:"rgba(21, 127, 204, 0.2)",mapRadiusNormal:9,mapRadiusSelected:14,mapMaxZoom:19,mapDelay:500,coordinatePrecision:6,numberPrecision:2}); +Ext.define("Traccar.AttributeFormatter",{singleton:!0,coordinateFormatter:function(a){return a.toFixed(Traccar.Style.coordinatePrecision)},speedFormatter:function(a){return Ext.getStore("SpeedUnits").formatValue(a,Traccar.app.getPreference("speedUnit"))},courseFormatter:function(a){return"N NE E SE S SW W NW".split(" ")[Math.floor(a/45)]},distanceFormatter:function(a){return Ext.getStore("DistanceUnits").formatValue(a,Traccar.app.getPreference("distanceUnit"))},defaultFormatter:function(a){return"number"=== +typeof a?Number(a.toFixed(Traccar.Style.numberPrecision)):"boolean"===typeof a?a?Ext.Msg.buttonText.yes:Ext.Msg.buttonText.no:a instanceof Date?Traccar.app.getPreference("twelveHourFormat",!1)?Ext.Date.format(a,Traccar.Style.dateTimeFormat12):Ext.Date.format(a,Traccar.Style.dateTimeFormat24):a},getFormatter:function(a){return"latitude"===a||"longitude"===a?this.coordinateFormatter:"speed"===a?this.speedFormatter:"course"===a?this.courseFormatter:"distance"===a||"odometer"===a?this.distanceFormatter: +this.defaultFormatter}}); +Ext.define("Traccar.model.Server",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"registration",type:"boolean"},{name:"readonly",type:"boolean"},{name:"map",type:"string"},{name:"bingKey",type:"string"},{name:"mapUrl",type:"string"},{name:"distanceUnit",type:"string"},{name:"speedUnit",type:"string"},{name:"latitude",type:"float"},{name:"longitude",type:"float"},{name:"zoom",type:"int"},{name:"twelveHourFormat",type:"boolean"},{name:"attributes"}],proxy:{type:"ajax", +url:"/api/server",actionMethods:{update:"PUT"},writer:{type:"json",writeAllFields:!0}}}); +Ext.define("Traccar.model.User",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"name",type:"string"},{name:"email",type:"string"},{name:"password",type:"string"},{name:"admin",type:"boolean"},{name:"map",type:"string"},{name:"distanceUnit",type:"string"},{name:"speedUnit",type:"string"},{name:"latitude",type:"float"},{name:"longitude",type:"float"},{name:"zoom",type:"int"},{name:"twelveHourFormat",type:"boolean"},{name:"attributes"}],proxy:{type:"rest",url:"/api/users", +writer:{type:"json",writeAllFields:!0}}});Ext.define("Traccar.model.Group",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"name",type:"string"},{name:"groupId",type:"int"},{name:"attributes"}]}); +Ext.define("Traccar.model.Device",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"name",type:"string"},{name:"uniqueId",type:"string"},{name:"status",type:"string"},{name:"lastUpdate",type:"date",dateFormat:"c"},{name:"groupId",type:"int"},{name:"geofenceIds"},{name:"attributes"}]}); +Ext.define("Traccar.model.Position",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"protocol",type:"string"},{name:"deviceId",type:"int"},{name:"serverTime",type:"date",dateFormat:"c"},{name:"deviceTime",type:"date",dateFormat:"c"},{name:"fixTime",type:"date",dateFormat:"c"},{name:"valid",type:"boolean"},{name:"latitude",type:"float"},{name:"longitude",type:"float"},{name:"altitude",type:"float"},{name:"speed",type:"float"},{name:"course",type:"float"},{name:"address", +type:"string"},{name:"attributes"}]});Ext.define("Traccar.model.Attribute",{extend:Ext.data.Model,fields:[{name:"priority",type:"int"},{name:"name",type:"string"},{name:"value",type:"string"}]});Ext.define("Traccar.model.Command",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"deviceId",type:"int"},{name:"type",type:"string"},{name:"attributes"}]}); +Ext.define("Traccar.model.Event",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"type",type:"string"},{name:"serverTime",type:"date",dateFormat:"c"},{name:"deviceId",type:"int"},{name:"positionId",type:"int"},{name:"geofenceId",type:"int"},{name:"attributes"}]}); +Ext.define("Traccar.model.Geofence",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"name",type:"string"},{name:"description",type:"string"},{name:"area",type:"string"},{name:"attributes"}]});Ext.define("Traccar.model.Notification",{extend:Ext.data.Model,identifier:"negative",fields:[{name:"id",type:"int"},{name:"type",type:"string"},{name:"userId",type:"int"},{name:"attributes"}]}); +Ext.define("Traccar.store.Groups",{extend:Ext.data.Store,model:"Traccar.model.Group",proxy:{type:"rest",url:"/api/groups",writer:{writeAllFields:!0}}});Ext.define("Traccar.store.Devices",{extend:Ext.data.Store,model:"Traccar.model.Device",proxy:{type:"rest",url:"/api/devices",writer:{writeAllFields:!0}}});Ext.define("Traccar.store.AllGroups",{extend:Ext.data.Store,model:"Traccar.model.Group",proxy:{type:"rest",url:"/api/groups",extraParams:{all:!0}}}); +Ext.define("Traccar.store.AllDevices",{extend:Ext.data.Store,model:"Traccar.model.Device",proxy:{type:"rest",url:"/api/devices",extraParams:{all:!0}}});Ext.define("Traccar.store.Positions",{extend:Ext.data.Store,model:"Traccar.model.Position",proxy:{type:"rest",url:"/api/positions"}});Ext.define("Traccar.store.LatestPositions",{extend:Ext.data.Store,model:"Traccar.model.Position"}); +Ext.define("Traccar.store.Users",{extend:Ext.data.Store,model:"Traccar.model.User",proxy:{type:"rest",url:"/api/users",writer:{writeAllFields:!0}}});Ext.define("Traccar.store.Attributes",{extend:Ext.data.Store,model:"Traccar.model.Attribute",sorters:[{property:"priority"}]});Ext.define("Traccar.store.MapTypes",{extend:Ext.data.Store,fields:["key","name"],data:[{key:"osm",name:Strings.mapOsm},{key:"bingRoad",name:Strings.mapBingRoad},{key:"bingAerial",name:Strings.mapBingAerial},{key:"custom",name:Strings.mapCustom}]}); +Ext.define("Traccar.store.DistanceUnits",{extend:Ext.data.Store,fields:["key","name","factor"],data:[{key:"km",name:Strings.sharedKm,factor:0.001},{key:"mi",name:Strings.sharedMi,factor:6.21371E-4}],formatValue:function(a,b){var c;b||(b="km");c=this.findRecord("key",b);return(a*c.get("factor")).toFixed(2)+" "+c.get("name")}}); +Ext.define("Traccar.store.SpeedUnits",{extend:Ext.data.Store,fields:["key","name","factor"],data:[{key:"kn",name:Strings.sharedKn,factor:1},{key:"kmh",name:Strings.sharedKmh,factor:1.852},{key:"mph",name:Strings.sharedMph,factor:1.15078}],formatValue:function(a,b){var c;b||(b="kn");c=this.findRecord("key",b);return(a*c.get("factor")).toFixed(1)+" "+c.get("name")}}); +Ext.define("Traccar.store.CommandTypes",{extend:Ext.data.Store,fields:["type","name"],listeners:{beforeload:function(a){a=a.getProxy();a.setUrl("/api/commandtypes?deviceId"+a.extraParams.deviceId)}},proxy:{type:"rest",url:"",reader:{type:"json",getData:function(a){Ext.each(a,function(a){var c;a.name=a.type;"undefined"!==typeof a.type&&(c="command"+a.type.charAt(0).toUpperCase()+a.type.slice(1),c=Strings[c],"undefined"!==typeof c&&(a.name=c))});return a}}}}); +Ext.define("Traccar.store.TimeUnits",{extend:Ext.data.Store,fields:["name","factor"],data:[{name:Strings.sharedSecond,factor:1},{name:Strings.sharedMinute,factor:60},{name:Strings.sharedHour,factor:3600}]});Ext.define("Traccar.store.Languages",{extend:Ext.data.Store,fields:["code","name"],data:function(){var a,b=[];for(a in Locale.languages)Locale.languages.hasOwnProperty(a)&&b.push({code:a,name:Locale.languages[a].name});return b}()}); +Ext.define("Traccar.store.Events",{extend:Ext.data.Store,model:"Traccar.model.Event",proxy:{type:"rest",url:"/api/events"}});Ext.define("Traccar.store.Geofences",{extend:Ext.data.Store,model:"Traccar.model.Geofence",proxy:{type:"rest",url:"/api/geofences",writer:{writeAllFields:!0}}});Ext.define("Traccar.store.AllGeofences",{extend:Ext.data.Store,model:"Traccar.model.Geofence",proxy:{type:"rest",url:"/api/geofences",extraParams:{all:!0}}}); +Ext.define("Traccar.store.Notifications",{extend:Ext.data.Store,model:"Traccar.model.Notification",proxy:{type:"rest",url:"/api/users/notifications"}});Ext.define("Traccar.store.AllNotifications",{extend:Ext.data.Store,model:"Traccar.model.Notification",proxy:{type:"rest",url:"/api/users/notifications",extraParams:{all:!0}},sortOnLoad:!0,sorters:{property:"type",direction:"ASC"}}); +Ext.define("Traccar.store.GeofenceTypes",{extend:Ext.data.Store,fields:["key","name"],data:[{key:"Polygon",name:Strings.mapShapePolygon},{key:"Circle",name:Strings.mapShapeCircle}]});Ext.define("Traccar.view.BaseDialog",{extend:Ext.window.Window,bodyPadding:Traccar.Style.panelPadding,resizable:!1,modal:!0}); +Ext.define("Traccar.view.RegisterController",{extend:Ext.app.ViewController,alias:"controller.register",onCreateClick:function(){var a=this.lookupReference("form");a.isValid()&&Ext.Ajax.request({scope:this,method:"POST",url:"/api/users",jsonData:a.getValues(),callback:this.onCreateReturn})},onCreateReturn:function(a,b,c){b?(this.closeView(),Ext.toast(Strings.loginCreated)):Traccar.app.showError(c)}}); +Ext.define("Traccar.view.Register",{extend:Traccar.view.BaseDialog,controller:"register",title:Strings.loginRegister,items:{xtype:"form",reference:"form",jsonSubmit:!0,items:[{xtype:"textfield",name:"name",fieldLabel:Strings.sharedName,allowBlank:!1},{xtype:"textfield",name:"email",fieldLabel:Strings.userEmail,vtype:"email",allowBlank:!1},{xtype:"textfield",name:"password",fieldLabel:Strings.userPassword,inputType:"password",allowBlank:!1}]},buttons:[{text:Strings.sharedSave,handler:"onCreateClick"}, +{text:Strings.sharedCancel,handler:"closeView"}]}); +Ext.define("Traccar.view.LoginController",{extend:Ext.app.ViewController,alias:"controller.login",init:function(){this.lookupReference("registerButton").setDisabled(!Traccar.app.getServer().get("registration"));this.lookupReference("languageField").setValue(Locale.language);var a=Ext.util.Cookies.get("user"),b=Ext.util.Cookies.get("pass");a&&b&&(this.lookupReference("txtUser").setValue(a),this.lookupReference("txtPassword").setValue(b),this.login())},login:function(){var a=this.lookupReference("form"); +a.isValid()&&(Ext.getBody().mask(Strings.sharedLoading),Ext.Ajax.request({scope:this,method:"POST",url:"/api/session",params:a.getValues(),callback:function(a,c,d){Ext.getBody().unmask();c?(this.lookupReference("chkRememberMe").getValue()&&(Ext.util.Cookies.set("user",this.lookupReference("txtUser").getValue(),Ext.Date.add(new Date,Ext.Date.YEAR,1)),Ext.util.Cookies.set("pass",this.lookupReference("txtPassword").getValue(),Ext.Date.add(new Date,Ext.Date.YEAR,1))),Traccar.app.setUser(Ext.decode(d.responseText)), +this.fireViewEvent("login")):Traccar.app.showError(Strings.loginFailed)}}))},logout:function(){Ext.util.Cookies.clear("user");Ext.util.Cookies.clear("pass");Ext.Ajax.request({scope:this,method:"DELETE",url:"/api/session",callback:function(){window.location.reload()}})},onSelectLanguage:function(a){var b,c;a=a.getValue();b=window.location.href;0<=b.indexOf("locale\x3d")?(c=b.substring(0,b.indexOf("locale")),b=b.substring(b.indexOf("locale")),b=b.substring(b.indexOf("\x3d")+1),b=0<=b.indexOf("\x26")? +b.substring(b.indexOf("\x26")):"",b=c+"locale\x3d"+a+b):b=0>b.indexOf("?")?b+("?locale\x3d"+a):b+("\x26locale\x3d"+a);window.location.href=b},onAfterRender:function(a){a.focus()},onSpecialKey:function(a,b){b.getKey()===b.ENTER&&this.login()},onLoginClick:function(){Ext.getElementById("submitButton").click();this.login()},onRegisterClick:function(){Ext.create("Traccar.view.Register").show()}}); +Ext.define("Traccar.view.Login",{extend:Traccar.view.BaseDialog,alias:"widget.login",controller:"login",title:Strings.loginTitle,closable:!1,modal:!1,items:{xtype:"form",reference:"form",autoEl:{tag:"form",method:"POST",action:"fake-login.html",target:"submitTarget"},items:[{xtype:"combobox",name:"language",fieldLabel:Strings.loginLanguage,store:"Languages",displayField:"name",valueField:"code",submitValue:!1,listeners:{select:"onSelectLanguage"},reference:"languageField"},{xtype:"textfield",name:"email", +reference:"txtUser",fieldLabel:Strings.userEmail,allowBlank:!1,enableKeyEvents:!0,listeners:{specialKey:"onSpecialKey",afterrender:"onAfterRender"},inputAttrTpl:['autocomplete\x3d"on"']},{xtype:"textfield",name:"password",reference:"txtPassword",fieldLabel:Strings.userPassword,inputType:"password",allowBlank:!1,enableKeyEvents:!0,listeners:{specialKey:"onSpecialKey"},inputAttrTpl:['autocomplete\x3d"on"']},{xtype:"checkboxfield",reference:"chkRememberMe",fieldLabel:Strings.rememberMe},{xtype:"component", +html:'\x3ciframe id\x3d"submitTarget" name\x3d"submitTarget" style\x3d"display:none"\x3e\x3c/iframe\x3e'},{xtype:"component",html:'\x3cinput type\x3d"submit" id\x3d"submitButton" style\x3d"display:none"\x3e'}]},buttons:[{text:Strings.loginRegister,handler:"onRegisterClick",reference:"registerButton"},{text:Strings.loginLogin,handler:"onLoginClick"}]}); +Ext.define("Traccar.view.CommandDialogController",{extend:Ext.app.ViewController,alias:"controller.commandDialog",onSelect:function(a){this.lookupReference("paramPositionPeriodic").setHidden("positionPeriodic"!==a.getValue());this.lookupReference("paramCustom").setHidden("custom"!==a.getValue())},onSendClick:function(a){var b,c;a=a.up("window").down("form");a.updateRecord();c=a.getRecord();"positionPeriodic"===c.get("type")&&(a=this.lookupReference("paramPositionPeriodic"),b=a.down('numberfield[name\x3d"frequency"]').getValue(), +b*=a.down('combobox[name\x3d"unit"]').getValue(),c.set("attributes",{frequency:b}));"custom"===c.get("type")&&(b=this.lookupReference("paramCustom").getValue(),c.set("attributes",{data:b}));Ext.Ajax.request({scope:this,url:"/api/commands",jsonData:c.getData(),callback:this.onSendResult})},onSendResult:function(a,b,c){b?(Ext.toast(Strings.commandSent),this.closeView()):Traccar.app.showError(c)}}); +Ext.define("Traccar.view.CommandDialog",{extend:Traccar.view.BaseDialog,controller:"commandDialog",title:Strings.commandTitle,items:{xtype:"form",items:[{xtype:"combobox",name:"type",fieldLabel:Strings.commandType,store:"CommandTypes",displayField:"name",valueField:"type",listeners:{select:"onSelect"}},{xtype:"fieldcontainer",reference:"paramPositionPeriodic",name:"attributes",hidden:!0,items:[{xtype:"numberfield",fieldLabel:Strings.commandFrequency,name:"frequency"},{xtype:"combobox",fieldLabel:Strings.commandUnit, +name:"unit",store:"TimeUnits",displayField:"name",valueField:"factor"}]},{xtype:"textfield",reference:"paramCustom",fieldLabel:Strings.commandCustom,name:"customCommand",hidden:!0,allowBlank:!1}]},buttons:[{text:Strings.commandSend,handler:"onSendClick"},{text:Strings.sharedCancel,handler:"closeView"}]}); +Ext.define("Traccar.view.BaseEditDialog",{extend:Traccar.view.BaseDialog,buttons:[{text:Strings.sharedAttributes,handler:"showAttributesView"},{xtype:"tbfill"},{text:Strings.sharedSave,handler:"onSaveClick"},{text:Strings.sharedCancel,handler:"closeView"}]}); +Ext.define("Traccar.view.DeviceDialog",{extend:Traccar.view.BaseEditDialog,controller:"baseEditDialog",title:Strings.deviceDialog,items:{xtype:"form",items:[{xtype:"textfield",name:"name",fieldLabel:Strings.sharedName,allowBlank:!1},{xtype:"textfield",name:"uniqueId",fieldLabel:Strings.deviceIdentifier,allowBlank:!1},{xtype:"combobox",name:"groupId",fieldLabel:Strings.groupParent,store:"Groups",queryMode:"local",displayField:"name",valueField:"id"}]}}); +Ext.define("Traccar.view.BasePermissionsController",{extend:Ext.app.ViewController,alias:"controller.basePermissionsController",init:function(){var a={},b,c;a[this.getView().baseObjectName]=this.getView().baseObject;b=this.getView().linkStoreName;c=this.getView().storeName;b="undefined"===typeof b?c:b;this.getView().setStore(Ext.getStore(c));this.getView().getStore().load({scope:this,callback:function(){Ext.create("Traccar.store."+b).load({params:a,scope:this,callback:function(a,b,c){if(c)for(b=0;b< +a.length;b++)c=this.getView().getStore().find("id",a[b].getData().id),this.getView().getSelectionModel().select(c,!0,!0)}})}})},onBeforeSelect:function(a,b){var c={};c[this.getView().baseObjectName]=this.getView().baseObject;c[this.getView().linkObjectName]=b.getData().id;Ext.Ajax.request({scope:this,url:this.getView().urlApi,jsonData:Ext.util.JSON.encode(c),callback:function(a,b,c){b||Traccar.app.showError(c)}})},onBeforeDeselect:function(a,b){var c={};c[this.getView().baseObjectName]=this.getView().baseObject; +c[this.getView().linkObjectName]=b.getData().id;Ext.Ajax.request({scope:this,method:"DELETE",url:this.getView().urlApi,jsonData:Ext.util.JSON.encode(c),callback:function(a,b,c){b||Traccar.app.showError(c)}})}}); +Ext.define("Traccar.view.DeviceGeofences",{extend:Ext.grid.Panel,xtype:"deviceGeofencesView",controller:"basePermissionsController",selModel:{selType:"checkboxmodel",checkOnly:!0,showHeaderCheckbox:!1},listeners:{beforedeselect:"onBeforeDeselect",beforeselect:"onBeforeSelect"},columns:[{text:Strings.sharedName,dataIndex:"name",flex:1}]}); +Ext.define("Traccar.view.DevicesController",{extend:Ext.app.ViewController,alias:"controller.devices",config:{listen:{controller:{"*":{selectDevice:"selectDevice",selectReport:"selectReport"}},store:{"#Devices":{update:"onUpdateDevice"}}}},init:function(){var a=Traccar.app.getServer().get("readonly")&&!Traccar.app.getUser().get("admin");this.lookupReference("toolbarAddButton").setVisible(!a);this.lookupReference("toolbarEditButton").setVisible(!a);this.lookupReference("toolbarRemoveButton").setVisible(!a)}, +onAddClick:function(){var a,b;a=Ext.create("Traccar.model.Device");a.store=Ext.getStore("Devices");b=Ext.create("Traccar.view.DeviceDialog");b.down("form").loadRecord(a);b.show()},onEditClick:function(){var a,b;a=this.getView().getSelectionModel().getSelection()[0];b=Ext.create("Traccar.view.DeviceDialog");b.down("form").loadRecord(a);b.show()},onRemoveClick:function(){var a=this.getView().getSelectionModel().getSelection()[0];Ext.Msg.show({title:Strings.deviceDialog,message:Strings.sharedRemoveConfirm, +buttons:Ext.Msg.YESNO,buttonText:{yes:Strings.sharedRemove,no:Strings.sharedCancel},fn:function(b){"yes"===b&&(b=Ext.getStore("Devices"),b.remove(a),b.sync())}})},onGeofencesClick:function(){var a;Traccar.app.getUser().get("admin");a=this.getView().getSelectionModel().getSelection()[0];Ext.create("Traccar.view.BaseWindow",{title:Strings.sharedGeofences,items:{xtype:"deviceGeofencesView",baseObjectName:"deviceId",linkObjectName:"geofenceId",storeName:"Geofences",urlApi:"/api/devices/geofences",baseObject:a.getData().id}}).show()}, +onCommandClick:function(){var a,b,c;a=this.getView().getSelectionModel().getSelection()[0].get("id");b=Ext.create("Traccar.model.Command");b.set("deviceId",a);c=Ext.create("Traccar.view.CommandDialog");c.down("form").down("combobox").getStore().getProxy().setExtraParam("deviceId",a);c.down("form").loadRecord(b);c.show()},onFollowClick:function(a,b){var c;b&&(c=this.getView().getSelectionModel().getSelection()[0],this.fireEvent("selectDevice",c,!0))},updateButtons:function(a){var b=0===a.getCount(); +this.lookupReference("toolbarEditButton").setDisabled(b);this.lookupReference("toolbarRemoveButton").setDisabled(b);this.lookupReference("toolbarGeofencesButton").setDisabled(b);this.lookupReference("deviceCommandButton").setDisabled(b||"online"!==a.getLastSelected().get("status"))},onSelectionChange:function(a){this.updateButtons(a);0