From 00738edbe7eab069dee15bf73e35f694d765607c Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 18 Mar 2022 00:00:56 +0800 Subject: [PATCH] [Status Page] Add ?edit --- src/pages/ManageStatusPage.vue | 5 +++-- src/pages/StatusPage.vue | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/pages/ManageStatusPage.vue b/src/pages/ManageStatusPage.vue index c6a8b7f5..eaf7416a 100644 --- a/src/pages/ManageStatusPage.vue +++ b/src/pages/ManageStatusPage.vue @@ -15,13 +15,14 @@ No status pages - + +
{{ statusPage.title }}
/status/{{ statusPage.slug }}
-
+
diff --git a/src/pages/StatusPage.vue b/src/pages/StatusPage.vue index 9ce22d53..72da70b6 100644 --- a/src/pages/StatusPage.vue +++ b/src/pages/StatusPage.vue @@ -460,6 +460,12 @@ export default { feedInterval = setInterval(() => { this.updateHeartbeatList(); }, (300 + 10) * 1000); + + // Go to edit page if ?edit present + // null means ?edit present, but no value + if (this.$route.query.edit || this.$route.query.edit === null) { + this.edit(); + } }, methods: { @@ -516,12 +522,7 @@ export default { console.log(time); setTimeout(() => { - // If the slug was changed, go to the new slug - if (this.slug !== this.config.slug) { - location.href = "/status/" + this.config.slug; - } else { - location.reload(); - } + location.href = "/status/" + this.config.slug; }, time); } else { @@ -548,7 +549,7 @@ export default { }, discard() { - location.reload(); + location.href = "/status/" + this.slug; }, changeTagsVisibility(show) {