Skip to content

Commit 09375b8

Browse files
author
xVanTuring
authored
Merge pull request #70 from xVanTuring/v0.3.0
0.3.0-alpha.4
2 parents c073053 + dd543ff commit 09375b8

File tree

17 files changed

+62
-49
lines changed

17 files changed

+62
-49
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "electron-ssr",
3-
"version": "0.3.0-alpha.3",
3+
"version": "0.3.0-alpha.4",
44
"description": "Cross platform ShadowsocksR GUI client built with electron",
55
"author": {
66
"name": "The Electron-SSR Authors",
@@ -43,7 +43,7 @@
4343
"chalk": "^3.0.0",
4444
"cli-progress": "^3.6.0",
4545
"devtron": "^1.4.0",
46-
"electron": "^6.1.7",
46+
"electron": "^6.1.9",
4747
"eslint": "^5.16.0",
4848
"eslint-plugin-vue": "^5.0.0",
4949
"request": "^2.88.2",

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/main/tray.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ async function generateMenus (appConfig) {
7272
handler.toggleProxy(appConfig.sysProxyMode)
7373
}
7474
},
75+
{ label: $t('MENU_SUB_COPY_HTTP_PROXY'), click: handler.copyHttpProxyCode },
7576
{
7677
label: $t('MENU_PAC'),
7778
submenu: [

src/main/window.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import logger from './logger'
44
import {
55
createProtocol
66
} from 'vue-cli-plugin-electron-builder/lib'
7-
import { isLinux } from '@/shared/env'
87

98
let mainWindow
109
let readyPromise
@@ -19,7 +18,7 @@ export function createWindow () {
1918
resizable: false,
2019
minimizable: false,
2120
maximizable: false,
22-
show: isLinux,
21+
show: false,
2322
webPreferences: { webSecurity: process.env.NODE_ENV === 'production', nodeIntegration: true }
2423
})
2524
if (process.platform === 'darwin') { app.dock.show() }

src/renderer/views/panel/SSRNode.vue renamed to src/renderer/components/node/SSRNode.vue

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
<template>
2-
<div
3-
class="node-root"
4-
:class="{selected:selected,activated:activated}"
5-
>
6-
<span class="active-indicator"/>
7-
<div class="node-selection-area"
8-
@click="click"
9-
@dblclick="dblclick">
2+
<div class="node-root" :class="{selected:selected,activated:activated,disabled:disabled}">
3+
<span class="active-indicator" />
4+
<div class="node-selection-area" @click="click" @dblclick="dblclick">
105
<span class="node-name">{{trimmedTitle}}</span>
116
<span class="latency-block">
127
<span class="latency-value" :class="latencyClass">{{latencyText}}</span>
@@ -32,6 +27,10 @@ export default {
3227
type: Boolean,
3328
required: true
3429
},
30+
disabled: {
31+
type: Boolean,
32+
require: true
33+
},
3534
latency: {
3635
type: Number,
3736
default: 0
@@ -45,10 +44,6 @@ export default {
4544
default: 23
4645
}
4746
},
48-
data () {
49-
return {
50-
}
51-
},
5247
computed: {
5348
latencyText () {
5449
if (this.latency > 0) {
@@ -67,7 +62,9 @@ export default {
6762
}
6863
},
6964
trimmedTitle () {
70-
if (this.name.length <= this.maxNameCount) { return this.name }
65+
if (this.name.length <= this.maxNameCount) {
66+
return this.name
67+
}
7168
// eslint-disable-next-line no-useless-escape
7269
let letterRegex = /[a-zA-Z0-9\[\]\-\/. ]/
7370
let titleArr = []
@@ -76,7 +73,10 @@ export default {
7673
while (maxCount > 0 && rawIndex < this.name.length) {
7774
titleArr.push(this.name[rawIndex])
7875
rawIndex++
79-
if (rawIndex + 1 < this.name.length && this.name[rawIndex].match(letterRegex)) {
76+
if (
77+
rawIndex + 1 < this.name.length &&
78+
this.name[rawIndex].match(letterRegex)
79+
) {
8080
titleArr.push(this.name[rawIndex])
8181
rawIndex++
8282
}
@@ -129,10 +129,13 @@ export default {
129129
.node-root.activated .active-indicator {
130130
background-color: #34c3f0;
131131
}
132+
.node-root.activated.disabled .active-indicator {
133+
background-color: #929292;
134+
}
132135
133136
.node-root.selected .node-selection-area {
134-
background-color: #CDE8F0;
135-
border-color: #34C3F0;
137+
background-color: #cde8f0;
138+
border-color: #34c3f0;
136139
}
137140
.latency-block {
138141
line-height: 28px;
@@ -152,13 +155,13 @@ export default {
152155
transition: all 200ms linear;
153156
}
154157
.latency-value.low {
155-
color: #67C23A;
158+
color: #67c23a;
156159
}
157160
.latency-value.med {
158-
color: #E6A23C;
161+
color: #e6a23c;
159162
}
160163
.latency-value.high {
161-
color: #F56C6C;
164+
color: #f56c6c;
162165
}
163166
.latency-value.no-data {
164167
color: #909399;

src/renderer/views/panel/NodeList.vue renamed to src/renderer/components/node/SSRNodeGroup.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
:id="node.id"
1515
:activated="node.id===activatedConfigId"
1616
:name="node.title"
17+
:disabled="disabled"
1718
@nodeSelected="nodeSelected"
1819
@nodeActivated="nodeActivated"/>
1920
</div>
@@ -31,7 +32,8 @@ export default {
3132
node: Object,
3233
selectedConfigId: String,
3334
activatedConfigId: String,
34-
selectedGroupName: String
35+
selectedGroupName: String,
36+
disabled: Boolean
3537
},
3638
data () {
3739
return {

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",

0 commit comments

Comments
 (0)