diff options
author | Gábor Somogyi <gabor.g.somogyi@gmail.com> | 2016-04-27 22:22:08 +0200 |
---|---|---|
committer | Gábor Somogyi <gabor.g.somogyi@gmail.com> | 2016-04-27 22:34:17 +0200 |
commit | bf68718e05f811ffeb2b4b57acab56dca3e7de56 (patch) | |
tree | 5853e81ae5d08e996d1600504027c7a870202643 /web/app/store | |
parent | 44f026f881efa6207ab79fb5bada20ab67f018a0 (diff) | |
download | traccar-server-bf68718e05f811ffeb2b4b57acab56dca3e7de56.tar.gz traccar-server-bf68718e05f811ffeb2b4b57acab56dca3e7de56.tar.bz2 traccar-server-bf68718e05f811ffeb2b4b57acab56dca3e7de56.zip |
Command framework ugly hack version
Diffstat (limited to 'web/app/store')
-rw-r--r-- | web/app/store/SupportedCommands.js (renamed from web/app/store/CommandTypes.js) | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/web/app/store/CommandTypes.js b/web/app/store/SupportedCommands.js index 3f5094266..2b052b902 100644 --- a/web/app/store/CommandTypes.js +++ b/web/app/store/SupportedCommands.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com) + * Copyright 2016 Gabor Somogyi (gabor.g.somogyi@gmail.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,21 +14,20 @@ * limitations under the License. */ -Ext.define('Traccar.store.CommandTypes', { +Ext.define('Traccar.store.SupportedCommands', { extend: 'Ext.data.Store', - fields: ['key', 'name'], + model: 'Traccar.model.SupportedCommand', - data: [{ - key: 'positionPeriodic', - name: Strings.commandPositionPeriodic - }, { - key: 'positionStop', - name: Strings.commandPositionStop - }, { - key: 'engineStop', - name: Strings.commandEngineStop - }, { - key: 'engineResume', - name: Strings.commandEngineResume - }] + listeners: { + 'beforeload' : function(store, options) { + var proxy; + proxy = store.getProxy(); + proxy.setUrl('/api/devices/' + proxy.extraParams.deviceId + '/supportedcommands'); + } + }, + + proxy: { + type: 'rest', + url: '' + } }); |