Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

更改配置文件保存路径 #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions args.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 28 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Shadowsocks GUI</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<style>
Expand All @@ -22,17 +23,18 @@
</head>
<body>
<div id="divError" class="alert alert-error hide">
Please fill in the blanks and click Save.
请填写空白并保存.
</div>
<div id="divWarning" class="alert alert-info hide">
</div>
<div id="divNewVersion" class="alert alert-success hide">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<span class="msg"></span>
</div>
<div id="url"></div>
<div class="form-horizontal">
<div class="control-group">
<label class="control-label" for="inputServerIP">Server IP</label>
<label class="control-label" for="inputServerIP">服务器 IP</label>
<div class="controls">
<div class="input-append combo">
<input class="left" type="text" id="inputServerIP" data-key="server" autocomplete="off" data-provide="typeahead" placeholder="Server IP">
Expand All @@ -53,24 +55,28 @@
</div>
</div>
</div>

<div class="control-group">
<label class="control-label" for="inputServerPort">Server Port</label>
<label class="control-label" for="inputServerPort">服务器端口</label>
<div class="controls">
<input type="text" id="inputServerPort" data-key="server_port" placeholder="Server Port">
</div>
</div>

<div class="control-group">
<label class="control-label" for="inputPassword">Password</label>
<label class="control-label" for="inputPassword">密码</label>
<div class="controls">
<input type="password" id="inputPassword" data-key="password" placeholder="Password">
</div>
</div>

<div class="control-group">
<label class="control-label" for="inputLocalPort">SOCKS 5 Proxy Port</label>
<div class="controls">
<input type="text" id="inputLocalPort" data-key="local_port" placeholder="Local Port" value="1080">
</div>
</div>

<div class="control-group">
<label class="control-label" for="selectMethod">Encryption Method</label>
<div class="controls">
Expand All @@ -92,15 +98,30 @@
</select>
</div>
</div>

<div class="control-group">
<label class="control-label" for="inputTimeout">Timeout in Second</label>
<label class="control-label" for="inputTimeout">超时分钟数</label>
<div class="controls">
<input type="number" id="inputTimeout" data-key="timeout" placeholder="Timeout" value="600" min=10>
<input type="number" id="inputTimeout" data-key="timeout" placeholder="Timeout" value="600">
</div>
</div>

<div class="control-group">
<label class="control-label" for="clientproxy">本地代理地址</label>
<div class="controls">
<button id="buttonSave" class="btn btn-primary"><i class="icon-ok icon-white"></i> Save</button>
<input type="text" id="clientproxy" placeholder="http://" data-key="client_proxy" value="172.17.18.84">
</div>
</div>

<div class="control-group">
<label class="control-label" for="clientport">本地代理端口</label>
<div class="controls">
<input type="number" id="clientport" placeholder="8080" data-key="client_port" value="8080">
</div>
</div>
<div class="control-group">
<div class="controls">
<button id="buttonSave" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
<button id="buttonConsole" class="btn btn-info"><i class="icon-wrench icon-white"></i> Debug</button>
<button id="buttonAbout" class="btn"><i class="icon-info-sign"></i></button>
</div>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"icon": "icon.png",
"toolbar": false,
"width": 500,
"height": 450,
"height": 520,
"position": "mouse",
"min_width": 500,
"min_height": 450,
"min_height": 500,
"max_width": 500,
"max_height": 450
"max_height": 550
},
"js-flags": "--expose-gc",
"licenses": [
Expand Down
4 changes: 3 additions & 1 deletion src/args.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ localStorage = window.localStorage
util = require 'util'

fs = require 'fs'
guiconfigFilename = fs.realpathSync(process.execPath + '/..') + '/gui-config.json'
guiconfigFilename = __dirname + '/gui-config.json'

loadFromJSON = ->
# Windows users are happy to see a config file within their shadowsocks-gui folder
Expand Down Expand Up @@ -41,6 +41,8 @@ publicConfig =
password: '$#HAL9000!'
method: 'aes-256-cfb'
timeout: 600
client_proxy: ''
client_port: 8080

defaultConfig =
server_port: 8388
Expand Down