From d6efa8625bc48aae98dc2ca400abb832a6830d9f Mon Sep 17 00:00:00 2001 From: jysperm Date: Wed, 27 Aug 2014 09:05:09 +0800 Subject: [PATCH] many improve --- config.coffee | 4 ++-- core/view/panel.jade | 8 ++++---- plugin/shadowsocks/WIKI/README.md | 13 ++++++++---- plugin/shadowsocks/action.coffee | 33 +++++++++++++++---------------- sample/shadowsocks.config.coffee | 4 ++-- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/config.coffee b/config.coffee index f803a30..45b070c 100644 --- a/config.coffee +++ b/config.coffee @@ -28,8 +28,8 @@ module.exports = plans: shadowsocks: - t_name: 'ShadowSocks 按量付费' - t_service: 'ShadowSocks' + t_name: 'ShadowSocks' + t_service: '按量付费' t_resources: '0.6 CNY / G' services: ['shadowsocks'] resources: {} diff --git a/core/view/panel.jade b/core/view/panel.jade index 8580d10..8d8c58d 100644 --- a/core/view/panel.jade +++ b/core/view/panel.jade @@ -24,7 +24,7 @@ block content .col-md-9 .row - header= t('panel.overview') + header 财务 p | #{t('plan.balance')}: #{account.attribute.balance.toFixed(2)} #{t('plan.currency.cny')} if account.attribute.remaining_time && account.attribute.remaining_time != Infinity && account.attribute.remaining_time != -Infinity @@ -33,7 +33,7 @@ block content a(href= '/panel/pay/').btn.btn-success 充值 .row - header= t('plan.') + header 服务 table.table.table-hover.plan-list tbody for plan in plans @@ -43,9 +43,9 @@ block content td= plan.t_resources td if plan.is_enable - button.btn.btn-danger.btn-sm= t('plan.unsubscribe') + button.btn.btn-danger.btn-sm 关闭 else - button.btn.btn-success.btn-sm= t('plan.subscribe') + button.btn.btn-success.btn-sm 开启 if switch_buttons.length #service-switch.row diff --git a/plugin/shadowsocks/WIKI/README.md b/plugin/shadowsocks/WIKI/README.md index 89a7bd6..5f62401 100644 --- a/plugin/shadowsocks/WIKI/README.md +++ b/plugin/shadowsocks/WIKI/README.md @@ -1,11 +1,16 @@ -## ShadowSocks +## 连接信息 * 服务器:即当前域名 * 端口:可在面板上查看 * 密码:可在面板上查看 * 加密方式:aes-256-cfb -## 计费细节 +## 常用客户端 -每消耗 100M 流量触发一次扣费(约 0.06 元), 若扣费导致帐号余额低于 0, 则会自动退订 ShadowSocks 功能,即关闭服务。 -当手动退订 ShadowSocks 时, 强行触发一次扣费,不足 100M 按 100M 计算。 +* [Windows GUI](http://pan.baidu.com/s/1qWry1Co) +* [OS X GoAgentX](http://pan.baidu.com/s/1xWGyE) | [OS X GUI](http://pan.baidu.com/s/1i3va6ZN) +* [Android apk](http://pan.baidu.com/s/1sjjUTgL) +* [More](http://shadowsocks.org/en/download/clients.html) + +## 计费细节 +每消耗 100M 流量触发一次扣费(约 0.06 元), 若扣费导致帐号余额低于 0, 则会自动关闭 ShadowSocks 服务。当手动关闭 ShadowSocks 时, 强行触发一次扣费,不足 100M 按 100M 计算。 diff --git a/plugin/shadowsocks/action.coffee b/plugin/shadowsocks/action.coffee index 8d782f4..8143ada 100644 --- a/plugin/shadowsocks/action.coffee +++ b/plugin/shadowsocks/action.coffee @@ -3,7 +3,7 @@ fs = require 'fs' path = require 'path' service = require './service' -{renderAccount, requireInService} = require '../../core/router/middleware' +{renderAccount, requireInService, requireAuthenticate} = require '../../core/router/middleware' mAccount = require '../../core/model/account' @@ -25,29 +25,28 @@ exports.post '/reset_password', (req, res) -> wiki_router = express.Router() -wiki_router.use (req, res) -> - req.inject [renderAccount], -> - url = req.url.substr 1 +wiki_router.use requireAuthenticate, (req, res) -> + url = req.url.substr 1 - unless url - url = 'README.md' + unless url + url = 'README.md' - filename = path.resolve path.join __dirname, 'WIKI', url - baseDir = path.resolve path.join __dirname, 'WIKI' + filename = path.resolve path.join __dirname, 'WIKI', url + baseDir = path.resolve path.join __dirname, 'WIKI' - unless filename[0 .. baseDir.length-1] == baseDir - return res.json 404 + unless filename[0 .. baseDir.length-1] == baseDir + return res.json 404 - fs.readFile filename, (err, data) -> - if err - return res.status(404).send err.toString() + fs.readFile filename, (err, data) -> + if err + return res.status(404).send err.toString() - res.render 'wiki', - title: url - content: markdown.toHTML data.toString() + res.render 'wiki', + title: url + content: markdown.toHTML data.toString() app.view_hook.menu_bar.push href: '/wiki/' - html: '用户手册' + html: '使用帮助' app.use '/wiki', wiki_router diff --git a/sample/shadowsocks.config.coffee b/sample/shadowsocks.config.coffee index f6cc03d..8602315 100644 --- a/sample/shadowsocks.config.coffee +++ b/sample/shadowsocks.config.coffee @@ -28,8 +28,8 @@ module.exports = plans: shadowsocks: - t_name: 'ShadowSocks 按量付费' - t_service: 'ShadowSocks' + t_name: 'ShadowSocks' + t_service: '按量付费' t_resources: '0.6 CNY / G' services: ['shadowsocks'] resources: {}