테스터 - 서버 선택 수정
This commit is contained in:
@@ -84,6 +84,7 @@ public class ApiRequestMgmtService {
|
|||||||
|
|
||||||
collection.getApis().remove(api);
|
collection.getApis().remove(api);
|
||||||
apiCollectionRepository.save(collection);
|
apiCollectionRepository.save(collection);
|
||||||
|
apiRequestRepository.deleteById(apiId);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,9 +61,8 @@
|
|||||||
<label class="form-label must">Method</label>
|
<label class="form-label must">Method</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-floating col-md-1 me-1">
|
<div class="form-floating col-md-1 me-1">
|
||||||
<select class="form-select server" name="server">
|
<select class="form-select server" name="server" required>
|
||||||
<option th:each="server : ${servers}" th:value="${server.id}" th:text="${server.name}"
|
<option th:each="server : ${servers}" th:value="${server.id}" th:text="${server.name}" th:data-path="${server.basePath}"></option>
|
||||||
th:data-path="${server.basePath}"></option>
|
|
||||||
</select>
|
</select>
|
||||||
<label class="form-label must">Server</label>
|
<label class="form-label must">Server</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -433,9 +432,8 @@
|
|||||||
controller.addQueryParam(idx, '', '');
|
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('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 () {
|
target.find('select[name="server"]').on('change', function () {
|
||||||
model.server = $(this).val();
|
model.server = $(this).val();
|
||||||
let selected = $(this).find('option:selected');
|
let selected = $(this).find('option:selected');
|
||||||
@@ -814,7 +812,7 @@
|
|||||||
console.log(model);
|
console.log(model);
|
||||||
|
|
||||||
this.currentAjaxRequest = $.ajax({
|
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',
|
type: 'POST',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
data: JSON.stringify(model),
|
data: JSON.stringify(model),
|
||||||
@@ -840,6 +838,7 @@
|
|||||||
headers: [],
|
headers: [],
|
||||||
queryParams: [],
|
queryParams: [],
|
||||||
requestBody: '',
|
requestBody: '',
|
||||||
|
collectionId : collectionId,
|
||||||
responseModel: {
|
responseModel: {
|
||||||
status: 0,
|
status: 0,
|
||||||
time: 0,
|
time: 0,
|
||||||
@@ -850,7 +849,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.currentAjaxRequest = $.ajax({
|
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',
|
type: 'POST',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
data: JSON.stringify(newApi),
|
data: JSON.stringify(newApi),
|
||||||
|
|||||||
Reference in New Issue
Block a user