활성 API 처리 버그 수정
This commit is contained in:
@@ -111,7 +111,8 @@ function detail(url, key) {
|
||||
$.each(json.interfaceList, function(i, item) {
|
||||
interfaceList.push({
|
||||
interfaceId: item.interfaceId || item.INTERFACEID,
|
||||
interfaceDesc: item.interfaceDesc || item.INTERFACEDESC
|
||||
interfaceDesc: item.interfaceDesc || item.INTERFACEDESC,
|
||||
useYn: item.useYn || item.USEYN || '1'
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -127,7 +128,15 @@ function renderInterfaceList() {
|
||||
var container = $('#interfaceListContainer');
|
||||
container.empty();
|
||||
|
||||
var activeCount = interfaceList.filter(function(item) {
|
||||
return item.useYn === '1' || item.useYn === undefined;
|
||||
}).length;
|
||||
$('#interfaceCountNum').text(interfaceList.length);
|
||||
if (interfaceList.length > 0 && activeCount === interfaceList.length) {
|
||||
$('#interfaceActiveLabel').html('<strong>전체 활성</strong>');
|
||||
} else {
|
||||
$('#interfaceActiveLabel').html('활성 <strong id="interfaceActiveNum">' + activeCount + '</strong>개');
|
||||
}
|
||||
|
||||
if (interfaceList.length === 0) {
|
||||
container.html('<tr class="interface-empty-row" id="interfaceEmpty"><td colspan="3" class="interface-empty"><i class="material-icons">inbox</i> 매핑된 API가 없습니다</td></tr>');
|
||||
@@ -157,7 +166,10 @@ function renderInterfaceList() {
|
||||
function getInterfaceListJson() {
|
||||
var gridData = [];
|
||||
$.each(interfaceList, function(i, item) {
|
||||
gridData.push({interfaceId: item.interfaceId});
|
||||
gridData.push({
|
||||
interfaceId: item.interfaceId,
|
||||
useYn: item.useYn !== undefined ? item.useYn : '1'
|
||||
});
|
||||
});
|
||||
return JSON.stringify(gridData);
|
||||
}
|
||||
@@ -381,6 +393,19 @@ function renderBucketStatus(servers) {
|
||||
$('#summaryThresholdWrap').hide();
|
||||
}
|
||||
|
||||
// 활성 API 정보 표시
|
||||
var activeApis = interfaceList.filter(function(item) {
|
||||
return item.useYn === '1' || item.useYn === undefined;
|
||||
});
|
||||
$('#summaryActiveApi').html(activeApis.length + '<span class="unit">개</span>');
|
||||
if (activeApis.length > 0) {
|
||||
var apiIds = activeApis.map(function(item) { return item.interfaceId; });
|
||||
var displayText = apiIds.length <= 3 ? apiIds.join(', ') : apiIds.slice(0, 3).join(', ') + ' 외 ' + (apiIds.length - 3) + '개';
|
||||
$('#summaryActiveApiList').text(displayText);
|
||||
} else {
|
||||
$('#summaryActiveApiList').text('');
|
||||
}
|
||||
|
||||
$('#bucketSummary').show();
|
||||
} else {
|
||||
$('#bucketSummary').hide();
|
||||
@@ -536,6 +561,15 @@ $(document).ready(function() {
|
||||
item.useYn = useYn;
|
||||
}
|
||||
});
|
||||
// 활성 건수 업데이트
|
||||
var activeCount = interfaceList.filter(function(item) {
|
||||
return item.useYn === '1' || item.useYn === undefined;
|
||||
}).length;
|
||||
if (interfaceList.length > 0 && activeCount === interfaceList.length) {
|
||||
$('#interfaceActiveLabel').html('<strong>전체 활성</strong>');
|
||||
} else {
|
||||
$('#interfaceActiveLabel').html('활성 <strong id="interfaceActiveNum">' + activeCount + '</strong>개');
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_modify").click(function() {
|
||||
@@ -816,7 +850,7 @@ $(document).ready(function() {
|
||||
<!-- API 매핑 -->
|
||||
<span class="section-label">API 매핑</span>
|
||||
<div class="interface-header">
|
||||
<span class="interface-count">매핑된 API <strong id="interfaceCountNum">0</strong>개</span>
|
||||
<span class="interface-count">매핑된 API <strong id="interfaceCountNum">0</strong>개 (<span id="interfaceActiveLabel">활성 <strong id="interfaceActiveNum">0</strong>개</span>)</span>
|
||||
<button type="button" class="cssbtn" id="btn_popup_interface"><i class="material-icons">add</i> 추가</button>
|
||||
</div>
|
||||
<div class="interface-list-wrap">
|
||||
@@ -869,6 +903,11 @@ $(document).ready(function() {
|
||||
<span class="bucket-summary-value" id="summaryThreshold">0<span class="unit">req</span></span>
|
||||
<span class="bucket-summary-sub" id="summaryThresholdCalc"></span>
|
||||
</div>
|
||||
<div class="bucket-summary-item">
|
||||
<span class="bucket-summary-label">적용 API</span>
|
||||
<span class="bucket-summary-value" id="summaryActiveApi">0<span class="unit">개</span></span>
|
||||
<span class="bucket-summary-sub" id="summaryActiveApiList"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user