shadowsocks i18n of widget

This commit is contained in:
jysperm
2014-11-09 07:51:17 +08:00
parent 21c93b9d07
commit 455fedab64
3 changed files with 27 additions and 14 deletions

View File

@@ -25,7 +25,12 @@ if config.plugins.shadowsocks.green_style
exports.registerHook 'view.panel.widgets',
generator: (req, callback) ->
exports.render 'widget', req, {}, callback
exports.render 'widget', req,
transfer_remainder: account.billing.balance / config.plugins.shadowsocks.price_bucket / (1000 * 1000 * 1000 / config.plugins.shadowsocks.billing_bucket)
traffic_24hours: null
traffic_7days: null
traffic_30days: null
, callback
exports.registerServiceHook 'enable',
filter: (req, callback) ->

View File

@@ -1,3 +1,11 @@
{
"": "ShadowSocks"
"": "ShadowSocks",
"remote_access": "连接",
"remote_port": "端口",
"reset": "重置",
"transfer": "流量",
"transfer_remainder": "余额折合约 __traffic__ G 流量",
"24hours_ago": "过去 24 小时",
"7days_ago": "过去 7 天",
"30days_ago": "过去 30 天"
}

View File

@@ -1,32 +1,32 @@
header ShadowSocks
header= t('')
.col-md-6
.panel.panel-default
.panel-heading
h3.panel-title 连接
h3.panel-title= t('remote_access')
.panel-body
.input-group
span.input-group-addon 端口
input.form-control(type='text', value=account.attribute.plugin.shadowsocks.port, disabled)
span.input-group-addon= t('remote_port')
p.form-control-static= account.pluggable.shadowsocks.port
.input-group
span.input-group-addon 密码
input.form-control(type='text', value=account.attribute.plugin.shadowsocks.password, disabled)
span.input-group-addon= t('account.password')
p.form-control-static= account.pluggable.shadowsocks.password
span.input-group-btn
button.btn.btn-default.action-reset-password(type='button') 重置
button.btn.btn-default.action-reset-password(type='button')= t('reset')
.col-md-6
.panel.panel-default
.panel-heading
h3.panel-title 流量
h3.panel-title= t('transfer')
.panel-body
p 余额折合约 #{(account.attribute.balance / config.plugins.shadowsocks.price_bucket / 10).toFixed(1)} G 流量
p= t('transfer_remainder', {traffic: transfer_remainder.toFixed(1)})
table.table.table-hover
tbody
tr
td #{(traffic_24hours / 1000).toFixed(1)}G
td 24 hour ago
td= t('24hours_ago')
tr
td #{(traffic_7days / 1000).toFixed(1)}G
td 7 days ago
td= t('7days_ago')
tr
td #{(traffic_30days / 1000).toFixed(1)}G
td 30 days ago
td= t('30days_ago')