테스터 - 서버 선택 수정

This commit is contained in:
현성필
2023-07-04 10:03:15 +09:00
parent 557dcdd0a6
commit cb2fefe55b
2 changed files with 7 additions and 7 deletions
@@ -84,6 +84,7 @@ public class ApiRequestMgmtService {
collection.getApis().remove(api);
apiCollectionRepository.save(collection);
apiRequestRepository.deleteById(apiId);
}
}
@@ -61,9 +61,8 @@
<label class="form-label must">Method</label>
</div>
<div class="form-floating col-md-1 me-1">
<select class="form-select server" name="server">
<option th:each="server : ${servers}" th:value="${server.id}" th:text="${server.name}"
th:data-path="${server.basePath}"></option>
<select class="form-select server" name="server" required>
<option th:each="server : ${servers}" th:value="${server.id}" th:text="${server.name}" th:data-path="${server.basePath}"></option>
</select>
<label class="form-label must">Server</label>
</div>
@@ -433,9 +432,8 @@
controller.addQueryParam(idx, '', '');
});
model.server = target.find('select[name="server"]').val();
target.find('input[name="basePath"]').val(target.find('select[name="server"] option:selected').data('path'));
target.find('select[name="server"]').val(model.server);
target.find('select[name="server"]').on('change', function () {
model.server = $(this).val();
let selected = $(this).find('option:selected');
@@ -814,7 +812,7 @@
console.log(model);
this.currentAjaxRequest = $.ajax({
url: '/mgmt/collections/{id}/apis/save.do'.replace('{id}', model.collectionId),
url: '/mgmt/collections/{collectionId}/apis/save.do'.replace('{collectionId}', model.collectionId),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(model),
@@ -840,6 +838,7 @@
headers: [],
queryParams: [],
requestBody: '',
collectionId : collectionId,
responseModel: {
status: 0,
time: 0,
@@ -850,7 +849,7 @@
};
this.currentAjaxRequest = $.ajax({
url: '/mgmt/collections/{id}/apis/save.do'.replace('{id}', collectionId),
url: '/mgmt/collections/{collectionId}/apis/save.do'.replace('{collectionId}', collectionId),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(newApi),