From 6a0f2db76a2a60679183b98720a0e48d76778d26 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 25 Apr 2015 13:54:42 +1200 Subject: Show devices in web interface --- web/DeviceView.js | 29 +++++++++++++++++++++++++++-- web/Strings.js | 3 ++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/web/DeviceView.js b/web/DeviceView.js index 6d475e406..a99e20fd4 100644 --- a/web/DeviceView.js +++ b/web/DeviceView.js @@ -15,8 +15,33 @@ */ Ext.define('DeviceView', { - extend: 'Ext.form.Panel', + extend: 'Ext.grid.Panel', xtype: 'device-view', - title: Strings.device_title + title: Strings.device_title, + + store: { + proxy: { + type: 'ajax', + url: '/api/device', + reader: { + type: 'json', + rootProperty: 'data' + } + }, + autoLoad: true, + + fields:[ + 'id', + 'name', + 'unique_id', + 'position_id', + 'data_id' + ] + }, + + columns: [ + { text: Strings.device_name, dataIndex: 'name', flex: 1 }, + { text: Strings.device_identifier, dataIndex: 'unique_id', flex: 1 } + ] }); diff --git a/web/Strings.js b/web/Strings.js index 6d210f75b..d853a8f00 100644 --- a/web/Strings.js +++ b/web/Strings.js @@ -25,7 +25,8 @@ Ext.define('Strings', { login_failed: 'Incorrect user name or password.', device_title: 'Devices', + device_name: 'Name', + device_identifier: 'Identifier', map_title: 'Map' - }); -- cgit v1.2.3