feat(admin): 新增弹框是否允许在新标签页中打开 add option to open iframe in new tab
- Add 'iframe_open_top' configuration to admin site settings - Implement functionality to open iframe in new tab if configured - Update admin layout to include new configuration option - Modify easy-admin.js to support new tab opening for iframes Signed-off-by: wolfcode <37436228+wolf-leo@users.noreply.github.com>
This commit is contained in:
@@ -21,8 +21,9 @@
|
||||
IS_SUPER_ADMIN: "{$isSuperAdmin|default='false'}",
|
||||
VERSION: "{$version|default='1.0.0'}",
|
||||
CSRF_TOKEN: "{:token()}",
|
||||
ADMIN_UPLOAD_URL: "{$adminUploadUrl|DEFAULT=''}",
|
||||
EDITOR_TYPE: "{$adminEditor|default='ueditor'}",
|
||||
ADMIN_UPLOAD_URL: "{$adminUploadUrl|default=''}",
|
||||
IFRAME_OPEN_TOP: "{$iframeOpenTop|default=0}",
|
||||
EDITOR_TYPE: "{$adminEditor|default='wangEditor'}",
|
||||
};
|
||||
</script>
|
||||
<script src="/static/plugs/layui-v2.x/layui.js" charset="utf-8"></script>
|
||||
|
||||
@@ -54,6 +54,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">新标签页窗口</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="iframe_open_top" value="0" title="不允许" {if 1!=sysConfig('site','iframe_open_top')}checked{/if}>
|
||||
<input type="radio" name="iframe_open_top" value="1" title="允许" {if 1==sysConfig('site','iframe_open_top')}checked{/if}>
|
||||
<br>
|
||||
<tip>是否允许弹框在新标签页打开。</tip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">默认编辑器</label>
|
||||
|
||||
@@ -240,6 +240,7 @@ class AdminController extends BaseController
|
||||
'version' => env('APP_DEBUG') ? time() : ConfigService::getVersion(),
|
||||
'adminUploadUrl' => url('ajax/upload', [], false),
|
||||
'adminEditor' => sysConfig('site', 'editor_type') ?: 'wangEditor',
|
||||
'iframeOpenTop' => sysConfig('site', 'iframe_open_top') ?: 0,
|
||||
];
|
||||
View::assign($data);
|
||||
}
|
||||
|
||||
@@ -977,6 +977,14 @@ define(["jquery", "tableSelect"], function ($, tableSelect) {
|
||||
before: function () {
|
||||
},
|
||||
success: function (layero, index) {
|
||||
if (window.CONFIG.IFRAME_OPEN_TOP == '1') {
|
||||
let _winTopBtn = `
|
||||
<span class="_winTopBtn layui-btn layui-btn-primary layui-btn-xs"
|
||||
style="position: absolute;top: 14px;right: 120px;color: #fff;border-color: #fff;" onclick="window.open(location.href)">
|
||||
新标签页打开
|
||||
</span>`
|
||||
$('.layui-layer-iframe').append(_winTopBtn)
|
||||
}
|
||||
},
|
||||
end: function () {
|
||||
index = null
|
||||
|
||||
Reference in New Issue
Block a user