From dd14a43f6d0b93c712ca6ea94b96a1ac1764e4c9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 2 Nov 2018 23:05:53 +0900 Subject: [PATCH] [Client] Admin page improved --- locales/ja-JP.yml | 28 ++-- src/client/app/admin/script.ts | 27 ++++ src/client/app/admin/style.styl | 6 + .../views/announcements.vue} | 17 ++- .../views/cpu-memory.vue} | 0 src/client/app/admin/views/dashboard.vue | 117 +++++++++++++++ src/client/app/admin/views/emoji.vue | 48 ++++++ .../views/hashtags.vue} | 19 +-- src/client/app/admin/views/index.vue | 101 +++++++++++++ src/client/app/admin/views/instance.vue | 62 ++++++++ src/client/app/admin/views/users.vue | 129 ++++++++++++++++ src/client/app/boot.js | 1 + src/client/app/desktop/script.ts | 2 - .../views/pages/admin/admin.dashboard.vue | 135 ----------------- .../views/pages/admin/admin.suspend-user.vue | 57 ------- .../pages/admin/admin.unsuspend-user.vue | 58 -------- .../views/pages/admin/admin.unverify-user.vue | 57 ------- .../views/pages/admin/admin.verify-user.vue | 57 ------- .../app/desktop/views/pages/admin/admin.vue | 140 ------------------ webpack.config.ts | 1 + 20 files changed, 529 insertions(+), 533 deletions(-) create mode 100644 src/client/app/admin/script.ts create mode 100644 src/client/app/admin/style.styl rename src/client/app/{desktop/views/pages/admin/admin.announcements.vue => admin/views/announcements.vue} (67%) rename src/client/app/{desktop/views/pages/admin/admin.cpu-memory.vue => admin/views/cpu-memory.vue} (100%) create mode 100644 src/client/app/admin/views/dashboard.vue create mode 100644 src/client/app/admin/views/emoji.vue rename src/client/app/{desktop/views/pages/admin/admin.hashtags.vue => admin/views/hashtags.vue} (69%) create mode 100644 src/client/app/admin/views/index.vue create mode 100644 src/client/app/admin/views/instance.vue create mode 100644 src/client/app/admin/views/users.vue delete mode 100644 src/client/app/desktop/views/pages/admin/admin.dashboard.vue delete mode 100644 src/client/app/desktop/views/pages/admin/admin.suspend-user.vue delete mode 100644 src/client/app/desktop/views/pages/admin/admin.unsuspend-user.vue delete mode 100644 src/client/app/desktop/views/pages/admin/admin.unverify-user.vue delete mode 100644 src/client/app/desktop/views/pages/admin/admin.verify-user.vue delete mode 100644 src/client/app/desktop/views/pages/admin/admin.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index bb3a151ad..2bcab8783 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1069,14 +1069,16 @@ desktop/views/components/window.vue: popout: "ポップアウト" close: "閉じる" -desktop/views/pages/admin/admin.vue: +admin/views/index.vue: dashboard: "ダッシュボード" + instance: "インスタンス" + emoji: "カスタム絵文字" users: "ユーザー" update: "更新" announcements: "お知らせ" hashtags: "ハッシュタグ" -desktop/views/pages/admin/admin.dashboard.vue: +admin/views/dashboard.vue: dashboard: "ダッシュボード" all-users: "全てのユーザー" original-users: "このインスタンスのユーザー" @@ -1087,30 +1089,34 @@ desktop/views/pages/admin/admin.dashboard.vue: disableRegistration: "Disable new user registration" disableLocalTimeline: "Disable the local timeline" -desktop/views/pages/admin/admin.suspend-user.vue: +admin/views/users.vue: suspend-user: "ユーザーの凍結" suspend: "凍結" suspended: "凍結しました" - -desktop/views/pages/admin/admin.unsuspend-user.vue: unsuspend-user: "ユーザーの凍結の解除" unsuspend: "凍結の解除" unsuspended: "凍結を解除しました" - -desktop/views/pages/admin/admin.verify-user.vue: verify-user: "ユーザーの公式アカウント設定" verify: "公式アカウントにする" verified: "公式アカウントにしました" - -desktop/views/pages/admin/admin.unverify-user.vue: unverify-user: "ユーザーの公式アカウント解除" unverify: "公式アカウントを解除する" unverified: "公式アカウントを解除しました" -desktop/views/pages/admin/admin.announcements.vue: +admin/views/emoji.vue: + add-emoji: + title: "絵文字の登録" + name: "絵文字名" + name-desc: "a~z 0~9 _ の文字が使えます。" + aliases: "エイリアス" + aliases-desc: "スペースで区切って複数設定できます。" + url: "絵文字画像URL" + add: "追加" + +admin/views/announcements.vue: announcements: "お知らせ" -desktop/views/pages/admin/admin.hashtags.vue: +admin/views/hashtags.vue: hided-tags: "Hidden Tags" desktop/views/pages/deck/deck.tl-column.vue: diff --git a/src/client/app/admin/script.ts b/src/client/app/admin/script.ts new file mode 100644 index 000000000..4002734d3 --- /dev/null +++ b/src/client/app/admin/script.ts @@ -0,0 +1,27 @@ +/** + * Admin + */ + +import VueRouter from 'vue-router'; + +// Style +import './style.styl'; + +import init from '../init'; +import Index from './views/index.vue'; + +init(launch => { + document.title = 'Admin'; + + // Init router + const router = new VueRouter({ + mode: 'history', + base: '/admin/', + routes: [ + { path: '/', component: Index }, + ] + }); + + // Launch the app + launch(router); +}); diff --git a/src/client/app/admin/style.styl b/src/client/app/admin/style.styl new file mode 100644 index 000000000..5ea395046 --- /dev/null +++ b/src/client/app/admin/style.styl @@ -0,0 +1,6 @@ +@import "../app" +@import "../reset" + +html + height 100% + background #EBEBEB diff --git a/src/client/app/desktop/views/pages/admin/admin.announcements.vue b/src/client/app/admin/views/announcements.vue similarity index 67% rename from src/client/app/desktop/views/pages/admin/admin.announcements.vue rename to src/client/app/admin/views/announcements.vue index 5c1ed74b2..049a8d572 100644 --- a/src/client/app/desktop/views/pages/admin/admin.announcements.vue +++ b/src/client/app/admin/views/announcements.vue @@ -1,8 +1,12 @@ @@ -45,8 +49,7 @@ export default Vue.extend({ diff --git a/src/client/app/desktop/views/pages/admin/admin.cpu-memory.vue b/src/client/app/admin/views/cpu-memory.vue similarity index 100% rename from src/client/app/desktop/views/pages/admin/admin.cpu-memory.vue rename to src/client/app/admin/views/cpu-memory.vue diff --git a/src/client/app/admin/views/dashboard.vue b/src/client/app/admin/views/dashboard.vue new file mode 100644 index 000000000..5af5255e2 --- /dev/null +++ b/src/client/app/admin/views/dashboard.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/src/client/app/admin/views/emoji.vue b/src/client/app/admin/views/emoji.vue new file mode 100644 index 000000000..1446cc1a9 --- /dev/null +++ b/src/client/app/admin/views/emoji.vue @@ -0,0 +1,48 @@ + + + diff --git a/src/client/app/desktop/views/pages/admin/admin.hashtags.vue b/src/client/app/admin/views/hashtags.vue similarity index 69% rename from src/client/app/desktop/views/pages/admin/admin.hashtags.vue rename to src/client/app/admin/views/hashtags.vue index 10bab1cbd..be90cea1d 100644 --- a/src/client/app/desktop/views/pages/admin/admin.hashtags.vue +++ b/src/client/app/admin/views/hashtags.vue @@ -1,8 +1,12 @@ @@ -35,11 +39,8 @@ export default Vue.extend({ diff --git a/src/client/app/admin/views/index.vue b/src/client/app/admin/views/index.vue new file mode 100644 index 000000000..c674bee02 --- /dev/null +++ b/src/client/app/admin/views/index.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/src/client/app/admin/views/instance.vue b/src/client/app/admin/views/instance.vue new file mode 100644 index 000000000..542a0d54a --- /dev/null +++ b/src/client/app/admin/views/instance.vue @@ -0,0 +1,62 @@ + + + diff --git a/src/client/app/admin/views/users.vue b/src/client/app/admin/views/users.vue new file mode 100644 index 000000000..3c5994368 --- /dev/null +++ b/src/client/app/admin/views/users.vue @@ -0,0 +1,129 @@ + + + diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 063749cae..0d5eefaea 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -46,6 +46,7 @@ if (`${url.pathname}/`.startsWith('/docs/')) app = 'docs'; if (`${url.pathname}/`.startsWith('/dev/')) app = 'dev'; if (`${url.pathname}/`.startsWith('/auth/')) app = 'auth'; + if (`${url.pathname}/`.startsWith('/admin/')) app = 'admin'; //#endregion //#region Detect the user language diff --git a/src/client/app/desktop/script.ts b/src/client/app/desktop/script.ts index 765ba0202..255589b01 100644 --- a/src/client/app/desktop/script.ts +++ b/src/client/app/desktop/script.ts @@ -23,7 +23,6 @@ import updateBanner from './api/update-banner'; import MkIndex from './views/pages/index.vue'; import MkHome from './views/pages/home.vue'; import MkDeck from './views/pages/deck/deck.vue'; -import MkAdmin from './views/pages/admin/admin.vue'; import MkStats from './views/pages/stats/stats.vue'; import MkUser from './views/pages/user/user.vue'; import MkFavorites from './views/pages/favorites.vue'; @@ -57,7 +56,6 @@ init(async (launch) => { { path: '/', name: 'index', component: MkIndex }, { path: '/home', name: 'home', component: MkHome }, { path: '/deck', name: 'deck', component: MkDeck }, - { path: '/admin', name: 'admin', component: MkAdmin }, { path: '/stats', name: 'stats', component: MkStats }, { path: '/i/customize-home', component: MkHomeCustomize }, { path: '/i/favorites', component: MkFavorites }, diff --git a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue deleted file mode 100644 index c0075220b..000000000 --- a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue +++ /dev/null @@ -1,135 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/admin/admin.suspend-user.vue b/src/client/app/desktop/views/pages/admin/admin.suspend-user.vue deleted file mode 100644 index a8ff937bb..000000000 --- a/src/client/app/desktop/views/pages/admin/admin.suspend-user.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/admin/admin.unsuspend-user.vue b/src/client/app/desktop/views/pages/admin/admin.unsuspend-user.vue deleted file mode 100644 index 146f5a41d..000000000 --- a/src/client/app/desktop/views/pages/admin/admin.unsuspend-user.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/admin/admin.unverify-user.vue b/src/client/app/desktop/views/pages/admin/admin.unverify-user.vue deleted file mode 100644 index 5e0fdae5c..000000000 --- a/src/client/app/desktop/views/pages/admin/admin.unverify-user.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/admin/admin.verify-user.vue b/src/client/app/desktop/views/pages/admin/admin.verify-user.vue deleted file mode 100644 index d237a5f9c..000000000 --- a/src/client/app/desktop/views/pages/admin/admin.verify-user.vue +++ /dev/null @@ -1,57 +0,0 @@ - - - - - diff --git a/src/client/app/desktop/views/pages/admin/admin.vue b/src/client/app/desktop/views/pages/admin/admin.vue deleted file mode 100644 index c1f5a7f0e..000000000 --- a/src/client/app/desktop/views/pages/admin/admin.vue +++ /dev/null @@ -1,140 +0,0 @@ - - - - - diff --git a/webpack.config.ts b/webpack.config.ts index e1163133c..05101b9de 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -57,6 +57,7 @@ const entry = { mobile: './src/client/app/mobile/script.ts', dev: './src/client/app/dev/script.ts', auth: './src/client/app/auth/script.ts', + admin: './src/client/app/admin/script.ts', sw: './src/client/app/sw.js' };