From 63225ed0fd712873a434e9e3600650a46b8653d4 Mon Sep 17 00:00:00 2001 From: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> Date: Mon, 13 Apr 2020 23:27:12 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AC=E3=83=BC=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E5=91=A8=E3=82=8A=E3=81=AEv11=E3=81=AE?= =?UTF-8?q?=E6=A9=9F=E8=83=BD=E5=BE=A9=E5=85=83=20(#6249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * モデレーション周りのv11の機能復元 * i18n * wip * wip Co-authored-by: syuilo --- locales/ja-JP.yml | 9 + src/client/components/note.vue | 6 +- src/client/components/user-menu.vue | 27 ++- .../components/user-moderate-dialog.vue | 105 --------- .../pages/instance/federation.instance.vue | 41 +++- src/client/pages/instance/users.user.vue | 209 ++++++++++++++++++ src/client/pages/instance/users.vue | 144 +++++++++--- src/client/pages/user/index.photos.vue | 2 +- src/client/pages/user/index.vue | 14 +- src/client/router.ts | 1 + 10 files changed, 409 insertions(+), 149 deletions(-) delete mode 100644 src/client/components/user-moderate-dialog.vue create mode 100644 src/client/pages/instance/users.user.vue diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 848bf4bb43..1812a2660c 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -265,6 +265,7 @@ watch: "ウォッチ" unwatch: "ウォッチ解除" accept: "許可" reject: "拒否" +normal: "正常" instanceName: "インスタンス名" instanceDescription: "インスタンスの紹介" maintainerName: "管理者の名前" @@ -319,6 +320,7 @@ notesAndReplies: "投稿と返信" withFiles: "ファイル付き" silence: "サイレンス" silenceConfirm: "サイレンスしますか?" +unsilence: "サイレンス解除" unsilenceConfirm: "サイレンス解除しますか?" popularUsers: "人気のユーザー" recentlyUpdatedUsers: "最近投稿したユーザー" @@ -483,6 +485,13 @@ scratchpadDescription: "スクラッチパッドは、AiScriptの実験環境を output: "出力" script: "スクリプト" disablePagesScript: "Pagesのスクリプトを無効にする" +updateRemoteUser: "リモートユーザー情報の更新" +deleteAllFiles: "すべてのファイルを削除" +deleteAllFilesConfirm: "すべてのファイルを削除しますか?" +removeAllFollowing: "フォローを全解除" +removeAllFollowingDescription: "{host}からのフォローをすべて解除します。そのインスタンスがもう存在しなくなった場合などに実行してください。" +userSuspended: "このユーザーは凍結されています。" +userSilenced: "このユーザーはサイレンスされています。" _theme: explore: "テーマを探す" diff --git a/src/client/components/note.vue b/src/client/components/note.vue index 07011ba50f..18d5cc34ba 100644 --- a/src/client/components/note.vue +++ b/src/client/components/note.vue @@ -561,13 +561,13 @@ export default Vue.extend({ }] : [] ), - ...(this.appearNote.userId == this.$store.state.i.id ? [ + ...(this.appearNote.userId == this.$store.state.i.id || this.$store.state.i.isModerator || this.$store.state.i.isAdmin ? [ null, - { + this.appearNote.userId == this.$store.state.i.id ? { icon: faEdit, text: this.$t('deleteAndEdit'), action: this.delEdit - }, + } : undefined, { icon: faTrashAlt, text: this.$t('delete'), diff --git a/src/client/components/user-menu.vue b/src/client/components/user-menu.vue index b0139380ef..a2275197d8 100644 --- a/src/client/components/user-menu.vue +++ b/src/client/components/user-menu.vue @@ -4,7 +4,7 @@ - - diff --git a/src/client/pages/instance/federation.instance.vue b/src/client/pages/instance/federation.instance.vue index b86f52809e..08f4d1b4fb 100644 --- a/src/client/pages/instance/federation.instance.vue +++ b/src/client/pages/instance/federation.instance.vue @@ -99,10 +99,19 @@ {{ $t('operations') }} {{ $t('stopActivityDelivery') }} {{ $t('blockThisInstance') }} +
+ {{ $t('deleteAllFiles') }} + {{ $t('deleteAllFiles') }} +
+
+ {{ $t('removeAllFollowing') }} + {{ $t('removeAllFollowing') }} + {{ $t('removeAllFollowingDescription', { host: instance.host }) }} +
{{ $t('metadata') }} -
{{ JSON.stringify(instance.metadata, null, 2) }}
+
{{ JSON.stringify(instance, null, 2) }}
@@ -112,11 +121,13 @@ import Vue from 'vue'; import Chart from 'chart.js'; import i18n from '../../i18n'; -import { faTimes, faCrosshairs, faCloudDownloadAlt, faCloudUploadAlt, faUsers, faPencilAlt, faFileImage, faDatabase, faTrafficLight, faLongArrowAltUp, faLongArrowAltDown } from '@fortawesome/free-solid-svg-icons'; +import { faTimes, faCrosshairs, faCloudDownloadAlt, faCloudUploadAlt, faUsers, faPencilAlt, faFileImage, faDatabase, faTrafficLight, faLongArrowAltUp, faLongArrowAltDown, faMinusCircle, faTrashAlt } from '@fortawesome/free-solid-svg-icons'; import XWindow from '../../components/window.vue'; import MkUsersDialog from '../../components/users-dialog.vue'; import MkSelect from '../../components/ui/select.vue'; +import MkButton from '../../components/ui/button.vue'; import MkSwitch from '../../components/ui/switch.vue'; +import MkInfo from '../../components/ui/info.vue'; const chartLimit = 90; const sum = (...arr) => arr.reduce((r, a) => r.map((b, i) => a[i] + b)); @@ -135,7 +146,9 @@ export default Vue.extend({ components: { XWindow, MkSelect, + MkButton, MkSwitch, + MkInfo, }, props: { @@ -153,7 +166,7 @@ export default Vue.extend({ chartInstance: null, chartSrc: 'requests', chartSpan: 'hour', - faTimes, faCrosshairs, faCloudDownloadAlt, faCloudUploadAlt, faUsers, faPencilAlt, faFileImage, faDatabase, faTrafficLight, faLongArrowAltUp, faLongArrowAltDown + faTimes, faCrosshairs, faCloudDownloadAlt, faCloudUploadAlt, faUsers, faPencilAlt, faFileImage, faDatabase, faTrafficLight, faLongArrowAltUp, faLongArrowAltDown, faMinusCircle, faTrashAlt }; }, @@ -239,6 +252,28 @@ export default Vue.extend({ this.chartSrc = src; }, + removeAllFollowing() { + this.$root.api('admin/federation/remove-all-following', { + host: this.instance.host + }).then(() => { + this.$root.dialog({ + type: 'success', + iconOnly: true, autoClose: true + }); + }); + }, + + deleteAllFiles() { + this.$root.api('admin/federation/delete-all-files', { + host: this.instance.host + }).then(() => { + this.$root.dialog({ + type: 'success', + iconOnly: true, autoClose: true + }); + }); + }, + renderChart() { if (this.chartInstance) { this.chartInstance.destroy(); diff --git a/src/client/pages/instance/users.user.vue b/src/client/pages/instance/users.user.vue new file mode 100644 index 0000000000..1fb064f7f0 --- /dev/null +++ b/src/client/pages/instance/users.user.vue @@ -0,0 +1,209 @@ + + + + + diff --git a/src/client/pages/instance/users.vue b/src/client/pages/instance/users.vue index db9e625e4c..b209ab68cf 100644 --- a/src/client/pages/instance/users.vue +++ b/src/client/pages/instance/users.vue @@ -12,19 +12,65 @@ {{ $t('lookup') }}
{{ $t('users') }}
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+
+ + {{ $t('username') }} + + + {{ $t('host') }} + +
+
@@ -38,12 +84,13 @@