summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2019-07-14 03:18:45 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-07-14 03:18:45 +0900
commitb34c1379e9aac1c8612a62afa849a48069d19d74 (patch)
treee6f96c78c8183ff2768ae4843981b909549e3a27 /src/client
parentNew translations ja-JP.yml (Chinese Simplified) (#5149) (diff)
downloadsharkey-b34c1379e9aac1c8612a62afa849a48069d19d74.tar.gz
sharkey-b34c1379e9aac1c8612a62afa849a48069d19d74.tar.bz2
sharkey-b34c1379e9aac1c8612a62afa849a48069d19d74.zip
Resolve #3238
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/admin/views/moderators.vue50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/client/app/admin/views/moderators.vue b/src/client/app/admin/views/moderators.vue
index bf7d951fc7..8ceab02d97 100644
--- a/src/client/app/admin/views/moderators.vue
+++ b/src/client/app/admin/views/moderators.vue
@@ -12,6 +12,31 @@
</ui-horizon-group>
</section>
</ui-card>
+
+ <ui-card>
+ <template #title>{{ $t('logs.title') }}</template>
+ <section class="fit-top">
+ <sequential-entrance animation="entranceFromTop" delay="25">
+ <div v-for="log in logs" :key="log.id" class="">
+ <ui-horizon-group inputs>
+ <ui-input :value="log.user | acct" type="text" readonly>
+ <span>{{ $t('logs.moderator') }}</span>
+ </ui-input>
+ <ui-input :value="log.type" type="text" readonly>
+ <span>{{ $t('logs.type') }}</span>
+ </ui-input>
+ <ui-input :value="log.createdAt | date" type="text" readonly>
+ <span>{{ $t('logs.at') }}</span>
+ </ui-input>
+ </ui-horizon-group>
+ <ui-textarea :value="JSON.stringify(log.info, null, 4)" readonly>
+ <span>{{ $t('logs.info') }}</span>
+ </ui-textarea>
+ </div>
+ </sequential-entrance>
+ <ui-button v-if="existMoreLogs" @click="fetchLogs">{{ $t('@.load-more') }}</ui-button>
+ </section>
+ </ui-card>
</div>
</template>
@@ -26,10 +51,17 @@ export default Vue.extend({
data() {
return {
username: '',
- changing: false
+ changing: false,
+ logs: [],
+ untilLogId: null,
+ existMoreLogs: false
};
},
+ created() {
+ this.fetchLogs();
+ },
+
methods: {
async add() {
this.changing = true;
@@ -74,6 +106,22 @@ export default Vue.extend({
this.changing = false;
},
+
+ fetchLogs() {
+ this.$root.api('admin/show-moderation-logs', {
+ untilId: this.untilId,
+ limit: 10 + 1
+ }).then(logs => {
+ if (logs.length == 10 + 1) {
+ logs.pop();
+ this.existMoreLogs = true;
+ } else {
+ this.existMoreLogs = false;
+ }
+ this.logs = this.logs.concat(logs);
+ this.untilLogId = this.logs[this.logs.length - 1].id;
+ });
+ },
}
});
</script>