TaoLer/app/admin/view/set/system/website.html

350 lines
14 KiB
HTML
Raw Normal View History

2020-01-01 13:17:19 +08:00
{extend name="public/base" /}
{block name="body"}
2020-04-02 23:41:48 +08:00
<div class="layui-fluid" id="component-tabs">
<div class="layui-row">
2020-01-01 13:17:19 +08:00
<div class="layui-col-md12">
<div class="layui-card">
2020-04-02 23:41:48 +08:00
<div class="layui-card-body">
<div class="layui-tab layui-tab-brief" lay-filter="website-tabs-brief">
2020-04-02 23:41:48 +08:00
<ul class="layui-tab-title">
<li class="layui-this" lay-id="website">网站设置</li>
<li lay-id="email">邮箱服务</li>
<li lay-id="config">服务配置</li>
2020-04-02 23:41:48 +08:00
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="layui-form" wid100 lay-filter="">
<div class="layui-form-item">
<label class="layui-form-label">网站名称</label>
<div class="layui-input-block">
<input type="text" name="webname" value="{$sysInfo.webname}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">网站域名</label>
<div class="layui-input-block">
2021-07-07 17:40:43 +08:00
<input type="text" name="domain" value="{$sysInfo.domain}" class="layui-input">
2020-04-02 23:41:48 +08:00
</div>
</div>
2020-05-10 18:52:02 +08:00
<div class="layui-form-item">
<label class="layui-form-label">模板切换</label>
<div class="layui-input-block">
<select name="template" lay-verify="required">
<option value=""></option>
{volist name="template" id="vo"}
<option {if condition="$sysInfo.template eq $vo"} selected {/if} value="{$vo}">{$vo}</option>
{/volist}
</select>
</div>
</div>
2020-04-02 23:41:48 +08:00
<div class="layui-form-item">
<label class="layui-form-label">LOGO</label>
<div class="layui-input-block">
<span><img src="{$sysInfo.logo}" hight="40" width="50" ></span>
{if condition="checkRuleButton('admin/set/upload')"}
<button type="button" class="layui-btn layui-btn-normal" id="logo-img">选择文件</button>
<button type="button" class="layui-btn" id="logo-upload-button">开始上传</button>
{else /}<button type="button" class="layui-btn layui-btn-normal layui-btn-disabled">选择文件</button>{/if}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">缓存时间</label>
<div class="layui-input-inline" style="width: 80px;">
<input type="text" name="cache" lay-verify="number" value="{$sysInfo.cache}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">分钟</div>
<div class="layui-form-mid layui-word-aux">本地开发一般推荐设置为 0线上环境建议设置为 10。</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">最大文件上传</label>
<div class="layui-input-inline" style="width: 80px;">
<input type="text" name="upsize" lay-verify="number" value="{$sysInfo.upsize}" class="layui-input">
</div>
<div class="layui-input-inline layui-input-company">KB</div>
<div class="layui-form-mid layui-word-aux">提示1 M = 1024 KB</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">上传文件类型</label>
<div class="layui-input-block">
2021-07-07 17:17:58 +08:00
<input type="text" name="uptype" value="{$sysInfo.uptype}" placeholder="请依照格式image:jgp|png,多个组合用,分开" class="layui-input">
2020-04-02 23:41:48 +08:00
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">禁止注册名</label>
<div class="layui-input-block">
<input type="text" name="blackname" value="{$sysInfo.blackname}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">首页标题</label>
<div class="layui-input-block">
<input type="text" name="webtitle" value="{$sysInfo.webtitle}" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">META关键词</label>
<div class="layui-input-block">
<textarea name="keywords" class="layui-textarea" placeholder="多个关键词在英文状态下用,分开">{$sysInfo.keywords}</textarea>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">META描述</label>
<div class="layui-input-block">
<textarea name="descript" class="layui-textarea">{$sysInfo.descript}</textarea>
</div>
</div>
2021-07-07 17:17:58 +08:00
<div class="layui-form-item">
<label class="layui-form-label">备案号</label>
<div class="layui-input-inline">
<input type="text" name="icp" value="{$sysInfo.icp}" class="layui-input">
</div>
</div>
2021-07-16 17:42:07 +08:00
<div class="layui-form-item">
<label class="layui-form-label">访问统计</label>
<div class="layui-input-block">
<input type="text" name="showlist" value="{$sysInfo.showlist}" class="layui-input">
</div>
</div>
2020-04-02 23:41:48 +08:00
<div class="layui-form-item">
<label class="layui-form-label">版权信息</label>
2021-07-07 17:40:43 +08:00
<div class="layui-input-inline" style="width: 400px;">
<input type="text" name="copyright" value="{$sysInfo.copyright}" class="layui-input">
2020-04-02 23:41:48 +08:00
</div>
<div class="layui-input-inline layui-input-company">提示:</div>
2021-07-16 17:42:07 +08:00
<div class="layui-form-mid layui-word-aux">未授权版本,不限制功能,但严禁私自改写此处版权脚本,一旦发现,永久关闭升级服务!!</div>
2020-04-02 23:41:48 +08:00
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
{if condition="checkRuleButton('admin/Set/website')"}
<button class="layui-btn" lay-submit lay-filter="set_website">确认保存</button>
{else /}<button class="layui-btn layui-btn-disabled">确认保存</button>{/if}
</div>
</div>
</div>
2020-01-01 13:17:19 +08:00
</div>
2020-04-02 23:41:48 +08:00
<div class="layui-tab-item">
<div class="layui-form" wid100 lay-filter="">
<div class="layui-form-item">
<label class="layui-form-label">SMTP服务器</label>
<div class="layui-input-inline">
<input type="text" name="host" value="{$mailserver.host}" class="layui-input">
</div>
2021-10-12 17:42:55 +08:00
<div class="layui-form-mid layui-word-aux">smtp.aliyun.com</div>
2020-04-02 23:41:48 +08:00
</div>
<div class="layui-form-item">
<label class="layui-form-label">SMTP端口号</label>
<div class="layui-input-inline" style="width: 80px;">
<input type="text" name="port" lay-verify="number" value="{$mailserver.port}" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux">一般为 25 或 465</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发件人邮箱</label>
<div class="layui-input-inline">
<input type="text" name="mail" value="{$mailserver.mail}" lay-verify="email" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发件人昵称</label>
<div class="layui-input-inline">
<input type="text" name="nickname" value="{$mailserver.nickname}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">邮箱登入密码</label>
<div class="layui-input-inline">
<input type="password" name="password" value="{$mailserver.password}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
{if condition="checkRuleButton('admin/Set/email')"}
<button class="layui-btn" lay-submit lay-filter="set_system_email">确认保存</button>
{else /}<button class="layui-btn layui-btn-disabled">确认保存</button>{/if}
</div>
</div>
</div>
{//邮箱发送测试}
2021-10-11 18:02:39 +08:00
{if $mailserver.active !== 1}
<div class="layui-form" wid100 >
<div class="layui-form-item">
<label class="layui-form-label">测试邮箱</label>
<div class="layui-input-inline">
2021-10-12 17:42:55 +08:00
<input type="text" name="email" value="{$email}" placeholder="推荐阿里云mail" lay-verify="email" class="layui-input">
</div>
<button class="layui-btn" lay-submit lay-filter="test_system_email">发送测试码</button>
</div>
</div>
<div class="layui-form" wid100>
<div class="layui-form-item">
<label class="layui-form-label">输入测试码</label>
<div class="layui-input-inline">
<input type="text" name="code" value="" autocomplete="off" class="layui-input">
</div>
<button class="layui-btn" lay-submit lay-filter="active_system_email">确认激活</button>
</div>
</div>
2021-10-11 18:02:39 +08:00
{/if}
2021-07-22 10:54:03 +08:00
</div>
<div class="layui-tab-item">
<div class="layui-form" wid100 lay-filter="config">
{if($mailserver.active == 1)}
2021-07-23 17:05:43 +08:00
<div class="layui-form-item">
<label class="layui-form-label">邮件通知:</label>
<div class="layui-input-inline" style="width: 30px;">
<input type="checkbox" name="email_notice" lay-skin="primary" value=1 {if config('taoler.config.email_notice') == 1} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">发帖及评论等邮件提醒(邮箱服务未激活无法设置)</div>
2021-07-22 10:54:03 +08:00
</div>
{/if}
<div class="layui-form-item">
<label class="layui-form-label">注册审核:</label>
<div class="layui-input-inline" style="width: 30px;">
<input type="checkbox" name="regist_check" lay-skin="primary" value=0 {if config('taoler.config.regist_check') == 0} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">注册是否需要审核</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发帖审核:</label>
<div class="layui-input-inline" style="width: 30px;">
<input type="checkbox" name="posts_check" lay-skin="primary" value=0 {if config('taoler.config.posts_check') == 0} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">发帖是否需要审核</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">评论审核:</label>
<div class="layui-input-inline" style="width: 30px;">
<input type="checkbox" name="commnets_check" lay-skin="primary" value=0 {if config('taoler.config.commnets_check') == 0} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">评论是否需要审核</div>
</div>
<div class="layui-form-item">
2021-07-23 17:05:43 +08:00
<label class="layui-form-label">分类显示:</label>
2021-07-22 10:54:03 +08:00
<div class="layui-input-inline" style="width: 30px;">
2021-07-23 17:05:43 +08:00
<input type="checkbox" name="cate_show" lay-skin="primary" value=1 {if config('taoler.config.cate_show') == 1} checked {/if}>
2021-07-22 10:54:03 +08:00
</div>
2021-07-23 17:05:43 +08:00
<div class="layui-form-mid layui-word-aux">是否显示列表及详情所属分类</div>
</div>
2021-07-23 17:05:43 +08:00
<div class="layui-form-item">
<label class="layui-form-label">区域简称:</label>
<div class="layui-input-inline" style="width: 30px;">
<input type="checkbox" name="area_show" lay-skin="primary" value=1 {if config('taoler.config.area_show') == 1} checked {/if}>
</div>
<div class="layui-form-mid layui-word-aux">是否显示发件人所在地区简称</div>
</div>
2021-07-22 10:54:03 +08:00
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="set_system_config">确认保存</button>
</div>
</div>
</div>
2020-01-01 13:17:19 +08:00
</div>
2020-04-02 23:41:48 +08:00
</div>
2020-01-01 13:17:19 +08:00
</div>
2020-04-02 23:41:48 +08:00
2020-01-01 13:17:19 +08:00
</div>
</div>
2020-04-02 23:41:48 +08:00
</div>
2020-01-01 13:17:19 +08:00
</div>
2020-04-02 23:41:48 +08:00
</div>
2020-01-01 13:17:19 +08:00
{/block}
2020-04-02 23:41:48 +08:00
{block name="js"}
2020-01-01 13:17:19 +08:00
<script>
2020-04-28 18:44:40 +08:00
var setWebSite ="{:url('Set/website')}";
var setEmail ="{:url('Set/email')}";
2020-01-01 13:17:19 +08:00
layui.config({
base: '/static/admin/' //静态资源所在路径
}).extend({
index: 'lib/index' //主入口模块
}).use(['index', 'set', 'upload'], function(){
2020-04-02 23:41:48 +08:00
var $ = layui.$
,form = layui.form
,upload = layui.upload;
var element =layui.element ;
2020-04-02 23:41:48 +08:00
2021-07-07 17:40:43 +08:00
//LOGO选完文件后不自动上传
2020-01-01 13:17:19 +08:00
upload.render({
elem: '#logo-img'
,url: "{:url('admin/set/upload')}"
,data: {type:'image'}
2020-01-01 13:17:19 +08:00
,auto: false
,exts: 'jpg|png|gif|bmp|jpeg'
2020-01-08 17:37:41 +08:00
,size: 1000
2020-01-01 13:17:19 +08:00
//,multiple: true
,bindAction: '#logo-upload-button'
,done: function(res){
if(res.code == 0){
layer.msg(res.msg,{icon:6,tiye:2000
2020-01-01 13:17:19 +08:00
},function(){
location.reload();
});
} else {
layer.open({title:"上传失败",content:res.msg,icon:5,anim:6});
2020-01-01 13:17:19 +08:00
}
}
});
//网站配置
2021-07-22 10:54:03 +08:00
form.on('submit(set_system_config)', function(data){
var field = data.field;
2021-07-22 13:04:54 +08:00
$.post("{:url('admin/set/config')}",field,function(res){
if(res.code == 0){
layer.msg(res.msg,{icon:6,tiye:2000
2021-07-22 13:04:54 +08:00
});
} else {
layer.open({title:"设置失败",content:res.msg,icon:5,anim:6});
}
});
return false;
});
//邮箱发送测试码
form.on('submit(test_system_email)', function(data){
var field = data.field;
$.post("{:url('admin/set/sendMailCode')}",field,function(res){
if(res.code == 0){
layer.msg(res.msg,{icon:6,tiye:2000
2021-07-22 13:04:54 +08:00
});
} else {
layer.open({title:"设置失败",content:res.msg,icon:5,anim:6});
}
});
return false;
});
//邮箱激活
form.on('submit(active_system_email)', function(data){
var field = data.field;
$.post("{:url('admin/set/activeMailServer')}",field,function(res){
if(res.code == 0){
layer.msg(res.msg,{icon:6,tiye:2000
});
} else {
layer.open({title:"设置失败",content:res.msg,icon:5,anim:6});
2021-07-22 13:04:54 +08:00
}
});
2021-07-22 10:54:03 +08:00
return false;
});
//显示当前tab
if(location.hash){
element.tabChange('website-tabs-brief', location.hash.replace(/^#/, ''));
}
element.on('tab(website-tabs-brief)', function(){
var othis = $(this), layid = othis.attr('lay-id');
if(layid){
location.hash = layid;
}
});
2020-04-02 23:41:48 +08:00
2020-01-01 13:17:19 +08:00
});
2020-04-02 23:41:48 +08:00
</script>
{/block}