GUI -- Added mechanism to test device view.
Themed device view.
Change-Id: I471ec56b94c927d834f8067d06efce33ddfa4596
diff --git a/web/gui/src/main/webapp/app/view/device/device.js b/web/gui/src/main/webapp/app/view/device/device.js
index b475280..6fef470 100644
--- a/web/gui/src/main/webapp/app/view/device/device.js
+++ b/web/gui/src/main/webapp/app/view/device/device.js
@@ -24,26 +24,19 @@
(function () {
'use strict';
- var urlSuffix = '/onos/v1/devices';
-
angular.module('ovDevice', [])
- .controller('OvDeviceCtrl', ['$log', '$location',
- function ($log, $http, $loc) {
+ .controller('OvDeviceCtrl', ['$log', '$location', 'RestService',
+ function ($log, $location, rs) {
var self = this;
self.deviceData = [];
- //var url = buildUrl($loc) + urlSuffix;
- //$log.log(url);
- //$http.get(url).then(
- // //success
- // function (response) {
- // self.deviceData = response.data.devices;
- // },
- // //failure
- // function (response) {
- // $log.warn('Failed to get device data ', response.status);
- // }
- //);
+ // TODO: remove test code
+ var testCase = $location.search().test;
+ var url = testCase ? 'test/' + testCase : 'device';
+
+ rs.get(url, function (data) {
+ self.deviceData = data.devices;
+ });
$log.log('OvDeviceCtrl has been created');
}]);