feat(frontend): Add Clone Button To Role Page

This commit is contained in:
Lilly Schramm 2025-06-20 20:27:40 +02:00
parent ebf21b474a
commit 6d98c9068c
7 changed files with 96 additions and 0 deletions

View file

@ -9,6 +9,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div class="_gaps">
<div class="_buttons">
<MkButton primary rounded @click="edit"><i class="ti ti-pencil"></i> {{ i18n.ts.edit }}</MkButton>
<MkButton secondary rounded @click="clone"><i class="ti ti-copy"></i> {{ i18n.ts.clone }}</MkButton>
<MkButton danger rounded @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
</div>
<MkFolder>
@ -97,6 +98,13 @@ function edit() {
router.push('/admin/roles/' + role.id + '/edit');
}
async function clone() {
const newRole = await misskeyApi('admin/roles/clone', {
roleId: role.id,
});
router.push('/admin/roles/' + newRole.id + '/edit');
}
async function del() {
const { canceled } = await os.confirm({
type: 'warning',