efront 3.7.5 → 3.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apps/pivot/auth/login.js +0 -1
- package/apps/pivot/link/list.html +2 -2
- package/apps/pivot/link/list.js +6 -6
- package/apps/pivot/link/list.less +5 -0
- package/coms/zimoli/LoadingArray.js +27 -0
- package/coms/zimoli/data.js +8 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/coms/zimoli/LoadingArray.ts +0 -14
package/apps/pivot/auth/login.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="clusters">
|
|
2
|
-
<a -repeat="(c,i) in clusters" @click="active(i)">
|
|
2
|
+
<a -repeat="(c,i) in clusters" ng-class="{current:i===index}" @click="active(i,c)">
|
|
3
3
|
<span -text="c"></span>
|
|
4
4
|
</a>
|
|
5
5
|
</div>
|
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
<padding>
|
|
8
8
|
<span -text=c.id></span>
|
|
9
9
|
<span class="time" -text=filterTime(c.optime)></span>
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
</padding>
|
|
12
12
|
</lattice>
|
package/apps/pivot/link/list.js
CHANGED
|
@@ -3,21 +3,21 @@ function main() {
|
|
|
3
3
|
page.innerHTML = template;
|
|
4
4
|
renderWithDefaults(page, {
|
|
5
5
|
async load() {
|
|
6
|
-
|
|
7
|
-
await
|
|
6
|
+
this.clusters = data.from("cluster", { opt: "list" });
|
|
7
|
+
await this.clusters;
|
|
8
8
|
this.active();
|
|
9
9
|
},
|
|
10
|
-
index: 0,
|
|
10
|
+
index: data.getInstance("index").index || 0,
|
|
11
11
|
clusters: [],
|
|
12
12
|
filterTime(d) {
|
|
13
13
|
return ((new Date - d) / 1000 | 0) + "秒";
|
|
14
14
|
},
|
|
15
15
|
clients: [],
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
active(index = this.index) {
|
|
17
|
+
data.setInstance('index', { index });
|
|
18
18
|
var clusters = this.clusters;
|
|
19
19
|
if (index >= clusters.length) index = clusters.length - 1;
|
|
20
|
-
this.clients = data.
|
|
20
|
+
this.clients = data.from("cluster", { opt: "list", id: clusters[index] });
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
page.$scope.load();
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// class LoadingArray extends Array {
|
|
2
|
+
// totalCount = 0;
|
|
3
|
+
// data = [];
|
|
4
|
+
// is_errored = null;
|
|
5
|
+
// error_message = null;
|
|
6
|
+
// is_loading = true;
|
|
7
|
+
// is_loaded = false;
|
|
8
|
+
// is_readonly = null;
|
|
9
|
+
// loading = null;
|
|
10
|
+
// loading_promise = null;
|
|
11
|
+
// then (ok, oh) {
|
|
12
|
+
// if (this.loading_promise) this.loading_promise.then(ok, oh);
|
|
13
|
+
// }
|
|
14
|
+
// }
|
|
15
|
+
function LoadingArray() {
|
|
16
|
+
var this0 = [];
|
|
17
|
+
this0.totalCount = 0;
|
|
18
|
+
this0.data = [];
|
|
19
|
+
this0.is_errored = null;
|
|
20
|
+
this0.error_message = null;
|
|
21
|
+
this0.is_loading = true;
|
|
22
|
+
this0.is_loaded = false;
|
|
23
|
+
this0.is_readonly = null;
|
|
24
|
+
this0.loading = null;
|
|
25
|
+
this0.loading_promise = null;
|
|
26
|
+
return this0;
|
|
27
|
+
};
|
package/coms/zimoli/data.js
CHANGED
|
@@ -402,6 +402,12 @@ function createApiMap(data) {
|
|
|
402
402
|
}
|
|
403
403
|
var _configfileurl;
|
|
404
404
|
var configPormise;
|
|
405
|
+
function LoadingArray_then(ok, oh) {
|
|
406
|
+
if (this.loading_promise) this.loading_promise.then(ok, oh);
|
|
407
|
+
else if (this.is_errored) oh(this.error_message);
|
|
408
|
+
else ok();
|
|
409
|
+
}
|
|
410
|
+
|
|
405
411
|
var privates = {
|
|
406
412
|
loadAfterConfig(serviceId, params) {
|
|
407
413
|
var promise = this.getApi(serviceId).then((api) => {
|
|
@@ -622,6 +628,7 @@ var data = {
|
|
|
622
628
|
if (isObject(response)) {
|
|
623
629
|
response.is_loaded = true;
|
|
624
630
|
response.is_loading = false;
|
|
631
|
+
if (response.then === LoadingArray_then) delete response.then;
|
|
625
632
|
}
|
|
626
633
|
this.loading_count--;
|
|
627
634
|
},
|
|
@@ -630,6 +637,7 @@ var data = {
|
|
|
630
637
|
if (isObject(response)) {
|
|
631
638
|
response.is_loaded = false;
|
|
632
639
|
response.is_loading = true;
|
|
640
|
+
response.then = LoadingArray_then;
|
|
633
641
|
}
|
|
634
642
|
this.loading_count++;
|
|
635
643
|
},
|