-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
/
app.js
61 lines (51 loc) · 1.9 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
(function ($) {
var app = angular.module('Demo', [
'ui.bootstrap',
'toastr',
'angular-loading-bar',
'httpInterceptors' //custom http interceptor
]);
app.controller('DemoController', function ($scope, $http, $modal, toastr) {
//var NONE = "none";
this.registries = {};
this.configQuery = {};
//this.refreshResult = NONE;
var self = this;
this.loadRegistries = function() {
$http.get("demo/client/registries")
.success(function (data) {
self.registries = data;
})
.error(function (data, status) {
toastr.error((data && data.msg) || 'Loading registries failed');
});
};
this.queryConfig = function() {
$http.get("demo/config/" + encodeURIComponent(this.configQuery.configName))
.success(function(data) {
self.configQuery.configValue = data.value;
})
.error(function(data, status) {
toastr.error((data && data.msg) || 'Load config failed');
});
};
//this.refreshConfig = function() {
// $http.post("refresh")
// .success(function(data) {
// self.assembleRefreshResult(data);
// })
// .error(function(data, status) {
// toastr.error((data && data.msg) || 'Refresh config failed');
// });
//
//};
//this.assembleRefreshResult = function(changedPropertyArray) {
// if(!changedPropertyArray || !changedPropertyArray.length) {
// this.refreshResult = NONE;
// return;
// }
// this.refreshResult = changedPropertyArray.join(',');
//};
this.loadRegistries();
});
})(jQuery);