From f29ed382899232e35dfe3252276f63dd7d0fed77 Mon Sep 17 00:00:00 2001 From: DmitriyMX Date: Sat, 17 Dec 2016 01:20:45 +0300 Subject: [PATCH] =?UTF-8?q?WebInterface:=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D0=B8=D0=BC=20=D0=B2=D0=B5=D1=81=D1=8C=20AngularJS?= =?UTF-8?q?=20App=20=D0=B2=20=D0=BE=D0=B4=D0=B8=D0=BD=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webinterface/pom.xml | 2 +- webinterface/src/main/resources/index.html | 1 - webinterface/src/main/resources/static/app.js | 41 ++++++++++++++++++- .../resources/static/bundle-list.component.js | 38 ----------------- 4 files changed, 40 insertions(+), 42 deletions(-) delete mode 100644 webinterface/src/main/resources/static/bundle-list.component.js diff --git a/webinterface/pom.xml b/webinterface/pom.xml index df755ce..61da162 100644 --- a/webinterface/pom.xml +++ b/webinterface/pom.xml @@ -19,7 +19,7 @@ asys webinterface - 0.5-SNAPSHOT + 0.6-SNAPSHOT bundle diff --git a/webinterface/src/main/resources/index.html b/webinterface/src/main/resources/index.html index 3911d4a..9330e70 100644 --- a/webinterface/src/main/resources/index.html +++ b/webinterface/src/main/resources/index.html @@ -5,7 +5,6 @@ ASys: Web interface -

ASys: Web interface

diff --git a/webinterface/src/main/resources/static/app.js b/webinterface/src/main/resources/static/app.js index 7fb82d3..95c0b73 100644 --- a/webinterface/src/main/resources/static/app.js +++ b/webinterface/src/main/resources/static/app.js @@ -1,2 +1,39 @@ -'use strict'; -angular.module('asysApp', []); \ No newline at end of file +var app = angular.module('asysApp', []); + +// filtres +app.filter('stateFormat', function() { + return function(state) { + if (state == 1) {return 'UNINSTALLED';} + else if (state == 2) {return 'INSTALLED';} + else if (state == 4) {return 'RESOLVED';} + else if (state == 8) {return 'STARTING';} + else if (state == 16) {return 'STOPPING';} + else if (state == 32) {return 'ACTIVE';} + else {return 'UNKNOW('+state+')'} + } +}); + +/* --- [bundle-list] --- */ +app.component('bundleList', { + template: + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
IDNameStateVersionLast modified
{{bundle.id}}{{bundle.name}}{{bundle.state | stateFormat}}{{bundle.version}}{{bundle.lastModified | date:"dd/MM/yyyy HH:mm"}}
', + controller: function BundleListController($http) { + var self = this; + $http.get('/ajax/bundles.json').then(function(response) { + self.bundles = response.data; + }); + } +}); \ No newline at end of file diff --git a/webinterface/src/main/resources/static/bundle-list.component.js b/webinterface/src/main/resources/static/bundle-list.component.js deleted file mode 100644 index b9ace6d..0000000 --- a/webinterface/src/main/resources/static/bundle-list.component.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -angular. - module('asysApp'). - component('bundleList', { - template: - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '
IDNameStateVersionLast modified
{{bundle.id}}{{bundle.name}}{{bundle.state | stateFormat}}{{bundle.version}}{{bundle.lastModified | date:"dd/MM/yyyy HH:mm"}}
', - controller: function PhoneListController($http) { - var self = this; - $http.get('/ajax/bundles.json').then(function(response) { - self.bundles = response.data; - }); - } - }). - filter('stateFormat', function() { - return function(state) { - if (state == 1) {return 'UNINSTALLED';} - else if (state == 2) {return 'INSTALLED';} - else if (state == 4) {return 'RESOLVED';} - else if (state == 8) {return 'STARTING';} - else if (state == 16) {return 'STOPPING';} - else if (state == 32) {return 'ACTIVE';} - else {return 'UNKNOW('+state+')'} - } - }); \ No newline at end of file