Skip to content

Commit

Permalink
add hide window option
Browse files Browse the repository at this point in the history
  • Loading branch information
xVanTuring authored and xVanTuring committed Mar 11, 2020
1 parent 29dbcfd commit dd543ff
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (!isPrimaryInstance) {
if (changed.length === 0) {
// if there is no config, or ssrPath is not set, show window
// 初始化时没有配置则打开页面,有配置则不显示主页面
if (appConfig.configs.length === 0 || !appConfig.ssrPath) {
if (!appConfig.hideWindow || appConfig.configs.length === 0 || !appConfig.ssrPath) {
showWindow()
}
} else if (changed.indexOf('autoLaunch') > -1) {
Expand Down
1 change: 1 addition & 0 deletions src/renderer/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"UI_SETTING_SSR_PYTHON_DIR": "SSR python Dir",
"UI_SETTING_SELECT_SSR_PYTHON_DIR": "Select SSR Dir",
"UI_SETTING_AUTO_START": "Auto Start",
"UI_SETTING_HIDE_WINDOW": "Hide Window",
"UI_SETTING_PAC_PORT": "Pac Port",
"UI_SETTING_SHARE_LAN": "Share LAN",
"UI_SETTING_LOCAL_LISTEN_PORT": "Local Listen Port",
Expand Down
1 change: 1 addition & 0 deletions src/renderer/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"UI_SETTING_SSR_PYTHON_DIR": "ssr python 目录",
"UI_SETTING_SELECT_SSR_PYTHON_DIR": "选择ssr目录",
"UI_SETTING_AUTO_START": "自动启动",
"UI_SETTING_HIDE_WINDOW": "隐藏窗口",
"UI_SETTING_PAC_PORT": "Pac 端口",
"UI_SETTING_SHARE_LAN": "局域网共享",
"UI_SETTING_LOCAL_LISTEN_PORT": "本地监听端口",
Expand Down
20 changes: 13 additions & 7 deletions src/renderer/views/option/Common.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<i-form-item class="flex-1" :label="$t('UI_SETTING_AUTO_START')">
<i-checkbox v-model="form.autoLaunch" @on-change="update('autoLaunch')" />
</i-form-item>
<i-form-item class="flex-1" :label="$t('UI_SETTING_HIDE_WINDOW')">
<i-checkbox v-model="form.hideWindow" @on-change="update('hideWindow')" />
</i-form-item>
<i-form-item class="flex-1" :label="$t('UI_SETTING_SHARE_LAN')">
<i-checkbox v-model="form.shareOverLan" @on-change="update('shareOverLan')" />
</i-form-item>
Expand Down Expand Up @@ -48,10 +51,10 @@
</i-form-item>
</div>
<i-form-item prop="lang" label="Language" :label-width="120">
<i-select v-model="form.lang" class="language-selector-view" @input="update('lang')">
<i-option value="zh-CN">简体中文</i-option>
<i-option value="en-US">English</i-option>
</i-select>
<i-select v-model="form.lang" class="language-selector-view" @input="update('lang')">
<i-option value="zh-CN">简体中文</i-option>
<i-option value="en-US">English</i-option>
</i-select>
</i-form-item>
</i-form>
</div>
Expand All @@ -68,6 +71,7 @@ export default {
form: {
ssrPath: appConfig.ssrPath,
autoLaunch: appConfig.autoLaunch,
hideWindow: appConfig.hideWindow,
shareOverLan: appConfig.shareOverLan,
localPort: appConfig.localPort,
pacPort: appConfig.pacPort,
Expand All @@ -83,7 +87,9 @@ export default {
if (exists) {
return Promise.resolve()
}
return Promise.reject(new Error(this.$t('UI_INCORRECT_FOLDER')))
return Promise.reject(
new Error(this.$t('UI_INCORRECT_FOLDER'))
)
})
}
}
Expand Down Expand Up @@ -143,7 +149,7 @@ export default {
}
</script>
<style lang="stylus" scoped>
.language-selector-view{
width 180px;
.language-selector-view {
width: 180px;
}
</style>
1 change: 1 addition & 0 deletions src/shared/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const defaultConfig = {
enable: false,
// 开机自启
autoLaunch: false,
hideWindow: !isLinux,
// 是否局域网共享
shareOverLan: false,
// 本地socks端口
Expand Down

0 comments on commit dd543ff

Please sign in to comment.