2023-01-12 06:02:26 -06:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<MkStickyContainer>
|
|
|
|
<template #header><XHeader :actions="headerActions" :tabs="headerTabs"/></template>
|
|
|
|
<MkSpacer :content-max="700">
|
|
|
|
<div class="_gaps">
|
|
|
|
<MkButton primary rounded @click="create"><i class="ti ti-plus"></i> {{ i18n.ts._role.new }}</MkButton>
|
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role.baseRole }}</template>
|
|
|
|
<div class="_gaps">
|
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.gtlAvailable }}</template>
|
|
|
|
<template #suffix>{{ options_gtlAvailable ? i18n.ts.yes : i18n.ts.no }}</template>
|
|
|
|
<MkSwitch v-model="options_gtlAvailable">
|
|
|
|
<template #label>{{ i18n.ts.enable }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</MkFolder>
|
|
|
|
|
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.ltlAvailable }}</template>
|
|
|
|
<template #suffix>{{ options_ltlAvailable ? i18n.ts.yes : i18n.ts.no }}</template>
|
|
|
|
<MkSwitch v-model="options_ltlAvailable">
|
|
|
|
<template #label>{{ i18n.ts.enable }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</MkFolder>
|
|
|
|
|
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.canPublicNote }}</template>
|
|
|
|
<template #suffix>{{ options_canPublicNote ? i18n.ts.yes : i18n.ts.no }}</template>
|
|
|
|
<MkSwitch v-model="options_canPublicNote">
|
|
|
|
<template #label>{{ i18n.ts.enable }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</MkFolder>
|
|
|
|
|
2023-01-12 23:22:53 -06:00
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.canInvite }}</template>
|
|
|
|
<template #suffix>{{ options_canInvite ? i18n.ts.yes : i18n.ts.no }}</template>
|
|
|
|
<MkSwitch v-model="options_canInvite">
|
|
|
|
<template #label>{{ i18n.ts.enable }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</MkFolder>
|
|
|
|
|
2023-01-12 23:58:27 -06:00
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.canManageCustomEmojis }}</template>
|
|
|
|
<template #suffix>{{ options_canManageCustomEmojis ? i18n.ts.yes : i18n.ts.no }}</template>
|
|
|
|
<MkSwitch v-model="options_canManageCustomEmojis">
|
|
|
|
<template #label>{{ i18n.ts.enable }}</template>
|
|
|
|
</MkSwitch>
|
|
|
|
</MkFolder>
|
|
|
|
|
2023-01-12 06:02:26 -06:00
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.driveCapacity }}</template>
|
|
|
|
<template #suffix>{{ options_driveCapacityMb }}MB</template>
|
|
|
|
<MkInput v-model="options_driveCapacityMb" type="number">
|
|
|
|
<template #suffix>MB</template>
|
|
|
|
</MkInput>
|
|
|
|
</MkFolder>
|
|
|
|
|
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.antennaMax }}</template>
|
|
|
|
<template #suffix>{{ options_antennaLimit }}</template>
|
|
|
|
<MkInput v-model="options_antennaLimit" type="number">
|
|
|
|
</MkInput>
|
|
|
|
</MkFolder>
|
2023-01-13 17:04:38 -06:00
|
|
|
|
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.wordMuteMax }}</template>
|
|
|
|
<template #suffix>{{ options_wordMuteLimit }}</template>
|
|
|
|
<MkInput v-model="options_wordMuteLimit" type="number">
|
|
|
|
<template #suffix>chars</template>
|
|
|
|
</MkInput>
|
|
|
|
</MkFolder>
|
|
|
|
|
2023-01-13 19:48:11 -06:00
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.webhookMax }}</template>
|
|
|
|
<template #suffix>{{ options_webhookLimit }}</template>
|
|
|
|
<MkInput v-model="options_webhookLimit" type="number">
|
|
|
|
</MkInput>
|
|
|
|
</MkFolder>
|
|
|
|
|
2023-01-14 01:14:24 -06:00
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.clipMax }}</template>
|
|
|
|
<template #suffix>{{ options_clipLimit }}</template>
|
|
|
|
<MkInput v-model="options_clipLimit" type="number">
|
|
|
|
</MkInput>
|
|
|
|
</MkFolder>
|
|
|
|
|
|
|
|
<MkFolder>
|
|
|
|
<template #label>{{ i18n.ts._role._options.noteEachClipsMax }}</template>
|
|
|
|
<template #suffix>{{ options_noteEachClipsLimit }}</template>
|
|
|
|
<MkInput v-model="options_noteEachClipsLimit" type="number">
|
|
|
|
</MkInput>
|
|
|
|
</MkFolder>
|
|
|
|
|
2023-01-12 06:02:26 -06:00
|
|
|
<MkButton primary rounded @click="updateBaseRole">{{ i18n.ts.save }}</MkButton>
|
|
|
|
</div>
|
|
|
|
</MkFolder>
|
|
|
|
<div class="_gaps_s">
|
|
|
|
<MkRolePreview v-for="role in roles" :key="role.id" :role="role"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { computed } from 'vue';
|
|
|
|
import XHeader from './_header_.vue';
|
|
|
|
import MkInput from '@/components/MkInput.vue';
|
|
|
|
import MkSelect from '@/components/MkSelect.vue';
|
|
|
|
import MkPagination from '@/components/MkPagination.vue';
|
|
|
|
import MkFolder from '@/components/MkFolder.vue';
|
|
|
|
import MkSwitch from '@/components/MkSwitch.vue';
|
|
|
|
import MkButton from '@/components/MkButton.vue';
|
|
|
|
import MkRolePreview from '@/components/MkRolePreview.vue';
|
|
|
|
import * as os from '@/os';
|
|
|
|
import { i18n } from '@/i18n';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
|
|
|
import { instance } from '@/instance';
|
|
|
|
import { useRouter } from '@/router';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
const roles = await os.api('admin/roles/list');
|
|
|
|
|
|
|
|
let options_gtlAvailable = $ref(instance.baseRole.gtlAvailable);
|
|
|
|
let options_ltlAvailable = $ref(instance.baseRole.ltlAvailable);
|
|
|
|
let options_canPublicNote = $ref(instance.baseRole.canPublicNote);
|
2023-01-12 23:22:53 -06:00
|
|
|
let options_canInvite = $ref(instance.baseRole.canInvite);
|
2023-01-12 23:58:27 -06:00
|
|
|
let options_canManageCustomEmojis = $ref(instance.baseRole.canManageCustomEmojis);
|
2023-01-12 06:02:26 -06:00
|
|
|
let options_driveCapacityMb = $ref(instance.baseRole.driveCapacityMb);
|
|
|
|
let options_antennaLimit = $ref(instance.baseRole.antennaLimit);
|
2023-01-13 17:04:38 -06:00
|
|
|
let options_wordMuteLimit = $ref(instance.baseRole.wordMuteLimit);
|
2023-01-13 19:48:11 -06:00
|
|
|
let options_webhookLimit = $ref(instance.baseRole.webhookLimit);
|
2023-01-14 01:14:24 -06:00
|
|
|
let options_clipLimit = $ref(instance.baseRole.clipLimit);
|
|
|
|
let options_noteEachClipsLimit = $ref(instance.baseRole.noteEachClipsLimit);
|
2023-01-12 06:02:26 -06:00
|
|
|
|
|
|
|
async function updateBaseRole() {
|
|
|
|
await os.apiWithDialog('admin/roles/update-default-role-override', {
|
|
|
|
options: {
|
|
|
|
gtlAvailable: options_gtlAvailable,
|
|
|
|
ltlAvailable: options_ltlAvailable,
|
|
|
|
canPublicNote: options_canPublicNote,
|
2023-01-12 23:22:53 -06:00
|
|
|
canInvite: options_canInvite,
|
2023-01-12 23:58:27 -06:00
|
|
|
canManageCustomEmojis: options_canManageCustomEmojis,
|
2023-01-12 06:02:26 -06:00
|
|
|
driveCapacityMb: options_driveCapacityMb,
|
|
|
|
antennaLimit: options_antennaLimit,
|
2023-01-13 17:04:38 -06:00
|
|
|
wordMuteLimit: options_wordMuteLimit,
|
2023-01-13 19:48:11 -06:00
|
|
|
webhookLimit: options_webhookLimit,
|
2023-01-14 01:14:24 -06:00
|
|
|
clipLimit: options_clipLimit,
|
|
|
|
noteEachClipsLimit: options_noteEachClipsLimit,
|
2023-01-12 06:02:26 -06:00
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
router.push('/admin/roles/new');
|
|
|
|
}
|
|
|
|
|
|
|
|
const headerActions = $computed(() => []);
|
|
|
|
|
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata(computed(() => ({
|
|
|
|
title: i18n.ts.roles,
|
|
|
|
icon: 'ti ti-badges',
|
|
|
|
})));
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
|
|
|
|
</style>
|