요청 관리 초기 사용시 서버 확인 메시지 표시 추가

This commit is contained in:
현성필
2023-10-30 16:52:12 +09:00
parent 1c1a052f3f
commit 76383e8e5f
+10 -1
View File
@@ -315,6 +315,10 @@ class APITester {
init(servers) { init(servers) {
if (servers) { if (servers) {
this.servers = servers; this.servers = servers;
if (this.servers.length === 0){
$('.toast-body').text('서버관리에서 서버를 등록해주세요.');
$('.toast').toast('show');
}
} }
this.bindEvents(); this.bindEvents();
this.loadCollections(); this.loadCollections();
@@ -402,7 +406,8 @@ class APITester {
showNewApiRequestModal(event) { showNewApiRequestModal(event) {
if (this.collections.length == 0) { if (this.collections.length == 0) {
alert('새로운 컬렉션을 추가해 주세요.'); $('.toast-body').text('새로운 컬렉션을 추가해 주세요.');
$('.toast').toast('show');
return; return;
} }
$('#new_api_request_modal').modal('show'); $('#new_api_request_modal').modal('show');
@@ -941,6 +946,9 @@ class APITester {
addAPIRequest(event) { addAPIRequest(event) {
const collectionId = $('#modal_collection').val(); const collectionId = $('#modal_collection').val();
const collection = this.collections.filter(function (collection) {
return collection.id === collectionId;
})[0];
let me = this; let me = this;
let newApi = { let newApi = {
id: '', id: '',
@@ -961,6 +969,7 @@ class APITester {
ody: '' ody: ''
} }
}; };
newApi.collectionName = collection.name;
this.currentAjaxRequest = $.ajax({ this.currentAjaxRequest = $.ajax({
url: `/mgmt/collections/${collectionId}/apis/save.do`, url: `/mgmt/collections/${collectionId}/apis/save.do`,