2018-08-15 06:50:49 +09:00
|
|
|
<template>
|
2018-08-25 15:40:22 +09:00
|
|
|
<div class="mk-admin-card">
|
2018-08-15 06:50:49 +09:00
|
|
|
<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;
|
|
|
|
|
2018-10-02 23:42:46 +09:00
|
|
|
const process = async () => {
|
|
|
|
const user = await (this as any).os.api(
|
|
|
|
"users/show",
|
|
|
|
parseAcct(this.username)
|
|
|
|
);
|
2018-08-15 06:50:49 +09:00
|
|
|
|
2018-10-02 23:42:46 +09:00
|
|
|
await (this as any).os.api("admin/unsuspend-user", {
|
|
|
|
userId: user.id
|
|
|
|
});
|
|
|
|
|
|
|
|
(this as any).os.apis.dialog({ text: "%i18n:@unsuspended%" });
|
|
|
|
};
|
|
|
|
|
|
|
|
await process().catch(e => {
|
|
|
|
(this as any).os.apis.dialog({ text: `Failed: ${e}` });
|
2018-08-15 06:50:49 +09:00
|
|
|
});
|
|
|
|
|
|
|
|
this.unsuspending = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2018-09-26 20:19:35 +09:00
|
|
|
|
2018-08-15 06:50:49 +09:00
|
|
|
|
|
|
|
header
|
|
|
|
margin 10px 0
|
|
|
|
|
|
|
|
|
|
|
|
button
|
|
|
|
margin 16px 0
|
|
|
|
|
|
|
|
</style>
|