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