Files
OMS/app/openapi/view/admin/setting/detail.html
2026-01-04 19:08:31 +08:00

139 lines
4.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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"}>&nbsp;<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>