This commit is contained in:
devezhao 2021-01-18 18:12:24 +08:00
parent 6497e3407d
commit 0f57fc21b5
10 changed files with 62 additions and 5 deletions

View file

@ -75,7 +75,15 @@ public enum ConfigurationItem {
// 激活 Redis 队列 (since = "2.1")
@Deprecated
RedisQueueEnable(false);
RedisQueueEnable(false),
// 视图页显示修改历史
ShowViewHistory(true),
// 登录验证码显示策略1为自动2为总是
LoginCaptchaPolicy(1),
;
private Object defaultVal;

View file

@ -19,6 +19,8 @@ import com.rebuild.core.configuration.general.TransformManager;
import com.rebuild.core.configuration.general.ViewAddonsManager;
import com.rebuild.core.metadata.MetadataHelper;
import com.rebuild.core.privileges.UserHelper;
import com.rebuild.core.support.ConfigurationItem;
import com.rebuild.core.support.RebuildConfiguration;
import com.rebuild.web.EntityController;
import com.rebuild.web.IdParam;
import org.springframework.web.bind.annotation.*;
@ -62,6 +64,9 @@ public class GeneralModelController extends EntityController {
JSON trans = TransformManager.instance.getTransforms(entity, user);
mv.getModel().put("TransformTos", trans);
// 显示历史
mv.getModel().put("ShowViewHistory", RebuildConfiguration.getBool(ConfigurationItem.ShowViewHistory));
mv.getModel().put("id", id);
return mv;
}

View file

@ -125,6 +125,11 @@ public class LoginController extends BaseController {
// 切换语言
putLocales(mv, AppUtils.getReuqestLocale(request));
// 验证码
if (RebuildConfiguration.getInt(ConfigurationItem.LoginCaptchaPolicy) == 2) {
ServletUtils.setSessionAttribute(request, SK_NEED_VCODE, true);
}
mv.getModelMap().put("UsersMsg", CheckDangers.getUserDanger());
return mv;
}
@ -158,6 +163,7 @@ public class LoginController extends BaseController {
// 清理
getLoginRetryTimes(user, -1);
ServletUtils.setSessionAttribute(request, SK_NEED_VCODE, null);
return RespBody.ok();
}

View file

@ -1309,6 +1309,11 @@
"MdeditLink": "Link",
"MdeditTable": "Table",
"MdeditFullScreen": "Full screen",
"ShowViewHistory": "Show modification history on view page",
"LoginCaptchaPolicy": "Login CAPTCHA display mode",
"LoginCaptchaPolicy1": "Automatic",
"LoginCaptchaPolicy2": "Always display",
"DBBackupsKeepingDays": "Backup retention time",
"s.__": "STATE",
"s.ApprovalState.DRAFT": "Draft",

View file

@ -1309,6 +1309,11 @@
"MdeditLink": "链接",
"MdeditTable": "表格",
"MdeditFullScreen": "全屏",
"ShowViewHistory": "在视图页显示修改历史",
"LoginCaptchaPolicy": "登录验证码显示模式",
"LoginCaptchaPolicy1": "自动",
"LoginCaptchaPolicy2": "总是显示",
"DBBackupsKeepingDays": "备份保留时间",
"s.__": "状态",
"s.ApprovalState.DRAFT": "草稿",

View file

@ -1309,6 +1309,11 @@
"MdeditLink": "鏈接",
"MdeditTable": "表格",
"MdeditFullScreen": "全屏",
"ShowViewHistory": "在視圖頁顯示修改歷史",
"LoginCaptchaPolicy": "登錄驗證碼顯示模式",
"LoginCaptchaPolicy1": "自動",
"LoginCaptchaPolicy2": "總是顯示",
"DBBackupsKeepingDays": "備份保留時間",
"s.__": "狀態",
"s.ApprovalState.DRAFT": "草稿",

View file

@ -78,6 +78,13 @@
<th:block th:if="${PasswordPolicy == '3'}">[[${bundle.L('PasswordPolicyL3')}]]</th:block>
</td>
</tr>
<tr>
<td>[[${bundle.L('LoginCaptchaPolicy')}]]</td>
<td data-id="LoginCaptchaPolicy" th:data-value="${LoginCaptchaPolicy}">
<th:block th:if="${LoginCaptchaPolicy == '1'}">[[${bundle.L('LoginCaptchaPolicy1')}]]</th:block>
<th:block th:if="${LoginCaptchaPolicy == '2'}">[[${bundle.L('LoginCaptchaPolicy2')}]]</th:block>
</td>
</tr>
<tr>
<td>[[${bundle.L('MultipleSessions')}]]</td>
<td data-id="MultipleSessions" th:data-value="${MultipleSessions}">[[${bundle.L(MultipleSessions ? 'True' : 'False')}]]</td>
@ -90,6 +97,10 @@
<td>[[${bundle.L('FileSharable')}]]</td>
<td data-id="FileSharable" th:data-value="${FileSharable}">[[${bundle.L(FileSharable ? 'True' : 'False')}]]</td>
</tr>
<tr>
<td>[[${bundle.L('ShowViewHistory')}]]</td>
<td data-id="ShowViewHistory" th:data-value="${ShowViewHistory}">[[${bundle.L(ShowViewHistory ? 'True' : 'False')}]]</td>
</tr>
</tbody>
</table>
<h5>[[${bundle.L('DataBackup')}]]</h5>
@ -102,6 +113,10 @@
</td>
<td data-id="DBBackupsEnable" th:data-value="${DBBackupsEnable}">[[${bundle.L(DBBackupsEnable ? 'True' : 'False')}]]</td>
</tr>
<tr>
<td>[[${bundle.L('DBBackupsKeepingDays')}]]</td>
<td data-id="DBBackupsKeepingDays" th:data-value="${DBBackupsKeepingDays}">[[${DBBackupsKeepingDays}]] [[${bundle.L('Day0')}]]</td>
</tr>
</tbody>
</table>
<div class="edit-footer">

View file

@ -14,7 +14,7 @@ $(document).ready(() => {
})
useEditComp = function (name, value) {
if (['OpenSignUp', 'LiveWallpaper', 'FileSharable', 'MarkWatermark', 'DBBackupsEnable', 'MultipleSessions'].includes(name)) {
if (['OpenSignUp', 'LiveWallpaper', 'FileSharable', 'MarkWatermark', 'DBBackupsEnable', 'MultipleSessions', 'ShowViewHistory'].includes(name)) {
return (
<select name={name} className="form-control form-control-sm" onChange={changeValue} defaultValue={value}>
<option value="true">{$L('True')}</option>
@ -34,17 +34,25 @@ useEditComp = function (name, value) {
if (rb.commercial > 0) _toggleLogo()
const options = []
for (let k in wpc._LANGS)
for (let k in wpc._LANGS) {
options.push(
<option value={k} key={k}>
{wpc._LANGS[k]}
</option>
)
}
return (
<select name={name} className="form-control form-control-sm" onChange={changeValue} defaultValue={value}>
{options}
</select>
)
} else if ('LoginCaptchaPolicy' === name) {
return (
<select name={name} className="form-control form-control-sm" onChange={changeValue} defaultValue={value}>
<option value="1">{$L('LoginCaptchaPolicy1')}</option>
<option value="2">{$L('LoginCaptchaPolicy2')}</option>
</select>
)
}
}

View file

@ -57,7 +57,7 @@
<dd class="col-12 col-lg-8 J_modifiedOn"></dd>
</dl>
</div>
<div class="view-history">
<div class="view-history" th:if="${ShowViewHistory}">
<div class="form-line">
<fieldset><legend>[[${bundle.L('ViewHistory')}]] <i class="zmdi zmdi-help zicon" data-toggle="tooltip" th:title="${bundle.L('ViewHistoryTip')}"></i></legend></fieldset>
</div>

View file

@ -93,7 +93,7 @@
<dd class="col-12 col-lg-8 J_modifiedOn"></dd>
</dl>
</div>
<div class="view-history">
<div class="view-history" th:if="${ShowViewHistory}">
<div class="form-line">
<fieldset><legend>[[${bundle.L('ViewHistory')}]] <i class="zmdi zmdi-help zicon" data-toggle="tooltip" th:title="${bundle.L('ViewHistoryTip')}"></i></legend></fieldset>
</div>