플랫 전분 기본 처리 반영

This commit is contained in:
현성필
2024-05-07 13:43:48 +09:00
parent a2aecb03e7
commit ac88b6388e
17 changed files with 1415 additions and 300 deletions
+31 -14
View File
@@ -175,6 +175,7 @@ class APITester {
width: 0
});
}
for (let i = 0; i < this.responseEditors.length; i++) {
this.responseEditors[i].layout({
width: 0
@@ -387,14 +388,13 @@ class APITester {
});
let language = model.type === 'HTTP' ? 'json' : 'text';
let target = null;
let requestBodyEditor = null;
let target = null;
if (model.type === 'HTTP') {
let httpClientView = new HTTPClientView(me, this.serverManager, apiRequestTabContent, model);
httpClientView.init();
this.openTab(model.id);
target = $('#api_request_' + model.id);
target = this.openTab(model.id);
requestBodyEditor = monaco.editor.create(target.find('.request_body')[0], {
value: model.requestBody, language: 'json', automaticLayout: true
});
@@ -403,12 +403,13 @@ class APITester {
if (model.type === 'TCP') {
const tcpClientView = new TCPClientView(me, this.serverManager, apiRequestTabContent, model);
tcpClientView.init();
this.openTab(model.id);
target = $('#api_request_' + model.id);
target = this.openTab(model.id);
requestBodyEditor = monaco.editor.create(target.find('.request_body')[0], {
value: model.requestBody, language: 'text', automaticLayout: false
value: model.requestBody, language: 'text', automaticLayout: true
});
tcpClientView.setRequestBodyEditor(requestBodyEditor);
tcpClientView.requestBodyEditor = requestBodyEditor;
}
requestBodyEditor.onMouseMove((e) => {
@@ -428,7 +429,8 @@ class APITester {
});
me.requestEditors.push(requestBodyEditor);
target.find('.request_body')[0].addEventListener('shown.bs.tab', () => {
target.find('.request_body_tab')[0].addEventListener('shown.bs.tab', () => {
me.requestEditors[index].layout();
});
@@ -553,6 +555,7 @@ class APITester {
}
openTab(id) {
const target = $(`#api_request_${id}`);
try {
$(`#api_request_tab_${id}`).tab('show'); // API request 탭 활성화
} catch (e) {
@@ -562,6 +565,7 @@ class APITester {
$(`#api_request_${id}`).find('.btn_request_body_tab').tab('show'); // Body 탭 활성화
} catch (e) {
}
return target;
}
addHeader(event) {
@@ -601,7 +605,6 @@ class APITester {
});
}
}
console.log(queryParams);
return queryParams;
}
@@ -791,18 +794,32 @@ class APITester {
})[0];
let me = this;
let newApi = {
id: '', server: null, method: 'GET', name: newApiName, path: '', type: newApiType, headers: [], queryParams: [], requestBody: '', preRequestScript: '', postRequestScript: '', collectionId: collectionId, responseModel: {
status: 0, time: 0, size: 0, headers: [], ody: ''
id: '',
server: null,
method: 'GET',
name: newApiName,
path: '',
type: newApiType,
headers: [],
queryParams: [],
requestBody: '',
preRequestScript: '',
postRequestScript: '',
collectionId: collectionId,
responseModel: {
status: 0,
time: 0,
size: 0,
headers: [],
body: ''
}
};
newApi.collectionName = collection.name;
if (newApiType === 'TCP') {
newApi.layout = [];
newApi.layout.push({layoutItems: []});
newApi.layout = { layoutItems : []};
}
this.currentAjaxRequest = $.ajax({
url: this.getAPISaveURL(collectionId), type: 'POST', contentType: 'application/json', data: JSON.stringify(newApi), success: function(data) {
newApi.id = data;