perf: 优化提示

pull/192/head
xiaojunnuo 2021-12-05 23:48:09 +08:00
parent a738488651
commit 4a350cb549
7 changed files with 30 additions and 16 deletions

View File

@ -22,7 +22,8 @@ module.exports = {
dock: {
hideWhenWinClose: false
},
closeStrategy: 0
closeStrategy: 0,
showShutdownTip: true
},
server: {
enabled: true,

View File

@ -14,7 +14,7 @@ function install (app, api) {
app.$confirm({
title: '关闭策略',
content: h => <div>
<div>
<div style={'margin-top:10px'}>
<a-radio-group vOn:change={onRadioChange}>
<a-radio value={1}>
直接关闭
@ -24,7 +24,7 @@ function install (app, api) {
</a-radio>
</a-radio-group>
</div>
<div>
<div style={'margin-top:10px'}>
<a-checkbox vOn:change={onCheckChange} >
记住本次选择不再提示
< /a-checkbox>

View File

@ -1,4 +1,5 @@
<template>
<a-config-provider :locale="locale">
<div class="ds_layout">
<a-layout>
<a-layout-sider theme="light">
@ -42,16 +43,19 @@
</a-layout>
</a-layout>
</div>
</a-config-provider>
</template>
<script>
import createMenus from '@/view/router/menu'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default {
name: 'App',
components: {
},
data () {
return {
locale: zhCN,
info: {},
menus: undefined
}

View File

@ -19,15 +19,15 @@
</template>
<div class="box">
<a-alert message="本应用开启后会修改系统代理,直接重启电脑可能会无法上网,您可以再次启动本应用即可恢复。如您需要卸载,在卸载前请务必右键右下角小图标退出本应用再进行卸载" banner />
<a-alert v-if="config && config.app.showShutdownTip" message="本应用开启后会修改系统代理,直接重启电脑可能会无法上网,您可以再次启动本应用即可恢复。如您需要卸载,在卸载前请务必完全退出本应用再进行卸载" banner closable @close="onShutdownTipClose"/>
<div class="mode-bar" style="margin:20px;" v-if="config && config.app">
<a-radio-group v-model="config.app.mode" button-style="solid" @change="modeChange">
<a-tooltip placement="topLeft" title="启用测速,关闭拦截,关闭增强(功能最弱,不稳定,不需要安装证书,最安全)">
<a-tooltip placement="topLeft" title="启用测速,关闭拦截,关闭增强(不稳定,不需要安装证书,最安全)">
<a-radio-button value="safe">
安全模式
</a-radio-button>
</a-tooltip>
<a-tooltip placement="topLeft" title="启用测速,启用拦截,关闭增强(功能稍强,需要安装证书)">
<a-tooltip placement="topLeft" title="启用测速,启用拦截,关闭增强(需要安装证书)">
<a-radio-button value="default">
默认模式
</a-radio-button>
@ -89,7 +89,7 @@
<div class="star" >
<div class="donate" @click="donateModal=true">
<a-icon type="like" theme="outlined"/>
捐赠本项目完全免费用爱发电
捐赠
</div>
<div class="right">
<div>如果它解决了你的问题请不要吝啬你的star哟点这里
@ -103,7 +103,8 @@
</div>
<a-modal title="捐赠" v-model="donateModal" width="550px" cancelText="不了" okText="果断支持" @ok="goDonate">
<div>* 如果觉得好用可以给予捐赠开源项目持续发展离不开您的支持感谢</div>
<div>* 本应用完全免费如果觉得好用可以给予捐赠</div>
<div>* 开源项目持续发展离不开您的支持感谢</div>
<div class="payQrcode">
<img height="200px" src="/pay.jpg"/>
</div>
@ -202,7 +203,7 @@ export default {
return
}
this.config.server.intercept.enabled = true
this.config.server.dns.speedTest.enabled = false
this.config.server.dns.speedTest.enabled = true
this.config.plugin.overwall.enabled = true
}
this.$api.config.save(this.config).then(() => {
@ -336,6 +337,16 @@ export default {
},
openExternal (url) {
this.$api.ipc.openExternal(url)
},
onShutdownTipClose (e) {
this.$confirm({
title: '是否永久关闭该提示',
okText: '我已知晓,不再提示',
cancelText: '下次还显示',
onOk: () => {
this.$api.config.update({ app: { showShutdownTip: false } })
}
})
}
}
}

View File

@ -53,9 +53,9 @@
<a-form-item label="镜像变量设置" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-checkbox v-model="config.plugin.node.startup.variables">
自动设置
自动设置启动npm加速开关时将会设置如下环境变量
</a-checkbox>
<div>某些库需要自己设置镜像变量才能下载比如electron</div>
<div class="form-help">某些库需要自己设置镜像变量才能下载比如electron</div>
<a-row :gutter="10" style="margin-top: 10px" v-for="(item,index) of npmVariables" :key='index'>
<a-col :span="10">
<a-input :disabled="item.key ===false" v-model="item.key"></a-input>

View File

@ -37,7 +37,7 @@
原生
</a-radio-button>
<a-radio-button value="https://mirrors.aliyun.com/pypi/simple/">
taobao镜像
aliyun镜像
</a-radio-button>
</a-radio-group>
<div class="form-help">设置后立即生效即使关闭ds也会继续保持</div>

View File

@ -51,18 +51,16 @@
v-model="config.server.setting.rootCaFile.keyPath"/>
</a-form-item>
<a-form-item label="启用拦截" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-tooltip title="关闭拦截且关闭功能增强的话就不需要安装根证书本应用退化为dns优选最安全">
<a-checkbox v-model="config.server.intercept.enabled">
启用拦截
</a-checkbox>
</a-tooltip>
<div class="form-help">关闭拦截且关闭功能增强的话就不需要安装根证书本应用退化为安全模式</div>
</a-form-item>
<a-form-item label="启用脚本" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-tooltip title="关闭后github的clone加速链接复制也将关闭">
<a-checkbox v-model="config.server.setting.script.enabled">
允许插入并运行脚本
</a-checkbox>
</a-tooltip>
<div class="form-help">关闭后github的clone加速链接复制也将关闭</div>
</a-form-item>
</a-tab-pane>
<a-tab-pane tab="拦截设置" key="2">