2018-08-13 18:05:58 +02:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<header>%i18n:@suspend-user%</header>
|
2018-08-14 21:44:39 +02:00
|
|
|
<input v-model="username" type="text" class="ui"/>
|
|
|
|
<button class="ui" @click="suspendUser" :disabled="suspending">%i18n:@suspend%</button>
|
2018-08-13 18:05:58 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from "vue";
|
|
|
|
import parseAcct from "../../../../../../misc/acct/parse";
|
|
|
|
|
|
|
|
export default Vue.extend({
|
2018-08-13 18:48:11 +02:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
username: null,
|
|
|
|
suspending: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async suspendUser() {
|
|
|
|
this.suspending = true;
|
2018-08-13 18:05:58 +02:00
|
|
|
|
2018-08-13 18:48:11 +02:00
|
|
|
const user = await (this as any).os.api(
|
|
|
|
"users/show",
|
|
|
|
parseAcct(this.username)
|
|
|
|
);
|
2018-08-13 18:05:58 +02:00
|
|
|
|
2018-08-13 18:48:11 +02:00
|
|
|
await (this as any).os.api("admin/suspend-user", {
|
|
|
|
userId: user.id
|
|
|
|
});
|
2018-08-13 18:05:58 +02:00
|
|
|
|
2018-08-13 18:48:11 +02:00
|
|
|
this.suspending = false;
|
2018-08-13 18:05:58 +02:00
|
|
|
|
2018-08-13 18:48:11 +02:00
|
|
|
(this as any).os.apis.dialog({ text: "%i18n:@suspended%" });
|
|
|
|
}
|
|
|
|
}
|
2018-08-13 18:05:58 +02:00
|
|
|
});
|
|
|
|
</script>
|
2018-08-17 20:59:48 +02:00
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
|
|
|
@import '~const.styl'
|
|
|
|
|
|
|
|
header
|
|
|
|
margin 10px 0
|
|
|
|
|
|
|
|
|
|
|
|
button
|
|
|
|
margin 16px 0
|
|
|
|
|
|
|
|
</style>
|