Adaptive Multilingualism.

This commit is contained in:
WispX 2021-07-23 17:46:26 +08:00
parent fbea72c239
commit b704a2c30a
22 changed files with 586 additions and 328 deletions

View File

@ -42,33 +42,30 @@ function format_size($size, $array = false)
/**
* 格式化友好时间戳
*
* @param $unixTime
* @return false|string
*/
function format_time($unixTime)
function format_time($remote, $local = null)
{
$showTime = date('Y', $unixTime) . "" . date('n', $unixTime) . "" . date('j', $unixTime) . "";
if (date('Y', $unixTime) == date('Y')) {
$showTime = date('n', $unixTime) . "" . date('j', $unixTime) . "" . date('H:i', $unixTime);
if (date('n.j', $unixTime) == date('n.j')) {
$timeDifference = time() - $unixTime + 1;
if ($timeDifference < 30) {
return "刚刚";
}
if ($timeDifference >= 30 && $timeDifference < 60) {
return $timeDifference . "秒前";
}
if ($timeDifference >= 60 && $timeDifference < 3600) {
return floor($timeDifference / 60) . "分钟前";
}
return date('H:i', $unixTime);
}
if (date('n.j', ($unixTime + 86400)) == date('n.j')) {
return "昨天 " . date('H:i', $unixTime);
$timediff = (is_null($local) || $local ? time() : $local) - $remote;
$chunks = array(
array(60 * 60 * 24 * 365, 'year'),
array(60 * 60 * 24 * 30, 'month'),
array(60 * 60 * 24 * 7, 'week'),
array(60 * 60 * 24, 'day'),
array(60 * 60, 'hour'),
array(60, 'minute'),
array(1, 'second')
);
$name = $count ='';
for ($i = 0, $j = count($chunks); $i < $j; $i++) {
$seconds = $chunks[$i][0];
$name = $chunks[$i][1];
if (($count = floor($timediff / $seconds)) != 0) {
break;
}
}
return $showTime;
return lang("%s {$name}%s ago", [$count, ($count > 1 ? 's' : '')]);
}
/**

View File

@ -15,6 +15,8 @@ use PHPMailer\PHPMailer\PHPMailer;
use think\Controller;
use think\Exception;
use think\facade\Config;
use think\facade\Cookie;
use think\facade\Lang;
use think\facade\Session;
use think\facade\Env;
@ -33,10 +35,16 @@ class Base extends Controller
$this->user = request()->user;
if ($this->request->has('lang')) {
Cookie::set('think_var', $this->request->get('lang'));
}
$this->assign([
'config' => $this->getConfig(),
'user' => $this->user,
'uri' => strtolower($this->request->controller() . '/' . $this->request->action())
'uri' => strtolower($this->request->controller() . '/' . $this->request->action()),
'lang' => Lang::range(),
'languages' => json_encode(Lang::get()),
]);
}

View File

@ -1,6 +1,6 @@
{extend name="common:base" /}
{block name="title"}角色组 - {$config.site_name}{/block}
{block name="title"}{:lang('Role group')} - {$config.site_name}{/block}
{block name="main"}
<div class="mdui-container">
@ -8,7 +8,7 @@
<div class="mdui-m-t-2 mdui-m-b-2">
<div class="mdui-typo">
<blockquote>
<p>不同的角色组下的用户,上传图片将使用不同的储存策略。<br>至少有一个默认角色组,新注册用户和访客将会使用默认的角色组。<br>角色组删除后,该组下面的用户将重置默认角色组。</p>
<p>{:lang('Role group tips')}</p>
</blockquote>
</div>
<div class="mdui-btn-group mdui-m-a-1">
@ -17,10 +17,10 @@
<table class="mdui-table mdui-table-selectable">
<thead>
<tr>
<th>使用策略</th>
<th>名称</th>
<th>注册默认</th>
<th>操作</th>
<th>{:lang('Strategy used')}</th>
<th>{:lang('Name')}</th>
<th>{:lang('Register default')}</th>
<th>{:lang('Operation')}</th>
</tr>
</thead>
<tbody>
@ -42,8 +42,8 @@
</td>
<td>
<div class="mdui-btn-group">
<button class="mdui-btn mdui-btn-raised mdui-btn-dense edit">编辑</button>
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-red mdui-btn-dense del">删除</button>
<button class="mdui-btn mdui-btn-raised mdui-btn-dense edit">{:lang('Edit')}</button>
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-red mdui-btn-dense del">{:lang('Delete')}</button>
</div>
</td>
</tr>
@ -56,13 +56,13 @@
<div class="mdui-dialog" id="add-dialog">
<div class="mdui-dialog-content">
<form action="{:url('admin/group/edit')}" method="post">
<div class="mdui-dialog-title">添加角色组</div>
<div class="mdui-dialog-title">{:lang('Add role group')}</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">组名称</label>
<input class="mdui-textfield-input" type="text" name="name" value="" placeholder="组名称" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('Group name')}</label>
<input class="mdui-textfield-input" type="text" name="name" value="" placeholder="{:lang('Group name')}" autocomplete="off"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">使用策略</label>
<label class="mdui-textfield-label">{:lang('Strategy used')}</label>
<select class="mdui-select" name="strategy">
{foreach $strategy_list as $strategy => $val}
<option value="{$strategy}">{$val.name}</option>
@ -70,15 +70,15 @@
</select>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">是否默认</label>
<label class="mdui-textfield-label">{:lang('Is default')}</label>
<label class="mdui-switch">
<input type="checkbox" name="default" value="1"/>
<i class="mdui-switch-icon"></i>
</label>
</div>
<div class="mdui-dialog-actions">
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-cancel>取消</button>
<button class="mdui-btn mdui-ripple">确定</button>
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-cancel>{:lang('Cancel')}</button>
<button class="mdui-btn mdui-ripple">{:lang('Confirm')}</button>
</div>
</form>
</div>
@ -86,13 +86,13 @@
<div class="mdui-dialog" id="edit-dialog">
<div class="mdui-dialog-content">
<form action="{:url('admin/group/edit')}" method="post">
<div class="mdui-dialog-title">编辑角色组</div>
<div class="mdui-dialog-title">{:lang('Edit role group')}</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">组名称</label>
<input class="mdui-textfield-input" type="text" name="name" value="" placeholder="组名称" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('Group name')}</label>
<input class="mdui-textfield-input" type="text" name="name" value="" placeholder="{:lang('Group name')}" autocomplete="off"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">使用策略</label>
<label class="mdui-textfield-label">{:lang('Strategy used')}</label>
<select class="mdui-select" name="strategy">
{foreach $strategy_list as $strategy => $val}
<option value="{$strategy}">{$val.name}</option>
@ -100,7 +100,7 @@
</select>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">是否默认</label>
<label class="mdui-textfield-label">{:lang('Is default')}</label>
<label class="mdui-switch">
<input type="checkbox" name="default" value="1"/>
<i class="mdui-switch-icon"></i>
@ -108,8 +108,8 @@
</div>
<input type="hidden" name="id" value="">
<div class="mdui-dialog-actions">
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-cancel>取消</button>
<button class="mdui-btn mdui-ripple">修改</button>
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-cancel>{:lang('Cancel')}</button>
<button class="mdui-btn mdui-ripple">{:lang('Modify')}</button>
</div>
</form>
</div>
@ -128,9 +128,9 @@
var editDialog = new mdui.Dialog('#edit-dialog');
var methods = {
delete: function (id, batch, callback) {
var msg = '确认删除该角色组吗?';
var msg = lang('Are you sure to delete this role group?');
if (batch) {
msg = '确认删除选中项角色组吗?';
msg = lang('Are you sure to delete the selected item role group?');
}
mdui.confirm(msg, function () {
app.request("{:url('admin/group/del')}", {id: id}, function () {
@ -138,7 +138,7 @@
});
}, function () {
}, {confirmText: '确定', cancelText: '取消'});
}, {confirmText: lang('Confirm'), cancelText: lang('Cancel')});
},
};
// 编辑提交

View File

@ -1,6 +1,6 @@
{extend name="common:base" /}
{block name="title"}图片管理 - {$config.site_name}{/block}
{block name="title"}{:lang('Picture management')} - {$config.site_name}{/block}
{block name="css"}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/viewerjs@1.5.0/dist/viewer.min.css">
@ -11,22 +11,22 @@
<main>
<div class="mdui-chip">
<span class="mdui-chip-icon"><i class="mdui-icon material-icons">&#xe88e;</i></span>
<span class="mdui-chip-title">共有 <small class="mdui-text-color-red">{$images->total()}</small> 张图片</span>
<span class="mdui-chip-title">{:lang('There are %s pictures in total', ['<small class="mdui-text-color-red">'.$images->total().'</small>'])}</span>
<a href="" class="mdui-chip-delete" mdui-tooltip="{content: '刷新', position: 'right'}"><i class="mdui-icon material-icons">&#xe863;</i></a>
</div>
<div class="mdui-clearfix mdui-m-t-1"></div>
<form action="" method="get" id="search-form">
<select class="where mdui-select mdui-float-left" mdui-select>
<option value="{}">全部</option>
<option value="{}">{:lang('All')}</option>
{foreach $strategyList as $key => $value}
<option value='{"strategy": "{$key}"}' {if $key eq $strategy}selected{/if}>{$value.name}</option>
{/foreach}
<option value='{"user_id": "0"}' {eq name="user_id" value="0"} selected{/eq}>访客图片</option>
<option value='{"suspicious": "1"}' {eq name="suspicious" value="1"} selected{/eq}>可疑图片</option>
<option value='{"user_id": "0"}' {eq name="user_id" value="0"} selected{/eq}>{:lang('Visitor picture')}</option>
<option value='{"suspicious": "1"}' {eq name="suspicious" value="1"} selected{/eq}>{:lang('Suspicious picture')}</option>
</select>
<input type="hidden" name="" id="search-input">
<input type="hidden" name="page" value="1">
<input class="mdui-textfield-input search-input mdui-float-left" type="text" name="keyword" placeholder="回车搜索..." value="{$keyword}" autocomplete="off"/>
<input class="mdui-textfield-input search-input mdui-float-left" type="text" name="keyword" placeholder="{:lang('Enter search...')}" value="{$keyword}" autocomplete="off"/>
</form>
<div class="mdui-clearfix"></div>
<div class="mdui-table-fluid mdui-m-t-2 mdui-m-b-2">

View File

@ -1,6 +1,6 @@
{extend name="common:base" /}
{block name="title"}控制台 - {$config.site_name}{/block}
{block name="title"}{:lang('Console')} - {$config.site_name}{/block}
{block name="main"}
<div class="mdui-container">
@ -10,7 +10,7 @@
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-teal mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<i class="mdui-icon material-icons">&#xe623;</i>
<p>占用储存</p>
<p>{:lang('Occupied storage')}</p>
<span class="mdui-text-color-white">{$storage[0]}
<small class="mdui-text-color-white">{if $storage[0]}{$storage[1]}{else/}Kb{/if}</small>
</span>
@ -18,44 +18,44 @@
</div>
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-cyan mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<p><i class="mdui-icon material-icons">&#xe3b6;</i> 图片数量</p>
<span class="mdui-text-color-white">{$images_num} <small class="mdui-text-color-white"></small></span>
<p><i class="mdui-icon material-icons">&#xe3b6;</i> {:lang('Number of pictures')}</p>
<span class="mdui-text-color-white">{$images_num} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
</div>
</div>
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-orange mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<p><i class="mdui-icon material-icons">&#xe8fd;</i> 可疑图片</p>
<span class="mdui-text-color-white">{$suspicious_images_num} <small class="mdui-text-color-white"></small></span>
<p><i class="mdui-icon material-icons">&#xe8fd;</i> {:lang('Suspicious picture')}</p>
<span class="mdui-text-color-white">{$suspicious_images_num} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
</div>
</div>
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-deep-purple mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<p><i class="mdui-icon material-icons">&#xe8d3;</i> 用户数量</p>
<span class="mdui-text-color-white">{$users_num} <small class="mdui-text-color-white"></small></span>
<p><i class="mdui-icon material-icons">&#xe8d3;</i> {:lang('Number of users')}</p>
<span class="mdui-text-color-white">{$users_num} <small class="mdui-text-color-white">{:lang('Ge')}</small></span>
</div>
</div>
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-red-accent mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<p><i class="mdui-icon material-icons">&#xe2c3;</i> 今日上传</p>
<span class="mdui-text-color-white">{$today} <small class="mdui-text-color-white"></small></span>
<p><i class="mdui-icon material-icons">&#xe2c3;</i> {:lang('Upload today')}</p>
<span class="mdui-text-color-white">{$today} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
</div>
</div>
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-indigo-accent mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<p><i class="mdui-icon material-icons">&#xe2c3;</i> 昨日上传</p>
<span class="mdui-text-color-white">{$yesterday} <small class="mdui-text-color-white"></small></span>
<p><i class="mdui-icon material-icons">&#xe2c3;</i> {:lang('Uploaded yesterday')}</p>
<span class="mdui-text-color-white">{$yesterday} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
</div>
</div>
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-brown mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<p><i class="mdui-icon material-icons">&#xe2c3;</i> 本月上传</p>
<span class="mdui-text-color-white">{$month} <small class="mdui-text-color-white"></small></span>
<p><i class="mdui-icon material-icons">&#xe2c3;</i> {:lang('Upload this month')}</p>
<span class="mdui-text-color-white">{$month} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
</div>
</div>
<div class="mdui-col item mdui-m-b-2">
<div class="mdui-color-blue-grey mdui-text-center mdui-text-color-white mdui-p-a-2 mdui-shadow-4 mdui-hoverable">
<p><i class="mdui-icon material-icons">&#xe2c3;</i> 游客上传</p>
<span class="mdui-text-color-white">{$tourists} <small class="mdui-text-color-white"></small></span>
<p><i class="mdui-icon material-icons">&#xe2c3;</i> {:lang('Visitor upload')}</p>
<span class="mdui-text-color-white">{$tourists} <small class="mdui-text-color-white">{:lang('Zhang')}</small></span>
</div>
</div>
</div>
@ -64,22 +64,22 @@
<table class="mdui-table">
<tbody>
<tr>
<th colspan="15">系统配置</th>
<th colspan="15">{:lang('System configuration')}</th>
</tr>
<tr>
<td>操作系统</td>
<td>{:lang('Operating system')}</td>
<td>{:php_uname('s')}</td>
<td>服务器 IP</td>
<td>{:lang('Server IP:')}</td>
<td>{:GetHostByName($Think.server.http_host)}</td>
<td>网站域名:</td>
<td>{:lang('Website domain name:')}</td>
<td>{$Think.server.http_host}</td>
</tr>
<tr>
<td>运行环境:</td>
<td>{:lang('Operating environment:')}</td>
<td>{$Think.server.server_software}</td>
<td>PHP 版本:</td>
<td>{:lang('PHP version:')}</td>
<td>{$Think.PHP_VERSION}</td>
<td>文件上传限制:</td>
<td>{:lang('File upload restrictions:')}</td>
<td>{:ini_get('upload_max_filesize')}</td>
</tr>
</tbody>
@ -89,22 +89,22 @@
<table class="mdui-table">
<tbody>
<tr>
<th colspan="15">软件信息</th>
<th colspan="15">{:lang('Software information')}</th>
</tr>
<tr>
<td>软件版本:</td>
<td>{:lang('Software version:')}</td>
<td>v{$config.system_version}</td>
</tr>
<tr>
<td>使用手册:</td>
<td>{:lang('User manual:')}</td>
<td><a href="https://www.kancloud.cn/wispx/lsky-pro/content" target="_blank">https://www.kancloud.cn/wispx/lsky-pro/content</a></td>
</tr>
<tr>
<td>仓库地址:</td>
<td>{:lang('Warehouse address:')}</td>
<td><a href="https://github.com/wisp-x/lsky-pro" target="_blank">https://github.com/wisp-x/lsky-pro</a></td>
</tr>
<tr>
<td>联系作者:</td>
<td>{:lang('Contact author:')}</td>
<td><a href="mailto:i@wispx.cn">i@wispx.cn</a></td>
</tr>
</tbody>

View File

@ -1,6 +1,6 @@
{extend name="common:base" /}
{block name="title"}系统管理 - {$config.site_name}{/block}
{block name="title"}{:lang('System management')} - {$config.site_name}{/block}
{block name="main"}
<div class="mdui-container">
@ -9,18 +9,17 @@
<div class="mdui-typo">
<blockquote class="mdui-m-l-0">
<p>
系统配置,统计代码中注意要使用&lt;script&gt;&lt;/script&gt;标签,不设置可为空。<br>
基础配置如果出现无法保存的情况请检查请求是否被防火墙拦截。
{:lang('System management tips')}
</p>
</blockquote>
</div>
<div class="mdui-tab mdui-tab-scrollable" mdui-tab>
<a href="#tab-basics" class="mdui-ripple">基础配置</a>
<a href="#tab-upload" class="mdui-ripple">上传配置</a>
<a href="#tab-user" class="mdui-ripple">用户配置</a>
<a href="#tab-mail" class="mdui-ripple">邮件配置</a>
<a href="#tab-other" class="mdui-ripple">其他配置</a>
<a href="#tab-audit" class="mdui-ripple">图片鉴黄</a>
<a href="#tab-basics" class="mdui-ripple">{:lang('Basic configuration')}</a>
<a href="#tab-upload" class="mdui-ripple">{:lang('Upload configuration')}</a>
<a href="#tab-user" class="mdui-ripple">{:lang('Upload configuration')}</a>
<a href="#tab-mail" class="mdui-ripple">{:lang('Mail configuration')}</a>
<a href="#tab-other" class="mdui-ripple">{:lang('Other configuration')}</a>
<a href="#tab-audit" class="mdui-ripple">{:lang('Picture identification yellow')}</a>
</div>
<div class="tabs mdui-col-sm-8 mdui-col-md-8">
{foreach $configs as $key => $value}
@ -28,7 +27,7 @@
<form action="{:url('admin/system/index')}" method="post">
{foreach $value as $val}
<div class="mdui-textfield">
<label class="mdui-textfield-label">{$val.title}{$val.tip ? '(' . $val.tip . ')' : ''}</label>
<label class="mdui-textfield-label">{:lang($val.title)}{$val.tip ? '(' . lang($val.tip) . ')' : ''}</label>
{switch $val.type}
{case text}
<input class="mdui-textfield-input" type="{$val.input_type}" name="{$val.name}" value="{$val.value}" autocomplete="off" placeholder="{$val.title}"/>
@ -45,18 +44,18 @@
{case select}
<select name="{$val.name}" class="mdui-select" mdui-select>
{foreach $val.extend as $k => $v}
<option value="{$k}" {if $k eq $val.value}selected{/if}>{$v}</option>
<option value="{$k}" {if $k eq $val.value}selected{/if}>{:lang($v)}</option>
{/foreach}
</select>
{/case}
{/switch}
</div>
{/foreach}
<button type="submit" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">保存</button>
<button type="reset" class="mdui-btn mdui-btn-raised mdui-ripple">重置</button>
<button type="submit" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">{:lang('Save')}</button>
<button type="reset" class="mdui-btn mdui-btn-raised mdui-ripple">{:lang('Reset')}</button>
{if 'mail' eq $key}
<!-- 测试邮件发送 -->
<button type="button" id="test-send-mail" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-cyan-600 mdui-text-color-white">测试邮件发送</button>
<button type="button" id="test-send-mail" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-cyan-600 mdui-text-color-white">{:lang('Test mail sending')}</button>
{/if}
</form>
</div>
@ -70,9 +69,9 @@
<table class="mdui-table mdui-table-hoverable">
<thead>
<tr>
<th>变量名</th>
<th>示例</th>
<th>说明</th>
<th>{:lang('Variable name')}</th>
<th>{:lang('Example')}</th>
<th>{:lang('Explain')}</th>
</tr>
</thead>
<tbody>
@ -94,9 +93,9 @@
<table class="mdui-table mdui-table-hoverable">
<thead>
<tr>
<th>变量名</th>
<th>示例</th>
<th>说明</th>
<th>{:lang('Variable name')}</th>
<th>{:lang('Example')}</th>
<th>{:lang('Explain')}</th>
</tr>
</thead>
<tbody>
@ -128,7 +127,7 @@
});
$('#test-send-mail').click(function () {
mdui.prompt('请输入邮箱',
mdui.prompt(lang('Please input email'),
function (value) {
app.request("{:url('admin/system/testMail')}", {email: value});
},
@ -136,8 +135,8 @@
},
{
confirmText: '确定',
cancelText: '取消'
confirmText: lang('Confirm'),
cancelText: lang('Cancel')
}
);
});

View File

@ -1,39 +1,39 @@
{extend name="common:base" /}
{block name="title"}用户管理 - {$config.site_name}{/block}
{block name="title"}{:lang('User management')} - {$config.site_name}{/block}
{block name="main"}
<div class="mdui-container">
<main>
<div class="mdui-chip">
<span class="mdui-chip-icon"><i class="mdui-icon material-icons">&#xe88e;</i></span>
<span class="mdui-chip-title">共有 <small class="mdui-text-color-red">{$users->total()}</small> 个用户</span>
<a href="" class="mdui-chip-delete" mdui-tooltip="{content: '刷新', position: 'right'}"><i class="mdui-icon material-icons">&#xe863;</i></a>
<span class="mdui-chip-title">{:lang('There are %s users in total', ['<small class="mdui-text-color-red">'.$users->total().'</small>'])}</span>
<a href="" class="mdui-chip-delete" mdui-tooltip="{content: '{:lang('Refresh')}', position: 'right'}"><i class="mdui-icon material-icons">&#xe863;</i></a>
</div>
<div class="mdui-clearfix mdui-m-t-1"></div>
<form action="" method="post" id="search-form">
<select class="where mdui-select mdui-float-left" name="state" mdui-select>
<option value="">全部</option>
<option value="1" {if 1 eq $state}selected{/if}>正常</option>
<option value="2" {if 2 eq $state}selected{/if}>冻结</option>
<option value="">{:lang('All')}</option>
<option value="1" {if 1 eq $state}selected{/if}>{:lang('Normal')}</option>
<option value="2" {if 2 eq $state}selected{/if}>{:lang('Frozen')}</option>
</select>
<input type="hidden" name="page" value="1">
<input class="mdui-textfield-input search-input mdui-float-left" type="text" name="keyword" placeholder="回车搜索..." value="{$keyword}" autocomplete="off"/>
<input class="mdui-textfield-input search-input mdui-float-left" type="text" name="keyword" placeholder="{:lang('Enter search...')}" value="{$keyword}" autocomplete="off"/>
</form>
<div class="mdui-clearfix"></div>
<div class="mdui-table-fluid mdui-m-t-2 mdui-m-b-2">
<table class="mdui-table mdui-table-selectable">
<thead>
<tr>
<th>用户名</th>
<th>角色组</th>
<th>昵称</th>
<th>邮箱</th>
<th>已使用容量</th>
<th>总容量</th>
<th>账号状态</th>
<th>注册IP</th>
<th>操作</th>
<th>{:lang('User name')}</th>
<th>{:lang('Role group')}</th>
<th>{:lang('Nickname')}</th>
<th>{:lang('Email')}</th>
<th>{:lang('Used capacity')}</th>
<th>{:lang('Total capacity')}</th>
<th>{:lang('Account status')}</th>
<th>{:lang('Register IP')}</th>
<th>{:lang('Operation')}</th>
</tr>
</thead>
<tbody>
@ -53,15 +53,15 @@
<td>{$value.quota|format_size}</td>
<td>
<select class="mdui-select state">
<option value="1" {if 1 eq $value.state}selected{/if}>正常</option>
<option value="0" {if 0 eq $value.state}selected{/if}>冻结</option>
<option value="1" {if 1 eq $value.state}selected{/if}>{:lang('Normal')}</option>
<option value="0" {if 0 eq $value.state}selected{/if}>{:lang('Frozen')}</option>
</select>
</td>
<td>{$value.reg_ip}</td>
<td>
<div class="mdui-btn-group">
<button class="mdui-btn mdui-btn-raised mdui-btn-dense edit">编辑</button>
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-red mdui-btn-dense del">删除</button>
<button class="mdui-btn mdui-btn-raised mdui-btn-dense edit">{:lang('Edit')}</button>
<button class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-red mdui-btn-dense del">{:lang('Delete')}</button>
</div>
</td>
</tr>
@ -76,39 +76,39 @@
<div class="mdui-dialog" id="edit-dialog">
<div class="mdui-dialog-content">
<form action="{:url('admin/users/edit')}" method="post">
<div class="mdui-dialog-title">修改用户数据</div>
<div class="mdui-dialog-title">{:lang('Modify user data')}</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">用户名</label>
<input class="mdui-textfield-input" type="text" name="username" value="" placeholder="用户名" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('User name')}</label>
<input class="mdui-textfield-input" type="text" name="username" value="" placeholder="{:lang('User name')}" autocomplete="off"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">邮箱</label>
<input class="mdui-textfield-input" type="email" name="email" value="" placeholder="邮箱" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('Email')}</label>
<input class="mdui-textfield-input" type="email" name="email" value="" placeholder="{:lang('Email')}" autocomplete="off"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">昵称</label>
<input class="mdui-textfield-input" type="text" name="nickname" value="" maxlength="15" placeholder="昵称" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('Nickname')}</label>
<input class="mdui-textfield-input" type="text" name="nickname" value="" maxlength="15" placeholder="{:lang('Nickname')}" autocomplete="off"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">储存容量</label>
<input class="mdui-textfield-input" type="text" name="quota" value="" placeholder="储存容量" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('Storage capacity')}</label>
<input class="mdui-textfield-input" type="text" name="quota" value="" placeholder="{:lang('Storage capacity')}" autocomplete="off"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">已使用储存容量</label>
<input class="mdui-textfield-input" type="text" name="use_quota" value="" placeholder="已使用储存容量" autocomplete="off" disabled/>
<label class="mdui-textfield-label">{:lang('Used storage capacity')}</label>
<input class="mdui-textfield-input" type="text" name="use_quota" value="" placeholder="{:lang('Used storage capacity')}" autocomplete="off" disabled/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">密码</label>
<input class="mdui-textfield-input" type="password" name="password" placeholder="密码,不修改请留空" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('Password')}</label>
<input class="mdui-textfield-input" type="password" name="password" placeholder="{:lang('Password tip')}" autocomplete="off"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">确认密码</label>
<input class="mdui-textfield-input" type="password" name="password_confirm" placeholder="确认密码" autocomplete="off"/>
<label class="mdui-textfield-label">{:lang('Confirm password')}</label>
<input class="mdui-textfield-input" type="password" name="password_confirm" placeholder="{:lang('Confirm password')}" autocomplete="off"/>
</div>
<input type="hidden" name="id" value="">
<div class="mdui-dialog-actions">
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-cancel>取消</button>
<button class="mdui-btn mdui-ripple">修改</button>
<button type="button" class="mdui-btn mdui-ripple" mdui-dialog-cancel>{:lang('Cancel')}</button>
<button class="mdui-btn mdui-ripple">{:lang('Modify')}</button>
</div>
</form>
</div>
@ -134,9 +134,9 @@
<script>
var methods = {
delete: function (id, batch, callback) {
var msg = '确认删除该用户吗?';
var msg = lang('Are you sure to delete this user?');
if (batch) {
msg = '确认删除选中项用户吗?';
msg = lang('Are you sure to delete the selected user?');
}
mdui.confirm(msg, function () {
app.request("{:url('admin/users/delete')}", {id: id}, function () {
@ -144,12 +144,12 @@
});
}, function () {
}, {confirmText: '确定', cancelText: '取消'});
}, {confirmText: lang('Confirm'), cancelText: lang('Cancel')});
},
frozen: function (id, batch, callback) {
var msg = '确认冻结该用户吗?';
var msg = lang('Are you sure to freeze this user?');
if (batch) {
msg = '确认冻结选中项用户吗?';
msg = lang('Are you sure to freeze the selected users?');
}
mdui.confirm(msg, function () {
app.request("{:url('admin/users/frozen')}", {id: id}, function () {
@ -157,7 +157,7 @@
});
}, function () {
}, {confirmText: '确定', cancelText: '取消'});
}, {confirmText: lang('Confirm'), cancelText: lang('Cancel')});
}
};
@ -180,7 +180,7 @@
}
} else {
mdui.snackbar({
message: '至少选择一项数据!'
message: lang('Select at least one data!')
});
}
}

View File

@ -13,7 +13,7 @@
<link rel="shortcut icon" href="/favicon.ico">
<link rel="stylesheet" href="/static/app/iconfont/iconfont.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@0.4.3/dist/css/mdui.min.css">
<link rel="stylesheet" href="/static/app/css/app.css?v=1.5">
<link rel="stylesheet" href="/static/app/css/app.css?v=1.6">
<link rel="stylesheet" href="/static/app/css/markdown.css?v=1.0">
<!--[if IE]>
<script>window.location.href = '/compatibility.html';</script>
@ -36,15 +36,23 @@
<a href="javascript:void(0)" mdui-menu="{target: '#user'}" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">&#xe853;</i></a>
<ul class="mdui-menu" id="user">
<li class="mdui-menu-item">
<a href="{:url('user/images')}" class="mdui-ripple">我的图片</a>
<a href="{:url('user/settings')}" class="mdui-ripple">设置</a>
<a href="{:url('user/images')}" class="mdui-ripple">{:lang('My picture')}</a>
<a href="{:url('user/settings')}" class="mdui-ripple">{:lang('Setting')}</a>
</li>
<li class="mdui-divider"></li>
<li class="mdui-menu-item">
<a href="{:url('user/logout')}" class="mdui-ripple">退出账号</a>
<a href="{:url('user/logout')}" class="mdui-ripple">{:lang('Logout')}</a>
</li>
</ul>
{/if}
<!-- Language -->
<a href="javascript:void(0)" mdui-menu="{target: '#language'}" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">&#xe894;</i></a>
<ul class="mdui-menu" id="language">
<li class="mdui-menu-item">
<a href="{:url('', 'lang=zh-cn')}" class="mdui-ripple">简体中文</a>
<a href="{:url('', 'lang=en')}" class="mdui-ripple">English</a>
</li>
</ul>
<!-- Theme -->
<a id="set-theme" href="javascript:app.toggleTheme()" class="mdui-btn mdui-btn-icon">
<i class="mdui-icon material-icons">{if cookie('theme') eq 'dark'}&#xe3ac;{else/}&#xe3a9;{/if}</i>
@ -57,48 +65,48 @@
<div class="mdui-list" mdui-collapse="{accordion: true}">
<a class="mdui-list-item mdui-ripple {if $uri eq 'index/index'}mdui-list-item-active{/if}" href="/">
<i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-blue">&#xe88a;</i>
<div class="mdui-list-item-content">首页</div>
<div class="mdui-list-item-content">{:lang('Home')}</div>
</a>
{if $config.open_gallery}
<a class="mdui-list-item mdui-ripple {if $uri eq 'index/gallery'}mdui-list-item-active{/if}" href="{:url('index/gallery')}">
<i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-teal">&#xe8aa;</i>
<div class="mdui-list-item-content">画廊</div>
<div class="mdui-list-item-content">{:lang('Gallery')}</div>
</a>
{/if}
{if $config.open_api}
<a class="mdui-list-item mdui-ripple {if $uri eq 'index/api'}mdui-list-item-active{/if}" href="{:url('index/api')}">
<i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-blue">&#xe157;</i>
<div class="mdui-list-item-content">接口</div>
<div class="mdui-list-item-content">{:lang('Api')}</div>
</a>
{/if}
{if $user}
<a class="mdui-list-item mdui-ripple {if $uri eq 'user/images'}mdui-list-item-active{/if}" href="{:url('user/images')}">
<i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-deep-orange">&#xe251;</i>
<div class="mdui-list-item-content">我的图片</div>
<div class="mdui-list-item-content">{:lang('My picture')}</div>
</a>
<a class="mdui-list-item mdui-ripple {if $uri eq 'user/settings'}mdui-list-item-active{/if}" href="{:url('user/settings')}">
<i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-theme">&#xe8b8;</i>
<div class="mdui-list-item-content">设置</div>
<div class="mdui-list-item-content">{:lang('Setting')}</div>
</a>
{if $user.is_admin}
<div class="mdui-collapse-item mdui-collapse-item-open">
<div class="mdui-collapse-item-header mdui-list-item mdui-ripple">
<i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-brown">&#xe8b9;</i>
<div class="mdui-list-item-content">系统管理</div>
<div class="mdui-list-item-content">{:lang('System management')}</div>
<i class="mdui-collapse-item-arrow mdui-icon material-icons">&#xe313;</i>
</div>
<div class="mdui-collapse-item-body mdui-list">
<a href="{:url('admin/system/console')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.system/console'}mdui-list-item-active{/if}">控制台</a>
<a href="{:url('admin/group/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.group/index'}mdui-list-item-active{/if}">角色组</a>
<a href="{:url('admin/users/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.users/index'}mdui-list-item-active{/if}">用户管理</a>
<a href="{:url('admin/images/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.images/index'}mdui-list-item-active{/if}">图片管理</a>
<a href="{:url('admin/strategy/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.strategy/index'}mdui-list-item-active{/if}">储存策略</a>
<a href="{:url('admin/system/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.system/index'}mdui-list-item-active{/if}">系统设置</a>
<a href="{:url('admin/system/console')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.system/console'}mdui-list-item-active{/if}">{:lang('Console')}</a>
<a href="{:url('admin/group/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.group/index'}mdui-list-item-active{/if}">{:lang('Role group')}</a>
<a href="{:url('admin/users/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.users/index'}mdui-list-item-active{/if}">{:lang('User management')}</a>
<a href="{:url('admin/images/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.images/index'}mdui-list-item-active{/if}">{:lang('Picture management')}</a>
<a href="{:url('admin/strategy/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.strategy/index'}mdui-list-item-active{/if}">{:lang('Storage')}</a>
<a href="{:url('admin/system/index')}" class="mdui-list-item mdui-ripple {if $uri eq 'admin.system/index'}mdui-list-item-active{/if}">{:lang('System setting')}</a>
</div>
</div>
{/if}
<div class="quota-container">
<p>容量使用</p>
<p>{:lang('Used capacity')}</p>
<progress max="{$user.quota}" value="{$user.use_quota}"></progress>
<p>
<span class="use-quota">{:format_size($user.use_quota)}</span> /
@ -108,11 +116,11 @@
{else /}
<a class="mdui-list-item mdui-ripple {if $uri eq 'auth/login'}mdui-list-item-active{/if}" href="{:url('auth/login')}">
<i class="mdui-list-item-icon mdui-icon material-icons iconfont icon-login mdui-text-color-teal"></i>
<div class="mdui-list-item-content">登录</div>
<div class="mdui-list-item-content">{:lang('Sign In')}</div>
</a>
<a class="mdui-list-item mdui-ripple {if $uri eq 'auth/register'}mdui-list-item-active{/if}" href="{:url('auth/register')}">
<i class="mdui-list-item-icon mdui-icon material-icons mdui-text-color-purple">&#xe7f0;</i>
<div class="mdui-list-item-content">注册</div>
<div class="mdui-list-item-content">{:lang('Sign Up')}</div>
</a>
{/if}
</div>
@ -139,10 +147,11 @@
<div class="mdui-container">
Copyright &copy; 2018 - present <a href="https://www.lsky.pro">Lsky Pro</a>. All rights reserved.
{if $config.icp_number}<a href="https://beian.miit.gov.cn/" target="_blank">{$config.icp_number}</a>.{/if}
请勿上传违反中国大陆和香港法律的图片,违者后果自负。
{:lang('Footer tip')}
</div>
</footer>
{/block}
<script>window.languages = JSON.parse('{$languages|raw}');</script>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mdui@0.4.3/dist/js/mdui.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js"></script>

View File

@ -1,6 +1,6 @@
{extend name="common:base" /}
{block name="title"}画廊 - {$config.site_name}{/block}
{block name="title"}{:lang('Gallery')} - {$config.site_name}{/block}
{block name="css"}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/viewerjs@1.5.0/dist/viewer.min.css">
@ -43,7 +43,7 @@
</div>
{/foreach}
</div>
<button class="mdui-btn mdui-m-t-2 mdui-center mdui-ripple" id="more">查看更多</button>
<button class="mdui-btn mdui-m-t-2 mdui-center mdui-ripple" id="more">{:lang('See more')}</button>
</main>
</div>
{/block}
@ -64,12 +64,12 @@
$more.click(function () {
if (loading) return;
loading = true;
$more.attr('disabled', true).text("加载中...");
$more.attr('disabled', true).text(lang('Loading...'));
app.ajax("", {page: page, limit: limit}, function (response) {
if (response.code) {
var data = response.data;
if (data.length === 0) {
$more.text("我也是有底线的~");
$more.text(lang('No more'));
} else {
var html = '';
for (var key in data) {
@ -89,9 +89,9 @@
$viewer.data('viewer').update();
loading = false;
if (data.length < limit) {
$more.text("我也是有底线的~");
$more.text(lang('No more'));
} else {
$more.attr('disabled', false).text("查看更多");
$more.attr('disabled', false).text(lang('See more'));
page++;
}
}
@ -99,4 +99,4 @@
});
});
</script>
{/block}
{/block}

View File

@ -16,9 +16,9 @@
<div id="mask"></div>
<div id="login-btn">SIGN IN</div>
<div id="login-box">
<input type="text" name="account" placeholder="请输入用户名或邮箱">
<input type="password" name="password" placeholder="请输入密码">
<button type="button" id="login">登录</button>
<input type="text" name="account" placeholder="{:lang('Account input tip')}">
<input type="password" name="password" placeholder="{:lang('Password input tip')}">
<button type="button" id="login">{:lang('Sign In')}</button>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>

View File

@ -20,7 +20,7 @@
{/if}
<div class="title">
<h1>Image Upload</h1>
<p>最大可上传 {:format_size($config.upload_max_size)} 的图片,单次同时可选择 {$config.upload_single_num} 张。本站已托管 {$images_count} 张图片。</p>
<p>{:lang('Home upload info', [format_size($config.upload_max_size), $config.upload_single_num, $images_count])}</p>
</div>
<form action="" method="post" enctype="multipart/form-data">
<input id="image" style="display: none;" type="file" multiple name="image" accept="image/*">
@ -44,10 +44,10 @@
<div class="mask">
<div class="content">
<div class="panel-box mdui-color-white mdui-text-center">
<h6 class="mdui-m-b-2">请登录后体验</h6>
<h6 class="mdui-m-b-2">{:lang('Sign in tip')}</h6>
<div class="mdui-btn-group">
<a href="{:url('auth/login')}" class="mdui-btn mdui-ripple mdui-color-cyan mdui-text-color-white mdui-btn-dense">登录</a>
<a href="{:url('auth/register')}" class="mdui-btn mdui-ripple mdui-color-green mdui-text-color-white mdui-btn-dense">注册</a>
<a href="{:url('auth/login')}" class="mdui-btn mdui-ripple mdui-color-cyan mdui-text-color-white mdui-btn-dense">{:lang('Sign in')}</a>
<a href="{:url('auth/register')}" class="mdui-btn mdui-ripple mdui-color-green mdui-text-color-white mdui-btn-dense">{:lang('Sign up')}</a>
</div>
</div>
</div>
@ -63,7 +63,9 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap-fileinput@5.0.7/js/plugins/purify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-fileinput@5.0.7/js/fileinput.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap-fileinput@5.0.7/themes/fas/theme.min.js"></script>
{if ($lang === 'zh-cn')}
<script src="https://cdn.jsdelivr.net/npm/bootstrap-fileinput@5.0.7/js/locales/zh.js"></script>
{/if}
<script>
var clipboard = new ClipboardJS('.copy', {
text: function(trigger) {
@ -72,11 +74,11 @@
});
clipboard.on('success', function(e) {
app.msg(true, '复制成功');
app.msg(true, lang('Copy success'));
});
clipboard.on('error', function(e) {
app.msg(false, '复制失败');
app.msg(false, lang('Copy fail'));
});
var sort = function (uls) {
@ -122,7 +124,7 @@
$('.quota-container span.use-quota').text(app.bytesToSize(response.data.use_quota));
}
} else if (500 === response.code) {
mdui.alert(response.msg, '发生异常');
mdui.alert(response.msg, lang('Exception occurred'));
} else {
mdui.alert(response.msg);
}
@ -187,15 +189,15 @@
function uploadBlobFile(images) {
var form = $("#image");
mdui.confirm('是否上传粘贴的图片?', function() {
mdui.confirm(lang('Upload pasted photos?'), function() {
$('.file-drop-zone-title').remove();
form.fileinput('readFiles', images);
setTimeout(function () {
form.fileinput('upload');
}, 400)
}, function () {}, {
confirmText: '确定',
cancelText: '取消'
confirmText: lang('Confirm'),
cancelText: lang('Cancel')
});
}
</script>

View File

@ -1,6 +1,6 @@
{extend name="common:base" /}
{block name="title"}图片管理 - {$config.site_name}{/block}
{block name="title"}{:lang('Picture management')} - {$config.site_name}{/block}
{block name="css"}
<link rel="stylesheet" href="/static/contextjs/css/context.standalone.css">
@ -14,20 +14,20 @@
<div class="screen-box mdui-m-b-1">
<div class="mdui-chip">
<span class="mdui-chip-icon"><i class="mdui-icon material-icons">&#xe88e;</i></span>
<span class="mdui-chip-title">共有 <small class="mdui-text-color-red num">0</small> 张图片</span>
<span id="reset" class="mdui-chip-delete" mdui-tooltip="{content: '重置数据', position: 'right'}"><i class="mdui-icon material-icons">&#xe863;</i></span>
<span class="mdui-chip-title">{:lang('There are %s pictures in total', ['<small class="mdui-text-color-red num">0</small>'])}</span>
<span id="reset" class="mdui-chip-delete" mdui-tooltip="{content: '{:lang('Reset data')}', position: 'right'}"><i class="mdui-icon material-icons">&#xe863;</i></span>
</div>
<div class="mdui-clearfix mdui-m-t-1"></div>
<form action="" method="post" id="search-form">
<select class="operation mdui-select" name="state" mdui-select>
<option value="">选中项</option>
<option value="move">移动</option>
<option value="delete">删除</option>
<option value="">{:lang('Selected items')}</option>
<option value="move">{:lang('Move')}</option>
<option value="delete">{:lang('Delete')}</option>
</select>
<div class="mdui-btn-group mdui-m-r-1 mdui-float-left">
<button type="button" id="all" class="mdui-btn mdui-ripple mdui-color-theme-accent mdui-float-right">全选</button>
<button type="button" id="all" class="mdui-btn mdui-ripple mdui-color-theme-accent mdui-float-right">{:lang('Select all')}</button>
</div>
<input class="mdui-textfield-input search-input mdui-float-right" type="text" name="keyword" placeholder="回车搜索..." value="" autocomplete="off"/>
<input class="mdui-textfield-input search-input mdui-float-right" type="text" name="keyword" placeholder="{:lang('Enter search...')}" value="" autocomplete="off"/>
</form>
<div class="mdui-clearfix"></div>
<ul class="breadcrumb mdui-m-t-1">
@ -54,29 +54,29 @@
<table>
<tbody>
<tr class="alias_name">
<td align="right">别名:</td>
<td align="right">{:lang('Alias:')}</td>
<td align="left"></td>
</tr>
<tr class="url">
<td align="right">链接:</td>
<td align="right">{:lang('Link:')}</td>
<td align="left">
<input class="mdui-textfield-input" type="text" placeholder="图片外链" value=""/>
<input class="mdui-textfield-input" type="text" placeholder="{:lang('Picture link')}" value=""/>
</td>
</tr>
<tr class="pathname">
<td align="right">位置:</td>
<td align="right">{:lang('Position:')}</td>
<td align="left"></td>
</tr>
<tr class="size">
<td align="right">大小:</td>
<td align="right">{:lang('Size:')}</td>
<td align="left"></td>
</tr>
<tr class="md5">
<td align="right">MD5</td>
<td align="right">{:lang('MD5:')}</td>
<td align="left"></td>
</tr>
<tr class="mime">
<td align="right">类型:</td>
<td align="right">{:lang('Type:')}</td>
<td align="left"></td>
</tr>
</tbody>
@ -86,10 +86,10 @@
</div>
<div class="mdui-dialog-actions">
<div class="mdui-btn-group">
<a href="" target="_blank" class="open-url mdui-btn mdui-color-theme-accent mdui-ripple mdui-btn-dense">打开链接</a>
<button data-clipboard-action="copy" data-clipboard-text="" class="copy-url mdui-btn mdui-color-teal mdui-ripple mdui-btn-dense">复制链接</button>
<button data-id="" class="delete-image mdui-btn mdui-color-red mdui-ripple mdui-btn-dense">删除</button>
<button class="mdui-btn mdui-ripple mdui-color-grey-600 mdui-btn-dense" mdui-dialog-cancel>关闭</button>
<a href="" target="_blank" class="open-url mdui-btn mdui-color-theme-accent mdui-ripple mdui-btn-dense">{:lang('Open link')}</a>
<button data-clipboard-action="copy" data-clipboard-text="" class="copy-url mdui-btn mdui-color-teal mdui-ripple mdui-btn-dense">{:lang('Copy link')}</button>
<button data-id="" class="delete-image mdui-btn mdui-color-red mdui-ripple mdui-btn-dense">{:lang('Delete')}</button>
<button class="mdui-btn mdui-ripple mdui-color-grey-600 mdui-btn-dense" mdui-dialog-cancel>{:lang('Close')}</button>
</div>
</div>
</div>
@ -104,8 +104,8 @@
</ul>
</div>
<div class="mdui-dialog-actions">
<button class="mdui-btn mdui-ripple" mdui-dialog-close>取消</button>
<button class="mdui-btn mdui-ripple" mdui-dialog-confirm>确定</button>
<button class="mdui-btn mdui-ripple" mdui-dialog-close>{:lang('Cancel')}</button>
<button class="mdui-btn mdui-ripple" mdui-dialog-confirm>{:lang('Confirm')}</button>
</div>
</div>
</div>
@ -141,7 +141,7 @@
getData: function (options) {
params = options || params;
var more = $(".more");
more.attr('disabled', true).text('加载中...');
more.attr('disabled', true).text(lang('Loading...'));
app.ajax("{:url('user/images')}", params, function (response) {
if (response.code) {
var images = response.data.images.data;
@ -190,12 +190,12 @@
}
if (response.data.images.current_page == response.data.images.last_page) {
return more.attr('disabled', true).text('我也是有底线的~');
return more.attr('disabled', true).text(lang('No more'));
}
params.page++;
return more.attr('disabled', false).text('加载更多');
return more.attr('disabled', false).text(lang('Loading more'));
} else {
more.attr('disabled', true).text('暂无数据');
more.attr('disabled', true).text(lang('No data available'));
}
}
});
@ -207,9 +207,9 @@
},
// 删除
delete: function (id, batch, callback) {
var msg = '确认删除该图片吗?';
var msg = lang('Are you sure to delete this picture?');
if (batch) {
msg = '确认删除选中项图片吗?';
msg = lang('Are you sure to delete the selected picture?');
}
mdui.confirm(msg, function () {
app.request("{:url('user/deleteImages')}", {id: id}, function () {
@ -217,7 +217,7 @@
});
}, function () {
}, {confirmText: '确定', cancelText: '取消'});
}, {confirmText: lang('Confirm'), cancelText: lang('Cancel')});
},
getFolders: function (options, openDialog, callback) {
openDialog = openDialog || false;
@ -238,7 +238,7 @@
);
}
} else {
$('#folders ul.mdui-list').html('<li class="mdui-text-center mdui-text-color-black-secondary">没有找到文件夹</li>');
$('#folders ul.mdui-list').html('<li class="mdui-text-center mdui-text-color-black-secondary">' + lang('Folder not found') + '</li>');
}
foldersDialog.handleUpdate();
openDialog && foldersDialog.open();
@ -253,14 +253,14 @@
// 监听复制操作
var clipboard = new ClipboardJS('.copy-url');
clipboard.on('success', function(e) {
app.msg(true, '复制成功!');
app.msg(true, lang('Copy success'));
e.clearSelection();
});
clipboard.on('error', function(e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
app.msg(false, '复制失败!');
app.msg(false, lang('Copy fail'));
});
// Context Start
@ -278,13 +278,13 @@
if ($that.parents().hasClass('folders-box')) {
context.attach('.folders-box .item', [
{header: 'Compressed Menu'},
{text: '打开', action: function (e) {
{text: lang('Open'), action: function (e) {
$item.click();
}
},
{text: '重新命名', action: function (e) {
{text: lang('Rename'), action: function (e) {
e.preventDefault();
mdui.prompt('请输入文件夹名称',
mdui.prompt(lang('Please enter a folder name'),
function (value) {
app.ajax("{:url('user/renameFolder')}", {
id: $item.data('id'),
@ -302,9 +302,9 @@
}
},
{divider: true},
{text: '删除', action: function (e) {
{text: lang('Delete'), action: function (e) {
e.preventDefault();
mdui.confirm('确认删除该文件夹吗?', function() {
mdui.confirm(lang('Are you sure to delete this folder?'), function() {
app.ajax("{:url('user/deleteFolder')}", {id: $item.data('id')}, function (response) {
if (response.code) {
$item.parent().remove();
@ -320,16 +320,16 @@
var $item = $that.closest('.item'), data = $item.data('json');
context.attach('.images-box .item', [
{header: 'Compressed Menu'},
{text: '查看图片', action: function (e) {
{text: lang('See picture'), action: function (e) {
e.preventDefault();
$item.find('img').click();
}
},
{text: '新窗口打开图片', href: data.url, target: '_blank'},
{text: lang('Open picture in new window'), href: data.url, target: '_blank'},
{divider: true},
{text: '重命名', action: function (e) {
{text: lang('Rename'), action: function (e) {
e.preventDefault();
mdui.prompt('请输入图片名称',
mdui.prompt(lang('Please enter a picture name'),
function (value) {
app.ajax("{:url('user/renameImage')}", {
id: data.id,
@ -345,13 +345,13 @@
);
}
},
{text: '复制链接', action: function (e) {
{text: lang('Copy link'), action: function (e) {
e.preventDefault();
$('#copy-url').attr('data-clipboard-text', data.url).click();
}
},
{
text: '删除', action: function (e) {
text: lang('Delete'), action: function (e) {
e.preventDefault();
methods.delete(data.id, false, function () {
$item.parent().remove();
@ -360,7 +360,7 @@
}
},
{
text: '属性', action: function (e) {
text: lang('Attribute'), action: function (e) {
e.preventDefault();
$item.find('i.info').click();
}
@ -369,9 +369,9 @@
} else {
context.attach('.box', [
{header: 'Compressed Menu'},
{text: '新建文件夹', action: function (e) {
{text: lang('New folder'), action: function (e) {
e.preventDefault();
mdui.prompt('请输入文件夹名称',
mdui.prompt(lang('Please enter a folder name'),
function (value) {
app.ajax("{:url('user/createFolder')}", {
parent_id: $('ul.breadcrumb li.active:last-child a').data('id'),
@ -388,7 +388,7 @@
}
},
{divider: true},
{text: '刷新', action: function (e) {
{text: lang('Refresh'), action: function (e) {
// e.preventDefault();
methods.resetData();
}
@ -502,7 +502,7 @@
}
} else {
app.msg(false, '至少选择一项数据!')
app.msg(false, lang('Select at least one data!'))
}
}
});
@ -514,16 +514,16 @@
if (0 === item.length) {
return mdui.snackbar({
position: 'right-top',
message: '暂无数据!'
message: lang('No data available!')
});
}
if (all) {
item.removeClass('choice');
$(this).text('全选');
$(this).text(lang('Select all'));
all = false;
} else {
item.removeClass('choice').addClass('choice');
$(this).text('取消全选');
$(this).text(lang('Deselect all'));
all = true;
}
});
@ -563,7 +563,7 @@
infoDialog.find('.delete-image').attr('data-id', data.id);
info.open();
} else {
app.msg(false, '数据异常!');
app.msg(false, lang('Data exception!'));
}
});
@ -577,7 +577,7 @@
totalBox.text(parseInt(totalBox.text()) - 1);
});
} else {
app.msg(false, '数据异常!');
app.msg(false, lang('Data exception!'));
}
});

View File

@ -1,6 +1,6 @@
{extend name="common:base" /}
{block name="title"}设置 - {$config.site_name}{/block}
{block name="title"}{:lang('Setting')} - {$config.site_name}{/block}
{block name="main"}
<div class="mdui-container">
@ -8,41 +8,41 @@
<div class="mdui-col-sm-8 mdui-col-md-8">
<form action="{:url('user/settings')}" method="post">
<div class="mdui-textfield">
<label class="mdui-textfield-label">用户名</label>
<label class="mdui-textfield-label">{:lang('User name')}</label>
<input class="mdui-textfield-input" type="text" value="{$user.username}" disabled/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">邮箱</label>
<label class="mdui-textfield-label">{:lang('Email')}</label>
<input class="mdui-textfield-input" type="email" value="{$user.email}" disabled/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">Token</label>
<input class="mdui-textfield-input" type="text" value="{$user.token}" disabled/>
<div class="mdui-textfield-helper">注意Token 具有管理图片权限,请不要随意泄漏。</div>
<div class="mdui-textfield-helper">{:lang('Token tip')}</div>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">昵称</label>
<input class="mdui-textfield-input" type="text" name="nickname" value="{$user.nickname}" maxlength="15" placeholder="昵称"/>
<label class="mdui-textfield-label">{:lang('Nickname')}</label>
<input class="mdui-textfield-input" type="text" name="nickname" value="{$user.nickname}" maxlength="15" placeholder="{:lang('Nickname')}"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">默认上传文件夹</label>
<input class="mdui-textfield-input" type="text" name="default_folder" value="{$user.default_folder}" maxlength="30" placeholder="默认上传文件夹名(不存在上传时自动创建)"/>
<label class="mdui-textfield-label">{:lang('Default upload folder')}</label>
<input class="mdui-textfield-input" type="text" name="default_folder" value="{$user.default_folder}" maxlength="30" placeholder="{:lang('Default upload folder tip')}"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">原密码</label>
<input class="mdui-textfield-input" type="password" name="password_old" placeholder="原密码,不修改请留空"/>
<label class="mdui-textfield-label">{:lang('Old password')}</label>
<input class="mdui-textfield-input" type="password" name="password_old" placeholder="{:lang('Old password tip')}"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">密码</label>
<input class="mdui-textfield-input" type="password" name="password" placeholder="密码,不修改请留空"/>
<label class="mdui-textfield-label">{:lang('Password')}</label>
<input class="mdui-textfield-input" type="password" name="password" placeholder="{:lang('Password tip')}"/>
</div>
<div class="mdui-textfield">
<label class="mdui-textfield-label">确认密码</label>
<input class="mdui-textfield-input" type="password" name="password_confirm" placeholder="确认密码"/>
<label class="mdui-textfield-label">{:lang('Confirm password')}</label>
<input class="mdui-textfield-input" type="password" name="password_confirm" placeholder="{:lang('Confirm password')}"/>
</div>
<div class="mdui-textfield">
<button type="submit" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">保存</button>
<button type="reset" class="mdui-btn mdui-btn-raised mdui-ripple">重置</button>
<button type="submit" class="mdui-btn mdui-btn-raised mdui-ripple mdui-color-theme-accent">{:lang('Save')}</button>
<button type="reset" class="mdui-btn mdui-btn-raised mdui-ripple">{:lang('Reset')}</button>
</div>
</form>
</div>
@ -60,4 +60,4 @@
});
});
</script>
{/block}
{/block}

5
application/lang/en.php Normal file
View File

@ -0,0 +1,5 @@
<?php
return [
];

211
application/lang/zh-cn.php Normal file
View File

@ -0,0 +1,211 @@
<?php
// [简体中文]
return [
'Home' => '首页',
'Gallery' => '画廊',
'Api' => '接口',
'My picture' => '我的图片',
'Setting' => '设置',
'System management' => '系统管理',
'Console' => '控制台',
'Role group' => '角色组',
'User management' => '用户管理',
'Picture management' => '图片管理',
'Storage' => '储存策略',
'System setting' => '系统设置',
'Sign In' => '登录',
'Sign Up' => '注册',
'Logout' => '退出账号',
'Used capacity' => '使用容量',
'Sign in tip' => '请登录后体验',
'Home upload info' => '最大可上传 %s 的图片,单次同时可选择 %s 张。本站已托管 %s 张图片。',
'Account input tip' => '请输入用户名或邮箱',
'Password input tip' => '请输入密码',
'Copy success' => '复制成功',
'Copy fail' => '复制失败',
'Upload pasted photos?' => '是否上传粘贴的图片?',
'Confirm' => '确定',
'Cancel' => '取消',
'Exception occurred' => '发生异常',
'Footer tip' => '请勿上传违反中国大陆和香港法律的图片,违者后果自负。',
'%s second%s ago' => '%s秒前',
'%s minute%s ago' => '%s分钟前',
'%s hour%s ago' => '%s小时前',
'%s day%s ago' => '%s天前',
'%s week%s ago' => '%s周前',
'%s month%s ago' => '%s月前',
'%s year%s ago' => '%s年前',
'See more' => '查看更多',
'Loading more' => '加载更多',
'Loading...' => '加载中...',
'No more' => '我也是有底线的~',
'No data available' => '暂无数据',
'There are %s pictures in total' => '共有 %s 张图片',
'Select all' => '全选',
'Deselect all' => '取消全选',
'Selected items' => '选中项',
'Move' => '移动',
'Delete' => '删除',
'Reset data' => '重置数据',
'Enter search...' => '回车搜索...',
'Are you sure to delete this picture?' => '确认删除该图片吗?',
'Are you sure to delete the selected picture?' => '确认删除选中项图片吗?',
'Folder not found' => '没有找到文件夹',
'Open' => '打开',
'Close' => '关闭',
'Rename' => '重新命名',
'Please enter a folder name' => '请输入文件夹名称',
'Are you sure to delete this folder?' => '确认删除该文件夹吗?',
'See picture' => '查看图片',
'Open picture in new window' => '新窗口打开图片',
'Please enter a picture name' => '请输入图片名称',
'Copy link' => '复制链接',
'Open link' => '打开链接',
'Attribute' => '属性',
'New folder' => '新建文件夹',
'Refresh' => '刷新',
'Select at least one data!' => '至少选择一项数据!',
'No data available!' => '暂无数据',
'Data exception!' => '数据异常!',
'Picture link' => '图片外链',
'Alias:' => '别名:',
'Link:' => '链接:',
'Position:' => '位置:',
'Size:' => '大小:',
'MD5:' => 'MD5',
'Type:' => '类型:',
'User name' => '用户名',
'Email' => '邮箱',
'Token tip' => '注意Token 具有管理图片权限,请不要随意泄漏。',
'Nickname' => '昵称',
'Default upload folder' => '默认上传文件夹',
'Default upload folder tip' => '默认上传文件夹名(不存在上传时自动创建)',
'Old password' => '原密码',
'Old password tip' => '原密码,不修改请留空',
'Password' => '密码',
'Password tip' => '密码,不修改请留空',
'Confirm password' => '确认密码',
'Save' => '保存',
'Reset' => '重置',
'Occupied storage' => '占用储存',
'Zhang' => '张',
'Ge' => '个',
'Suspicious picture' => '可疑图片',
'Number of users' => '用户数量',
'Upload today' => '今日上传',
'Uploaded yesterday' => '昨日上传',
'Upload this month' => '本月上传',
'Visitor upload' => '游客上传',
'System configuration' => '系统配置',
'Operating system' => '操作系统',
'Server IP:' => '服务器 IP',
'Website domain name:' => '网站域名:',
'Operating environment:' => '运行环境:',
'PHP version:' => 'PHP 版本',
'File upload restrictions:' => '文件上传限制:',
'Software information' => '软件信息',
'Software version:' => '软件版本:',
'User manual:' => '用户手册:',
'Warehouse address:' => '仓库地址:',
'System management tips' => '系统配置,统计代码中注意要使用&lt;script&gt;&lt;/script&gt;标签,不设置可为空。<br>基础配置如果出现无法保存的情况请检查请求是否被防火墙拦截。',
'Basic configuration' => '基础配置',
'Upload configuration' => '上传配置',
'Mail configuration' => '邮件配置',
'Other configuration' => '其他配置',
'Picture identification yellow' => '图片鉴黄',
'Test mail sending' => '测试邮件发送',
'Variable name' => '变量名',
'Example' => '示例',
'Explain' => '说明',
'Please input email' => '请输入邮箱',
'Turn off registration' => '关闭注册',
'Website title' => '网站标题',
'Website keywords' => '网站关键字',
'Website description' => '网站描述',
'Custom CSS' => '自定义CSS',
'Statistical code' => '统计代码',
'Allow visitors to upload' => '允许游客上传',
'Allow visitors to upload tip' => '是否允许游客上传',
'Upload max size' => '最大上传大小',
'Upload max size tip' => '单位b默认52428805M',
'Upload single num' => '单次同时上传数量',
'Same ip day max upload' => '相同ip一天内最大上传限制',
'Same ip day max upload tip' => '为0则不限制',
'Upload allowed exts' => '允许上传的文件后缀',
'Upload allowed exts tip' => '逗号隔开',
'Path naming rule' => '文件路径命名规则',
'File naming rule' => '文件命名规则',
'Path naming variable cross reference table' => '路径命名变量对照表',
'File naming variable cross reference table' => '文件命名变量对照表',
'User initial quota' => '用户初始配额容量',
'User initial quota tip' => '单位b默认10737418241G最大18位',
'Mail send mode' => '邮件发送方式',
'Mail smtp secure' => 'SMTP验证方式',
'Mail smtp host' => 'SMTP主机地址',
'Mail smtp username' => 'SMTP用户名',
'Mail smtp password' => 'SMTP密码',
'Mail smtp port' => 'SMTP端口',
'Mail form email' => '发件人邮箱',
'Soft delete' => '软删除',
'Soft delete tip' => '删除图片时不删除源文件,不建议开启',
'Open gallery' => '开启画廊',
'Open gallery tip' => '开启画廊功能,游客上传的图片将会出现在画廊中',
'Open api' => '开启API',
'Open api tip' => '是否开放接口',
'Ban ip' => '封禁IP',
'Ban ip tip' => '封禁IP, 多个使用逗号隔开',
'Storage strategy' => '储存策略',
'Domain name' => '域名',
'Regional node' => '地域节点',
'Region' => '所属区域',
'Bucket name' => '储存桶名称',
'Operator account' => '操作员账号',
'Operator password' => '操作员密码',
'Cloud storage service name' => '云储存服务名称',
'System notice' => '系统公告',
'System notice tip' => '支持html',
'Remote storage type' => '远程储存类型',
'Passive mode' => '被动模式',
'Connection address' => '连接地址',
'Login account' => '登录账号',
'Login password' => '登录密码',
'Connection port' => '连接端口',
'Turn on picture yellow identification' => '开启图片鉴黄',
'Turn on picture yellow identification tip' => '接口申请地址:<a href="https://www.moderatecontent.com" target="_blank">https://www.moderatecontent.com</a>',
'Content rating' => '内容评级',
'Content rating tip' => '1=非常严格2=严格3=一般',
'Very strict' => '非常严格',
'Strict' => '严格',
'Commonly' => '一般',
'System version' => '系统版本',
'Default group' => '默认组',
'Role group tips' => '不同的角色组下的用户,上传图片将使用不同的储存策略。<br>至少有一个默认角色组,新注册用户和访客将会使用默认的角色组。<br>角色组删除后,该组下面的用户将重置默认角色组。',
'Strategy used' => '使用策略',
'Name' => '名称',
'Register default' => '注册默认',
'Operation' => '操作',
'Edit' => '编辑',
'Add role group' => '添加角色组',
'Edit role group' => '编辑角色组',
'Group name' => '组名称',
'Is default' => '是否默认',
'Modify' => '修改',
'Are you sure to delete this role group?' => '确认删除该角色组吗?',
'Are you sure to delete the selected item role group?' => '确认删除选中项角色组吗?',
'There are %s users in total' => '共有 %s 个用户',
'All' => '全部',
'Normal' => '正常',
'Frozen' => '冻结',
'Total capacity' => '总容量',
'Account status' => '账号状态',
'Register IP' => '注册IP',
'Modify user data' => '修改用户数据',
'Storage capacity' => '储存容量',
'Used storage capacity' => '已使用储存容量',
'Are you sure to delete this user?' => '确认删除该用户吗?',
'Are you sure to delete the selected user?' => '确认删除选中项用户吗?',
'Are you sure to freeze this user?' => '确认冻结该用户吗?',
'Are you sure to freeze the selected users?' => '确认冻结选中项用户吗?',
'Visitor picture' => '访客图片',
];

View File

@ -17,7 +17,7 @@ CREATE TABLE IF NOT EXISTS `lsky_config` (
`input_type` varchar(32) NOT NULL DEFAULT 'text' COMMENT 'input type属性',
`name` varchar(32) CHARACTER SET utf8mb4 NOT NULL UNIQUE COMMENT '配置名',
`title` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '配置标题',
`tip` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '配置描述',
`tip` varchar(1000) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '配置描述',
`value` text CHARACTER SET utf8mb4 NOT NULL COMMENT '配置值',
`extend` text CHARACTER SET utf8mb4 NOT NULL COMMENT '扩展属性',
PRIMARY KEY (`id`)
@ -109,67 +109,67 @@ CREATE TABLE `lsky_group` (
--
INSERT INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
(NULL, 'basics', 'bool', 'checkbox', 'close_register', '关闭注册', NULL, '0', ''),
(NULL, 'basics', 'text', 'text', 'site_name', '网站标题', NULL, 'Lsky Pro', ''),
(NULL, 'basics', 'text', 'text', 'site_keywords', '网站关键字', NULL, 'Lsky Pro', ''),
(NULL, 'basics', 'text', 'text', 'site_description', '网站描述', NULL, 'Lsky Pro, Your photo album on the cloud.', ''),
(NULL, 'basics', 'textarea', 'textarea', 'custom_style', '自定义CSS', NULL, '<!-- 可以直接引入第三方css样式 -->\r\n<style>\r\n /* body {} */\r\n</style>', ''),
(NULL, 'basics', 'textarea', 'textarea', 'statistics_code', '统计代码', NULL, '<script>\r\n// js统计代码</script>', ''),
(NULL, 'basics', 'text', 'text', 'icp_number', '备案号', NULL, '', ''),
(NULL, 'upload', 'bool', 'checkbox', 'allowed_tourist_upload', '允许游客上传', '是否允许游客上传', '1', ''),
(NULL, 'upload', 'text', 'text', 'upload_max_size', '最大上传大小', '单位b默认52428805M', '5242880', ''),
(NULL, 'upload', 'text', 'number', 'upload_single_num', '单次同时上传数量', NULL, '10', ''),
(NULL, 'upload', 'text', 'number', 'same_ip_day_max_upload', '相同ip一天内最大上传限制', '为0则不限制', '0', ''),
(NULL, 'upload', 'text', 'text', 'upload_allowed_exts', '允许上传的文件后缀', '逗号隔开', 'jpg,jpeg,gif,png,ico', ''),
(NULL, 'upload', 'text', 'text', 'path_naming_rule', '文件路径命名规则', '<a href="javascript:void(0)" mdui-dialog="{target: \'#path-var\'}">路径命名变量对照表</a>', '{Y}/{m}/{d}', ''),
(NULL, 'upload', 'text', 'text', 'file_naming_rule', '文件命名规则', '<a href="javascript:void(0)" mdui-dialog="{target: \'#file-var\'}">文件命名变量对照表</a>', '{uniqid}', ''),
(NULL, 'user', 'text', 'text', 'user_initial_quota', '用户初始配额容量', '单位b默认10737418241G最大18位', '1073741824', ''),
(NULL, 'mail', 'select', 'text', 'mail_send_mode', '邮件发送方式', NULL, 'smtp', '{\"smtp\":\"SMTP\"}'),
(NULL, 'mail', 'select', 'text', 'mail_smtp_secure', 'SMTP验证方式', NULL, 'none', '{\"none\":\"None\",\"tls\":\"TLS\",\"ssl\":\"SSL\"}'),
(NULL, 'mail', 'text', 'text', 'mail_smtp_host', 'SMTP主机地址', NULL, '', ''),
(NULL, 'mail', 'text', 'text', 'mail_smtp_username', 'SMTP用户名', NULL, '', ''),
(NULL, 'mail', 'text', 'password', 'mail_smtp_password', 'SMTP密码', NULL, '', ''),
(NULL, 'mail', 'text', 'number', 'mail_smtp_port', 'SMTP端口', '25/465', '25', ''),
(NULL, 'mail', 'text', 'email', 'mail_form_email', '发件人邮箱', NULL, '', ''),
(NULL, 'basics', 'bool', 'checkbox', 'close_register', 'Turn off registration', NULL, '0', ''),
(NULL, 'basics', 'text', 'text', 'site_name', 'Website title', NULL, 'Lsky Pro', ''),
(NULL, 'basics', 'text', 'text', 'site_keywords', 'Website keywords', NULL, 'Lsky Pro', ''),
(NULL, 'basics', 'text', 'text', 'site_description', 'Website description', NULL, 'Lsky Pro, Your photo album on the cloud.', ''),
(NULL, 'basics', 'textarea', 'textarea', 'custom_style', 'Custom CSS', NULL, '<!-- 可以直接引入第三方css样式 -->\r\n<style>\r\n /* body {} */\r\n</style>', ''),
(NULL, 'basics', 'textarea', 'textarea', 'statistics_code', 'Statistical code', NULL, '<script>\r\n// js统计代码</script>', ''),
(NULL, 'basics', 'text', 'text', 'icp_number', 'Icp number', NULL, '', ''),
(NULL, 'upload', 'bool', 'checkbox', 'allowed_tourist_upload', 'Allow visitors to upload', 'Allow visitors to upload tip', '1', ''),
(NULL, 'upload', 'text', 'text', 'upload_max_size', 'Upload max size', 'Upload max size tip', '5242880', ''),
(NULL, 'upload', 'text', 'number', 'upload_single_num', 'Upload single num', NULL, '10', ''),
(NULL, 'upload', 'text', 'number', 'same_ip_day_max_upload', 'Same ip day max upload', 'Same ip day max upload tip', '0', ''),
(NULL, 'upload', 'text', 'text', 'upload_allowed_exts', 'Upload allowed exts', 'Upload allowed exts tip', 'jpg,jpeg,gif,png,ico', ''),
(NULL, 'upload', 'text', 'text', 'path_naming_rule', 'Path naming rule', '<a href="javascript:void(0)" mdui-dialog="{target: \'#path-var\'}">Path naming variable cross reference table</a>', '{Y}/{m}/{d}', ''),
(NULL, 'upload', 'text', 'text', 'file_naming_rule', 'File naming rule', '<a href="javascript:void(0)" mdui-dialog="{target: \'#file-var\'}">File naming variable cross reference table</a>', '{uniqid}', ''),
(NULL, 'user', 'text', 'text', 'user_initial_quota', 'User initial quota', 'User initial quota tip', '1073741824', ''),
(NULL, 'mail', 'select', 'text', 'mail_send_mode', 'Mail send mode', NULL, 'smtp', '{\"smtp\":\"SMTP\"}'),
(NULL, 'mail', 'select', 'text', 'mail_smtp_secure', 'Mail smtp secure', NULL, 'none', '{\"none\":\"None\",\"tls\":\"TLS\",\"ssl\":\"SSL\"}'),
(NULL, 'mail', 'text', 'text', 'mail_smtp_host', 'Mail smtp host', NULL, '', ''),
(NULL, 'mail', 'text', 'text', 'mail_smtp_username', 'Mail smtp username', NULL, '', ''),
(NULL, 'mail', 'text', 'password', 'mail_smtp_password', 'Mail smtp password', NULL, '', ''),
(NULL, 'mail', 'text', 'number', 'mail_smtp_port', 'Mail smtp port', '25/465', '25', ''),
(NULL, 'mail', 'text', 'email', 'mail_form_email', 'Mail form email', NULL, '', ''),
(NULL, 'other', 'bool', 'checkbox', 'soft_delete', '软删除', '删除图片时不删除源文件,不建议开启', '0', ''),
(NULL, 'other', 'bool', 'checkbox', 'open_gallery', '开启画廊', '开启画廊功能,游客上传的图片将会出现在画廊中', '0', ''),
(NULL, 'other', 'bool', 'checkbox', 'open_api', '开启API', '是否开放接口', '0', ''),
(NULL, 'other', 'textarea', 'textarea', 'ban_ip', '封禁IP', '封禁IP, 多个使用逗号隔开', '', ''),
(NULL, 'other', 'bool', 'checkbox', 'soft_delete', 'Soft delete', 'Soft delete tip', '0', ''),
(NULL, 'other', 'bool', 'checkbox', 'open_gallery', 'Open gallery', 'Open gallery tip', '0', ''),
(NULL, 'other', 'bool', 'checkbox', 'open_api', 'Open api', 'Open api tip', '0', ''),
(NULL, 'other', 'textarea', 'textarea', 'ban_ip', 'Ban ip', 'Ban ip tip', '', ''),
(NULL, 'storage_strategy', 'select', 'text', 'storage_strategy', '储存策略', NULL, 'local', ''),
(NULL, 'local', 'text', 'text', 'local_cdn_domain', '域名', NULL, '', ''),
(NULL, 'oss', 'text', 'text', 'oss_cdn_domain', '域名', NULL, '', ''),
(NULL, 'storage_strategy', 'select', 'text', 'storage_strategy', 'Storage strategy', NULL, 'local', ''),
(NULL, 'local', 'text', 'text', 'local_cdn_domain', 'Domain name', NULL, '', ''),
(NULL, 'oss', 'text', 'text', 'oss_cdn_domain', 'Domain name', NULL, '', ''),
(NULL, 'oss', 'text', 'text', 'oss_access_key_id', 'AccessKeyId', NULL, '', ''),
(NULL, 'oss', 'text', 'text', 'oss_access_key_secret', 'AccessKeySecret', NULL, '', ''),
(NULL, 'oss', 'text', 'text', 'oss_endpoint', 'Endpoint', '地域节点', '', ''),
(NULL, 'oss', 'text', 'text', 'oss_endpoint', 'Endpoint', 'Regional node', '', ''),
(NULL, 'oss', 'text', 'text', 'oss_bucket', 'Bucket', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_cdn_domain', '域名', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_cdn_domain', 'Domain name', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_secret_id', 'SecretId', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_secret_key', 'SecretKey', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_region', '所属地域', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_bucket', 'Bucket', '储存桶名称', '', ''),
(NULL, 'kodo', 'text', 'text', 'kodo_cdn_domain', '域名', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_region', 'Region', NULL, '', ''),
(NULL, 'cos', 'text', 'text', 'cos_bucket', 'Bucket', 'Bucket name', '', ''),
(NULL, 'kodo', 'text', 'text', 'kodo_cdn_domain', 'Domain name', NULL, '', ''),
(NULL, 'kodo', 'text', 'text', 'kodo_access_key', 'AccessKey', NULL, '', ''),
(NULL, 'kodo', 'text', 'text', 'kodo_secret_key', 'SecretKey', NULL, '', ''),
(NULL, 'kodo', 'text', 'text', 'kodo_bucket', 'Bucket', NULL, '', ''),
(NULL, 'uss', 'text', 'text', 'uss_cdn_domain', '域名', NULL, '', ''),
(NULL, 'uss', 'text', 'text', 'uss_operator_name', 'OperatorName', '操作员账号', '', ''),
(NULL, 'uss', 'text', 'password', 'uss_operator_pwd', 'OperatorPwd', '操作员密码', '', ''),
(NULL, 'uss', 'text', 'text', 'uss_service_name', 'ServiceName', '云储存服务名称', '', ''),
(NULL, 'basics', 'textarea', 'textarea', 'notice', '系统公告', '支持html', '', ''),
(NULL, 'remote', 'text', 'text', 'remote_cdn_domain', '域名', NULL, '', ''),
(NULL, 'remote', 'select', 'text', 'remote_type', '远程储存类型', NULL, 'ftp', '{\"ftp\":\"ftp\"}'),
(NULL, 'remote', 'bool', 'checkbox', 'remote_pasv', '被动模式', NULL, '0', ''),
(NULL, 'remote', 'text', 'text', 'remote_host', '连接地址', NULL, '', ''),
(NULL, 'remote', 'text', 'text', 'remote_name', '登录账号', NULL, '', ''),
(NULL, 'remote', 'text', 'password', 'remote_password', '登录密码', NULL, '', ''),
(NULL, 'remote', 'text', 'number', 'remote_port', '连接端口', NULL, '21', ''),
(NULL, 'uss', 'text', 'text', 'uss_cdn_domain', 'Domain name', NULL, '', ''),
(NULL, 'uss', 'text', 'text', 'uss_operator_name', 'OperatorName', 'Operator account', '', ''),
(NULL, 'uss', 'text', 'password', 'uss_operator_pwd', 'OperatorPwd', 'Operator password', '', ''),
(NULL, 'uss', 'text', 'text', 'uss_service_name', 'ServiceName', 'Cloud storage service name', '', ''),
(NULL, 'basics', 'textarea', 'textarea', 'notice', 'System notice', 'System notice tip', '', ''),
(NULL, 'remote', 'text', 'text', 'remote_cdn_domain', 'Domain name', NULL, '', ''),
(NULL, 'remote', 'select', 'text', 'remote_type', 'Remote storage type', NULL, 'ftp', '{\"ftp\":\"ftp\"}'),
(NULL, 'remote', 'bool', 'checkbox', 'remote_pasv', 'Passive mode', NULL, '0', ''),
(NULL, 'remote', 'text', 'text', 'remote_host', 'Connection address', NULL, '', ''),
(NULL, 'remote', 'text', 'text', 'remote_name', 'Login account', NULL, '', ''),
(NULL, 'remote', 'text', 'password', 'remote_password', 'Login password', NULL, '', ''),
(NULL, 'remote', 'text', 'number', 'remote_port', 'Connection port', NULL, '21', ''),
(NULL, 'audit', 'bool', 'checkbox', 'open_audit', '开启图片鉴黄', '接口申请地址:<a href="https://www.moderatecontent.com" target="_blank">https://www.moderatecontent.com</a>', '0', ''),
(NULL, 'audit', 'bool', 'checkbox', 'open_audit', 'Turn on picture yellow identification', 'Turn on picture yellow identification tip', '0', ''),
(NULL, 'audit', 'text', 'text', 'audit_key', 'Key', NULL, '', ''),
(NULL, 'audit', 'select', 'text', 'audit_index', '内容评级', '1=非常严格2=严格3=一般', '3', '{\"1\": \"非常严格\", \"2\": \"严格\", \"3\": \"一般\"}'),
(NULL, 'audit', 'select', 'text', 'audit_index', 'Content rating', 'Content rating tip', '3', '{\"1\": \"Very strict\", \"2\": \"Strict\", \"3\": \"Commonly\"}'),
(NULL, '', 'text', 'text', 'system_version', '系统版本', NULL, '1.6.4', '');
(NULL, '', 'text', 'text', 'system_version', 'System version', NULL, '1.6.4', '');
INSERT INTO `lsky_group` (`id`, `strategy`, `name`, `default`, `update_time`, `create_time`) VALUES (NULL, 'local', '默认组', '1', '0', '0');
INSERT INTO `lsky_group` (`id`, `strategy`, `name`, `default`, `update_time`, `create_time`) VALUES (NULL, 'local', 'Default group', '1', '0', '0');

View File

@ -9,10 +9,10 @@ UPDATE `lsky_config` SET `value` = '1.2.1' WHERE `lsky_config`.`name` = 'system_
UPDATE `lsky_config` SET `value` = '1.3.2' WHERE `lsky_config`.`name` = 'system_version';
INSERT IGNORE INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
(NULL, 'audit', 'bool', 'checkbox', 'open_audit', '开启图片鉴黄', '鉴黄接口申请地址https://www.moderatecontent.com', '0', ''),
(NULL, 'audit', 'bool', 'checkbox', 'open_audit', 'Turn on picture yellow identification', 'Turn on picture yellow identification tip', '0', ''),
(NULL, 'audit', 'text', 'text', 'audit_key', 'Key', NULL, '', ''),
(NULL, 'audit', 'select', 'text', 'audit_index', '内容评级', '1=非常严格2=严格3=一般', '3', '{\"1\": \"非常严格\", \"2\": \"严格\", \"3\": \"一般\"}'),
(NULL, 'other', 'bool', 'checkbox', 'open_api', '开启API', '是否开放接口', '0', '');
(NULL, 'audit', 'select', 'text', 'audit_index', 'Content rating', 'Content rating tip', '3', '{\"1\": \"Very strict\", \"2\": \"Strict\", \"3\": \"Commonly\"}'),
(NULL, 'other', 'bool', 'checkbox', 'open_api', 'Open api', 'Open api tip', '0', '');
-- v1.3.3
UPDATE `lsky_config` SET `value` = '1.3.3' WHERE `lsky_config`.`name` = 'system_version';
@ -49,10 +49,10 @@ UPDATE `lsky_images` SET `strategy` = 'kodo' WHERE `lsky_images`.`strategy` = 'q
-- v1.5.0
UPDATE `lsky_config` SET `value` = '1.5.0' WHERE `lsky_config`.`name` = 'system_version';
UPDATE `lsky_config` SET `tip` = '接口申请地址:<a href="https://www.moderatecontent.com" target="_blank">https://www.moderatecontent.com</a>' WHERE `lsky_config`.`name` = 'open_audit';
UPDATE `lsky_config` SET `tip` = 'Turn on picture yellow identification tip' WHERE `lsky_config`.`name` = 'open_audit';
INSERT IGNORE INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
(NULL, 'basics', 'textarea', 'textarea', 'custom_style', '自定义CSS', NULL, '<!-- 可以直接引入第三方css样式 -->\r\n<style>\r\n /* body {} */\r\n</style>', ''),
(NULL, 'basics', 'textarea', 'textarea', 'statistics_code', '统计代码', NULL, '<script>\r\n // js统计代码 \r\n</script>', '');
(NULL, 'basics', 'textarea', 'textarea', 'custom_style', 'Custom CSS', NULL, '<!-- 可以直接引入第三方css样式 -->\r\n<style>\r\n /* body {} */\r\n</style>', ''),
(NULL, 'basics', 'textarea', 'textarea', 'statistics_code', 'Statistical code', NULL, '<script>\r\n // js统计代码 \r\n</script>', '');
CREATE TABLE IF NOT EXISTS `lsky_group` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT 'ID',
`strategy` varchar(32) NOT NULL COMMENT '使用策略',
@ -80,13 +80,13 @@ UPDATE `lsky_config` SET `value` = '1.5.4' WHERE `lsky_config`.`name` = 'system_
-- v1.5.5
UPDATE `lsky_config` SET `value` = '1.5.5' WHERE `lsky_config`.`name` = 'system_version';
INSERT IGNORE INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
(NULL, 'basics', 'textarea', 'textarea', 'notice', '系统公告', '支持html', '', ''),
(NULL, 'remote', 'text', 'text', 'remote_cdn_domain', '域名', NULL, '', ''),
(NULL, 'remote', 'select', 'text', 'remote_type', '远程储存类型', NULL, 'ftp', '{\"ftp\":\"Ftp\"}'),
(NULL, 'remote', 'text', 'text', 'remote_host', '连接地址', NULL, '', ''),
(NULL, 'remote', 'text', 'text', 'remote_name', '登录账号', NULL, '', ''),
(NULL, 'remote', 'text', 'password', 'remote_password', '登录密码', NULL, '', ''),
(NULL, 'remote', 'text', 'number', 'remote_port', '连接端口', NULL, '21', '');
(NULL, 'basics', 'textarea', 'textarea', 'notice', 'System notice', 'System notice tip', '', ''),
(NULL, 'remote', 'text', 'text', 'remote_cdn_domain', 'Domain name', NULL, '', ''),
(NULL, 'remote', 'select', 'text', 'remote_type', 'Remote storage type', NULL, 'ftp', '{\"ftp\":\"Ftp\"}'),
(NULL, 'remote', 'text', 'text', 'remote_host', 'Connection address', NULL, '', ''),
(NULL, 'remote', 'text', 'text', 'remote_name', 'Login account', NULL, '', ''),
(NULL, 'remote', 'text', 'password', 'remote_password', 'Login password', NULL, '', ''),
(NULL, 'remote', 'text', 'number', 'remote_port', 'Connection port', NULL, '21', '');
-- v1.5.6
UPDATE `lsky_config` SET `value` = '1.5.6' WHERE `lsky_config`.`name` = 'system_version';
@ -100,8 +100,8 @@ UPDATE `lsky_config` SET `value` = '1.5.8' WHERE `lsky_config`.`name` = 'system_
-- v1.6.0
UPDATE `lsky_config` SET `value` = '1.6.0' WHERE `lsky_config`.`name` = 'system_version';
INSERT IGNORE INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
(NULL, 'other', 'textarea', 'textarea', 'ban_ip', '封禁IP', '封禁IP, 多个使用逗号隔开', '', ''),
(NULL, 'remote', 'bool', 'checkbox', 'remote_pasv', '被动模式', NULL, '0', '');
(NULL, 'other', 'textarea', 'textarea', 'ban_ip', 'Ban ip', 'Ban ip tip', '', ''),
(NULL, 'remote', 'bool', 'checkbox', 'remote_pasv', 'Passive mode', NULL, '0', '');
-- v1.6.1
UPDATE `lsky_config` SET `value` = '1.6.1' WHERE `lsky_config`.`name` = 'system_version';
@ -109,9 +109,9 @@ UPDATE `lsky_config` SET `value` = '1.6.1' WHERE `lsky_config`.`name` = 'system_
-- v1.6.3
UPDATE `lsky_config` SET `value` = '1.6.3' WHERE `lsky_config`.`name` = 'system_version';
INSERT IGNORE INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
(NULL, 'other', 'bool', 'checkbox', 'open_gallery', '开启画廊', '开启画廊功能,游客上传的图片将会出现在画廊中', '', '');
(NULL, 'other', 'bool', 'checkbox', 'open_gallery', 'Open gallery', 'Open gallery tip', '', '');
-- v1.6.4
UPDATE `lsky_config` SET `value` = '1.6.4' WHERE `lsky_config`.`name` = 'system_version';
INSERT IGNORE INTO `lsky_config` (`id`, `key`, `type`, `input_type`, `name`, `title`, `tip`, `value`, `extend`) VALUES
(NULL, 'upload', 'text', 'number', 'same_ip_day_max_upload', '相同ip一天内最大上传限制', '为0则不限制', '0', '');
(NULL, 'upload', 'text', 'number', 'same_ip_day_max_upload', 'Same ip day max upload', 'Same ip day max upload tip', '0', '');

View File

@ -39,7 +39,7 @@ return [
// 默认时区
'default_timezone' => 'Asia/Shanghai',
// 是否开启多语言
'lang_switch_on' => false,
'lang_switch_on' => true,
// 默认全局过滤方法 用逗号分隔多个
'default_filter' => '',
// 默认语言

View File

@ -69,6 +69,9 @@ body {
.mdui-drawer-body-left footer {
width: calc(100% - 240px);
}
.mdui-tab a {
text-transform: capitalize;
}
main {
position: relative;
top: 0;
@ -310,7 +313,7 @@ main ul.breadcrumb li.active a {
}
main .mdui-table td,
main .mdui-table th {
padding: 0 10px;
padding: 7px 10px;
}
main .mask {
position: absolute;

File diff suppressed because one or more lines are too long

View File

@ -43,6 +43,10 @@ body {
}
}
.mdui-tab a {
text-transform: capitalize;
}
main {
position: relative;
top: 0;

View File

@ -1,4 +1,12 @@
var app = {
sprintf: function () {
var args = arguments, string = args[0];
for (var i = 1; i < args.length; i++) {
var item = arguments[i];
string = string.replace('%s', item);
}
return string;
},
/**
* ajax
* @param url
@ -286,3 +294,15 @@ var app = {
$('#set-theme i').html(theme === 'dark' ? '&#xe3ac;' : '&#xe3a9;');
}
};
window.lang = function (name, vars) {
vars = vars || [];
var k = name.toLowerCase();
for (var key in languages) {
if (k === key) {
return app.sprintf(languages[k], ...vars);
}
}
return name;
};