1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-24 03:28:27 +09:00
MisskeyIO/src/client/app/desktop/views/pages/admin/admin.unsuspend-user.vue
2018-09-26 20:19:35 +09:00

52 lines
905 B
Vue

<template>
<div class="mk-admin-card">
<header>%i18n:@unsuspend-user%</header>
<input v-model="username" type="text" class="ui"/>
<button class="ui" @click="unsuspendUser" :disabled="unsuspending">%i18n:@unsuspend%</button>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import parseAcct from "../../../../../../misc/acct/parse";
export default Vue.extend({
data() {
return {
username: null,
unsuspending: false
};
},
methods: {
async unsuspendUser() {
this.unsuspending = true;
const user = await (this as any).os.api(
"users/show",
parseAcct(this.username)
);
await (this as any).os.api("admin/unsuspend-user", {
userId: user.id
});
this.unsuspending = false;
(this as any).os.apis.dialog({ text: "%i18n:@unsuspended%" });
}
}
});
</script>
<style lang="stylus" scoped>
header
margin 10px 0
button
margin 16px 0
</style>