init
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/approval/apprequest/prodAppRequestMan.json" />';
|
||||
var url_view = '<c:url value="/onl/apim/approval/apprequest/prodAppRequestMan.view" />';
|
||||
$(document).ready(function() {
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: {
|
||||
cmd: 'LIST',
|
||||
},
|
||||
colNames: ['id', '기관명 ', '상태', '생성일'],
|
||||
colModel: [
|
||||
{name: 'id', align: 'center', key: true, hidden: true},
|
||||
{
|
||||
name: 'org.orgName',
|
||||
align: 'center',
|
||||
width: 150,
|
||||
label: '기업명'
|
||||
},
|
||||
{
|
||||
name: 'status',
|
||||
align: 'center',
|
||||
width: 80,
|
||||
formatter: function(cellvalue) {
|
||||
const statusMap = {
|
||||
'PENDING': '대기중',
|
||||
'APPROVED': '승인',
|
||||
'REJECTED': '반려',
|
||||
'CANCELED': '취소'
|
||||
};
|
||||
return statusMap[cellvalue] || cellvalue;
|
||||
}
|
||||
},
|
||||
{name: 'createdDate', align: 'center', width: 120}
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
pager: $('#pager'),
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
viewrecords: true,
|
||||
autowidth: true,
|
||||
height: 'auto',
|
||||
ondblClickRow: function(rowId) {
|
||||
var rowData = $(this).getRowData(rowId);
|
||||
var id = rowData['id'];
|
||||
var approvalType = rowData['approvalType'];
|
||||
var args = {};
|
||||
var url2 = url_view;
|
||||
url2 += '?cmd=DETAIL';
|
||||
url2 += '&menuId=' + '${param.menuId}';
|
||||
url2 += '&type=' + approvalType;
|
||||
url2 += '&id=' + id;
|
||||
|
||||
showModal(url2, args, 800, 650, function() {
|
||||
$("#grid").trigger("reloadGrid");
|
||||
});
|
||||
},
|
||||
loadError: function(jqXHR, textStatus, errorThrown) {
|
||||
var location = '<%=request.getContextPath()%>/';
|
||||
comloadError(jqXHR, textStatus, errorThrown, location);
|
||||
}
|
||||
});
|
||||
|
||||
resizeJqGridWidth('grid', 'content_middle', '1000');
|
||||
|
||||
$("#btn_search").click(function() {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST");
|
||||
$("#grid").setGridParam({url: url, postData: postData, page: 1}).trigger("reloadGrid");
|
||||
});
|
||||
|
||||
$("select[name^=search], input[name^=search]").keydown(function(key) {
|
||||
if (key.keyCode == 13) {
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle" id="content_middle">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="title">운영 인증키 요청 목록<span class="tooltip">운영 인증키 요청을 관리합니다.</span></div>
|
||||
<form id="ajaxForm" onsubmit="return false;">
|
||||
<table class="search_condition" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:10%;">승인 상태</th>
|
||||
<td style="width:15%;">
|
||||
<div class="select-style">
|
||||
<select name="searchStatus">
|
||||
<option value="">전체</option>
|
||||
<option value="PENDING">대기중</option>
|
||||
<option value="CANCELED">취소됨</option>
|
||||
<option value="DENIED">반려됨</option>
|
||||
<option value="APPROVED">승인됨</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,129 @@
|
||||
<%@ page contentType="text/html; charset=utf-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title>운영 인증키 요청 상세</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/approval/apprequest/prodAppRequestMan.json" />';
|
||||
var url_view = '<c:url value="/onl/apim/approval/apprequest/prodAppRequestMan.view" />';
|
||||
let appRequest = null;
|
||||
|
||||
$(document).ready(function() {
|
||||
var key = "${param.id}";
|
||||
if (key) {
|
||||
detail(key);
|
||||
}
|
||||
|
||||
$("#btn_close").click(function() {
|
||||
window.close();
|
||||
});
|
||||
|
||||
$("#btn_save").click(function() {
|
||||
console.log(appRequest);
|
||||
|
||||
if (confirm("변경하시겠습니까?")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {cmd: "UPDATE", id: key, apiList: JSON.stringify(appRequest.apiList), status :$("#approvalStatus").val()},
|
||||
success: function(args) {
|
||||
alert("변경되었습니다.");
|
||||
window.opener.location.reload();
|
||||
window.close();
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function detail(key) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'DETAIL', id: key},
|
||||
success: function(json) {
|
||||
var data = json;
|
||||
appRequest = json;
|
||||
$("#approvalStatus").val(data.status);
|
||||
$("#requesterOrg").text(data.org.orgName);
|
||||
$("#reason").text(data.reason);
|
||||
$("#createdDate").text(data.createdDate).inputmask("9999-99-99 99:99:99", {'autoUnmask': true});
|
||||
|
||||
var apisHtml = "";
|
||||
for (var i = 0; i < data.apiList.length; i++) {
|
||||
var api = data.apiList[i];
|
||||
apisHtml += "<tr>";
|
||||
apisHtml += "<td>" + api.apiName + "</td>";
|
||||
apisHtml += "</tr>";
|
||||
}
|
||||
$("#apisTable tbody").html(apisHtml);
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="popup_box">
|
||||
<div class="title" id="approvalSubject" style="margin-top: 15px;"></div>
|
||||
<%--제목--%>
|
||||
<div class="popup_content">
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th>요청 기관</th>
|
||||
<td><span id="requesterOrg"></span></td>
|
||||
<th style="width:20%;">처리 상태</th>
|
||||
<td style="width:30%;">
|
||||
<select id="approvalStatus" style="width:100%" >
|
||||
<option value="PENDING">대기중</option>
|
||||
<option value="APPROVED">승인</option>
|
||||
<option value="DENIED">반려</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>요청일자</th>
|
||||
<td><span id="createdDate"></span></td>
|
||||
<th></th>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>요청 사유</th>
|
||||
<td colspan="3"><span id="reason"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="title">API 목록</div>
|
||||
<table id="apisTable" class="table_row" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>API 이름</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="popup_button">
|
||||
<button type="button" class="cssbtn" id="btn_save" level="W"><i class="material-icons">check</i>저장</button>
|
||||
<button type="button" class="cssbtn" id="btn_close" level="R"><i class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,138 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>s
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/approval/credential/credentialMan.json" />';
|
||||
var url_view = '<c:url value="/onl/apim/approval/credential/credentialMan.view" />';
|
||||
|
||||
$(document).ready(function () {
|
||||
var gridPostData = getSearchForJqgrid("cmd", "LIST");
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: gridPostData,
|
||||
colNames: [
|
||||
'clientid',
|
||||
'법인 명',
|
||||
'서버',
|
||||
'<%= localeMessage.getString("clntMan.clntNm") %>',
|
||||
'APP 상태'
|
||||
],
|
||||
colModel: [
|
||||
{name: 'clientid', key: true, hidden: true },
|
||||
{name: 'orgname', align: 'left', sortable: false},
|
||||
{name: 'server', align: 'center', sortable: false},
|
||||
{name: 'clientname', align: 'left', sortable: false},
|
||||
{
|
||||
name: 'appstatus',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
formatter: function (cellvalue, options, rowObject) {
|
||||
return cellvalue === '0' ? '차단' : '정상';
|
||||
}
|
||||
}
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
pager: $('#pager'),
|
||||
page: '${param.page}',
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: $("#container").height(),
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
ondblClickRow: function (rowId) {
|
||||
var rowData = $(this).getRowData(rowId);
|
||||
var url2 = url_view;
|
||||
url2 += '?cmd=DETAIL';
|
||||
url2 += '&page=' + $(this).getGridParam("page");
|
||||
url2 += '&returnUrl=' + getReturnUrl();
|
||||
url2 += '&menuId=' + '${param.menuId}';
|
||||
url2 += '&' + getSearchUrl();
|
||||
url2 += '&clientId=' + rowData['clientid'];
|
||||
goNav(url2);
|
||||
}
|
||||
});
|
||||
|
||||
resizeJqGridWidth('grid', 'content_middle', '1000');
|
||||
|
||||
$("#btn_search").click(function () {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST"); //jqgrid에서는 object 로
|
||||
$("#grid").setGridParam({postData: postData, page: "1"}).trigger("reloadGrid");
|
||||
|
||||
});
|
||||
<%--$("#btn_new").click(function () {--%>
|
||||
<%-- var url2 = url_view;--%>
|
||||
<%-- url2 += '?cmd=DETAIL';--%>
|
||||
<%-- url2 += '&page=' + $("#grid").getGridParam("page");--%>
|
||||
<%-- url2 += '&returnUrl=' + getReturnUrl();--%>
|
||||
<%-- url2 += '&menuId=' + '${param.menuId}';--%>
|
||||
<%-- //검색값--%>
|
||||
<%-- url2 += '&' + getSearchUrl();--%>
|
||||
<%-- goNav(url2);--%>
|
||||
<%--});--%>
|
||||
|
||||
$("input[name^=search]").keydown(function (key) {
|
||||
if (key.keyCode == 13) {
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle" id="content_middle">
|
||||
<div class="search_wrap">
|
||||
<%-- <button type="button" class="cssbtn" id="btn_new" level="W"><i--%>
|
||||
<%-- class="material-icons">add</i> <%= localeMessage.getString("button.new") %>--%>
|
||||
<%-- </button>--%>
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i
|
||||
class="material-icons">search</i> <%= localeMessage.getString("button.search") %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="title" id="title">${rmsMenuName}</div>
|
||||
|
||||
<table class="search_condition" cellspacing=0;>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:180px;"><%= localeMessage.getString("clntMan.clntNm") %>
|
||||
</th>
|
||||
<td><input type="text" name="searchClientName" value="${param.searchClientName}"></td>
|
||||
<th style="width:180px;"><%= localeMessage.getString("clntMan.clntId") %>
|
||||
</th>
|
||||
<td><input type="text" name="searchClientId" value="${param.searchClientId}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,403 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/approval/credential/credentialMan.json" />';
|
||||
var api_url_view = '<c:url value="/onl/apim/apigroup/apiGroupMan.view" />';
|
||||
var group_url_view = '<c:url value="/onl/admin/authserver/clientMan.view" />';
|
||||
|
||||
var isDetail = false;
|
||||
|
||||
function isValid() {
|
||||
if ($('input[name=clientname]').val() == "") {
|
||||
alert("CLIENT명을 입력하여 주십시요.");
|
||||
$('input[name=clientname]').focus();
|
||||
return false;
|
||||
}
|
||||
if ($('input[name=clientId]').val() == "") {
|
||||
alert("CLIENT 아이디를 입력하여 주십시요.");
|
||||
$('input[name=clientId]').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function detail(key) {
|
||||
if (!isDetail) return;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'DETAIL', clientId: key},
|
||||
success: function (json) {
|
||||
var apiList = json["apiList"];
|
||||
$("#selectedApiGrid").jqGrid("clearGridData");
|
||||
$("#selectedApiGrid")[0].addJSONData(apiList);
|
||||
|
||||
var data = json;
|
||||
$("#btn_gen_id").hide();
|
||||
$('input[name=clientId]').css('width', '100%');
|
||||
$('input[name=clientid]').attr('readonly', true);
|
||||
$('input[name=clientname]').attr('readonly', true);
|
||||
$("#btn_clientId_byte").hide();
|
||||
$("#btn_gen_secret").hide();
|
||||
$('input[name=clientSecret]').css('width', '100%');
|
||||
$('input[name=clientSecret]').attr('readonly', true);
|
||||
$("#btn_clientSecret_byte").hide();
|
||||
$('select[name=orgid]').prop('disabled', true);
|
||||
|
||||
$("#ajaxForm input[type!=checkbox],#ajaxForm select,#ajaxForm textarea").each(function () {
|
||||
var name = $(this).attr("name");
|
||||
var tag = $(this).prop("tagName").toLowerCase();
|
||||
$(tag + "[name=" + name + "]").val(data[name]);
|
||||
});
|
||||
|
||||
// Set the appStatus dropdown value
|
||||
if (json.appstatus !== undefined && json.appstatus !== null) {
|
||||
$('select[name=appStatus]').val(json.appstatus);
|
||||
} else {
|
||||
$('select[name=appStatus]').val('1'); // Set to normal if no value
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init(key, callback) {
|
||||
|
||||
var selectedApiGrid = $("#selectedApiGrid");
|
||||
selectedApiGrid.jqGrid({
|
||||
datatype: "local",
|
||||
colNames: ['API ID', 'API 이름'],
|
||||
colModel: [
|
||||
{name: 'apiId', index: 'apiId', width: 100, align: 'center'},
|
||||
{name: 'apiName', index: 'apiName', width: 100, align: 'center'}
|
||||
],
|
||||
rowNum: 10,
|
||||
rowList: [10, 20, 30],
|
||||
pager: '#selectedApiGridPager',
|
||||
sortname: 'apiId',
|
||||
viewrecords: true,
|
||||
sortorder: "asc",
|
||||
caption: "선택된 API",
|
||||
height: 200,
|
||||
autowidth: true,
|
||||
// multiselect: true,
|
||||
ondblClickRow: function (rowid, status, e) {
|
||||
// selectedApiGrid.jqGrid('delRowData', rowid);
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'LIST_DETAIL_COMBO'},
|
||||
success: function (json) {
|
||||
json.portalOrgList.unshift({
|
||||
id: "", // 실제 저장될 값은 빈 문자열
|
||||
orgName: "미분류" // 화면에 표시될 텍스트
|
||||
});
|
||||
new makeOptions("id", "orgName")
|
||||
.setObj($("select[name=orgid]"))
|
||||
.setFormat(nameOptionFormat)
|
||||
.setData(json.portalOrgList).rendering();
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
callback(key);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
var returnUrl = getReturnUrlForReturn();
|
||||
var key = "${param.clientId}";
|
||||
if (key != "" && key != "null") {
|
||||
isDetail = true;
|
||||
}
|
||||
init(key, detail);
|
||||
|
||||
$("#btn_modify").click(function () {
|
||||
if (!isValid()) {
|
||||
return;
|
||||
}
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
if (isDetail) {
|
||||
postData.push({name: "cmd", value: "UPDATE"});
|
||||
} else {
|
||||
postData.push({name: "cmd", value: "INSERT"});
|
||||
}
|
||||
|
||||
var data = $("#selectedApiGrid").getRowData();
|
||||
var gridData = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
gridData.push({apiId: data[i]['apiId']});
|
||||
}
|
||||
|
||||
const orgName = $("select[name=orgid] option:selected").text();
|
||||
postData.push({
|
||||
name: "orgname",
|
||||
value: orgName
|
||||
});
|
||||
|
||||
postData.push({
|
||||
name: "apiList",
|
||||
value: JSON.stringify(gridData)
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postData,
|
||||
success: function (args) {
|
||||
alert("저장 되었습니다.");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_delete").click(function () {
|
||||
if (confirm("삭제하시겠습니까?")) {
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
postData.push({name: "cmd", value: "DELETE"});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postData,
|
||||
success: function (args) {
|
||||
if (args.status == "error") {
|
||||
alert("동기화중 오류입니다.\n확인하여 주십시요.\n" + args.message);
|
||||
} else {
|
||||
alert("삭제 되었습니다.");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_popup_api").click(function () {
|
||||
const args = {};
|
||||
const url2 = api_url_view += "?cmd=POPUP";
|
||||
showModal(url2, args, 1280, 860, function () {
|
||||
const popupFrame = args.self.frames[0];
|
||||
const returnValue = popupFrame.returnValue;
|
||||
const frameElement = popupFrame.frameElement
|
||||
const parentElement = frameElement.parentNode; // 부모 노드를 가져옴
|
||||
|
||||
if (parentElement) { // 부모 노드가 존재하는지 확인
|
||||
parentElement.removeChild(frameElement);
|
||||
}
|
||||
|
||||
var rows = $("#selectedApiGrid").jqGrid('getRowData');
|
||||
console.log(returnValue);
|
||||
|
||||
const apiId = returnValue.apiId;
|
||||
var apiIdExists = rows.some(function (row) {
|
||||
return row.apiId === apiId;
|
||||
});
|
||||
|
||||
if (apiIdExists) {
|
||||
return;
|
||||
}
|
||||
returnValue.apiName = returnValue.apiDesc;
|
||||
var ids = $("#selectedApiGrid").jqGrid('getDataIDs');
|
||||
var lastId = ids.length > 0 ? Math.max.apply(Math, ids) : 0;
|
||||
var newId = lastId + 1;
|
||||
$("#selectedApiGrid").jqGrid('addRowData', newId, returnValue, "last");
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_popup_api_group").click(function () {
|
||||
const args = {};
|
||||
const url2 = group_url_view += "?cmd=GROUP_POPUP";
|
||||
showModal(url2, args, 1280, 860, function () {
|
||||
const popupFrame = args.self.frames[0];
|
||||
const returnValue = popupFrame.returnValue;
|
||||
const frameElement = popupFrame.frameElement
|
||||
const parentElement = frameElement.parentNode; // 부모 노드를 가져옴
|
||||
|
||||
if (parentElement) { // 부모 노드가 존재하는지 확인
|
||||
parentElement.removeChild(frameElement);
|
||||
}
|
||||
|
||||
var rows = $("#selectedApiGrid").jqGrid('getRowData');
|
||||
console.log(returnValue);
|
||||
if (!returnValue.apiGroupApiList || returnValue.apiGroupApiList.length === 0) {
|
||||
return; // If apiGroupApiList is empty, do nothing
|
||||
}
|
||||
|
||||
returnValue.apiGroupApiList.forEach(function (apiGroupApi) {
|
||||
const apiId = apiGroupApi.apiId;
|
||||
var apiIdExists = rows.some(function (row) {
|
||||
return row.apiId === apiId;
|
||||
});
|
||||
|
||||
if (apiIdExists) {
|
||||
return;
|
||||
}
|
||||
apiGroupApi.apiName = apiGroupApi.apiDesc;
|
||||
var ids = $("#selectedApiGrid").jqGrid('getDataIDs');
|
||||
var lastId = ids.length > 0 ? Math.max.apply(Math, ids) : 0;
|
||||
var newId = lastId + 1;
|
||||
$("#selectedApiGrid").jqGrid('addRowData', newId, apiGroupApi, "last");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_delete_api").click(function () {
|
||||
var grid = $("#selectedApiGrid");
|
||||
var selectedRowIds = grid.jqGrid('getGridParam', 'selarrrow'); // 선택된 행의 ID 배열을 가져옴
|
||||
if (selectedRowIds.length > 0) {
|
||||
// 선택된 행의 ID를 복사한 배열을 사용
|
||||
var idsToDelete = selectedRowIds.slice();
|
||||
|
||||
for (var i = 0; i < idsToDelete.length; i++) {
|
||||
grid.jqGrid('delRowData', idsToDelete[i]); // 선택된 각 행을 삭제
|
||||
}
|
||||
} else {
|
||||
alert("Please select at least one row to delete.");
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_previous").click(function () {
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
});
|
||||
|
||||
$("#btn_gen_id").click(function () {
|
||||
//$('input[name=clientId]').val(generateString(32));
|
||||
$('input[name=clientId]').val(generateString($("#btn_clientId_byte").val()));
|
||||
});
|
||||
|
||||
$("#btn_gen_secret").click(function () {
|
||||
//$('input[name=clientSecret]').val(generateString(128));
|
||||
$('input[name=clientSecret]').val(generateString($("#btn_clientSecret_byte").val()));
|
||||
});
|
||||
|
||||
buttonControl(isDetail);
|
||||
titleControl(isDetail);
|
||||
});
|
||||
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
function generateString(length) {
|
||||
let result = '';
|
||||
const charactersLength = characters.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_delete" level="W" status="DETAIL"><i class="material-icons">delete</i> <%= localeMessage.getString("button.delete") %>
|
||||
</button>
|
||||
<%-- <button type="button" class="cssbtn" id="btn_modify" level="W" status="DETAIL,NEW"><i--%>
|
||||
<%-- class="material-icons">save</i> <%= localeMessage.getString("button.modify") %>--%>
|
||||
<%-- </button>--%>
|
||||
<button type="button" class="cssbtn" id="btn_previous" level="R" status="DETAIL,NEW"><i
|
||||
class="material-icons">arrow_back</i> <%= localeMessage.getString("button.previous") %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="title" id="title">${rmsMenuName}</div>
|
||||
|
||||
<form id="ajaxForm">
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:180px;"><%= localeMessage.getString("clntManDtl.clntNm") %> <small>(*)</small></th>
|
||||
<td><input type="text" name="clientname"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= localeMessage.getString("clntManDtl.clntId") %> <small>(*)</small></th>
|
||||
<td>
|
||||
<input type="text" name="clientid" />
|
||||
<%-- <select name="clientId_byte" id="btn_clientId_byte" style="width: 76px;">--%>
|
||||
<%-- <option value="32" selected="selected">32 byte</option>--%>
|
||||
<%-- <option value="64">64 byte</option>--%>
|
||||
<%-- <option value="128">128 byte</option>--%>
|
||||
<%-- <option value="256">256 byte</option>--%>
|
||||
<%-- </select>--%>
|
||||
<%-- <img src="<c:url value="/img/btn_pop_input.png"/>" id="btn_gen_id"/>--%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>APP 상태</th>
|
||||
<td>
|
||||
<div class="select-style">
|
||||
<select name="appstatus" >
|
||||
<option value="1" selected>정상</option>
|
||||
<option value="0">차단</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>법인</th>
|
||||
<td>
|
||||
<div class="select-style">
|
||||
<select id="orgId" class="form-control" name="orgid">
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div style="font-size:0;">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px ">
|
||||
<div class="table_row_title" style="margin-bottom: 0px">API</div>
|
||||
<%-- <div style="text-align: end;">--%>
|
||||
<%-- <button type="button" class="cssbtn" id="btn_delete_api" level="W" status="DETAIL,NEW">--%>
|
||||
<%-- <i class="material-icons">delete</i> <%= localeMessage.getString("button.delete") %>--%>
|
||||
<%-- </button>--%>
|
||||
<%-- <button type="button" class="cssbtn" id="btn_popup_api" level="W" status="DETAIL,NEW">--%>
|
||||
<%-- <i class="material-icons">add</i> API <%= localeMessage.getString("button.add") %>--%>
|
||||
<%-- </button>--%>
|
||||
<%-- <button type="button" class="cssbtn" id="btn_popup_api_group" level="W" status="DETAIL,NEW">--%>
|
||||
<%-- <i class="material-icons">add</i> API 그룹<%= localeMessage.getString("button.add") %>--%>
|
||||
<%-- </button>--%>
|
||||
<%-- </div>--%>
|
||||
</div>
|
||||
<div style="display:inline-block; width:calc(100%); vertical-align:top;">
|
||||
<div id="selectedApiList" style="margin-top:10px;">
|
||||
<table id="selectedApiGrid"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,138 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<link href="<c:url value='/addon/bootstrap-5.3.2/css/bootstrap.min.css'/>" rel="stylesheet"/>
|
||||
<script src="<c:url value='/addon/bootstrap-5.3.2/js/bootstrap.bundle.min.js'/>"></script>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/apigroup/apiGroupMan.json"/>';
|
||||
var url_view = '<c:url value="/onl/apim/apigroup/apiGroupMan.view"/>';
|
||||
var responseData = {};
|
||||
|
||||
function useFormatter(cellvalue, options, rowObject) {
|
||||
if (cellvalue == null || cellvalue == '')
|
||||
return '';
|
||||
return cellvalue === '0' ? '미사용' : '사용';
|
||||
}
|
||||
|
||||
function detail() {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST"); // jqGrid expects an object
|
||||
$("#grid").setGridParam({url: url, postData: postData}).trigger("reloadGrid");
|
||||
}
|
||||
|
||||
function search() {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST"); // jqGrid expects an object
|
||||
$("#grid").setGridParam({url: url, postData: postData, page: 1}).trigger("reloadGrid");
|
||||
}
|
||||
|
||||
function list() {
|
||||
detail();
|
||||
var gridPostData = getSearchForJqgrid("cmd", "LIST"); // jqGrid expects an object
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: gridPostData,
|
||||
colNames: ['API 그룹 명', '설명', 'id'],
|
||||
colModel: [
|
||||
{name: 'groupName', align: 'center', width: '80', sortable: false},
|
||||
{name: 'groupDesc', align: 'left'},
|
||||
{name: 'id', align: 'center', width: '40', hidden: true}
|
||||
],
|
||||
jsonReader: {
|
||||
root: function (obj) {
|
||||
responseData = obj.rows; // Store the response data
|
||||
return obj.rows;
|
||||
},
|
||||
repeatitems: false
|
||||
},
|
||||
pager: $('#pager'),
|
||||
page: '${param.page}',
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: $("#container").height(),
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
loadComplete: function(d) {
|
||||
var colModel = $(this).getGridParam("colModel");
|
||||
for (var i = 0; i < colModel.length; i++) {
|
||||
$(this).setColProp(colModel[i].name, {sortable: false});
|
||||
}
|
||||
},
|
||||
ondblClickRow: function(rowId) {
|
||||
const rowData = $(this).getRowData(rowId);
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
dataType:"json",
|
||||
data:{cmd: 'DETAIL', apiGroupId : rowData.id},
|
||||
success:function(json){
|
||||
window.returnValue = json;
|
||||
window.close();
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
list();
|
||||
resizeJqGridWidth('grid', 'content_middle', '1000');
|
||||
|
||||
$("#btn_search").click(function() {
|
||||
search();
|
||||
});
|
||||
$("input[name^=search]").keydown(function(key) {
|
||||
if (key.keyCode == 13) {
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div class="content_middle" id="content_middle" style="margin-top: 0px">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="title" id="title">${rmsMenuName}</div>
|
||||
<table class="search_condition" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:180px;">API 그룹 명</th>
|
||||
<td>
|
||||
<input type="text" name="searchGroupName" value="${param.searchGroupName}">
|
||||
</td>
|
||||
<th style="width:180px;">설명</th>
|
||||
<td>
|
||||
<input type="text" name="searchGroupDesc" value="${param.searchGroupDesc}">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,103 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title>Client 선택</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css_custom.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
</head>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/admin/authserver/clientMan.json" />';
|
||||
$(document).ready(function() {
|
||||
var gridPostData = getSearchForJqgrid("cmd","POPUP_LIST");
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: gridPostData,
|
||||
colNames: ['클라이언트명', '클라이언트ID', '스코프', 'GRANT타입', 'TOKEN유효시간(초)'],
|
||||
colModel: [
|
||||
{ name: 'CLIENTNAME', align: 'left', sortable: false },
|
||||
{ name: 'CLIENTID', align: 'left', sortable: false },
|
||||
{ name: 'SCOPE', align: 'left', sortable: false },
|
||||
{ name: 'GRANTTYPES', align: 'left', sortable: false },
|
||||
{ name: 'ACCESSTOKENVALIDITYSECONDS', align: 'center', sortable: false }
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
pager : $('#pager'),
|
||||
page : '${param.page}',
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: 'auto',
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
shrinkToFit: true,
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
ondblClickRow: function(rowid) {
|
||||
var rowData = $(this).getRowData(rowid);
|
||||
var clientId = rowData['CLIENTID'];
|
||||
if (window.opener && typeof window.opener.selectClient === "function") {
|
||||
window.opener.selectClient(clientId);
|
||||
window.close();
|
||||
} else if (window.parent && typeof window.parent.selectClient === "function") {
|
||||
window.parent.selectClient(clientId);
|
||||
window.parent.closeModal();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
resizeJqGridWidth('grid', 'popup_box', '100%');
|
||||
|
||||
$("#btn_search").click(function(){
|
||||
var postData = getSearchForJqgrid("cmd","POPUP_LIST");
|
||||
$("#grid").setGridParam({ postData: postData, page: 1 }).trigger("reloadGrid");
|
||||
});
|
||||
|
||||
$("#btn_close").click(function(){
|
||||
if (window.parent && typeof window.parent.closeModal === "function") {
|
||||
window.parent.closeModal();
|
||||
} else {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name^=search]").keydown(function(key){
|
||||
if (key.keyCode == 13){
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
<div class="popup_box" >
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_close" level="R"><i class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %></button>
|
||||
</div>
|
||||
<div class="title">Client 선택</div>
|
||||
|
||||
<table class="search_condition" cellspacing="0">
|
||||
<tr>
|
||||
<th>클라이언트명</th>
|
||||
<td><input type="text" name="searchClientName" value="${param.searchClientName}"></td>
|
||||
<th>클라이언트ID</th>
|
||||
<td><input type="text" name="searchClientId" value="${param.searchClientId}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- grid -->
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
</div><!-- end popup_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,288 @@
|
||||
<%@ page import="com.eactive.eai.rms.common.util.CommonConstants" %>
|
||||
<%@ page import="com.eactive.eai.rms.common.login.LoginVo" %>
|
||||
<%@ page contentType="text/html; charset=utf-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title>승인 요청 상세</title>
|
||||
<style>
|
||||
.table_row tbody tr.highlight_new {
|
||||
background-color: #e6f3ff !important;
|
||||
}
|
||||
.table_row tbody tr.highlight_delete {
|
||||
background-color: #ffe6e6 !important;
|
||||
}
|
||||
.table_row tbody tr.highlight_new td.status {
|
||||
color: #4a90e2;
|
||||
font-weight: normal;
|
||||
}
|
||||
.table_row tbody tr.highlight_delete td.status {
|
||||
color: #e74c3c;
|
||||
font-weight: normal;
|
||||
}
|
||||
</style>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript">
|
||||
<%
|
||||
LoginVo loginVo = (LoginVo) session.getAttribute(CommonConstants.LOGIN);
|
||||
%>
|
||||
var loginUser = '<%= loginVo.getUserId() %>';
|
||||
var url = '<c:url value="/onl/apim/approval/portalApprovalMan.json" />';
|
||||
var url_view = '<c:url value="/onl/apim/approval/portalApprovalMan.view" />';
|
||||
|
||||
$(document).ready(function () {
|
||||
var key = "${param.id}";
|
||||
if (key) {
|
||||
detail(key);
|
||||
}
|
||||
|
||||
$("#btn_app_approve").click(function () {
|
||||
if (confirm("승인하시겠습니까?")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {cmd: "APPROVE", id: key},
|
||||
success: function (args) {
|
||||
<%--alert("<%= localeMessage.getString("approval.approveSuccess") %>");--%>
|
||||
alert("승인되었습니다.");
|
||||
window.opener.location.reload();
|
||||
window.close();
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_app_reject").click(function () {
|
||||
var rejectReason = prompt("반려 사유를 입력해 주세요");
|
||||
if (rejectReason != null) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {cmd: "REJECT", id: key, rejectReason: rejectReason},
|
||||
success: function (args) {
|
||||
alert("반려되었습니다.");
|
||||
window.opener.location.reload();
|
||||
window.close();
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn_app_redeploy').click(function () {
|
||||
if (confirm("재배포 하시겠습니까?")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {cmd: "REDEPLOY", id: key},
|
||||
success: function (args) {
|
||||
alert("요청되었습니다.");
|
||||
window.opener.location.reload();
|
||||
window.close();
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_close").click(function () {
|
||||
window.close();
|
||||
});
|
||||
});
|
||||
|
||||
function detail(key) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'DETAIL', id: key},
|
||||
success: function (json) {
|
||||
var data = json;
|
||||
$("#approvalType").text(data.approvalType === 'USER' ? "법인사용자" : "API 사용");
|
||||
$("#approvalStatus").text(data.approvalStatus.description);
|
||||
$("#requesterName").text(data.requester.userName);
|
||||
$("#approvalSubject").text(data.approvalSubject);
|
||||
$("#approvalDetail").html(data.approvalDetail);
|
||||
$("#createdDate").text(data.createdDate).inputmask("9999-99-99 99:99:99.999", {'autoUnmask': true});
|
||||
|
||||
if (data.approvers.some(approver =>
|
||||
approver.approverStatus === 'CURRENT' &&
|
||||
approver.user.USERID === loginUser
|
||||
)) {
|
||||
document.getElementById("btn_app_approve").style.display = "";
|
||||
document.getElementById("btn_app_reject").style.display = "";
|
||||
} else {
|
||||
document.getElementById("btn_app_approve").style.display = "none";
|
||||
document.getElementById("btn_app_reject").style.display = "none";
|
||||
}
|
||||
|
||||
if (data.approvalStatus.description === '배포실패') {
|
||||
document.getElementById("btn_app_redeploy").style.display = "";
|
||||
}
|
||||
|
||||
var approversHtml = "";
|
||||
data.approvers.sort((a, b) => a.ordinal - b.ordinal);
|
||||
for (var i = 0; i < data.approvers.length; i++) {
|
||||
var approver = data.approvers[i];
|
||||
approversHtml += "<tr>";
|
||||
approversHtml += "<td>" + approver.user.USERNAME + "</td>";
|
||||
approversHtml += "<td>" + approver.approverStatusDescription + "</td>";
|
||||
approversHtml += "<td>" + (approver.approvedDate ? new Date(approver.approvedDate).toLocaleString() : "") + "</td>";
|
||||
approversHtml += "</tr>";
|
||||
}
|
||||
$("#approversTable tbody").html(approversHtml);
|
||||
|
||||
$("#clientName").text(data.clientName);
|
||||
|
||||
var apiServiceHtml = "";
|
||||
for (var i = 0; i < data.apiServices.length; i++) {
|
||||
var apiService = data.apiServices[i];
|
||||
apiServiceHtml += "<tr>";
|
||||
apiServiceHtml += "<td>" + apiService.groupName + "</td>";
|
||||
apiServiceHtml += "</tr>";
|
||||
}
|
||||
$("#apiServiceTable tbody").html(apiServiceHtml);
|
||||
|
||||
var apisHtml = "";
|
||||
|
||||
for (var i = 0; i < data.apis.length; i++) {
|
||||
var api = data.apis[i];
|
||||
var apiGroupName = data.apiGroupNameList[i];
|
||||
var isNew = false;
|
||||
var isDelete = false;
|
||||
|
||||
if ((data.requestType === 'MODIFY' || data.requestType === 'PROD_MODIFY') && data.prevApisList && data.prevApisList.length > 0) {
|
||||
isNew = !data.prevApisList.some(prevApi => prevApi.apiId === api.apiId);
|
||||
}
|
||||
|
||||
if ((data.requestType === 'DELETE' || data.requestType === 'PROD_DELETE') && data.prevApisList && data.prevApisList.lenght > 0) {
|
||||
isDelete = true;
|
||||
isNew = false;
|
||||
}
|
||||
|
||||
var trClass = "";
|
||||
if (isNew) trClass = "highlight_new";
|
||||
if (isDelete) trClass = "highlight_delete";
|
||||
apisHtml += "<tr " + (trClass ? "class='" + trClass + "'" : "") + ">";
|
||||
apisHtml += "<td>" + apiGroupName + "</td>";
|
||||
apisHtml += "<td>" + api.apiName + "</td>";
|
||||
apisHtml += "<td class='status'>" + (isNew ? "추가" : "") + (isDelete ? "삭제" : "") + "</td>";
|
||||
apisHtml += "</tr>";
|
||||
}
|
||||
|
||||
if ((data.requestType === 'MODIFY' || data.requestType === 'PROD_MODIFY') && data.prevApisList && data.prevApisList.length > 0) {
|
||||
|
||||
data.prevApisList.forEach(function(prevApi, index) {
|
||||
var isDeleted = !data.apis.some(api => api.apiId === prevApi.apiId);
|
||||
|
||||
if (isDeleted) {
|
||||
apisHtml += "<tr class='highlight_delete'>";
|
||||
apisHtml += "<td>" + data.prevApiGroupNameList[index] + "</td>";
|
||||
apisHtml += "<td>" + prevApi.apiName + "</td>";
|
||||
apisHtml += "<td class='status'>삭제</td>";
|
||||
apisHtml += "</tr>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#apisTable tbody").html(apisHtml);
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="popup_box">
|
||||
<div class="title" id="approvalSubject" style="margin-top: 15px;"></div>
|
||||
<%--제목--%>
|
||||
<div class="popup_content">
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:20%;">승인 유형</th>
|
||||
<td style="width:30%;"><span id="approvalType"></span></td>
|
||||
<th style="width:20%;">승인 상태</th>
|
||||
<td style="width:30%;"><span id="approvalStatus"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>요청자</th>
|
||||
<td><span id="requesterName"></span></td>
|
||||
<th>생성일</th>
|
||||
<td><span id="createdDate"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>상세 내용</th>
|
||||
<td colspan="3">
|
||||
<div id="approvalDetail" style="white-space: pre-wrap;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="title">Client 정보</div>
|
||||
<table id="client" class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:20%;">이름</th>
|
||||
<td><span id="clientName"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="title">API 목록</div>
|
||||
<table id="apisTable" class="table_row" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>서비스명</th>
|
||||
<th>API 이름</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="title">승인자 목록</div>
|
||||
<table id="approversTable" class="table_row" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>승인자</th>
|
||||
<th>상태</th>
|
||||
<th>승인/거절 일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="popup_button">
|
||||
<button type="button" class="cssbtn" style="display: none;" id="btn_app_approve" level="W"><i
|
||||
class="material-icons">check</i>승인
|
||||
</button>
|
||||
<button type="button" class="cssbtn" style="display: none;" id="btn_app_reject" level="W"><i
|
||||
class="material-icons">close</i>반려
|
||||
</button>
|
||||
<button type="button" class="cssbtn" style="display: none;" id="btn_app_redeploy" level="W"><i
|
||||
class="material-icons">close</i>재처리
|
||||
</button>
|
||||
<button type="button" class="cssbtn" id="btn_close" level="R"><i
|
||||
class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript" >
|
||||
var url = '<c:url value="/onl/apim/approval/portalApprovalMan.json" />';
|
||||
var url_view = '<c:url value="/onl/apim/approval/portalApprovalMan.view" />';
|
||||
const APPROVAL_TYPE_DISPLAY = {
|
||||
'USER': '법인사용자',
|
||||
'APP': 'API 사용'
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: {
|
||||
cmd: 'LIST',
|
||||
searchApprovalType: $('select[name=searchApprovalType]').val(),
|
||||
searchApprovalStatus: $('select[name=searchApprovalStatus]').val(),
|
||||
searchApprovalSubject: $('input[name=searchApprovalSubject]').val()
|
||||
},
|
||||
colNames: ['No.', 'id', '제목', '승인 유형', '승인 유형', '승인 상태','요청자', '생성일'],
|
||||
colModel: [
|
||||
{ name: 'rowNum', align: 'center', width: '30', sortable: false},
|
||||
{ name: 'id', align: 'center', key: true, hidden: true },
|
||||
{ name: 'approvalSubject', align: 'center', width: 200 },
|
||||
{ name: 'approvalType', align: 'center', width: 80, formatter: function(cellvalue) { return APPROVAL_TYPE_DISPLAY[cellvalue] || cellvalue;}},
|
||||
{ name: 'approvalType', align: 'center', width: 80, hidden: true},
|
||||
{ name: 'approvalStatus.description', align: 'center', width: 80 },
|
||||
{ name: 'requester.userName', align: 'center', width: 100 },
|
||||
{ name: 'createdDate', align: 'center', width: 120, formatter: 'date', formatoptions: { srcformat: 'ISO8601Long', newformat: 'Y-m-d H:i:s' } }
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
pager: $('#pager'),
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
viewrecords: true,
|
||||
autowidth: true,
|
||||
height: 'auto',
|
||||
ondblClickRow: function(rowId) {
|
||||
var rowData = $(this).getRowData(rowId);
|
||||
var id = rowData['id'];
|
||||
var approvalType = rowData['approvalType'];
|
||||
var args = {};
|
||||
var url2 = url_view;
|
||||
url2 += '?cmd=DETAIL';
|
||||
url2 += '&menuId=' + '${param.menuId}';
|
||||
url2 += '&type=' + approvalType;
|
||||
url2 += '&id=' + id;
|
||||
|
||||
showModal(url2, args, 800, 650, function(){
|
||||
$("#grid").trigger("reloadGrid");
|
||||
});
|
||||
},
|
||||
loadComplete: function(d) {
|
||||
var records = $(this).getGridParam('records');
|
||||
var page = $(this).getGridParam('page');
|
||||
var rowNum = $(this).getGridParam('rowNum');
|
||||
var rows = $(this).getDataIDs();
|
||||
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var number = ((page - 1) * rowNum + i) + 1;
|
||||
// var reverseNumber = records - ((page - 1) * rowNum + i);
|
||||
$(this).setCell(rows[i], 'rowNum', number);
|
||||
}
|
||||
},
|
||||
loadError: function(jqXHR, textStatus, errorThrown) {
|
||||
var location = '<%=request.getContextPath()%>/';
|
||||
comloadError(jqXHR, textStatus, errorThrown, location);
|
||||
}
|
||||
});
|
||||
|
||||
resizeJqGridWidth('grid', 'content_middle', '1000');
|
||||
|
||||
$("#btn_search").click(function() {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST");
|
||||
$("#grid").setGridParam({ url: url, postData: postData, page: 1 }).trigger("reloadGrid");
|
||||
});
|
||||
|
||||
$("select[name^=search], input[name^=search]").keydown(function(key) {
|
||||
if (key.keyCode == 13) {
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle" id="content_middle">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %></button>
|
||||
</div>
|
||||
<div class="title">승인 요청 목록<span class="tooltip">승인 요청을 관리합니다.</span></div>
|
||||
<form id="ajaxForm" onsubmit="return false;">
|
||||
<table class="search_condition" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:10%;">승인 유형</th>
|
||||
<td style="width:15%;">
|
||||
<div class="select-style">
|
||||
<select name="searchApprovalType">
|
||||
<option value="">전체</option>
|
||||
<option value="APP">API 사용</option>
|
||||
<option value="USER">법인사용자</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<th style="width:10%;">승인 상태</th>
|
||||
<td style="width:15%;">
|
||||
<div class="select-style">
|
||||
<select name="searchApprovalStatus">
|
||||
<option value="">전체</option>
|
||||
<option value="CREATED">생성됨</option>
|
||||
<option value="REQUESTED">요청됨</option>
|
||||
<option value="DENIED">반려됨</option>
|
||||
<option value="END">승인됨</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<th style="width:10%;">제목</th>
|
||||
<td><input type="text" name="searchApprovalSubject" value="${param.searchApprovalSubject}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,477 @@
|
||||
<%@ page import="com.eactive.eai.rms.common.datasource.DataSourceTypeManager" %>
|
||||
<%@ page import="com.eactive.eai.rms.common.login.LoginVo" %>
|
||||
<%@ page import="com.eactive.eai.rms.common.util.CommonConstants" %>
|
||||
<%@ page contentType="text/html; charset=utf-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title>사용자 승인 요청 상세</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/portal.jsp"/>
|
||||
<!-- 마스킹 해제 관련 스타일 추가 -->
|
||||
<style>
|
||||
.cssbtn.active {
|
||||
background-color: #f0f0f0;
|
||||
color: #666;
|
||||
}
|
||||
.alert {
|
||||
padding: 10px 15px;
|
||||
margin-bottom: 15px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.alert-warning {
|
||||
color: #856404;
|
||||
background-color: #fff3cd;
|
||||
border-color: #ffeeba;
|
||||
}
|
||||
.alert i {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.unmasked-field {
|
||||
background-color: #fff3cd;
|
||||
color: #856404;
|
||||
padding: 2px 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
</style>
|
||||
<script language="javascript">
|
||||
<%
|
||||
LoginVo loginVo = (LoginVo) session.getAttribute(CommonConstants.LOGIN);
|
||||
%>
|
||||
var loginUser = '<%= loginVo.getUserId() %>';
|
||||
var url = '<c:url value="/onl/apim/approval/portalApprovalMan.json" />';
|
||||
var url_view = '<c:url value="/onl/apim/approval/portalApprovalMan.view" />';
|
||||
var file_download = '<c:url value="/file/download.do" />';
|
||||
$(document).ready(function() {
|
||||
var key = "${param.id}";
|
||||
if (key) {
|
||||
detail(key);
|
||||
}
|
||||
|
||||
$("#btn_unmask").click(function() {
|
||||
var status = $(this).attr("status");
|
||||
if(status === "DETAIL") {
|
||||
var reason = prompt("마스킹 해제 사유를 입력해 주세요");
|
||||
if (reason) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {
|
||||
cmd: "UNMASK",
|
||||
id: key,
|
||||
reason: reason
|
||||
},
|
||||
success: function(data) {
|
||||
// UI 업데이트
|
||||
updateDetailView(data);
|
||||
// 버튼 상태 변경
|
||||
$("#btn_unmask").hide();
|
||||
|
||||
// 마스킹 해제 상태 표시
|
||||
$(".popup_content").prepend(
|
||||
'<div class="alert alert-warning" id="unmask-alert">' +
|
||||
'<i class="material-icons">warning</i> ' +
|
||||
'현재 마스킹 해제된 상태로 조회중입니다' +
|
||||
'</div>'
|
||||
);
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// 마스킹 보기로 되돌리기
|
||||
detail(key);
|
||||
$(this)
|
||||
.attr("status", "DETAIL")
|
||||
.html('<i class="material-icons">lock_open</i> 마스킹해제')
|
||||
.removeClass('active'); // 활성화 상태 클래스 제거
|
||||
|
||||
// 마스킹 해제 상태 알림 제거
|
||||
$("#unmask-alert").remove();
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_user_approve").click(function() {
|
||||
if (confirm("승인하시겠습니까?")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {cmd: "APPROVE", id: key},
|
||||
success: function(args) {
|
||||
alert("승인되었습니다.");
|
||||
window.opener.location.reload();
|
||||
window.close();
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_user_reject").click(function() {
|
||||
var rejectReason = prompt("반려 사유를 입력해 주세요");
|
||||
if (rejectReason != null) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {cmd: "REJECT", id: key, rejectReason: rejectReason},
|
||||
success: function(args) {
|
||||
alert("반려되었습니다.");
|
||||
window.opener.location.reload();
|
||||
window.close();
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#btn_user_redeploy').click(function() {
|
||||
if (confirm("재배포 하시겠습니까?")) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {cmd: "REDEPLOY", id: key},
|
||||
success: function(args) {
|
||||
alert("요청되었습니다.");
|
||||
window.opener.location.reload();
|
||||
window.close();
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_close").click(function() {
|
||||
window.close();
|
||||
});
|
||||
});
|
||||
|
||||
function downloadFile(fileId, fileSn) {
|
||||
window.location.href = file_download + '?fileId=' + fileId + '&fileSn=' + fileSn;
|
||||
}
|
||||
|
||||
function detail(key) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'DETAIL', id: key},
|
||||
success: function(json) {
|
||||
var data = json;
|
||||
$("#approvalType").text(data.approvalType === 'USER' ? "법인사용자" : "API 사용");
|
||||
$("#approvalStatus").text(data.approvalStatus.description);
|
||||
$("#requesterName").text(data.requester.userName);
|
||||
$("#approvalSubject").text(data.approvalSubject);
|
||||
$("#createdDate").text(data.createdDate).inputmask("9999-99-99 99:99:99", {'autoUnmask': true});
|
||||
|
||||
// 상세 내용이 있을 때만 tr 표시
|
||||
if (data.approvalDetail && $.trim(data.approvalDetail)) {
|
||||
$("#approvalDetail").html(data.approvalDetail);
|
||||
$("#approvalDetailRow").show();
|
||||
} else {
|
||||
$("#approvalDetailRow").hide();
|
||||
}
|
||||
|
||||
data.approvers.sort((a, b) => a.ordinal - b.ordinal);
|
||||
var approversHtml = "";
|
||||
for (var i = 0; i < data.approvers.length; i++) {
|
||||
var approver = data.approvers[i];
|
||||
approversHtml += "<tr>";
|
||||
approversHtml += "<td>" + approver.user.USERNAME + "</td>";
|
||||
approversHtml += "<td>" + approver.approverStatusDescription + "</td>";
|
||||
approversHtml += "<td>" + (approver.approvedDate ? new Date(approver.approvedDate).toLocaleString() : "") + "</td>";
|
||||
approversHtml += "</tr>";
|
||||
}
|
||||
$("#approversTable tbody").html(approversHtml);
|
||||
|
||||
// Display Portal User details
|
||||
var portalUser = data.portalUser;
|
||||
$("#loginId").text(portalUser.loginId);
|
||||
$("#userName").text(portalUser.userName);
|
||||
$("#mobileNumber").text(portalUser.mobileNumber);
|
||||
$("#userStatusDescription").text(portalUser.userStatusDescription);
|
||||
$("#roleCodeDescription").text(portalUser.roleCodeDescription);
|
||||
if (data.approvers.some(approver =>
|
||||
approver.approverStatus === 'CURRENT' &&
|
||||
approver.user.USERID === loginUser
|
||||
)) {
|
||||
document.getElementById("btn_user_approve").style.display = "";
|
||||
document.getElementById("btn_user_reject").style.display = "";
|
||||
} else {
|
||||
document.getElementById("btn_user_approve").style.display = "none";
|
||||
document.getElementById("btn_user_reject").style.display = "none";
|
||||
}
|
||||
|
||||
if (data.approvalStatus.description === '배포실패'){
|
||||
document.getElementById("btn_user_redeploy").style.display = "";
|
||||
}
|
||||
|
||||
// Display Portal Org details
|
||||
var portalOrg = portalUser.portalOrgUIs;
|
||||
$("#orgName").text(portalOrg.orgName);
|
||||
$("#orgStatusDescription").text(portalOrg.orgStatusDescription);
|
||||
$("#serviceName").text(portalOrg.serviceName);
|
||||
$("#corpRegNo").text(formatCorpRegNo(portalOrg.corpRegNo));
|
||||
$("#compRegNo").text(formatCompanyRegNo(portalOrg.compRegNo));
|
||||
|
||||
$("#scPhoneNumber").text(portalOrg.scPhoneNumber); // 고객센터 전화번호
|
||||
$("#orgPhoneNumber").text(portalOrg.orgPhoneNumber); // 회사 전화번호
|
||||
$("#ceoName").text(portalOrg.ceoName); // 대표자 성명
|
||||
$("#orgIndustryType").text(portalOrg.orgIndustryType || ""); // 업종
|
||||
$("#orgAddr").text(portalOrg.orgAddr); // 소재지
|
||||
$("#orgSectors").text(portalOrg.orgSectors || ""); // 업태
|
||||
$("#orgCode").text(portalOrg.orgCode);
|
||||
$("#ipWhitelist").text(portalOrg.ipWhitelist || "");
|
||||
|
||||
if (portalOrg.compRegFile) {
|
||||
$("#fileName").text(portalOrg.fileName);
|
||||
if (portalOrg.fileName) {
|
||||
$("#fileWrapper").show().off('click').on('click', function() {
|
||||
downloadFile(portalOrg.compRegFile, '1'); // fileSn은 단일 파일이므로 '1'로 고정
|
||||
});
|
||||
$("#compRegFile").val(portalOrg.compRegFile);
|
||||
} else {
|
||||
$("#fileWrapper").hide();
|
||||
}
|
||||
} else {
|
||||
$("#fileName").text("");
|
||||
$("#fileWrapper").hide();
|
||||
}
|
||||
},
|
||||
error: function(e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
function updateDetailView(data) {
|
||||
$("#approvalType").text(data.approvalType === 'USER' ? "법인사용자" : "API 사용");
|
||||
$("#approvalStatus").text(data.approvalStatus.description);
|
||||
$("#requesterName").text(data.requester.userName);
|
||||
$("#approvalSubject").text(data.approvalSubject);
|
||||
$("#createdDate").text(data.createdDate).inputmask("9999-99-99 99:99:99", {'autoUnmask': true});
|
||||
|
||||
// 상세 내용이 있을 때만 tr 표시
|
||||
if (data.approvalDetail && $.trim(data.approvalDetail)) {
|
||||
$("#approvalDetail").html(data.approvalDetail);
|
||||
$("#approvalDetailRow").show();
|
||||
} else {
|
||||
$("#approvalDetailRow").hide();
|
||||
}
|
||||
|
||||
// 승인자 목록 업데이트
|
||||
updateApprovers(data.approvers);
|
||||
|
||||
// 사용자 정보 업데이트
|
||||
var portalUser = data.portalUser;
|
||||
$("#loginId").text(portalUser.loginId);
|
||||
$("#userName").text(portalUser.userName);
|
||||
$("#mobileNumber").text(portalUser.mobileNumber);
|
||||
$("#userStatusDescription").text(portalUser.userStatusDescription);
|
||||
$("#roleCodeDescription").text(portalUser.roleCodeDescription);
|
||||
|
||||
// 법인 정보 업데이트
|
||||
var portalOrg = portalUser.portalOrgUIs;
|
||||
updateOrgInfo(portalOrg);
|
||||
|
||||
// 마스킹 상태에 따라 데이터를 다르게 표시
|
||||
var isMasked = $("#btn_unmask").attr("status") === "DETAIL";
|
||||
|
||||
// 마스킹 해제 상태일 때 스타일 변경
|
||||
if (!isMasked) {
|
||||
// 마스킹 해제된 필드들 하이라이트
|
||||
$("#userName, #loginId, #mobileNumber, #ipWhitelist").addClass("unmasked-field");
|
||||
|
||||
// 마스킹 해제 상태 알림 표시
|
||||
if (!$("#unmask-alert").length) {
|
||||
$(".popup_content").prepend(
|
||||
'<div class="alert alert-warning" id="unmask-alert">' +
|
||||
'<i class="material-icons">warning</i> ' +
|
||||
'현재 마스킹 해제된 상태로 조회중입니다' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 마스킹된 상태로 되돌리기
|
||||
$(".unmasked-field").removeClass("unmasked-field");
|
||||
$("#unmask-alert").remove();
|
||||
}
|
||||
}
|
||||
|
||||
function updateApprovers(approvers) {
|
||||
var approversHtml = "";
|
||||
approvers.sort((a, b) => a.ordinal - b.ordinal);
|
||||
for (var i = 0; i < approvers.length; i++) {
|
||||
var approver = approvers[i];
|
||||
approversHtml += "<tr>";
|
||||
approversHtml += "<td>" + approver.user.USERNAME + "</td>";
|
||||
approversHtml += "<td>" + approver.approverStatusDescription + "</td>";
|
||||
approversHtml += "<td>" + (approver.approvedDate ? new Date(approver.approvedDate).toLocaleString() : "") + "</td>";
|
||||
approversHtml += "</tr>";
|
||||
}
|
||||
$("#approversTable tbody").html(approversHtml);
|
||||
}
|
||||
|
||||
// 법인 정보 업데이트 함수
|
||||
function updateOrgInfo(portalOrg) {
|
||||
$("#orgName").text(portalOrg.orgName);
|
||||
$("#orgStatusDescription").text(portalOrg.orgStatusDescription);
|
||||
$("#serviceName").text(portalOrg.serviceName);
|
||||
$("#corpRegNo").text(formatCorpRegNo(portalOrg.corpRegNo));
|
||||
$("#compRegNo").text(formatCompanyRegNo(portalOrg.compRegNo));
|
||||
$("#scPhoneNumber").text(portalOrg.scPhoneNumber);
|
||||
$("#orgPhoneNumber").text(portalOrg.orgPhoneNumber);
|
||||
$("#ceoName").text(portalOrg.ceoName);
|
||||
$("#orgIndustryType").text(portalOrg.orgIndustryType || "");
|
||||
$("#orgAddr").text(portalOrg.orgAddr);
|
||||
$("#orgSectors").text(portalOrg.orgSectors || "");
|
||||
$("#orgCode").text(portalOrg.orgCode);
|
||||
$("#ipWhitelist").text(portalOrg.ipWhitelist || "");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="popup_box">
|
||||
<div class="title" id="approvalSubject" style="margin-top: 15px;"></div>
|
||||
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_unmask" level="W" status="DETAIL"><i class="material-icons">lock_open</i> 마스킹해제</button>
|
||||
</div>
|
||||
<%--제목--%>
|
||||
<div class="popup_content">
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:20%;">승인 유형</th>
|
||||
<td style="width:30%;"><span id="approvalType"></span></td>
|
||||
<th style="width:20%;">승인 상태</th>
|
||||
<td style="width:30%;"><span id="approvalStatus"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>요청자</th>
|
||||
<td id="requesterName"></td>
|
||||
<th>생성일</th>
|
||||
<td id="createdDate"></td>
|
||||
</tr>
|
||||
<tr id="approvalDetailRow">
|
||||
<th>상세 내용</th>
|
||||
<td colspan="3">
|
||||
<div id="approvalDetail" style="white-space: pre-wrap;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="title">사용자 정보</div>
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:20%;">이메일 아이디</th>
|
||||
<td style="width:30%;" colspan="3"><span id="loginId"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width:20%;">이름</th>
|
||||
<td style="width:30%;"><span id="userName"></span></td>
|
||||
<th style="width:20%;">권한</th>
|
||||
<td style="width:30%;"><span id="roleCodeDescription"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>핸드폰 번호</th>
|
||||
<td><span id="mobileNumber"></span></td>
|
||||
<th>사용자 상태</th>
|
||||
<td><span id="userStatusDescription"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="title">법인 정보</div>
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:20%;">법인명</th>
|
||||
<td style="width:30%;"><span id="orgName"></span></td>
|
||||
<th style="width:20%;">법인 상태</th>
|
||||
<td style="width:30%;"><span id="orgStatusDescription"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>제휴기관코드</th>
|
||||
<td><span id="orgCode"></span></td>
|
||||
<th>업태</th>
|
||||
<td><span id="orgSectors"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>서비스명</th>
|
||||
<td><span id="serviceName"></span></td>
|
||||
<th>업종</th>
|
||||
<td><span id="orgIndustryType"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>법인 등록 번호</th>
|
||||
<td><span id="corpRegNo"></span></td>
|
||||
<th>사업자 등록 번호</th>
|
||||
<td><span id="compRegNo"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>회사 전화번호</th>
|
||||
<td><span id="orgPhoneNumber"></span></td>
|
||||
<th>고객 센터 전화번호</th>
|
||||
<td><span id="scPhoneNumber"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>대표자 성명</th>
|
||||
<td><span id="ceoName"></span></td>
|
||||
<th>소재지</th>
|
||||
<td><span id="orgAddr"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>사업자 등록증</th>
|
||||
<td colspan="3">
|
||||
<span id="fileWrapper" style="display: none; cursor: pointer;">
|
||||
<img src="${pageContext.request.contextPath}/images/icon_file.png" style="vertical-align: middle; margin-right: 5px;">
|
||||
<span id="fileName" style="text-decoration: underline;"></span>
|
||||
<input type="hidden" id="compRegFile"/>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>사용 서버 IP 대역</th>
|
||||
<td colspan="3"><span id="ipWhitelist"></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="title">승인자 목록</div>
|
||||
<table id="approversTable" class="table_row" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>승인자</th>
|
||||
<th>상태</th>
|
||||
<th>승인/거절 일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="popup_button">
|
||||
<button type="button" class="cssbtn" style="display: none;" id="btn_user_approve" level="W"><i class="material-icons">check</i>승인</button>
|
||||
<button type="button" class="cssbtn" style="display: none;" id="btn_user_reject" level="W"><i class="material-icons">close</i>반려</button>
|
||||
<button type="button" class="cssbtn" style="display: none;" id="btn_user_redeploy" level="W"><i class="material-icons">close</i>재처리</button>
|
||||
<button type="button" class="cssbtn" id="btn_close" level="R"><i class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,136 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/approval/prodclient/clientMan.json" />';
|
||||
var url_view = '<c:url value="/onl/apim/approval/prodclient/clientMan.view" />';
|
||||
|
||||
$(document).ready(function () {
|
||||
var gridPostData = getSearchForJqgrid("cmd", "LIST");
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: gridPostData,
|
||||
colNames: [
|
||||
'clientid',
|
||||
'법인 명',
|
||||
'<%= localeMessage.getString("clntMan.clntNm") %>',
|
||||
'APP 상태'
|
||||
],
|
||||
colModel: [
|
||||
{name: 'clientid', key: true, hidden: true },
|
||||
{name: 'orgname', align: 'left', sortable: false},
|
||||
{name: 'clientname', align: 'left', sortable: false},
|
||||
{
|
||||
name: 'appstatus',
|
||||
align: 'center',
|
||||
sortable: false,
|
||||
formatter: function (cellvalue, options, rowObject) {
|
||||
return cellvalue === '0' ? '차단' : '정상';
|
||||
}
|
||||
}
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
pager: $('#pager'),
|
||||
page: '${param.page}',
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: $("#container").height(),
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
ondblClickRow: function (rowId) {
|
||||
var rowData = $(this).getRowData(rowId);
|
||||
var url2 = url_view;
|
||||
url2 += '?cmd=DETAIL';
|
||||
url2 += '&page=' + $(this).getGridParam("page");
|
||||
url2 += '&returnUrl=' + getReturnUrl();
|
||||
url2 += '&menuId=' + '${param.menuId}';
|
||||
url2 += '&' + getSearchUrl();
|
||||
url2 += '&clientId=' + rowData['clientid'];
|
||||
goNav(url2);
|
||||
}
|
||||
});
|
||||
|
||||
resizeJqGridWidth('grid', 'content_middle', '1000');
|
||||
|
||||
$("#btn_search").click(function () {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST"); //jqgrid에서는 object 로
|
||||
$("#grid").setGridParam({postData: postData, page: "1"}).trigger("reloadGrid");
|
||||
|
||||
});
|
||||
$("#btn_new").click(function () {
|
||||
var url2 = url_view;
|
||||
url2 += '?cmd=DETAIL';
|
||||
url2 += '&page=' + $("#grid").getGridParam("page");
|
||||
url2 += '&returnUrl=' + getReturnUrl();
|
||||
url2 += '&menuId=' + '${param.menuId}';
|
||||
//검색값
|
||||
url2 += '&' + getSearchUrl();
|
||||
goNav(url2);
|
||||
});
|
||||
|
||||
$("input[name^=search]").keydown(function (key) {
|
||||
if (key.keyCode == 13) {
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle" id="content_middle">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_new" level="W"><i
|
||||
class="material-icons">add</i> <%= localeMessage.getString("button.new") %>
|
||||
</button>
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i
|
||||
class="material-icons">search</i> <%= localeMessage.getString("button.search") %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="title" id="title">${rmsMenuName}</div>
|
||||
|
||||
<table class="search_condition" cellspacing=0;>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:180px;"><%= localeMessage.getString("clntMan.clntNm") %>
|
||||
</th>
|
||||
<td><input type="text" name="searchClientName" value="${param.searchClientName}"></td>
|
||||
<th style="width:180px;"><%= localeMessage.getString("clntMan.clntId") %>
|
||||
</th>
|
||||
<td><input type="text" name="searchClientId" value="${param.searchClientId}"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,401 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/approval/prodclient/clientMan.json" />';
|
||||
var api_url_view = '<c:url value="/onl/apim/apigroup/apiGroupMan.view" />';
|
||||
var group_url_view = '<c:url value="/onl/admin/authserver/clientMan.view" />';
|
||||
|
||||
var isDetail = false;
|
||||
|
||||
function isValid() {
|
||||
if ($('input[name=clientname]').val() == "") {
|
||||
alert("CLIENT명을 입력하여 주십시요.");
|
||||
$('input[name=clientname]').focus();
|
||||
return false;
|
||||
}
|
||||
if ($('input[name=clientId]').val() == "") {
|
||||
alert("CLIENT 아이디를 입력하여 주십시요.");
|
||||
$('input[name=clientId]').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function detail(key) {
|
||||
if (!isDetail) return;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'DETAIL', clientId: key},
|
||||
success: function (json) {
|
||||
var apiList = json["apiList"];
|
||||
$("#selectedApiGrid").jqGrid("clearGridData");
|
||||
$("#selectedApiGrid")[0].addJSONData(apiList);
|
||||
|
||||
var data = json;
|
||||
$("#btn_gen_id").hide();
|
||||
$('input[name=clientId]').css('width', '100%');
|
||||
$('input[name=clientId]').attr('readonly', true);
|
||||
$("#btn_clientId_byte").hide();
|
||||
$("#btn_gen_secret").hide();
|
||||
$('input[name=clientSecret]').css('width', '100%');
|
||||
$('input[name=clientSecret]').attr('readonly', true);
|
||||
$("#btn_clientSecret_byte").hide();
|
||||
|
||||
$("#ajaxForm input[type!=checkbox],#ajaxForm select,#ajaxForm textarea").each(function () {
|
||||
var name = $(this).attr("name");
|
||||
var tag = $(this).prop("tagName").toLowerCase();
|
||||
$(tag + "[name=" + name + "]").val(data[name]);
|
||||
});
|
||||
|
||||
// Set the appStatus dropdown value
|
||||
if (json.appstatus !== undefined && json.appstatus !== null) {
|
||||
$('select[name=appStatus]').val(json.appstatus);
|
||||
} else {
|
||||
$('select[name=appStatus]').val('1'); // Set to normal if no value
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function init(key, callback) {
|
||||
|
||||
var selectedApiGrid = $("#selectedApiGrid");
|
||||
selectedApiGrid.jqGrid({
|
||||
datatype: "local",
|
||||
colNames: ['API ID', 'API 이름'],
|
||||
colModel: [
|
||||
{name: 'apiId', index: 'apiId', width: 100, align: 'center'},
|
||||
{name: 'apiName', index: 'apiName', width: 100, align: 'center'}
|
||||
],
|
||||
rowNum: 10,
|
||||
rowList: [10, 20, 30],
|
||||
pager: '#selectedApiGridPager',
|
||||
sortname: 'apiId',
|
||||
viewrecords: true,
|
||||
sortorder: "asc",
|
||||
caption: "선택된 API",
|
||||
height: 200,
|
||||
autowidth: true,
|
||||
multiselect: true,
|
||||
ondblClickRow: function (rowid, status, e) {
|
||||
// selectedApiGrid.jqGrid('delRowData', rowid);
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
dataType: "json",
|
||||
data: {cmd: 'LIST_DETAIL_COMBO'},
|
||||
success: function (json) {
|
||||
json.portalOrgList.unshift({
|
||||
id: "", // 실제 저장될 값은 빈 문자열
|
||||
orgName: "미분류" // 화면에 표시될 텍스트
|
||||
});
|
||||
new makeOptions("id", "orgName")
|
||||
.setObj($("select[name=orgid]"))
|
||||
.setFormat(nameOptionFormat)
|
||||
.setData(json.portalOrgList).rendering();
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
callback(key);
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
var returnUrl = getReturnUrlForReturn();
|
||||
var key = "${param.clientId}";
|
||||
if (key != "" && key != "null") {
|
||||
isDetail = true;
|
||||
}
|
||||
init(key, detail);
|
||||
|
||||
$("#btn_modify").click(function () {
|
||||
if (!isValid()) {
|
||||
return;
|
||||
}
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
if (isDetail) {
|
||||
postData.push({name: "cmd", value: "UPDATE"});
|
||||
} else {
|
||||
postData.push({name: "cmd", value: "INSERT"});
|
||||
}
|
||||
|
||||
var data = $("#selectedApiGrid").getRowData();
|
||||
var gridData = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
gridData.push({apiId: data[i]['apiId']});
|
||||
}
|
||||
|
||||
const orgName = $("select[name=orgid] option:selected").text();
|
||||
postData.push({
|
||||
name: "orgname",
|
||||
value: orgName
|
||||
});
|
||||
|
||||
postData.push({
|
||||
name: "apiList",
|
||||
value: JSON.stringify(gridData)
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postData,
|
||||
success: function (args) {
|
||||
alert("저장 되었습니다.");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_delete").click(function () {
|
||||
if (confirm("삭제하시겠습니까?")) {
|
||||
var postData = $('#ajaxForm').serializeArray();
|
||||
postData.push({name: "cmd", value: "DELETE"});
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: postData,
|
||||
success: function (args) {
|
||||
if (args.status == "error") {
|
||||
alert("동기화중 오류입니다.\n확인하여 주십시요.\n" + args.message);
|
||||
} else {
|
||||
alert("삭제 되었습니다.");
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_popup_api").click(function () {
|
||||
const args = {};
|
||||
const url2 = api_url_view += "?cmd=POPUP";
|
||||
showModal(url2, args, 1280, 860, function () {
|
||||
const popupFrame = args.self.frames[0];
|
||||
const returnValue = popupFrame.returnValue;
|
||||
const frameElement = popupFrame.frameElement
|
||||
const parentElement = frameElement.parentNode; // 부모 노드를 가져옴
|
||||
|
||||
if (parentElement) { // 부모 노드가 존재하는지 확인
|
||||
parentElement.removeChild(frameElement);
|
||||
}
|
||||
|
||||
var rows = $("#selectedApiGrid").jqGrid('getRowData');
|
||||
console.log(returnValue);
|
||||
|
||||
const apiId = returnValue.apiId;
|
||||
var apiIdExists = rows.some(function (row) {
|
||||
return row.apiId === apiId;
|
||||
});
|
||||
|
||||
if (apiIdExists) {
|
||||
return;
|
||||
}
|
||||
returnValue.apiName = returnValue.apiDesc;
|
||||
var ids = $("#selectedApiGrid").jqGrid('getDataIDs');
|
||||
var lastId = ids.length > 0 ? Math.max.apply(Math, ids) : 0;
|
||||
var newId = lastId + 1;
|
||||
$("#selectedApiGrid").jqGrid('addRowData', newId, returnValue, "last");
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_popup_api_group").click(function () {
|
||||
const args = {};
|
||||
const url2 = group_url_view += "?cmd=GROUP_POPUP";
|
||||
showModal(url2, args, 1280, 860, function () {
|
||||
const popupFrame = args.self.frames[0];
|
||||
const returnValue = popupFrame.returnValue;
|
||||
const frameElement = popupFrame.frameElement
|
||||
const parentElement = frameElement.parentNode; // 부모 노드를 가져옴
|
||||
|
||||
if (parentElement) { // 부모 노드가 존재하는지 확인
|
||||
parentElement.removeChild(frameElement);
|
||||
}
|
||||
|
||||
var rows = $("#selectedApiGrid").jqGrid('getRowData');
|
||||
console.log(returnValue);
|
||||
if (!returnValue.apiGroupApiList || returnValue.apiGroupApiList.length === 0) {
|
||||
return; // If apiGroupApiList is empty, do nothing
|
||||
}
|
||||
|
||||
returnValue.apiGroupApiList.forEach(function (apiGroupApi) {
|
||||
const apiId = apiGroupApi.apiId;
|
||||
var apiIdExists = rows.some(function (row) {
|
||||
return row.apiId === apiId;
|
||||
});
|
||||
|
||||
if (apiIdExists) {
|
||||
return;
|
||||
}
|
||||
apiGroupApi.apiName = apiGroupApi.apiDesc;
|
||||
var ids = $("#selectedApiGrid").jqGrid('getDataIDs');
|
||||
var lastId = ids.length > 0 ? Math.max.apply(Math, ids) : 0;
|
||||
var newId = lastId + 1;
|
||||
$("#selectedApiGrid").jqGrid('addRowData', newId, apiGroupApi, "last");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$("#btn_delete_api").click(function () {
|
||||
var grid = $("#selectedApiGrid");
|
||||
var selectedRowIds = grid.jqGrid('getGridParam', 'selarrrow'); // 선택된 행의 ID 배열을 가져옴
|
||||
if (selectedRowIds.length > 0) {
|
||||
// 선택된 행의 ID를 복사한 배열을 사용
|
||||
var idsToDelete = selectedRowIds.slice();
|
||||
|
||||
for (var i = 0; i < idsToDelete.length; i++) {
|
||||
grid.jqGrid('delRowData', idsToDelete[i]); // 선택된 각 행을 삭제
|
||||
}
|
||||
} else {
|
||||
alert("Please select at least one row to delete.");
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_previous").click(function () {
|
||||
goNav(returnUrl);//LIST로 이동
|
||||
});
|
||||
|
||||
$("#btn_gen_id").click(function () {
|
||||
//$('input[name=clientId]').val(generateString(32));
|
||||
$('input[name=clientId]').val(generateString($("#btn_clientId_byte").val()));
|
||||
});
|
||||
|
||||
$("#btn_gen_secret").click(function () {
|
||||
//$('input[name=clientSecret]').val(generateString(128));
|
||||
$('input[name=clientSecret]').val(generateString($("#btn_clientSecret_byte").val()));
|
||||
});
|
||||
|
||||
buttonControl(isDetail);
|
||||
titleControl(isDetail);
|
||||
});
|
||||
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
function generateString(length) {
|
||||
let result = '';
|
||||
const charactersLength = characters.length;
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="right_box">
|
||||
<div class="content_top">
|
||||
<ul class="path">
|
||||
<li><a href="#">${rmsMenuPath}</a></li>
|
||||
</ul>
|
||||
</div><!-- end content_top -->
|
||||
<div class="content_middle">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_delete" level="W" status="DETAIL"><i class="material-icons">delete</i> <%= localeMessage.getString("button.delete") %>
|
||||
</button>
|
||||
<button type="button" class="cssbtn" id="btn_modify" level="W" status="DETAIL,NEW"><i
|
||||
class="material-icons">save</i> <%= localeMessage.getString("button.modify") %>
|
||||
</button>
|
||||
<button type="button" class="cssbtn" id="btn_previous" level="R" status="DETAIL,NEW"><i
|
||||
class="material-icons">arrow_back</i> <%= localeMessage.getString("button.previous") %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="title" id="title">${rmsMenuName}</div>
|
||||
|
||||
<form id="ajaxForm">
|
||||
<table class="table_row" cellspacing="0">
|
||||
<tr>
|
||||
<th style="width:180px;"><%= localeMessage.getString("clntManDtl.clntNm") %> <small>(*)</small></th>
|
||||
<td><input type="text" name="clientname"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= localeMessage.getString("clntManDtl.clntId") %> <small>(*)</small></th>
|
||||
<td>
|
||||
<input type="text" name="clientid" style="width: calc(100% - 142px);"/>
|
||||
<select name="clientId_byte" id="btn_clientId_byte" style="width: 76px;">
|
||||
<option value="32" selected="selected">32 byte</option>
|
||||
<option value="64">64 byte</option>
|
||||
<option value="128">128 byte</option>
|
||||
<option value="256">256 byte</option>
|
||||
</select>
|
||||
<img src="<c:url value="/img/btn_pop_input.png"/>" id="btn_gen_id"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>APP 상태</th>
|
||||
<td>
|
||||
<div class="select-style">
|
||||
<select name="appstatus">
|
||||
<option value="1" selected>정상</option>
|
||||
<option value="0">차단</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>법인</th>
|
||||
<td>
|
||||
<div class="select-style">
|
||||
<select id="orgId" class="form-control" name="orgid">
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div style="font-size:0;">
|
||||
<div style="display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px ">
|
||||
<div class="table_row_title" style="margin-bottom: 0px">API</div>
|
||||
<div style="text-align: end;">
|
||||
<button type="button" class="cssbtn" id="btn_delete_api" level="W" status="DETAIL,NEW">
|
||||
<i class="material-icons">delete</i> <%= localeMessage.getString("button.delete") %>
|
||||
</button>
|
||||
<button type="button" class="cssbtn" id="btn_popup_api" level="W" status="DETAIL,NEW">
|
||||
<i class="material-icons">add</i> API <%= localeMessage.getString("button.add") %>
|
||||
</button>
|
||||
<button type="button" class="cssbtn" id="btn_popup_api_group" level="W" status="DETAIL,NEW">
|
||||
<i class="material-icons">add</i> API 그룹<%= localeMessage.getString("button.add") %>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:inline-block; width:calc(100%); vertical-align:top;">
|
||||
<div id="selectedApiList" style="margin-top:10px;">
|
||||
<table id="selectedApiGrid"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,138 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8" %>
|
||||
<%@ page import="java.io.*" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
<link href="<c:url value='/addon/bootstrap-5.3.2/css/bootstrap.min.css'/>" rel="stylesheet"/>
|
||||
<script src="<c:url value='/addon/bootstrap-5.3.2/js/bootstrap.bundle.min.js'/>"></script>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/apim/apigroup/apiGroupMan.json"/>';
|
||||
var url_view = '<c:url value="/onl/apim/apigroup/apiGroupMan.view"/>';
|
||||
var responseData = {};
|
||||
|
||||
function useFormatter(cellvalue, options, rowObject) {
|
||||
if (cellvalue == null || cellvalue == '')
|
||||
return '';
|
||||
return cellvalue === '0' ? '미사용' : '사용';
|
||||
}
|
||||
|
||||
function detail() {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST"); // jqGrid expects an object
|
||||
$("#grid").setGridParam({url: url, postData: postData}).trigger("reloadGrid");
|
||||
}
|
||||
|
||||
function search() {
|
||||
var postData = getSearchForJqgrid("cmd", "LIST"); // jqGrid expects an object
|
||||
$("#grid").setGridParam({url: url, postData: postData, page: 1}).trigger("reloadGrid");
|
||||
}
|
||||
|
||||
function list() {
|
||||
detail();
|
||||
var gridPostData = getSearchForJqgrid("cmd", "LIST"); // jqGrid expects an object
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: gridPostData,
|
||||
colNames: ['API 그룹 명', '설명', 'id'],
|
||||
colModel: [
|
||||
{name: 'groupName', align: 'center', width: '80', sortable: false},
|
||||
{name: 'groupDesc', align: 'left'},
|
||||
{name: 'id', align: 'center', width: '40', hidden: true}
|
||||
],
|
||||
jsonReader: {
|
||||
root: function (obj) {
|
||||
responseData = obj.rows; // Store the response data
|
||||
return obj.rows;
|
||||
},
|
||||
repeatitems: false
|
||||
},
|
||||
pager: $('#pager'),
|
||||
page: '${param.page}',
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: $("#container").height(),
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
loadComplete: function(d) {
|
||||
var colModel = $(this).getGridParam("colModel");
|
||||
for (var i = 0; i < colModel.length; i++) {
|
||||
$(this).setColProp(colModel[i].name, {sortable: false});
|
||||
}
|
||||
},
|
||||
ondblClickRow: function(rowId) {
|
||||
const rowData = $(this).getRowData(rowId);
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url:url,
|
||||
dataType:"json",
|
||||
data:{cmd: 'DETAIL', apiGroupId : rowData.id},
|
||||
success:function(json){
|
||||
window.returnValue = json;
|
||||
window.close();
|
||||
},
|
||||
error:function(e){
|
||||
alert(e.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
list();
|
||||
resizeJqGridWidth('grid', 'content_middle', '1000');
|
||||
|
||||
$("#btn_search").click(function() {
|
||||
search();
|
||||
});
|
||||
$("input[name^=search]").keydown(function(key) {
|
||||
if (key.keyCode == 13) {
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
|
||||
buttonControl();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div class="content_middle" id="content_middle" style="margin-top: 0px">
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %>
|
||||
</button>
|
||||
</div>
|
||||
<div class="title" id="title">${rmsMenuName}</div>
|
||||
<table class="search_condition" cellspacing="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width:180px;">API 그룹 명</th>
|
||||
<td>
|
||||
<input type="text" name="searchGroupName" value="${param.searchGroupName}">
|
||||
</td>
|
||||
<th style="width:180px;">설명</th>
|
||||
<td>
|
||||
<input type="text" name="searchGroupDesc" value="${param.searchGroupDesc}">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
</div><!-- end content_middle -->
|
||||
</div><!-- end right_box -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,103 @@
|
||||
<%@ page language="java" contentType="text/html; charset=utf-8"%>
|
||||
<%@ page import="java.io.*"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ include file="/jsp/common/include/localemessage.jsp" %>
|
||||
<%
|
||||
response.setHeader("Pragma", "No-cache");
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<title>Client 선택</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<jsp:include page="/jsp/common/include/css_custom.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/css.jsp"/>
|
||||
<jsp:include page="/jsp/common/include/script.jsp"/>
|
||||
</head>
|
||||
<script language="javascript">
|
||||
var url = '<c:url value="/onl/admin/authserver/clientMan.json" />';
|
||||
$(document).ready(function() {
|
||||
var gridPostData = getSearchForJqgrid("cmd","POPUP_LIST");
|
||||
$('#grid').jqGrid({
|
||||
datatype: "json",
|
||||
mtype: 'POST',
|
||||
url: url,
|
||||
postData: gridPostData,
|
||||
colNames: ['클라이언트명', '클라이언트ID', '스코프', 'GRANT타입', 'TOKEN유효시간(초)'],
|
||||
colModel: [
|
||||
{ name: 'CLIENTNAME', align: 'left', sortable: false },
|
||||
{ name: 'CLIENTID', align: 'left', sortable: false },
|
||||
{ name: 'SCOPE', align: 'left', sortable: false },
|
||||
{ name: 'GRANTTYPES', align: 'left', sortable: false },
|
||||
{ name: 'ACCESSTOKENVALIDITYSECONDS', align: 'center', sortable: false }
|
||||
],
|
||||
jsonReader: {
|
||||
repeatitems: false
|
||||
},
|
||||
pager : $('#pager'),
|
||||
page : '${param.page}',
|
||||
rowNum: '${rmsDefaultRowNum}',
|
||||
autoheight: true,
|
||||
height: 'auto',
|
||||
autowidth: true,
|
||||
viewrecords: true,
|
||||
shrinkToFit: true,
|
||||
rowList: eval('[${rmsDefaultRowList}]'),
|
||||
ondblClickRow: function(rowid) {
|
||||
var rowData = $(this).getRowData(rowid);
|
||||
var clientId = rowData['CLIENTID'];
|
||||
if (window.opener && typeof window.opener.selectClient === "function") {
|
||||
window.opener.selectClient(clientId);
|
||||
window.close();
|
||||
} else if (window.parent && typeof window.parent.selectClient === "function") {
|
||||
window.parent.selectClient(clientId);
|
||||
window.parent.closeModal();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
resizeJqGridWidth('grid', 'popup_box', '100%');
|
||||
|
||||
$("#btn_search").click(function(){
|
||||
var postData = getSearchForJqgrid("cmd","POPUP_LIST");
|
||||
$("#grid").setGridParam({ postData: postData, page: 1 }).trigger("reloadGrid");
|
||||
});
|
||||
|
||||
$("#btn_close").click(function(){
|
||||
if (window.parent && typeof window.parent.closeModal === "function") {
|
||||
window.parent.closeModal();
|
||||
} else {
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name^=search]").keydown(function(key){
|
||||
if (key.keyCode == 13){
|
||||
$("#btn_search").click();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
<div class="popup_box" >
|
||||
<div class="search_wrap">
|
||||
<button type="button" class="cssbtn" id="btn_search" level="R"><i class="material-icons">search</i> <%= localeMessage.getString("button.search") %></button>
|
||||
<button type="button" class="cssbtn" id="btn_close" level="R"><i class="material-icons">cancel</i> <%= localeMessage.getString("button.close") %></button>
|
||||
</div>
|
||||
<div class="title">Client 선택</div>
|
||||
|
||||
<table class="search_condition" cellspacing="0">
|
||||
<tr>
|
||||
<th>클라이언트명</th>
|
||||
<td><input type="text" name="searchClientName" value="${param.searchClientName}"></td>
|
||||
<th>클라이언트ID</th>
|
||||
<td><input type="text" name="searchClientId" value="${param.searchClientId}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- grid -->
|
||||
<table id="grid"></table>
|
||||
<div id="pager"></div>
|
||||
</div><!-- end popup_box -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user