From b34c1379e9aac1c8612a62afa849a48069d19d74 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 14 Jul 2019 03:18:45 +0900 Subject: Resolve #3238 --- src/client/app/admin/views/moderators.vue | 50 ++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'src/client') 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 @@ + + + +
+ +
+ + + {{ $t('logs.moderator') }} + + + {{ $t('logs.type') }} + + + {{ $t('logs.at') }} + + + + {{ $t('logs.info') }} + +
+
+ {{ $t('@.load-more') }} +
+
@@ -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; + }); + }, } }); -- cgit v1.2.3-freya