♻️ Refactor Functions
This commit is contained in:
@@ -7,7 +7,7 @@ import * as querystring from "querystring";
|
|||||||
* output this: 'msg1=value1&msg2=value2'
|
* output this: 'msg1=value1&msg2=value2'
|
||||||
* @param dataArguments
|
* @param dataArguments
|
||||||
*/
|
*/
|
||||||
function joinDataArguments(dataArguments) {
|
let joinDataArguments=(dataArguments)=> {
|
||||||
let data = "";
|
let data = "";
|
||||||
dataArguments.forEach((argument, i) => {
|
dataArguments.forEach((argument, i) => {
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
"requestUpdateData.collectionIndex": function resetFolderIndex() {
|
"requestUpdateData.collectionIndex": ()=> { //resetFolderIndex Function
|
||||||
// if user choosen some folder, than selected other collection, which doesn't have any folders
|
// if user choosen some folder, than selected other collection, which doesn't have any folders
|
||||||
// than `requestUpdateData.folderIndex` won't be reseted
|
// than `requestUpdateData.folderIndex` won't be reseted
|
||||||
this.$data.requestUpdateData.folderIndex = undefined;
|
this.$data.requestUpdateData.folderIndex = undefined;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ export default {
|
|||||||
this.$data.requestData.folderIndex = undefined;
|
this.$data.requestData.folderIndex = undefined;
|
||||||
this.$data.requestData.requestIndex = undefined;
|
this.$data.requestData.requestIndex = undefined;
|
||||||
},
|
},
|
||||||
"requestData.folderIndex": function resetRequestIndex() {
|
"requestData.folderIndex": ()=> {
|
||||||
this.$data.requestData.requestIndex = undefined;
|
this.$data.requestData.requestIndex = undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -923,7 +923,7 @@ export default {
|
|||||||
if (status && this.rawParams === "") this.rawParams = "{}";
|
if (status && this.rawParams === "") this.rawParams = "{}";
|
||||||
else this.setRouteQueryState();
|
else this.setRouteQueryState();
|
||||||
},
|
},
|
||||||
"response.body": function(val) {
|
"response.body": (val)=> {
|
||||||
if (
|
if (
|
||||||
this.response.body === "(waiting to send request)" ||
|
this.response.body === "(waiting to send request)" ||
|
||||||
this.response.body === "Loading..."
|
this.response.body === "Loading..."
|
||||||
@@ -947,7 +947,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
params: {
|
params: {
|
||||||
handler: function(newValue) {
|
handler: (newValue)=> {
|
||||||
if (!this.paramsWatchEnabled) {
|
if (!this.paramsWatchEnabled) {
|
||||||
this.paramsWatchEnabled = true;
|
this.paramsWatchEnabled = true;
|
||||||
return;
|
return;
|
||||||
@@ -1984,7 +1984,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.observeRequestButton();
|
this.observeRequestButton();
|
||||||
this._keyListener = function(e) {
|
this._keyListener = (e)=> {
|
||||||
if (e.key === "g" && (e.ctrlKey || e.metaKey)) {
|
if (e.key === "g" && (e.ctrlKey || e.metaKey)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.sendRequest();
|
this.sendRequest();
|
||||||
|
|||||||
@@ -432,8 +432,8 @@ export default {
|
|||||||
this.sse.close();
|
this.sse.close();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updated: function() {
|
updated: ()=> {
|
||||||
this.$nextTick(function() {
|
this.$nextTick(()=> {
|
||||||
const divLog = document.getElementById("log");
|
const divLog = document.getElementById("log");
|
||||||
divLog.scrollBy(0, divLog.scrollHeight + 100);
|
divLog.scrollBy(0, divLog.scrollHeight + 100);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user