Skip to content

Commit d1eb36c

Browse files
committed
更新[BoxJs]: 优化: ["刷新窗口增加 3 秒倒数自动刷新", "添加订阅能马上刷新订阅", "刷新窗口弹出时会顺便发起更新应用订阅", "可以隐藏手动更新订阅的提示"]
1 parent e969b10 commit d1eb36c

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

‎box/release/box.release.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{
22
"releases": [
3+
{
4+
"version": "0.3.8",
5+
"tags": ["beta"],
6+
"author": "@chavyleung",
7+
"icon": "https://avatars3.githubusercontent.com/u/29748519",
8+
"repo": "https://github.com/chavyleung",
9+
"notes": [
10+
{
11+
"name": "优化",
12+
"descs": ["刷新窗口增加 3 秒倒数自动刷新", "刷新窗口弹出时会顺便发起更新应用订阅", "可以隐藏手动更新订阅的提示"]
13+
}
14+
]
15+
},
316
{
417
"version": "0.3.7",
518
"tags": ["beta"],

‎chavy.box.js‎

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,11 @@ function printHtml(data, curapp = null, curview = 'app') {
750750
<v-switch label="隐藏底部导航" v-model="box.usercfgs.isHideNavi" @change="onUserCfgsChange"></v-switch>
751751
</v-list-item-content>
752752
</v-list-item>
753+
<v-list-item>
754+
<v-list-item-content>
755+
<v-switch label="隐藏更新订阅提示" v-model="box.usercfgs.isHideRefreshTip" @change="onUserCfgsChange"></v-switch>
756+
</v-list-item-content>
757+
</v-list-item>
753758
<v-list-item>
754759
<v-list-item-content>
755760
<v-switch label="调试模式 (数据)" v-model="box.usercfgs.isDebugData" @change="onUserCfgsChange"></v-switch>
@@ -938,9 +943,9 @@ function printHtml(data, curapp = null, curview = 'app') {
938943
<v-subheader inset>
939944
应用订阅 ({{ appsubs.length }})
940945
<v-spacer></v-spacer>
941-
<v-tooltip v-model="ui.refreshtip.show" bottom>
946+
<v-tooltip v-model="ui.refreshtip.show && !box.usercfgs.isHideRefreshTip" bottom>
942947
<template v-slot:activator="{ on }">
943-
<v-btn v-on="on" icon @click="onRefreshAppSubs"><v-icon>mdi-refresh-circle</v-icon></v-btn>
948+
<v-btn icon @click="onRefreshAppSubs"><v-icon>mdi-refresh-circle</v-icon></v-btn>
944949
</template>
945950
<span>手动更新订阅</span>
946951
</v-tooltip>
@@ -1081,7 +1086,7 @@ function printHtml(data, curapp = null, curview = 'app') {
10811086
<v-card-actions>
10821087
<v-spacer></v-spacer>
10831088
<v-btn color="grey darken-1" text @click="ui.reloadConfirmDialog.show = false">稍候</v-btn>
1084-
<v-btn color="green darken-1" text @click="reload">马上刷新</v-btn>
1089+
<v-btn color="green darken-1" text @click="reload">马上刷新 {{ ui.reloadConfirmDialog.sec ? '(' + ui.reloadConfirmDialog.sec + ')' : '' }}</v-btn>
10851090
</v-card-actions>
10861091
</v-card>
10871092
</v-dialog>
@@ -1268,7 +1273,7 @@ function printHtml(data, curapp = null, curview = 'app') {
12681273
refreshtip: { show: false },
12691274
editProfileDialog: { show: false, bak: '' },
12701275
impGlobalBakDialog: { show: false, bak: '' },
1271-
reloadConfirmDialog: { show: false, title: '操作成功', message: '是否马上刷新页面?' },
1276+
reloadConfirmDialog: { show: false, sec: 0, title: '操作成功', message: '是否马上刷新页面?' },
12721277
impSessionDialog: { show: false, impval: '' },
12731278
addAppSubDialog: { show: false, url: '' },
12741279
versheet: { show: false },
@@ -1401,6 +1406,15 @@ function printHtml(data, curapp = null, curview = 'app') {
14011406
}
14021407
}
14031408
}
1409+
},
1410+
'ui.reloadConfirmDialog.sec': {
1411+
handler(newval, oldval) {
1412+
if (newval !== 0) {
1413+
setTimeout(() => this.ui.reloadConfirmDialog.sec -= 1, 1000)
1414+
} else {
1415+
this.reload()
1416+
}
1417+
}
14041418
}
14051419
},
14061420
methods: {
@@ -1534,14 +1548,15 @@ function printHtml(data, curapp = null, curview = 'app') {
15341548
this.onReload()
15351549
},
15361550
onRefreshAppSubs(){
1537-
axios.post('/api', JSON.stringify({ cmd: 'refreshAppSubs', val: null }))
15381551
this.onReload()
15391552
},
15401553
reload() {
15411554
window.location.reload()
15421555
},
15431556
onReload() {
1557+
axios.post('/api', JSON.stringify({ cmd: 'refreshAppSubs', val: null }))
15441558
this.ui.reloadConfirmDialog.show = true
1559+
this.ui.reloadConfirmDialog.sec = 3
15451560
},
15461561
onDelSession(session) {
15471562
axios.post('/api', JSON.stringify({ cmd: 'delSession', val: session }))

0 commit comments

Comments
 (0)