diff options
Diffstat (limited to '_www')
| -rw-r--r-- | _www/functions.js | 23 | ||||
| -rw-r--r-- | _www/functions.ts | 24 | ||||
| -rw-r--r-- | _www/http_target.js | 62 | ||||
| -rw-r--r-- | _www/http_target.ts | 62 | ||||
| -rw-r--r-- | _www/interface.ts | 4 |
5 files changed, 64 insertions, 111 deletions
diff --git a/_www/functions.js b/_www/functions.js index 762a8cc..178690a 100644 --- a/_www/functions.js +++ b/_www/functions.js @@ -76,29 +76,6 @@ export function generateFormInput(parent, fi) { break; } } -export function HTTPMethodToString(m) { - switch (m) { - case 0: - return "GET"; - case 1: - return "CONNECT"; - case 2: - return "DELETE"; - case 3: - return "HEAD"; - case 4: - return "OPTIONS"; - case 5: - return "PATCH"; - case 6: - return "POST"; - case 7: - return "PUT"; - case 8: - return "TRACE"; - } - return "???"; -} // // loadHTTPTargetHeader get HTTPTarget header from local storage by key. // If no header exist in storage return the one from HTTPTarget itself. diff --git a/_www/functions.ts b/_www/functions.ts index b570cc4..a0ec997 100644 --- a/_www/functions.ts +++ b/_www/functions.ts @@ -98,30 +98,6 @@ export function generateFormInput(parent: HTMLElement, fi: FormInput) { } } -export function HTTPMethodToString(m: number): string { - switch (m) { - case 0: - return "GET"; - case 1: - return "CONNECT"; - case 2: - return "DELETE"; - case 3: - return "HEAD"; - case 4: - return "OPTIONS"; - case 5: - return "PATCH"; - case 6: - return "POST"; - case 7: - return "PUT"; - case 8: - return "TRACE"; - } - return "???"; -} - // // loadHTTPTargetHeader get HTTPTarget header from local storage by key. // If no header exist in storage return the one from HTTPTarget itself. diff --git a/_www/http_target.js b/_www/http_target.js index 690036c..2177a64 100644 --- a/_www/http_target.js +++ b/_www/http_target.js @@ -81,45 +81,45 @@ export class HTTPTarget { name: "", options: { GET: { - value: "0", - selected: m === "0", + value: "GET", + selected: m === "GET", }, CONNECT: { - value: "1", - selected: m === "1", + value: "CONNECT", + selected: m === "CONNECT", }, DELETE: { - value: "2", - selected: m === "2", + value: "DELETE", + selected: m === "DELETE", }, HEAD: { - value: "3", - selected: m === "3", + value: "HEAD", + selected: m === "HEAD", }, OPTIONS: { - value: "4", - selected: m === "4", + value: "OPTIONS", + selected: m === "OPTIONS", }, PATCH: { - value: "5", - selected: m === "5", + value: "PATCH", + selected: m === "PATCH", }, POST: { - value: "6", - selected: m === "6", + value: "POST", + selected: m === "POST", }, PUT: { - value: "7", - selected: m === "7", + value: "PUT", + selected: m === "PUT", }, TRACE: { - value: "8", - selected: m === "8", + value: "TRACE", + selected: m === "TRACE", }, }, is_disabled: !this.opts.IsCustomizable, onChangeHandler: (_, value) => { - this.opts.Method = parseInt(value); + this.opts.Method = value; }, }; const wuiRequestMethod = new WuiInputSelect(selectOpts); @@ -143,31 +143,31 @@ export class HTTPTarget { name: "", options: { "(none)": { - value: "0", - selected: ct === "0", + value: "", + selected: ct === "", }, - "(query)": { - value: "1", - selected: ct === "1", + query: { + value: "query", + selected: ct === "query", }, "application/x-www-form-urlencoded": { - value: "2", - selected: ct === "2", + value: "form-urlencoded", + selected: ct === "form-urlencoded", }, "multipart/form-data": { - value: "3", - selected: ct === "3", + value: "form-data", + selected: ct === "form-data", }, "application/json": { - value: "4", - selected: ct === "4", + value: "json", + selected: ct === "json", }, }, class_input: CLASS_INPUT, class_label: CLASS_INPUT_LABEL, is_disabled: !this.opts.IsCustomizable, onChangeHandler: (_, value) => { - this.opts.RequestType = parseInt(value); + this.opts.RequestType = value; }, }; const wuiRequestType = new WuiInputSelect(selectOpts); diff --git a/_www/http_target.ts b/_www/http_target.ts index d910435..63d938e 100644 --- a/_www/http_target.ts +++ b/_www/http_target.ts @@ -111,45 +111,45 @@ export class HTTPTarget { name: "", options: { GET: { - value: "0", - selected: m === "0", + value: "GET", + selected: m === "GET", }, CONNECT: { - value: "1", - selected: m === "1", + value: "CONNECT", + selected: m === "CONNECT", }, DELETE: { - value: "2", - selected: m === "2", + value: "DELETE", + selected: m === "DELETE", }, HEAD: { - value: "3", - selected: m === "3", + value: "HEAD", + selected: m === "HEAD", }, OPTIONS: { - value: "4", - selected: m === "4", + value: "OPTIONS", + selected: m === "OPTIONS", }, PATCH: { - value: "5", - selected: m === "5", + value: "PATCH", + selected: m === "PATCH", }, POST: { - value: "6", - selected: m === "6", + value: "POST", + selected: m === "POST", }, PUT: { - value: "7", - selected: m === "7", + value: "PUT", + selected: m === "PUT", }, TRACE: { - value: "8", - selected: m === "8", + value: "TRACE", + selected: m === "TRACE", }, }, is_disabled: !this.opts.IsCustomizable, onChangeHandler: (_: string, value: string) => { - this.opts.Method = parseInt(value); + this.opts.Method = value; }, }; const wuiRequestMethod = new WuiInputSelect(selectOpts); @@ -176,31 +176,31 @@ export class HTTPTarget { name: "", options: { "(none)": { - value: "0", - selected: ct === "0", + value: "", + selected: ct === "", }, - "(query)": { - value: "1", - selected: ct === "1", + query: { + value: "query", + selected: ct === "query", }, "application/x-www-form-urlencoded": { - value: "2", - selected: ct === "2", + value: "form-urlencoded", + selected: ct === "form-urlencoded", }, "multipart/form-data": { - value: "3", - selected: ct === "3", + value: "form-data", + selected: ct === "form-data", }, "application/json": { - value: "4", - selected: ct === "4", + value: "json", + selected: ct === "json", }, }, class_input: CLASS_INPUT, class_label: CLASS_INPUT_LABEL, is_disabled: !this.opts.IsCustomizable, onChangeHandler: (_: string, value: string) => { - this.opts.RequestType = parseInt(value); + this.opts.RequestType = value; }, }; const wuiRequestType = new WuiInputSelect(selectOpts); diff --git a/_www/interface.ts b/_www/interface.ts index 9c4d487..d525c80 100644 --- a/_www/interface.ts +++ b/_www/interface.ts @@ -59,9 +59,9 @@ export interface HTTPTargetInterface { Name: string; Hint?: string; ID: string; - Method: number; + Method: string; Path: string; - RequestType: number; + RequestType: string; Headers: KeyFormInput; Params: KeyFormInput; RawBody: string; |
