This commit is contained in:
syuilo 2019-05-23 14:11:42 +09:00
parent 7e5a4456c2
commit 09cc82bf39
2 changed files with 24 additions and 0 deletions

View file

@ -26,6 +26,8 @@
</details>
</code>
</div>
<ui-button @click="deleteAll()">{{ $t('delete-all') }}</ui-button>
</section>
</ui-card>
</div>
@ -78,6 +80,15 @@ export default Vue.extend({
}).then(logs => {
this.logs = logs.reverse();
});
},
deleteAll() {
this.$root.api('admin/delete-logs').then(() => {
this.$root.dialog({
type: 'success',
splash: true
});
});
}
}
});

View file

@ -0,0 +1,13 @@
import define from '../../define';
import { Logs } from '../../../../models';
export const meta = {
tags: ['admin'],
requireCredential: true,
requireModerator: true,
};
export default define(meta, async (ps) => {
await Logs.delete({});
});