mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
139 lines
6.4 KiB
PHP
139 lines
6.4 KiB
PHP
{extend name="extra@admin/content"}
|
||
|
||
{block name="content"}
|
||
<form onsubmit="return false;" action="__SELF__" data-auto="true" method="post"
|
||
class='form-horizontal' style='padding-top:20px'>
|
||
|
||
<div class="form-group">
|
||
<label class="col-sm-2 control-label">Storage <span class="nowrap">(存储引擎)</span></label>
|
||
<div class='col-sm-8'>
|
||
<select class="layui-input" name="storage_type" required="required">
|
||
{if sysconf('storage_type')!=='qiniu'}
|
||
<option selected value='local'>本地服务器</option>
|
||
<option value='qiniu'>七牛云存储</option>
|
||
{else}
|
||
<option value='local'>本地服务器</option>
|
||
<option selected value='qiniu'>七牛云存储</option>
|
||
{/if}
|
||
</select>
|
||
<div class="help-block" data-storage-type="qiniu">
|
||
若还没有七牛云帐号,请点击
|
||
<a target="_blank" href="https://portal.qiniu.com/signup?code=3lhz6nmnwbple">免费申请10G存储空间</a>,
|
||
申请成功后添加公开bucket空间
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="hr-line-dashed" data-storage-type="qiniu"></div>
|
||
|
||
<div class="form-group" data-storage-type="qiniu">
|
||
<label class="col-sm-2 control-label">Region <span class="nowrap">(存储区域)</span></label>
|
||
<div class='col-sm-8'>
|
||
<select class="layui-input" name="storage_qiniu_region" required="required">
|
||
|
||
{if sysconf('storage_qiniu_region') eq '华东'}
|
||
<option selected value='华东'>华东</option>
|
||
{else}
|
||
<option value='华东'>华东</option>
|
||
{/if}
|
||
|
||
{if sysconf('storage_qiniu_region') eq '华北'}
|
||
<option selected value='华北'>华北</option>
|
||
{else}
|
||
<option value='华北'>华北</option>
|
||
{/if}
|
||
|
||
{if sysconf('storage_qiniu_region') eq '华南'}
|
||
<option selected value='华南'>华南</option>
|
||
{else}
|
||
<option value='华南'>华南</option>
|
||
{/if}
|
||
|
||
{if sysconf('storage_qiniu_region') eq '北美'}
|
||
<option selected value='北美'>北美</option>
|
||
{else}
|
||
<option value='北美'>北美</option>
|
||
{/if}
|
||
|
||
</select>
|
||
<p class="help-block">七牛云存储空间所在区域,需要严格对应储存所在区域才能上传文件</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group" data-storage-type="qiniu">
|
||
<label class="col-sm-2 control-label">Protocol <span class="nowrap">(访问协议)</span></label>
|
||
<div class='col-sm-8'>
|
||
<select class="layui-input" name="storage_qiniu_is_https" required="required">
|
||
{if sysconf('storage_qiniu_is_https')!=='1'}
|
||
<option selected value='0'>HTTP</option>
|
||
<option value='1'>HTTPS</option>
|
||
{else}
|
||
<option value='0'>HTTP</option>
|
||
<option selected value='1'>HTTPS</option>
|
||
{/if}
|
||
</select>
|
||
<p class="help-block">七牛云资源访问协议(HTTP 或 HTTPS),HTTPS 需要配置证书才能使用</p>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-group" data-storage-type="qiniu">
|
||
<label class="col-sm-2 control-label">Bucket <span class="nowrap">(空间名称)</span></label>
|
||
<div class='col-sm-8'>
|
||
<input type="text" name="storage_qiniu_bucket" required="required" title="请输入七牛云存储 Bucket (空间名称)"
|
||
placeholder="请输入七牛云存储 Bucket (空间名称)" value="{:sysconf('storage_qiniu_bucket')}"
|
||
class="layui-input">
|
||
<p class="help-block">填写七牛云存储空间名称,如:static</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group" data-storage-type="qiniu">
|
||
<label class="col-sm-2 control-label">Domain <span class="nowrap">(访问域名)</span></label>
|
||
<div class='col-sm-8'>
|
||
<input type="text" name="storage_qiniu_domain" required="required" title="请输入七牛云存储 Domain (访问域名)"
|
||
placeholder="请输入七牛云存储 Domain (访问域名)" value="{:sysconf('storage_qiniu_domain')}"
|
||
class="layui-input">
|
||
<p class="help-block">填写七牛云存储访问域名,如:static.ctolog.cc</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group" data-storage-type="qiniu">
|
||
<label class="col-sm-2 control-label">AccessKey <span class="nowrap">(访问密钥)</span></label>
|
||
<div class='col-sm-8'>
|
||
<input type="text" name="storage_qiniu_access_key" required="required" title="请输入七牛云 AccessKey (访问密钥)"
|
||
placeholder="请输入七牛云 AccessKey (访问密钥)" value="{:sysconf('storage_qiniu_access_key')}"
|
||
class="layui-input">
|
||
<p class="help-block">可以在 七牛云 个人中心 设置并获取到访问密钥</p>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="form-group" data-storage-type="qiniu">
|
||
<label class="col-sm-2 control-label">SecretKey <span class="nowrap">(安全密钥)</span></label>
|
||
<div class='col-sm-8'>
|
||
<input type="password" name="storage_qiniu_secret_key" required="required" title="请输入七牛云 SecretKey (安全密钥)"
|
||
placeholder="请输入七牛云 SecretKey (安全密钥)" value="{:sysconf('storage_qiniu_secret_key')}"
|
||
maxlength="43" class="layui-input">
|
||
<p class="help-block">可以在 七牛云 个人中心 设置并获取到安全密钥</p>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="hr-line-dashed"></div>
|
||
|
||
<div class="col-sm-4 col-sm-offset-2">
|
||
<div class="layui-form-item text-center">
|
||
<button class="layui-btn" type="submit">保存配置</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
{/block}
|
||
|
||
{block name="script"}
|
||
<script>
|
||
$(function () {
|
||
$('[name="storage_type"]').on('change', function () {
|
||
$("[data-storage-type]").not($("[data-storage-type='" + $(this).val() + "']").show()).hide();
|
||
}).trigger('change');
|
||
});
|
||
</script>
|
||
{/block} |