diff --git a/box/chavy.boxjs.html b/box/chavy.boxjs.html
index e65f49a8f..e33cb2578 100644
--- a/box/chavy.boxjs.html
+++ b/box/chavy.boxjs.html
@@ -1,375 +1,375 @@
-
- BoxJs
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{env.id}}
-
-
-
-
-
- mdi-chevron-left
-
-
-
-
-
- mdi-menu
+ }
+ [v-cloak] {
+ display: none;
+ }
+ .v-navigation-drawer {
+ padding-top: constant(safe-area-inset-top) !important;
+ padding-top: env(safe-area-inset-top) !important;
+ }
+ .v-bottom-sheet.v-dialog--fullscreen {
+ padding-top: constant(safe-area-inset-top) !important;
+ padding-top: env(safe-area-inset-top) !important;
+ }
+ .v-app-bar.safe {
+ height: auto !important;
+ padding-top: constant(safe-area-inset-top) !important;
+ padding-top: env(safe-area-inset-top) !important;
+ }
+ .v-toolbar.safe {
+ height: auto !important;
+ padding-top: constant(safe-area-inset-top) !important;
+ padding-top: env(safe-area-inset-top) !important;
+ }
+ .v-toolbar__content {
+ padding-left: 12px !important;
+ padding-right: 12px !important;
+ }
+ .v-main {
+ margin-top: constant(safe-area-inset-top) !important;
+ margin-top: env(safe-area-inset-top) !important;
+ margin-bottom: constant(safe-area-inset-bottom) !important;
+ margin-bottom: env(safe-area-inset-bottom) !important;
+ }
+ .v-main .container {
+ height: 100%;
+ }
+ .v-bottom-navigation,
+ .v-bottom-sheet {
+ padding-bottom: constant(safe-area-inset-bottom);
+ padding-bottom: env(safe-area-inset-bottom);
+ }
+ .v-bottom-navigation {
+ box-sizing: content-box;
+ }
+ .v-bottom-navigation button {
+ box-sizing: border-box;
+ }
+ .v-bottom-navigation button.v-btn:before {
+ background-color: transparent;
+ }
+ .v-speed-dial {
+ margin-bottom: calc(48px + constant(safe-area-inset-bottom));
+ margin-bottom: calc(48px + env(safe-area-inset-bottom));
+ }
+ .container.container--fluid {
+ padding-bottom: 68px;
+ }
+ .appicon {
+ user-select: none;
+ -webkit-user-select: none;
+ cursor: pointer;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
- mdi-chevron-left
-
-
-
-
+
+
+
+ {{env.id}}
+
+
+
+
+
+ mdi-chevron-left
+
+
+
+
+
+ mdi-menu
+
+
+
+
+
+
+
+
+
+ mdi-chevron-left
+
+
+
+
+
+
+
+
+
+
+
+
+ {{`${app.name} (${app.id})`}}
+ {{app.repo}}
+ {{app.author}}
+
+
+
+
-
-
-
-
-
-
-
- {{`${app.name} (${app.id})`}}
- {{app.repo}}
- {{app.author}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{c.login}}
-
-
-
-
-
-
-
-
+ {{c.login}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ mdi-image
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-image
-
-
-
-
-
-
-
- mdi-dock-top
-
-
-
-
-
-
-
- mdi-format-align-top
-
-
-
-
-
-
-
- mdi-dock-bottom
-
-
-
-
-
-
-
- mdi-format-align-bottom
-
-
-
-
-
-
-
- mdi-volume-off
-
-
-
-
-
-
- mdi-volume-off
-
-
-
-
-
-
- mdi-help
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-face-profile
-
-
-
-
-
-
- mdi-code-tags
-
-
-
-
-
-
- mdi-refresh
-
-
-
-
-
-
- mdi-language-html5
-
-
-
-
-
+
-
-
-
+ v-model="box.usercfgs.isMute"
+ >
+
+
+ mdi-volume-off
+
+
+
+
+
+
+ mdi-volume-off
+
+
+
+
+
+
+ mdi-help
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-face-profile
+
+
+
+
+
+
+ mdi-code-tags
+
+
+
+
+
+
+ mdi-refresh
+
+
+
+
+
+
+ mdi-language-html5
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
- {{ui.snackbar.msg}}
-
-
+
+
+
+
+ {{ui.snackbar.msg}}
+
+
-
-
-
-
-
-
-
-
- {{app.name}}
-
-
-
-
-
-
-
-
-
-
- {{ $t('apps.fav') }} ({{favApps.length}})
-
-
-
-
-
-
- {{app.name}} ({{app.id}})
- {{app.repo}}
- {{app.author}}
-
-
-
-
- mdi-dots-vertical
-
-
-
- {{ $t('base.sort.up') }}
-
-
- {{ $t('base.sort.dn') }}
-
-
-
- {{ $t('apps.unStar') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{sub.name}} ({{sub.apps.length}})
-
-
-
-
-
-
- {{app.name}} ({{app.id}})
- {{app.repo}}
- {{app.author}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('apps.sysApps') }} ({{sysApps.length}})
-
-
-
-
-
-
- {{app.name}} ({{app.id}})
- {{app.repo}}
- {{app.author}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('subs.add') }}
-
- mdi-cloud{{ $t('subs.moreSubs') }}
-
-
-
-
-
- {{ $t('subs.appSubs') }} ({{appSubs.length}})
-
-
- mdi-cloud-circle
-
-
- mdi-refresh-circle
-
-
- mdi-plus-circle
-
-
-
-
-
- mdi-account
+ >
+
+
+
+
+
+
+
+
+ {{app.name}}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('apps.fav') }} ({{favApps.length}})
+
+
+
+
+
-
- {{sub.name}} ({{sub.apps.length}})
- {{ $t('subs.errData') }}
-
- {{sub.repo ? sub.repo : sub.url}}
- {{sub.author ? sub.author : '@anonymous'}}
-
- {{ $t('subs.updated') }}: {{ timeago.format(sub.updateTime, timeagoLang.replace('-', '_')) }}
-
+ {{app.name}} ({{app.id}})
+ {{app.repo}}
+ {{app.author}}
mdi-dots-vertical
-
-
-
- {{ $t('subs.install') }}
-
-
-
-
- {{ $t('subs.repo') }}
-
-
- {{ $t('base.cmd.cp') }}
-
-
- {{ $t('base.cmd.share') }}
-
-
-
+
+
{{ $t('base.sort.up') }}
-
+
{{ $t('base.sort.dn') }}
-
-
- {{ $t('base.cmd.del') }}
+
+
+ {{ $t('apps.unStar') }}
-
+
+
+
+
+
+
+
+
+
+ {{sub.name}} ({{sub.apps.length}})
+
+
+
+
+
+
+ {{app.name}} ({{app.id}})
+ {{app.repo}}
+ {{app.author}}
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+ {{ $t('apps.sysApps') }} ({{sysApps.length}})
+
+
+
+
+
+
+ {{app.name}} ({{app.id}})
+ {{app.repo}}
+ {{app.author}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('subs.add') }}
+
+ mdi-cloud{{ $t('subs.moreSubs') }}
+
+
+
+
+
+ {{ $t('subs.appSubs') }} ({{appSubs.length}})
+
+
+ mdi-cloud-circle
+
+
+ mdi-refresh-circle
+
+
+ mdi-plus-circle
+
+
+
+
+
+ mdi-account
+
+
+ {{sub.name}} ({{sub.apps.length}})
+ {{ $t('subs.errData') }}
+
+ {{sub.repo ? sub.repo : sub.url}}
+ {{sub.author ? sub.author : '@anonymous'}}
+
+ {{ $t('subs.updated') }}: {{ timeago.format(sub.updateTime, timeagoLang.replace('-', '_')) }}
+
+
+
+
+
+ mdi-dots-vertical
+
+
+
+
+ {{ $t('subs.install') }}
+
+
+
+
+ {{ $t('subs.repo') }}
+
+
+ {{ $t('base.cmd.cp') }}
+
+
+ {{ $t('base.cmd.share') }}
+
+
+
+ {{ $t('base.sort.up') }}
+
+
+ {{ $t('base.sort.dn') }}
+
+
+
+ {{ $t('base.cmd.del') }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('subs.addDialog.title') }}
+
+
+
+
+
+
+
+ {{$t('base.dialog.close')}}
+
+ {{$t('base.dialog.save')}}
+
+
+
+
+
+
+ {{ ui.installConfirmDialog.title }}
+ {{ ui.installConfirmDialog.message }}
+
+
+ {{$t('base.dialog.close')}}
+
+ {{$t('base.dialog.ok')}}
+
+
+
+
+
+
+
+
+
+ {{box.usercfgs.name ? box.usercfgs.name : $t('profile.leaveName')}}
+
+
+
+ mdi-cog-outline
+
- {{ $t('subs.addDialog.title') }}
+ {{ $t('profile.editor.title') }}
-
+
+
- {{$t('base.dialog.close')}}
-
- {{$t('base.dialog.save')}}
+ {{ $t('base.dialog.close') }}
+
+ {{ $t('base.dialog.save') }}
-
+
+
+
+ {{ $t('profile.datas') }}
+
+ {{ $t('profile.apps') }}: {{this.apps.length}}
+ {{ $t('profile.subs') }}: {{this.appSubs.length}}
+ {{ $t('profile.sessions') }}: {{this.sessions.length}}
+
+
+
+
+ {{ $t('profile.dataviewer')}}
+
+
+ {{ $t('profile.imp') }}
+
- {{ ui.installConfirmDialog.title }}
- {{ ui.installConfirmDialog.message }}
+ {{ $t('profile.impDialog.title') }}
+
+
+
+
+
- {{$t('base.dialog.close')}}
-
- {{$t('base.dialog.ok')}}
-
+ {{ $t('base.dialog.close') }}
+ {{ $t('profile.imp') }}
-
-
-
-
-
- {{box.usercfgs.name ? box.usercfgs.name : $t('profile.leaveName')}}
-
-
+ {{ $t('profile.bak') }}
+
+
+
+
+
+
+
+ {{bak.name}}
+ {{dayjs(bak.createTime).format('YYYY-MM-DD HH:mm:ss')}}
+
+ {{tag}}
+
+
+
+ mdi-chevron-right
+
+
+
+
+
+
+
+
+
+
+ {{ $t('viewer.dataUnsubscribed') }} ({{gistkeys.length}})
+
+
+
+ {{ key }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('viewer.dataRecentlyViewed') }} ({{viewkeys.length}})
+
+
+
+ {{ key }}
+
+
+
+
+
+
+
+
+
+ {{ $t('viewer.dataViewer') }}
+
+ {{ $t('base.cmd.cp') }}
+
+
+
+
+
+
+
+
+ {{ $t('base.dialog.view') }}
+
+
+
+
+ {{ $t('viewer.dataEditor') }}
+
+ {{ $t('base.cmd.cp') }}
+
+
+
+
+
+
+
+
+
+ {{
+ $t('base.dialog.save') }}
+
+
+
+
+
+
+
+ {{ $t('codding.title') }}
+
+
+ mdi-play-circle
+
+
+
+
+
+
+
+
+ {{curapp.name}}
+
+
+ mdi-play-circle
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('appDetail.scripts') }} ({{curapp.scripts.length}})
+
+
+ {{scriptIdx + 1}}. {{script.name}}
+
+ mdi-play-circle
+
+
+
+
+
+
+
+ {{ $t('appDetail.settings') }} ({{curapp.settings.length}})
+
+
+
+
+
+
+ {{setting.name}}
+
+
+
+ {{setting.name}}
+
+
+
+
+
+ {{setting.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('base.dialog.save') }}
+
+
+
+
+
+ {{ $t('appDetail.curSession') }}
+ {{curapp.curSession ? curapp.curSession.name : ''}}
+
+
+
+ mdi-dots-vertical
+
+
+
+ {{ $t('base.cmd.cp') }}
+
+
- mdi-cog-outline
+
+ {{ $t('base.cmd.imp') }}
+
- {{ $t('profile.editor.title') }}
+ {{ $t('appDetail.impDialog.title') }}
-
-
+
- {{ $t('base.dialog.close') }}
-
- {{ $t('base.dialog.save') }}
+
+ {{ $t('base.dialog.close') }}
+
+
+ {{ $t('base.cmd.imp') }}
-
-
-
- {{ $t('profile.datas') }}
-
- {{ $t('profile.apps') }}: {{this.apps.length}}
- {{ $t('profile.subs') }}: {{this.appSubs.length}}
- {{ $t('profile.sessions') }}: {{this.sessions.length}}
-
-
-
-
- {{ $t('profile.dataviewer')}}
-
+
+ {{ $t('appDetail.copyDatas') }}
+
+
+
+ {{ $t('appDetail.clearDatas') }}
+
+
+
+
+
+
+ {{data.key}}
+ {{data.val ? data.val : $t('appDetail.noDatas')}}
+
+
+
+ mdi-close
+
+
+
+
+
+
+ {{ $t('base.cmd.duplicate') }}
+
+
+
+
+ #{{sessionIdx + 1}} {{session.name}}
+ #{{sessionIdx + 1}} {{session.name}}
+
+
+
+ mdi-dots-vertical
+
+
+
- {{ $t('profile.imp') }}
+
+ {{ $t('base.cmd.mod') }}
+
- {{ $t('profile.impDialog.title') }}
+ {{ $t('appDetail.sessionEditor.title') }}
-
+
+
+
+
+
+
+
+
+
- {{ $t('base.dialog.close') }}
- {{ $t('profile.imp') }}
+ {{ $t('base.dialog.close') }}
+ {{ $t('base.dialog.save') }}
- {{ $t('profile.bak') }}
-
-
-
-
-
-
-
- {{bak.name}}
- {{dayjs(bak.createTime).format('YYYY-MM-DD HH:mm:ss')}}
-
- {{tag}}
-
-
-
- mdi-chevron-right
-
-
-
-
-
-
-
-
-
-
- {{ $t('viewer.dataUnsubscribed') }} ({{gistkeys.length}})
-
-
-
- {{ key }}
-
-
-
-
-
-
-
-
-
-
- {{ $t('viewer.dataRecentlyViewed') }} ({{viewkeys.length}})
-
-
-
- {{ key }}
-
-
-
-
-
-
-
-
-
- {{ $t('viewer.dataViewer') }}
-
- {{ $t('base.cmd.cp') }}
-
-
-
-
-
-
-
-
- {{ $t('base.dialog.view') }}
-
-
-
-
- {{ $t('viewer.dataEditor') }}
-
- {{ $t('base.cmd.cp') }}
-
-
-
-
-
-
-
-
-
- {{
- $t('base.dialog.save') }}
-
-
-
-
-
-
-
- {{ $t('codding.title') }}
-
-
- mdi-play-circle
-
-
-
-
-
-
-
-
- {{curapp.name}}
-
-
- mdi-play-circle
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('appDetail.scripts') }} ({{curapp.scripts.length}})
-
-
- {{scriptIdx + 1}}. {{script.name}}
-
- mdi-play-circle
-
-
-
-
-
-
-
- {{ $t('appDetail.settings') }} ({{curapp.settings.length}})
-
-
-
-
-
-
- {{setting.name}}
-
-
-
- {{setting.name}}
-
-
-
-
-
- {{setting.name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('base.dialog.save') }}
-
-
-
-
-
- {{ $t('appDetail.curSession') }}
- {{curapp.curSession ? curapp.curSession.name : ''}}
-
-
-
- mdi-dots-vertical
-
-
-
- {{ $t('base.cmd.cp') }}
-
-
-
-
- {{ $t('base.cmd.imp') }}
-
-
-
- {{ $t('appDetail.impDialog.title') }}
-
-
-
-
-
-
-
-
- {{ $t('base.dialog.close') }}
-
-
- {{ $t('base.cmd.imp') }}
-
-
-
-
-
- {{ $t('appDetail.copyDatas') }}
-
-
-
- {{ $t('appDetail.clearDatas') }}
-
-
-
-
-
-
- {{data.key}}
- {{data.val ? data.val : $t('appDetail.noDatas')}}
-
-
-
- mdi-close
-
-
-
-
-
-
- {{ $t('base.cmd.duplicate') }}
-
-
-
-
- #{{sessionIdx + 1}} {{session.name}}
- #{{sessionIdx + 1}} {{session.name}}
-
-
-
- mdi-dots-vertical
-
-
-
-
-
- {{ $t('base.cmd.mod') }}
-
-
-
- {{ $t('appDetail.sessionEditor.title') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $t('base.dialog.close') }}
- {{ $t('base.dialog.save') }}
-
-
-
-
-
- {{ $t('base.cmd.del') }}
-
-
-
-
-
-
- {{data.key}}
- {{data.val ? data.val : $t('appDetail.noDatas')}}
-
-
-
-
- {{dayjs(session.createTime).format('YYYY-MM-DD HH:mm:ss')}}
-
- {{ $t('base.dialog.apply') }}
-
-
-
-
-
-
- {{curbak.name}}
-
- {{ $t('base.cmd.recovery') }}
-
-
- {{ $t('bakDetail.title') }}
-
-
-
-
-
-
-
- {{ $t('base.cmd.del') }}
-
-
-
-
- {{ $t('bakDetail.dataTitle') }}
-
- {{ $t('base.cmd.cp') }}
-
-
-
-
-
- Surge 费用计算器(open AI 编写)
- 仅供参考,最终价格以实际为准
-
-
-
-
计算费用
-
费用:{{ cost.toFixed(2) }}
-
-
-
-
-
-
- {{ $t('menus.home') }}mdi-home
- {{ $t('menus.apps') }}mdi-application
- {{ $t('menus.subs') }}mdi-database
-
-
- {{ $t('menus.profile') }}
-
-
-
- {{ $t('menus.profile') }}
- mdi-face-profile
-
-
-
-
-
-
-
+ {{ $t('base.cmd.del') }}
+
+
+
+
+
+
+ {{data.key}}
+ {{data.val ? data.val : $t('appDetail.noDatas')}}
+
+
+
+
+ {{dayjs(session.createTime).format('YYYY-MM-DD HH:mm:ss')}}
+
+ {{ $t('base.dialog.apply') }}
+
+
+
+
+
+
+ {{curbak.name}}
+
+ {{ $t('base.cmd.recovery') }}
+
+
+ {{ $t('bakDetail.title') }}
+
+
+
+
+
+
+
+ {{ $t('base.cmd.del') }}
+
+
+
+
+ {{ $t('bakDetail.dataTitle') }}
+
+ {{ $t('base.cmd.cp') }}
+
+
+
+
+
+ Surge 费用计算器(open AI 编写)
+ 仅供参考,最终价格以实际为准
+
+
+
+
计算费用
+
费用:{{ cost.toFixed(2) }}
+
+
+
+
+
+
+ {{ $t('menus.home') }}mdi-home
+ {{ $t('menus.apps') }}mdi-application
+ {{ $t('menus.subs') }}mdi-database
+
+
+ {{ $t('menus.profile') }}
+
+
+
+ {{ $t('menus.profile') }}
+ mdi-face-profile
+
+
+
+
+
+
+
-
-
-
-
- mdi-help
-
-
- mdi-new-box
-
-
- mdi-calculator-variant-outline
-
-
- {{box.usercfgs.isLeftBoxIcon ? 'mdi-format-horizontal-align-right' : 'mdi-format-horizontal-align-left'}}
-
-
- mdi-refresh
-
-
- mdi-code-tags
-
-
- mdi-magnify
-
-
-
-
-
-
-
- mdi-help-circle
-
-
-
- {{ $t('versionSheet.updateButton') }}
- {{ $t('versionSheet.updateButton') }}
-
-
- {{ $t('versionSheet.versionButton') }}
-
-
-
- mdi-chevron-double-down
-
-
-
-
-
-
-
-
- {{ $t('reloadDialog.title') }}
- {{ $t('reloadDialog.text') }}
-
-
- {{ $t('base.dialog.close') }}
- {{ $t('reloadDialog.reload') }}
-
-
-
-
-
-
+ >
+
+
+
+
+ mdi-help
+
+
+ mdi-new-box
+
+
+ mdi-calculator-variant-outline
+
+
+ {{box.usercfgs.isLeftBoxIcon ? 'mdi-format-horizontal-align-right' : 'mdi-format-horizontal-align-left'}}
+
+
+ mdi-refresh
+
+
+ mdi-code-tags
+
+
+ mdi-magnify
+
+
+
+
+
+
+
+ mdi-help-circle
+
+
+
+ {{ $t('versionSheet.updateButton') }}
+ {{ $t('versionSheet.updateButton') }}
+
+
+ {{ $t('versionSheet.versionButton') }}
+
+
+
+ mdi-chevron-double-down
+
+
+
+
+
+
+
-
- 执行结果
+ {{ $t('reloadDialog.title') }}
+ {{ $t('reloadDialog.text') }}
+
-
- mdi-chevron-double-down
-
-
-
-
-
-
+ {{ $t('base.dialog.close') }}
+ {{ $t('reloadDialog.reload') }}
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+ this.box.usercfgs[type] = this.box.usercfgs[type].filter((k) => k != key)
+ },
+ // 查询数据
+ queryData() {
+ const key = this.ui.viewer.key
+ this.ui.viewer.key = key ? key : 'boxjs_host'
+ axios.get(`/query/data/${this.ui.viewer.key}`).then((resp) => {
+ this.ui.viewer.val = resp.data.val
+ const newkeys = [this.ui.viewer.key, ...this.box.usercfgs.viewkeys]
+ this.box.usercfgs.viewkeys = Array.from(new Set(newkeys)).filter((k) => k)
+ })
+ },
+ saveData() {
+ const key = this.ui.viewer.key
+ const val = this.ui.viewer.val
+ if (key) {
+ if(!this.appsAllKeys.includes(key) && !this.box.usercfgs.gist_cache_key.includes(key)){
+ const newkeys = [key, ...this.box.usercfgs.gist_cache_key]
+ this.box.usercfgs.gist_cache_key = Array.from(new Set(newkeys)).filter((k) => k)
+ }
+ axios.post('/api/saveData/', {key,val}).then((resp) => {
+ this.ui.viewer.val = resp.data.val
+ })
+ }
+ },
+ // 对比版本号
+ compareVersion(v1, v2) {
+ var _v1 = v1.split('.'),
+ _v2 = v2.split('.'),
+ _r = _v1[0] - _v2[0]
+ return _r == 0 && v1 != v2 ? this.compareVersion(_v1.splice(1).join('.'), _v2.splice(1).join('.')) : _r
+ },
+ // 设置HTTP Backend
+ setHttpBackend() {
+ // 目前HTTP Backend不能修改端口号
+ var regex = /^http:\/\/(.*):9999$/
+ if (this.box.syscfgs.env === 'QuanX') {
+ if (regex.test(window.location.origin)) {
+ axios.defaults.baseURL = ''
+ return
+ }
+ // 如果是Quantumult X环境并且配置了正确格式的HTTP Backend,将axios请求指向到HTTP Backend
+ if (this.box.usercfgs.http_backend && regex.test(this.box.usercfgs.http_backend)) {
+ axios.defaults.baseURL = this.box.usercfgs.http_backend
+ this.ui.isCors = true
+ } else {
+ axios.defaults.baseURL = ''
+ }
+ }
+ },
+ calculateUpgradePrice(purchaseDate, licenseType) {
+ const licensePrices = {
+ '1 Device License': 34.99,
+ '3 Devices License': 48.99,
+ '5 Devices License': 69.99,
+ }
+
+ const upgradePrice = licensePrices[licenseType]
+ if (!upgradePrice) {
+ throw new Error(`Invalid license type: ${licenseType}`)
+ }
+
+ const discountEndDate = dayjs('2022-04-15')
+ const freeDate = dayjs('2022-10-15')
+
+ if (dayjs(purchaseDate).isBefore(discountEndDate)) {
+ return licensePrices[licenseType]
+ }
+
+ const equivalentPurchaseDate = dayjs(purchaseDate)
+
+ const diffDays = freeDate.diff(discountEndDate, 'day')
+ const daysFromDiscountEndDate = equivalentPurchaseDate.diff(discountEndDate, 'day')
+
+ if (daysFromDiscountEndDate >= diffDays) {
+ // After free upgrade date
+ return 0
+ } else {
+ const ratio = 1 - daysFromDiscountEndDate / diffDays
+ const price = Math.ceil(ratio * upgradePrice * 100) / 100 - 0.01
+ return price < 1.99 ? 1.99 : price
+ }
+ },
+ calculateCost() {
+ this.cost = this.calculateUpgradePrice(this.purchaseDate, this.licenseType)
+ },
+ }
+ })
+
+