context-path 대응

This commit is contained in:
현성필
2024-01-23 14:44:00 +09:00
parent 1e059a8cf7
commit be1053d832
6 changed files with 81 additions and 37 deletions
+23 -7
View File
@@ -4,12 +4,28 @@ import APIScenarioExecutor from "./APIScenarioExecutor";
import Drawflow from "drawflow";
class APIScenario {
constructor(apiTester) {
constructor(apiTester, contextPath) {
this.scenarioList = [];
this.currentIndex = -1;
this.currentScenario = null;
this.apiTester = apiTester;
console.log('constructor');
this.contextPath = contextPath || '/';
}
getAPIScenarioListURL() {
return this.contextPath + 'mgmt/api_scenario/list.do';
}
getAPIScenarioCreateURL() {
return this.contextPath + 'mgmt/api_scenario/create.do';
}
getAPIScenarioUpdateURL() {
return this.contextPath + 'mgmt/api_scenario/update.do';
}
getAPIScenarioDeleteURL() {
return this.contextPath + 'mgmt/api_scenario/delete.do';
}
init() {
@@ -36,7 +52,7 @@ class APIScenario {
loadScenarioList(callback) {
const me = this;
this.currentAjaxRequest = $.ajax({
url: '/mgmt/api_scenario/list.do',
url: this.getAPIScenarioListURL(),
type: 'GET',
contentType: 'application/json',
success: function (data) {
@@ -114,7 +130,7 @@ class APIScenario {
const me = this;
me.showLoadingOverlay();
this.currentAjaxRequest = $.ajax({
url: '/mgmt/api_scenario/create.do',
url: this.getAPIScenarioCreateURL(),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({name: name, scenario: "{}", description: ""}),
@@ -152,7 +168,7 @@ class APIScenario {
const me = this;
me.showLoadingOverlay();
this.currentAjaxRequest = $.ajax({
url: '/mgmt/api_scenario/update.do',
url: this.getAPIScenarioUpdateURL(),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify(updatedScenario),
@@ -181,7 +197,7 @@ class APIScenario {
const me = this;
me.showLoadingOverlay();
this.currentAjaxRequest = $.ajax({
url: '/mgmt/api_scenario/delete.do',
url: this.getAPIScenarioDeleteURL(),
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({id: id}),