wip
This commit is contained in:
27
src/client/app/desktop/views/pages/admin/admin.dashboard.vue
Normal file
27
src/client/app/desktop/views/pages/admin/admin.dashboard.vue
Normal file
@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<div>
|
||||
<header>%i18n:@dashboard%</header>
|
||||
|
||||
<p><b>%i18n:@all-users%</b><span>{ stats.usersCount | number }</span></p>
|
||||
<p><b>%i18n:@original-users%</b><span>{ stats.originalUsersCount | number }</span></p>
|
||||
<p><b>%i18n:@all-notes%</b><span>{ stats.notesCount | number }</span></p>
|
||||
<p><b>%i18n:@original-notes%</b><span>{ stats.originalNotesCount | number }</span></p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from "vue";
|
||||
|
||||
export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
stats: null
|
||||
};
|
||||
},
|
||||
created() {
|
||||
(this as any).api('stats').then(stats => {
|
||||
this.stats = stats;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<div>
|
||||
<header>%i18n:@suspend-user%</header>
|
||||
<input v-model="username"/>
|
||||
<button @click="suspendUser" :disabled="suspending">%i18n:@suspend%</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from "vue";
|
||||
import parseAcct from "../../../../../../misc/acct/parse";
|
||||
|
||||
export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
username: null,
|
||||
suspending: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async suspendUser() {
|
||||
this.suspending = true;
|
||||
|
||||
const user = await (this as any).os.api(
|
||||
"users/show",
|
||||
parseAcct(this.username)
|
||||
);
|
||||
|
||||
await (this as any).os.api("admin/suspend-user", {
|
||||
userId: user.id
|
||||
});
|
||||
|
||||
this.suspending = false;
|
||||
|
||||
(this as any).os.apis.dialog("%i18n:@suspended%");
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
35
src/client/app/desktop/views/pages/admin/admin.vue
Normal file
35
src/client/app/desktop/views/pages/admin/admin.vue
Normal file
@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li @click="nav('dashboard')" :class="{ active: page == 'dashboard' }">%i18n:@dashborad%</li>
|
||||
<li @click="nav('drive')" :class="{ active: page == 'drive' }">%i18n:@drive%</li>
|
||||
<li @click="nav('users')" :class="{ active: page == 'users' }">%i18n:@users%</li>
|
||||
<li @click="nav('update')" :class="{ active: page == 'update' }">%i18n:@update%</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<main>
|
||||
<div v-if="page == 'dashboard'">
|
||||
<x-dashboard/>
|
||||
</div>
|
||||
<div v-if="page == 'drive'"></div>
|
||||
<div v-if="page == 'users'">
|
||||
<x-suspend-user/>
|
||||
</div>
|
||||
<div v-if="page == 'update'"></div>
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from "vue";
|
||||
import XDashboard from "./admin.dashboard.vue";
|
||||
import XSuspendUser from "./admin.suspend-user.vue";
|
||||
|
||||
export default Vue.extend({
|
||||
components: {
|
||||
XDashboard,
|
||||
XSuspendUser
|
||||
}
|
||||
});
|
||||
</script>
|
Reference in New Issue
Block a user