Resolve #4967
This commit is contained in:
parent
1e1a7ee858
commit
9c8d26affa
2 changed files with 24 additions and 0 deletions
|
@ -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
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
13
src/server/api/endpoints/admin/delete-logs.ts
Normal file
13
src/server/api/endpoints/admin/delete-logs.ts
Normal 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({});
|
||||
});
|
Loading…
Reference in a new issue