zioinfo-mail/workspace/zioinfo-esn/restapi_lgit/target/ROOT/management/permission.html
DESKTOP-TKLFCPR\ython 371f77e7ab
Some checks failed
GUARDiA CI / Python Lint & Import Test (push) Has been cancelled
GUARDiA CI / Validate Install Scripts (push) Has been cancelled
GUARDiA CI / PR Validation Summary (push) Has been cancelled
fix(enhance-v4): APK QR 버그 수정 + 웹메일 라우터 수정
2026-06-02 20:23:55 +09:00

383 lines
12 KiB
HTML

<div id="permission_contents">
<ul id="permision_tab" class="tab tab-top">
<li><a href="#administrator" id="perm_admin">Administrator</a></li>
<li><a href="#manager" id="perm_mgr">Manager</a></li>
<li><a href="#user" id="perm_user">User</a></li>
</ul>
<div id="permission_tab_contents">
<div id="administrator"></div>
<div id="manager"></div>
<div id="user"></div>
</div>
</div>
<script type="text/javascript">
var permision_tab
, permission_tab_loading;
jui.ready([ "ui.modal" ], function(modal) {
permission_tab_loading = modal('#loading', {
target: '#permission_contents',
opacity: 0.1,
autoHide: false
});
});
jui.ready([ "uix.tab" ], function(tab) {
permision_tab = tab("#permision_tab", {
event: {
change: function(data) {
switch(data.index) {
case 0:
fnGetConfigList(1, 'administrator');
break;
case 1:
fnGetConfigList(2, 'manager');
break;
case 2:
fnGetConfigList(3, 'user');
break;
}
}
},
target: "#permission_tab_contents",
index: 0
});
});
function fnGetConfigList(lev_code, target) {
var menu_code
, parent_code
, depth
, info
, cnt;
permission_tab_loading.show();
$.ajax({
url: '/restapi/menu/config_list'
, type: 'POST'
, data: {
'level_code': lev_code
}, success : function(json) {
var html = '<table width="100%" cellpadding="0" cellspacing="0" border="0">\r\n'
+'<colgroup>\r\n';
+' <col width="32%" />\r\n'
+' <col width="2%" />\r\n'
+' <col width="32%" />\r\n'
+' <col width="2%" />\r\n'
+' <col width="32%" />\r\n';
+'</colgroup>\r\n'
+'<tr>\r\n';
for(var i = 0; i < json.length; i ++) {
menu_code = json[i].menu_code;
parent_code = json[i].parent_code;
depth = json[i].depth;
info = json[i].info;
cnt = json[i].cnt;
// if(authObj.lev_code == 0) {
if (depth == 1) {
if (i > 0) {
html += ''
+' </table>\r\n'
+' </div>\r\n'
+' </div>\r\n'
+' </td>\r\n'
+' <td></td>\r\n'
}
html += ''
+' <td style="vertical-align:top;">\r\n'
+' <div class="panel">\r\n'
+' <div class="head"><input type="checkbox" name="menu_code" id="menu_code_'+ lev_code +'_'+ menu_code +'" value="'+ menu_code +'" onclick="fnCheckChildMenu('+ lev_code +', '+ menu_code +');" ';
if (cnt == 1) html += ' checked=\'checked\'';
html += ''
+' /> '+ locale[info]
+'&nbsp;&nbsp;<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="menu_icon_'+ lev_code +'_'+ menu_code +'"></i>'
+'</div>'
+' <div class="body" style="height:160px;">\r\n'
+' <table width="100%" border="0">\r\n'
+' <colgroup>\r\n'
+' <col width="10" />\r\n'
+' <col width="*" />\r\n'
+' </colgroup>\r\n'
} else {
html += ''
+' <tr>\r\n'
+' <td></td>\r\n'
+' <td><input type="checkbox" name="menu_code" id="menu_code_'+ lev_code +'_'+ menu_code +'" value="'+ menu_code +'" onclick="fnCheckParentMenu('+ lev_code +', '+ menu_code +', '+ parent_code +');" ';
if (cnt == 1) html += ' checked=\'checked\'';
html += ''
+' /> '+ locale[info] +'</td>\r\n'
+' </tr>\r\n';
}
// }else {
// if(menu_code < 40) {
// if (depth == 1) {
// if (i > 0) {
// html += ''
// +' </table>\r\n'
// +' </div>\r\n'
// +' </div>\r\n'
// +' </td>\r\n'
// +' <td></td>\r\n'
// }
// html += ''
// +' <td style="vertical-align:top;">\r\n'
// +' <div class="panel">\r\n'
// +' <div class="head"><input type="checkbox" name="menu_code" id="menu_code_'+ lev_code +'_'+ menu_code +'" value="'+ menu_code +'" onclick="fnCheckChildMenu('+ lev_code +', '+ menu_code +');" ';
// if (cnt == 1) html += ' checked=\'checked\'';
// html += ''
// +' /> '+ locale[info]
// +'&nbsp;&nbsp;<i class="icon-help" style="color:gray;font-size: 20px; vertical-align:middle;" id="menu_icon_'+ lev_code +'_'+ menu_code +'"></i>'
// +'</div>'
// +' <div class="body" style="height:160px;">\r\n'
// +' <table width="100%" border="0">\r\n'
// +' <colgroup>\r\n'
// +' <col width="10" />\r\n'
// +' <col width="*" />\r\n'
// +' </colgroup>\r\n'
// } else {
// html += ''
// +' <tr>\r\n'
// +' <td></td>\r\n'
// +' <td><input type="checkbox" name="menu_code" id="menu_code_'+ lev_code +'_'+ menu_code +'" value="'+ menu_code +'" onclick="fnCheckParentMenu('+ lev_code +', '+ menu_code +', '+ parent_code +');" ';
// if (cnt == 1) html += ' checked=\'checked\'';
// html += ''
// +' /> '+ locale[info] +'</td>\r\n'
// +' </tr>\r\n';
// }
// }
// }
}
html += ''
+' </table>\r\n'
+' </div>\r\n'
+' </div>\r\n'
+' </td>\r\n'
+'</tr>\r\n'
+'</table>\r\n'
+'<div class="" style="text-align:right;padding-top:5px;float:right">\r\n'
+' <a class="btn btn-gray" id="btn_permission_'+ target +'_save" onclick="fnSetMenuAdd(\''+ lev_code +'\', \''+ target +'\');">' + locale.save + '</a>\r\n'
+' <a class="btn btn-gray" id="btn_refresh_'+ target + '" onclick="fnSetRefresh(\''+ lev_code +'\', \''+ target +'\');">' + locale.refresh + '</a>\r\n'
+'</div>\r\n';
$('#'+ target).html(html);
permission_tab_loading.hide();
jui.ready([ "ui.tooltip" ], function(tooltip) {
tooltip_icon_20 = tooltip("#menu_icon_1_20", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_20
});
tooltip_icon_20 = tooltip("#menu_icon_2_20", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_20
});
tooltip_icon_20 = tooltip("#menu_icon_3_20", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_20
});
tooltip_icon_30 = tooltip("#menu_icon_1_30", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_30
});
tooltip_icon_30 = tooltip("#menu_icon_2_30", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_30
});
tooltip_icon_30 = tooltip("#menu_icon_3_30", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_30
});
tooltip_icon_40 = tooltip("#menu_icon_1_40", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_40
});
tooltip_icon_40 = tooltip("#menu_icon_2_40", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_40
});
tooltip_icon_40 = tooltip("#menu_icon_3_40", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_40
});
tooltip_btn_permission_administrator = tooltip("#btn_permission_administrator_save", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_permission_user_save
});
tooltip_btn_permission_manager = tooltip("#btn_permission_manager_save", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_permission_user_save
});
tooltip_btn_permission_user = tooltip("#btn_permission_user_save", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_permission_user_save
});
tooltip_btn_refresh = tooltip("#btn_refresh_administrator", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_permission_refresh
});
tooltip_btn_refresh = tooltip("#btn_refresh_manager", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_permission_refresh
});
tooltip_btn_refresh = tooltip("#btn_refresh_user", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_btn_permission_refresh
});
});
}, error:function(request,status,err){
permission_tab_loading.hide();
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
function fnSetRefresh(level_code, target) {
fnGetConfigList(level_code, target)
}
function fnSetMenuAdd(level_code, target) {
var menu_code = $('#'+ target +' input:checkbox[name=menu_code]:checked').map(function() {
return $(this).val();
}).get().join(',');
$.ajax({
url: '/restapi/menu/menu_add'
, type: 'POST'
, data: {
'level_code': level_code
, 'arr_menu_code': menu_code
}, success : function(json) {
if(json.result.toLowerCase() == 'success') {
alertify.success(locale[json.result]);
fnGetConfigList(level_code, target);
}else {
alertify.error(locale[json.result]);
}
}, error:function(request,status,err){
if (request.status == 0) {
alertify.error(locale.server_not_run);
} else {
// alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+err);
alert(locale.service_error + "(" + request.status + ")");
}
}
});
}
function fnCheckParentMenu(level_code, menu_code, parent_code) {
if ($('#menu_code_'+ level_code +'_'+ menu_code).is(':checked')) {
if (!$('#menu_code_'+ level_code +'_'+ parent_code).is(':checked')) {
$('#menu_code_'+ level_code +'_'+ parent_code).attr('checked', 'checked');
}
}
}
function fnCheckChildMenu(level_code, menu_code) {
if ($('#menu_code_'+ level_code +'_'+ menu_code).is(':checked')) {
for(var i = 1; i < 10; i ++) {
if (!$('#menu_code_'+ level_code +'_'+ (menu_code + i)).is(':checked'))
$('#menu_code_'+ level_code +'_'+ (menu_code + i)).attr('checked', 'checked');
}
} else {
for(var i = 1; i < 10; i ++) {
$('#menu_code_'+ level_code +'_'+ (menu_code + i)).removeAttr('checked');
}
}
}
$(function() {
fnGetConfigList(1, 'administrator');
});
jui.ready([ "ui.tooltip" ], function(tooltip) {
tooltip_perm_admin = tooltip("#perm_admin", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_perm_admin
});
tooltip_perm_mgr = tooltip("#perm_mgr", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_perm_mgr
});
tooltip_perm_user = tooltip("#perm_user", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_perm_user
});
tooltip_icon_20 = tooltip("#menu_icon_20", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_20
});
tooltip_icon_30 = tooltip("#menu_icon_30", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_30
});
tooltip_icon_40 = tooltip("#menu_icon_40", {
position: "top",
width: 400,
align: "left",
title: locale.tooltip_icon_40
});
});
$('#perm_admin').text(locale.administrator);
$('#perm_mgr').text(locale.manager);
$('#perm_user').text(locale.user);
</script>