2022-08-14 11:48:53 +00:00
|
|
|
<template>
|
2022-10-27 22:55:07 +00:00
|
|
|
<Scaffold enable-tabs>
|
|
|
|
<template #title>
|
|
|
|
{{ $t('repo.settings.settings') }}
|
|
|
|
</template>
|
|
|
|
<Tab id="secrets" :title="$t('admin.settings.secrets.secrets')">
|
|
|
|
<AdminSecretsTab />
|
|
|
|
</Tab>
|
|
|
|
</Scaffold>
|
2022-08-14 11:48:53 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent, onMounted } from 'vue';
|
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
import AdminSecretsTab from '~/components/admin/settings/AdminSecretsTab.vue';
|
2022-10-27 22:55:07 +00:00
|
|
|
import Scaffold from '~/components/layout/scaffold/Scaffold.vue';
|
|
|
|
import Tab from '~/components/layout/scaffold/Tab.vue';
|
2022-08-14 11:48:53 +00:00
|
|
|
import useAuthentication from '~/compositions/useAuthentication';
|
|
|
|
import useNotifications from '~/compositions/useNotifications';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
name: 'AdminSettings',
|
|
|
|
|
|
|
|
components: {
|
|
|
|
Tab,
|
|
|
|
AdminSecretsTab,
|
2022-10-27 22:55:07 +00:00
|
|
|
Scaffold,
|
2022-08-14 11:48:53 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
const notifications = useNotifications();
|
|
|
|
const router = useRouter();
|
|
|
|
const i18n = useI18n();
|
|
|
|
const { user } = useAuthentication();
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
if (!user?.admin) {
|
|
|
|
notifications.notify({ type: 'error', title: i18n.t('admin.settings.not_allowed') });
|
|
|
|
await router.replace({ name: 'home' });
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|