From 7d11c8b767a43837d336099790e89e7b550554a4 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Tue, 2 Oct 2018 23:42:46 +0900 Subject: [PATCH] Improve admin UI (#2802) --- .../views/pages/admin/admin.announcements.vue | 17 ++++++++++++-- .../views/pages/admin/admin.dashboard.vue | 8 ++++++- .../views/pages/admin/admin.hashtags.vue | 4 ++++ .../views/pages/admin/admin.suspend-user.vue | 22 ++++++++++++------- .../pages/admin/admin.unsuspend-user.vue | 21 ++++++++++++------ .../views/pages/admin/admin.unverify-user.vue | 22 ++++++++++++------- .../views/pages/admin/admin.verify-user.vue | 22 ++++++++++++------- .../app/desktop/views/pages/admin/admin.vue | 12 +++++++--- 8 files changed, 91 insertions(+), 37 deletions(-) diff --git a/src/client/app/desktop/views/pages/admin/admin.announcements.vue b/src/client/app/desktop/views/pages/admin/admin.announcements.vue index 272016b3f9..722fa227cf 100644 --- a/src/client/app/desktop/views/pages/admin/admin.announcements.vue +++ b/src/client/app/desktop/views/pages/admin/admin.announcements.vue @@ -1,7 +1,7 @@ @@ -22,8 +22,21 @@ export default Vue.extend({ }, methods: { save() { + let json; + + try { + json = JSON.parse(this.broadcasts); + } catch (e) { + (this as any).os.apis.dialog({ text: `Failed: ${e}` }); + return; + } + (this as any).api('admin/update-meta', { - broadcasts: JSON.parse(this.broadcasts) + broadcasts: json + }).then(() => { + (this as any).os.apis.dialog({ text: `Saved` }); + }.catch(e => { + (this as any).os.apis.dialog({ text: `Failed ${e}` }); }); } } diff --git a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue index f5734012bd..1b0c5f8125 100644 --- a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue +++ b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue @@ -13,7 +13,7 @@ -
+