diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2019-01-30 17:25:56 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-30 17:25:56 +0900 |
| commit | 00b134ce1ecfd2103677c3ed4fdda96c6748d687 (patch) | |
| tree | 054e190a1ad2df5ec27ed5f18aab2a54d475b1ca /src/client/app/admin/views/users.vue | |
| parent | Fix import (diff) | |
| download | misskey-00b134ce1ecfd2103677c3ed4fdda96c6748d687.tar.gz misskey-00b134ce1ecfd2103677c3ed4fdda96c6748d687.tar.bz2 misskey-00b134ce1ecfd2103677c3ed4fdda96c6748d687.zip | |
Introduce silence (#4043)
* Introduce silence
* Fix icon
Diffstat (limited to 'src/client/app/admin/views/users.vue')
| -rw-r--r-- | src/client/app/admin/views/users.vue | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/src/client/app/admin/views/users.vue b/src/client/app/admin/views/users.vue index 09d074eee2..f2306c26f2 100644 --- a/src/client/app/admin/views/users.vue +++ b/src/client/app/admin/views/users.vue @@ -17,6 +17,10 @@ <ui-button @click="unverifyUser" :disabled="unverifying">{{ $t('unverify') }}</ui-button> </ui-horizon-group> <ui-horizon-group> + <ui-button @click="silenceUser"><fa :icon="faMicrophoneSlash"/> {{ $t('make-silence') }}</ui-button> + <ui-button @click="unsilenceUser">{{ $t('unmake-silence') }}</ui-button> + </ui-horizon-group> + <ui-horizon-group> <ui-button @click="suspendUser" :disabled="suspending"><fa :icon="faSnowflake"/> {{ $t('suspend') }}</ui-button> <ui-button @click="unsuspendUser" :disabled="unsuspending">{{ $t('unsuspend') }}</ui-button> </ui-horizon-group> @@ -66,7 +70,7 @@ import Vue from 'vue'; import i18n from '../../i18n'; import parseAcct from "../../../../misc/acct/parse"; -import { faCertificate, faUsers, faTerminal, faSearch, faKey, faSync } from '@fortawesome/free-solid-svg-icons'; +import { faCertificate, faUsers, faTerminal, faSearch, faKey, faSync, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons'; import { faSnowflake } from '@fortawesome/free-regular-svg-icons'; import XUser from './users.user.vue'; @@ -90,7 +94,7 @@ export default Vue.extend({ offset: 0, users: [], existMore: false, - faTerminal, faCertificate, faUsers, faSnowflake, faSearch, faKey, faSync + faTerminal, faCertificate, faUsers, faSnowflake, faSearch, faKey, faSync, faMicrophoneSlash }; }, @@ -216,6 +220,44 @@ export default Vue.extend({ this.refreshUser(); }, + async silenceUser() { + const process = async () => { + await this.$root.api('admin/silence-user', { userId: this.user._id }); + this.$root.dialog({ + type: 'success', + splash: true + }); + }; + + await process().catch(e => { + this.$root.dialog({ + type: 'error', + text: e.toString() + }); + }); + + this.refreshUser(); + }, + + async unsilenceUser() { + const process = async () => { + await this.$root.api('admin/unsilence-user', { userId: this.user._id }); + this.$root.dialog({ + type: 'success', + splash: true + }); + }; + + await process().catch(e => { + this.$root.dialog({ + type: 'error', + text: e.toString() + }); + }); + + this.refreshUser(); + }, + async suspendUser() { if (!await this.getConfirmed(this.$t('suspend-confirm'))) return; |