Skip to content

Commit dd543ff

Browse files
xVanTuringxVanTuring
authored andcommitted
add hide window option
1 parent 29dbcfd commit dd543ff

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

src/main/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if (!isPrimaryInstance) {
5555
if (changed.length === 0) {
5656
// if there is no config, or ssrPath is not set, show window
5757
// 初始化时没有配置则打开页面,有配置则不显示主页面
58-
if (appConfig.configs.length === 0 || !appConfig.ssrPath) {
58+
if (!appConfig.hideWindow || appConfig.configs.length === 0 || !appConfig.ssrPath) {
5959
showWindow()
6060
}
6161
} else if (changed.indexOf('autoLaunch') > -1) {

src/renderer/locales/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"UI_SETTING_SSR_PYTHON_DIR": "SSR python Dir",
2626
"UI_SETTING_SELECT_SSR_PYTHON_DIR": "Select SSR Dir",
2727
"UI_SETTING_AUTO_START": "Auto Start",
28+
"UI_SETTING_HIDE_WINDOW": "Hide Window",
2829
"UI_SETTING_PAC_PORT": "Pac Port",
2930
"UI_SETTING_SHARE_LAN": "Share LAN",
3031
"UI_SETTING_LOCAL_LISTEN_PORT": "Local Listen Port",

src/renderer/locales/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"UI_SETTING_SSR_PYTHON_DIR": "ssr python 目录",
2525
"UI_SETTING_SELECT_SSR_PYTHON_DIR": "选择ssr目录",
2626
"UI_SETTING_AUTO_START": "自动启动",
27+
"UI_SETTING_HIDE_WINDOW": "隐藏窗口",
2728
"UI_SETTING_PAC_PORT": "Pac 端口",
2829
"UI_SETTING_SHARE_LAN": "局域网共享",
2930
"UI_SETTING_LOCAL_LISTEN_PORT": "本地监听端口",

src/renderer/views/option/Common.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
<i-form-item class="flex-1" :label="$t('UI_SETTING_AUTO_START')">
1515
<i-checkbox v-model="form.autoLaunch" @on-change="update('autoLaunch')" />
1616
</i-form-item>
17+
<i-form-item class="flex-1" :label="$t('UI_SETTING_HIDE_WINDOW')">
18+
<i-checkbox v-model="form.hideWindow" @on-change="update('hideWindow')" />
19+
</i-form-item>
1720
<i-form-item class="flex-1" :label="$t('UI_SETTING_SHARE_LAN')">
1821
<i-checkbox v-model="form.shareOverLan" @on-change="update('shareOverLan')" />
1922
</i-form-item>
@@ -48,10 +51,10 @@
4851
</i-form-item>
4952
</div>
5053
<i-form-item prop="lang" label="Language" :label-width="120">
51-
<i-select v-model="form.lang" class="language-selector-view" @input="update('lang')">
52-
<i-option value="zh-CN">简体中文</i-option>
53-
<i-option value="en-US">English</i-option>
54-
</i-select>
54+
<i-select v-model="form.lang" class="language-selector-view" @input="update('lang')">
55+
<i-option value="zh-CN">简体中文</i-option>
56+
<i-option value="en-US">English</i-option>
57+
</i-select>
5558
</i-form-item>
5659
</i-form>
5760
</div>
@@ -68,6 +71,7 @@ export default {
6871
form: {
6972
ssrPath: appConfig.ssrPath,
7073
autoLaunch: appConfig.autoLaunch,
74+
hideWindow: appConfig.hideWindow,
7175
shareOverLan: appConfig.shareOverLan,
7276
localPort: appConfig.localPort,
7377
pacPort: appConfig.pacPort,
@@ -83,7 +87,9 @@ export default {
8387
if (exists) {
8488
return Promise.resolve()
8589
}
86-
return Promise.reject(new Error(this.$t('UI_INCORRECT_FOLDER')))
90+
return Promise.reject(
91+
new Error(this.$t('UI_INCORRECT_FOLDER'))
92+
)
8793
})
8894
}
8995
}
@@ -143,7 +149,7 @@ export default {
143149
}
144150
</script>
145151
<style lang="stylus" scoped>
146-
.language-selector-view{
147-
width 180px;
152+
.language-selector-view {
153+
width: 180px;
148154
}
149155
</style>

src/shared/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const defaultConfig = {
99
enable: false,
1010
// 开机自启
1111
autoLaunch: false,
12+
hideWindow: !isLinux,
1213
// 是否局域网共享
1314
shareOverLan: false,
1415
// 本地socks端口

0 commit comments

Comments
 (0)