From 7ac0ab2e340dfb782bca0b5c9b96bce169390ea0 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 15 Oct 2021 18:57:27 +0800 Subject: [PATCH] [http options] beautify the json format when clicked the save button --- src/pages/EditMonitor.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/EditMonitor.vue b/src/pages/EditMonitor.vue index f88614415..dd3d62bb4 100644 --- a/src/pages/EditMonitor.vue +++ b/src/pages/EditMonitor.vue @@ -466,6 +466,15 @@ export default { return; } + // Beautiful the JSON format + if (this.monitor.body) { + this.monitor.body = JSON.stringify(JSON.parse(this.monitor.body), null, 4); + } + + if (this.monitor.headers) { + this.monitor.headers = JSON.stringify(JSON.parse(this.monitor.headers), null, 4); + } + if (this.isAdd) { this.$root.add(this.monitor, async (res) => {