Rewrite of WebUI (#245)

Rewrite of the UI using Typescript, Vue3, Windicss and Vite. The design should  be close to the current one with some changes:
- latest pipeline in a sidebar on the right
- secrets and registry as part of the repo-settings (secrets and registry entries shouldn't be used as much so they can be "hidden" under settings IMO)
- start page shows list of active repositories with button to enable / add new ones (currently you see all repositories and in most cases you only add new repositories once in a while)
This commit is contained in:
Anbraten
2021-11-03 17:40:31 +01:00
committed by GitHub
parent 0bb62be303
commit 58838f225c
239 changed files with 7765 additions and 13633 deletions

View File

@@ -0,0 +1,76 @@
<template>
<FluidContainer>
<div class="flex border-b items-center pb-4 mb-4 dark:border-gray-600">
<IconButton icon="back" @click="$router.back()" />
<h1 class="text-xl ml-2 text-gray-500">Settings</h1>
</div>
<Tabs>
<Tab title="General">
<GeneralTab />
</Tab>
<Tab title="Secrets">
<SecretsTab />
</Tab>
<Tab title="Registries">
<RegistriesTab />
</Tab>
<Tab title="Badge">
<BadgeTab />
</Tab>
<Tab title="Actions">
<ActionsTab />
</Tab>
</Tabs>
</FluidContainer>
</template>
<script lang="ts">
import { defineComponent, inject, onMounted, Ref } from 'vue';
import { useRouter } from 'vue-router';
import IconButton from '~/components/atomic/IconButton.vue';
import FluidContainer from '~/components/layout/FluidContainer.vue';
import ActionsTab from '~/components/repo/settings/ActionsTab.vue';
import BadgeTab from '~/components/repo/settings/BadgeTab.vue';
import GeneralTab from '~/components/repo/settings/GeneralTab.vue';
import RegistriesTab from '~/components/repo/settings/RegistriesTab.vue';
import SecretsTab from '~/components/repo/settings/SecretsTab.vue';
import Tab from '~/components/tabs/Tab.vue';
import Tabs from '~/components/tabs/Tabs.vue';
import useNotifications from '~/compositions/useNotifications';
import { RepoPermissions } from '~/lib/api/types';
export default defineComponent({
name: 'RepoSettings',
components: {
FluidContainer,
IconButton,
Tabs,
Tab,
GeneralTab,
SecretsTab,
RegistriesTab,
ActionsTab,
BadgeTab,
},
setup() {
const notifications = useNotifications();
const router = useRouter();
const repoPermissions = inject<Ref<RepoPermissions>>('repo-permissions');
if (!repoPermissions) {
throw new Error('Unexpected: "repoPermissions" should be provided at this place');
}
onMounted(async () => {
if (!repoPermissions.value.admin) {
notifications.notify({ type: 'error', title: 'Not allowed to access these repository settings' });
await router.replace({ name: 'home' });
}
});
},
});
</script>