perf: 关闭策略
parent
ca863da878
commit
ae06bcfc5f
|
@ -172,6 +172,10 @@ const configApi = {
|
||||||
const config = configApi.get()
|
const config = configApi.get()
|
||||||
return config || {}
|
return config || {}
|
||||||
},
|
},
|
||||||
|
update (partConfig) {
|
||||||
|
const newConfig = lodash.merge(configApi.get(), partConfig)
|
||||||
|
configApi.save(newConfig)
|
||||||
|
},
|
||||||
get,
|
get,
|
||||||
set (newConfig) {
|
set (newConfig) {
|
||||||
if (newConfig == null) {
|
if (newConfig == null) {
|
||||||
|
|
|
@ -186,6 +186,10 @@ function createWindow (startHideWindow) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
if (isLinux()) {
|
||||||
|
quit(app)
|
||||||
|
return
|
||||||
|
}
|
||||||
const config = DevSidecar.api.config.get()
|
const config = DevSidecar.api.config.get()
|
||||||
const closeStrategy = config.app.closeStrategy
|
const closeStrategy = config.app.closeStrategy
|
||||||
if (closeStrategy === 0) {
|
if (closeStrategy === 0) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ function install (app, api) {
|
||||||
async onOk () {
|
async onOk () {
|
||||||
console.log('OK')
|
console.log('OK')
|
||||||
if (result.save) {
|
if (result.save) {
|
||||||
await api.config.save({ app: { closeStrategy: result.closeType } })
|
await api.config.update({ app: { closeStrategy: result.closeType } })
|
||||||
}
|
}
|
||||||
api.ipc.send('close', { key: 'selected', value: result.closeType })
|
api.ipc.send('close', { key: 'selected', value: result.closeType })
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<a-form-item label="远程配置地址" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form-item label="远程配置地址" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<a-input v-model="config.app.remoteConfig.url"></a-input>
|
<a-input v-model="config.app.remoteConfig.url"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="关闭策略" :label-col="labelCol" :wrapper-col="wrapperCol">
|
<a-form-item v-if="!isLinux()" label="关闭策略" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
<a-radio-group v-model="config.app.closeStrategy"
|
<a-radio-group v-model="config.app.closeStrategy"
|
||||||
default-value="0" button-style="solid">
|
default-value="0" button-style="solid">
|
||||||
<a-radio-button :value="0">
|
<a-radio-button :value="0">
|
||||||
|
|
Loading…
Reference in New Issue