Scope관리 Api Reload 버그 수정

This commit is contained in:
eastargh
2026-07-06 16:26:40 +09:00
parent 142d402bad
commit c3955cefd8
3 changed files with 93 additions and 60 deletions
@@ -19,7 +19,6 @@
var url = '<c:url value="/onl/admin/authserver/scopeMan.json" />';
var url_view = '<c:url value="/onl/admin/authserver/scopeMan.view" />';
var api_url_view = '<c:url value="/onl/apim/apigroup/apiGroupMan.view" />';
var mapping_url = '<c:url value="/onl/admin/authserver/apiScopeMan.json" />';
var isDetail = false;
function isValid(){
@@ -65,9 +64,9 @@ function mappingInfo(key){
$.ajax({
type : "POST",
url: mapping_url,
url: url,
dataType: "json",
data: {cmd: 'LIST', searchScopeId : key},
data: {cmd: 'API_LIST', searchScopeId : key},
success: function(json){
var mappingData = json.rows;
@@ -131,45 +130,6 @@ function init(key, callback){
}
}
function saveApiGridData(scopeId, returnUrl) {
var postData = [];
var rows = $("#selectedApiGrid").jqGrid('getRowData');
$.each(rows, function(index, item) {
item.scopeId = scopeId;
});
postData.push({
name: "apiList",
value: JSON.stringify(rows)
});
postData.push({ name: "cmd" , value:"INSERT_APILIST" });
postData.push({ name: "scopeId" , value:scopeId });
$.ajax({
type : "POST",
url:mapping_url,
data: postData,
beforeSend: function() {
$("[id^='btn_']").prop("disabled", true);
$("#btn_modify").text("처리중 . . . . .");
},
success:function(args){
alert("저장 되었습니다.");
goNav(returnUrl);//LIST로 이동
},
error:function(e){
alert(e.responseText);
},
complete: function() {
$("[id^='btn_']").prop("disabled", false);
$("#btn_modify").text("수정");
}
});
}
$(document).ready(function() {
var returnUrl = getReturnUrlForReturn();
var key ="${param.scopeId}";
@@ -182,28 +142,39 @@ $(document).ready(function() {
if (!isValid()){
return;
}
var scopeId = $('input[name=scopeId]').val();
var postData = $('#ajaxForm').serializeArray();
var rows = $("#selectedApiGrid").jqGrid('getRowData');
$.each(rows, function(index, item) {
item.scopeId = scopeId;
});
postData.push({ name: "apiList" , value: JSON.stringify(rows) });
if (isDetail){
postData.push({ name: "cmd" , value:"UPDATE"});
}else{
postData.push({ name: "cmd" , value:"INSERT"});
}
$.ajax({
type : "POST",
url:url,
data:postData,
beforeSend: function() {
$("[id^='btn_']").prop("disabled", true);
$("#btn_modify").text("처리중 . . . . .");
},
success:function(args){
alert("SCOPE 정보가 저장 되었습니다. 이어서 API 리스트를 저장합니다.");
if(!isDetail) { // INSERT 일 경우 ScopeId를 업데이트
key = $('input[name=scopeId]').val();
}
saveApiGridData(key, returnUrl); // API LIST 저장.
alert("저장 되었습니다.");
goNav(returnUrl);//LIST로 이동
},
error:function(e){
alert(e.responseText);
},
complete: function() {
$("[id^='btn_']").prop("disabled", false);
$("#btn_modify").text("수정");
}
});
});