mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-23 02:45:33 +08:00
128 lines
4.3 KiB
HTML
128 lines
4.3 KiB
HTML
<!--
|
||
Copyright © ShopeX (http://www.shopex.cn). All rights reserved.
|
||
See LICENSE file for license details.
|
||
-->
|
||
|
||
<form id="brandForm" action="index.php?app=openapi&ctl=admin_setting&act=save" method="post">
|
||
<input type="hidden" name="s_id" value="<{$settingInfo.s_id}>">
|
||
<div class="tableform">
|
||
<div class="division">
|
||
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
||
<tr>
|
||
<th><{t}>访问来源名称:<{/t}></th>
|
||
<td><{input type="text" name="name" value=$settingInfo.name vtype="required"}><em><font color='red'>*</font></em></td>
|
||
</tr>
|
||
<{if $settingInfo.code }>
|
||
<tr>
|
||
<th><{t}>标识:<{/t}></th>
|
||
<td><{$settingInfo.code}><em><font color='red'>*</font></em></td>
|
||
</tr>
|
||
<{else}>
|
||
<tr>
|
||
<th><{t}>标识:<{/t}></th>
|
||
<td><{input type="text" name="code" value=$settingInfo.code vtype="required"}><em><font color='red'>*</font></em></td>
|
||
</tr>
|
||
<{/if}>
|
||
<tr>
|
||
<th>接口调用私钥:</th>
|
||
<td><{input type="text" name="interfacekey" value=$settingInfo.interfacekey vtype="required"}> <input type='button' value="随机生成私钥" onclick="genstr();" /><span style='margin-left:5px;'>用于数据接口调用时,签名验证的必要参数,请尽量设置成包含英文、数字、大小写的复杂格式</span></td>
|
||
</tr>
|
||
<tr>
|
||
<th><{t}>Data Mask:<{/t}></th>
|
||
<td>
|
||
<input type="radio" name="is_data_mask" value=1 <{if $settingInfo.is_data_mask == 1}> checked<{/if}>>Y
|
||
<input type="radio" name="is_data_mask" value=0 <{if $settingInfo.is_data_mask == 0 || !$settingInfo.is_data_mask}> checked<{/if}>>N<em><font color='red'>*</font></em>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th><{t}>访问权限:<{/t}></th>
|
||
<td>
|
||
<{tabber}>
|
||
<{foreach from=$configLists item=group key=service}>
|
||
<{tab name=$service }>
|
||
<h4>全选 <input type="checkbox" name="selectall" class='selectall'></h4>
|
||
<{foreach from=$group item=config key=key}>
|
||
<h4><{$config.label}>:</h4>
|
||
<div style="padding-left:15px;">
|
||
<{foreach from=$config.methods item=method key=k}>
|
||
<input type="checkbox" class="config" name="config[<{$key}>][]" value="<{$k}>" <{if is_array($settingInfo.config[$key]) && $k|in_array:$settingInfo.config[$key]}>checked=checked<{/if}>/><label style='padding:0px 2px 0px 5px'><{$method}>(<{$k}>)</label>
|
||
<{/foreach}>
|
||
</div>
|
||
<{/foreach}>
|
||
</div>
|
||
<{/tab}>
|
||
<{/foreach}>
|
||
<{/tabber}>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th><{t}>状态:<{/t}></th>
|
||
<td>
|
||
<input type="radio" name="status" value=1 <{if $settingInfo.status == 1}> checked<{/if}>>开启
|
||
<input type="radio" name="status" value=0 <{if $settingInfo.status == 0}> checked<{/if}>>关闭<em><font color='red'>*</font></em>
|
||
</td>
|
||
</tr>
|
||
</table>
|
||
</div>
|
||
|
||
<div class="table-action">
|
||
<{button type="submit" id="btn-brand" label="保存"}>
|
||
</div>
|
||
|
||
</form>
|
||
<script>
|
||
|
||
$('brandForm').store('target',{
|
||
onRequest:function(){
|
||
$('btn-brand').set('disabled', 'true');
|
||
},
|
||
onComplete:function(jsontext){
|
||
var json = Json.evaluate(jsontext);
|
||
if (typeof(json.error) != 'undefined'){
|
||
$('btn-brand').set('disabled', '');
|
||
}else{
|
||
$('btn-brand').set('disabled', 'true');
|
||
if(opener && opener.finderGroup && opener.finderGroup['<{$env.get.finder_id}>']){
|
||
opener.finderGroup['<{$env.get.finder_id}>'].refresh.delay(400,opener.finderGroup['<{$env.get.finder_id}>']);
|
||
window.close();
|
||
}
|
||
}
|
||
}
|
||
});
|
||
|
||
<{if $env.get._finder_name}>
|
||
$('brandForm').store('target',{
|
||
update:'messagebox'
|
||
});
|
||
<{/if}>
|
||
|
||
function genstr(){
|
||
var len = 32;
|
||
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnoprstuvwxyz';
|
||
var maxPos = chars.length;
|
||
var pwd = '';
|
||
for (i = 0; i < len; i++) {
|
||
pwd += chars.charAt(Math.floor(Math.random() * maxPos));
|
||
}
|
||
$('brandForm').getElement("input[name='interfacekey']").set('value',pwd);
|
||
}
|
||
|
||
$$('.selectall').each(function(item) {
|
||
item.addEvent('click',function(e){
|
||
if (this.checked){
|
||
this.getParent('div').getElements('.config').each(function(c){
|
||
|
||
c.set('checked','checked')
|
||
}
|
||
);
|
||
}else{
|
||
this.getParent('div').getElements('.config').each(function(c){
|
||
|
||
c.set('checked','')
|
||
}
|
||
);
|
||
}
|
||
});
|
||
});
|
||
</script>
|