aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-28 22:41:07 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-28 22:41:07 +1200
commita5f47492857a175548beff07cfb565129f687ae2 (patch)
treed5650b6f5db7de9296d8d00cab505b9f594112f6 /web
parentc14f99819add0971a82ced01bf6d54ed77aedb74 (diff)
downloadtraccar-server-a5f47492857a175548beff07cfb565129f687ae2.tar.gz
traccar-server-a5f47492857a175548beff07cfb565129f687ae2.tar.bz2
traccar-server-a5f47492857a175548beff07cfb565129f687ae2.zip
Implement API to create devices
Diffstat (limited to 'web')
-rw-r--r--web/DeviceView.js25
1 files changed, 20 insertions, 5 deletions
diff --git a/web/DeviceView.js b/web/DeviceView.js
index 4414b67ea..06cec7779 100644
--- a/web/DeviceView.js
+++ b/web/DeviceView.js
@@ -21,7 +21,22 @@ Ext.define('DeviceView', {
title: Strings.device_title,
tbar: [{
- text:'Add'
+ text:'Add',
+ handler: function() {
+
+ var device = {
+ name: "AjaxTest",
+ uniqueId: "UniqueId"
+ };
+
+ Ext.Ajax.request({
+ url: '/api/device/add',
+ jsonData: Ext.encode(device),
+ success: function() {
+ alert("success");
+ }
+ });
+ }
}, {
text:'Edit'
}, {
@@ -56,14 +71,14 @@ Ext.define('DeviceView', {
fields:[
'id',
'name',
- 'unique_id',
- 'position_id',
- 'data_id'
+ 'uniqueId',
+ 'positionId',
+ 'dataId'
]
},
columns: [
{ text: Strings.device_name, dataIndex: 'name', flex: 1 },
- { text: Strings.device_identifier, dataIndex: 'unique_id', flex: 1 }
+ { text: Strings.device_identifier, dataIndex: 'uniqueId', flex: 1 }
]
});