From cb77b7c9858a9c859f2d60069a83267931d7f0f6 Mon Sep 17 00:00:00 2001 From: "zhangqingtian@pxjy.com" Date: Wed, 16 May 2018 11:08:14 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=96=B0=E5=A2=9ETable.api.formatter.toggl?= =?UTF-8?q?e=EF=BC=8C=E6=96=87=E4=BB=B6=E5=A4=A7=E5=B0=8F=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=EF=BC=8C=E6=9B=B4=E6=96=B0=E5=90=8E=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E5=8E=8B=E7=BC=A9=E6=89=93=E5=8C=85=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=9A=84JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/backend/general/attachment.js | 2 +- public/assets/js/require-table.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/public/assets/js/backend/general/attachment.js b/public/assets/js/backend/general/attachment.js index 7118da62a..a4c0b6cc3 100644 --- a/public/assets/js/backend/general/attachment.js +++ b/public/assets/js/backend/general/attachment.js @@ -30,7 +30,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin {field: 'imageheight', title: __('Imageheight'), sortable: true}, {field: 'imagetype', title: __('Imagetype'), formatter:Table.api.formatter.search}, {field: 'storage', title: __('Storage'), formatter: Table.api.formatter.search}, - {field: 'filesize', title: __('Filesize'), operate: 'BETWEEN', sortable: true}, + {field: 'filesize', title: __('Filesize'), operate: 'BETWEEN', sortable: true, formatter: Table.api.formatter.filesize}, {field: 'mimetype', title: __('Mimetype'), formatter:Table.api.formatter.search}, { field: 'createtime', diff --git a/public/assets/js/require-table.js b/public/assets/js/require-table.js index 55042656c..74a8cac98 100644 --- a/public/assets/js/require-table.js +++ b/public/assets/js/require-table.js @@ -458,6 +458,19 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table } else { return value ? Moment(parseInt(value) * 1000).format(datetimeFormat) : __('None'); } + }, + filesize: function (value, row, index) { + if(value == null || value == ''){ + return "0 Bytes"; + } + var unitArr = new Array("Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); + var i = 0; + var srcsize = parseFloat(value); + i = Math.floor(Math.log(srcsize) / Math.log(1024)); + var size = srcsize / Math.pow(1024,i); + //保留的小数位数 + size = size.toFixed(2); + return size + unitArr[i]; }, operate: function (value, row, index) { var table = this.table; -- Gitee From efbcba4132578dbc0b16df35017481eff093fa74 Mon Sep 17 00:00:00 2001 From: "zhangqingtian@pxjy.com" Date: Thu, 17 May 2018 10:16:27 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=9D=83=E9=99=90=E5=88=86=E9=85=8D=EF=BC=8C?= =?UTF-8?q?jstree=E5=88=97=E8=A1=A8=E9=80=89=E9=A1=B9=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E5=8F=96=E6=B6=88=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?width:80px=EF=BC=8C=E9=98=B2=E6=AD=A2=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E6=96=87=E5=AD=97=E8=BF=87=E5=A4=9A=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=AE=8C=E6=95=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/css/backend.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/assets/css/backend.css b/public/assets/css/backend.css index 3152184a7..398f40db2 100644 --- a/public/assets/css/backend.css +++ b/public/assets/css/backend.css @@ -560,14 +560,14 @@ form.form-horizontal .control-label { float: left; background: none; margin-left: 0; - width: 80px; + /*width: 80px;*/ clear: none; } #treeview .jstree-leaf { float: left; margin-left: 0; padding-left: 24px; - width: 80px; + /*width: 80px;*/ clear: none; color: #777; } -- Gitee From 45ccd336eecd6d66f3c7bba8998f9baf8b9ff475 Mon Sep 17 00:00:00 2001 From: "zhangqingtian@pxjy.com" Date: Thu, 17 May 2018 11:48:49 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=EF=BC=8C=E6=9D=83=E9=99=90=E7=AE=A1=E7=90=86=EF=BC=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E7=AE=A1=E7=90=86=E7=9A=84=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=94=B9=E4=B8=BA=E9=94=81=E5=AE=9A=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E9=94=81=E5=AE=9A=E4=BB=A5=E5=90=8E=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=B8=8D=E8=83=BD=E5=86=8D=E7=99=BB=E5=BD=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/lang/zh-cn/index.php | 1 + application/admin/library/Auth.php | 4 ++++ application/admin/view/auth/admin/add.html | 2 +- application/admin/view/auth/admin/edit.html | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/application/admin/lang/zh-cn/index.php b/application/admin/lang/zh-cn/index.php index d96e47a91..8855fafdc 100644 --- a/application/admin/lang/zh-cn/index.php +++ b/application/admin/lang/zh-cn/index.php @@ -25,6 +25,7 @@ return [ 'Username or password can not be empty' => '用户名密码不能为空', 'Username or password is incorrect' => '用户名或密码不正确', 'Username is incorrect' => '用户名不正确', + 'Username is locked' => '用户名已锁定,请联系管理员', 'Password is incorrect' => '密码不正确', 'Please try again after 1 day' => '请于1天后再尝试登录', 'Login successful' => '登录成功!', diff --git a/application/admin/library/Auth.php b/application/admin/library/Auth.php index 0524a3539..f4e5c42e9 100644 --- a/application/admin/library/Auth.php +++ b/application/admin/library/Auth.php @@ -42,6 +42,10 @@ class Auth extends \fast\Auth if (!$admin) { $this->setError('Username is incorrect'); return false; + } + if ($admin->status == 'locked') { + $this->setError('Username is locked'); + return false; } if (Config::get('fastadmin.login_failure_retry') && $admin->loginfailure >= 10 && time() - $admin->updatetime < 86400) { $this->setError('Please try again after 1 day'); diff --git a/application/admin/view/auth/admin/add.html b/application/admin/view/auth/admin/add.html index 99a39996b..6098c25d2 100644 --- a/application/admin/view/auth/admin/add.html +++ b/application/admin/view/auth/admin/add.html @@ -32,7 +32,7 @@
- {:build_radios('row[status]', ['normal'=>__('Normal'), 'hidden'=>__('Hidden')])} + {:build_radios('row[status]', ['normal'=>__('Normal'), 'locked'=>__('Locked')])}