From 66f3a155e6050fc297d2f600e6d619c5dba0f764 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 3 Sep 2018 23:23:50 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=AA=E3=82=93=E3=81=8B=E3=82=82=E3=81=86?= =?UTF-8?q?=E3=82=81=E3=81=A3=E3=81=A1=E3=82=83=E3=82=84=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/common/views/components/signin.vue | 2 +- .../app/common/views/widgets/broadcast.vue | 10 +- .../views/pages/admin/admin.announcements.vue | 41 +++ .../app/desktop/views/pages/admin/admin.vue | 6 + .../app/desktop/views/pages/welcome.vue | 297 ++++++++---------- src/server/api/endpoints/admin/update-meta.ts | 12 +- 6 files changed, 199 insertions(+), 169 deletions(-) create mode 100644 src/client/app/desktop/views/pages/admin/admin.announcements.vue diff --git a/src/client/app/common/views/components/signin.vue b/src/client/app/common/views/components/signin.vue index 5230ac371..b1c6782e9 100644 --- a/src/client/app/common/views/components/signin.vue +++ b/src/client/app/common/views/components/signin.vue @@ -78,7 +78,7 @@ export default Vue.extend({ cursor wait !important > .avatar - margin 16px auto 0 auto + margin 0 auto 0 auto width 64px height 64px background #ddd diff --git a/src/client/app/common/views/widgets/broadcast.vue b/src/client/app/common/views/widgets/broadcast.vue index 69b2a54fe..d3a39bd9c 100644 --- a/src/client/app/common/views/widgets/broadcast.vue +++ b/src/client/app/common/views/widgets/broadcast.vue @@ -42,15 +42,7 @@ export default define({ }, mounted() { (this as any).os.getMeta().then(meta => { - let broadcasts = []; - if (meta.broadcasts) { - meta.broadcasts.forEach(broadcast => { - if (broadcast[lang]) { - broadcasts.push(broadcast[lang]); - } - }); - } - this.broadcasts = broadcasts; + this.broadcasts = meta.broadcasts; this.fetching = false; }); }, diff --git a/src/client/app/desktop/views/pages/admin/admin.announcements.vue b/src/client/app/desktop/views/pages/admin/admin.announcements.vue new file mode 100644 index 000000000..532400deb --- /dev/null +++ b/src/client/app/desktop/views/pages/admin/admin.announcements.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/client/app/desktop/views/pages/admin/admin.vue b/src/client/app/desktop/views/pages/admin/admin.vue index 3438462cd..a71059c37 100644 --- a/src/client/app/desktop/views/pages/admin/admin.vue +++ b/src/client/app/desktop/views/pages/admin/admin.vue @@ -4,6 +4,7 @@ @@ -13,6 +14,9 @@ +
+ +
@@ -28,6 +32,7 @@ - - - diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts index 9737a281e..10ca15d32 100644 --- a/src/server/api/endpoints/admin/update-meta.ts +++ b/src/server/api/endpoints/admin/update-meta.ts @@ -11,11 +11,17 @@ export const meta = { requireAdmin: true, params: { + broadcasts: $.arr($.obj()).optional.nullable.note({ + desc: { + 'ja-JP': 'γƒ–γƒ­γƒΌγƒ‰γ‚­γƒ£γ‚Ήγƒˆ' + } + }), + disableRegistration: $.bool.optional.nullable.note({ desc: { 'ja-JP': 'ζ‹›εΎ…εˆΆγ‹ε¦γ‹' } - }), + }) } }; @@ -25,6 +31,10 @@ export default (params: any) => new Promise(async (res, rej) => { const set = {} as any; + if (ps.broadcasts) { + set.broadcasts = ps.broadcasts; + } + if (typeof ps.disableRegistration === 'boolean') { set.disableRegistration = ps.disableRegistration; }