mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-06-02 13:39:55 +00:00
58838f225c
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)
31 lines
784 B
TypeScript
31 lines
784 B
TypeScript
import { computed, toRef } from 'vue';
|
|
|
|
import useUserConfig from '~/compositions/useUserConfig';
|
|
import BuildStore from '~/store/builds';
|
|
|
|
import useAuthentication from './useAuthentication';
|
|
|
|
const { userConfig, setUserConfig } = useUserConfig();
|
|
|
|
export default () => {
|
|
const buildStore = BuildStore();
|
|
const { isAuthenticated } = useAuthentication();
|
|
|
|
const isOpen = computed(() => userConfig.value.isBuildFeedOpen && !!isAuthenticated);
|
|
|
|
function toggle() {
|
|
setUserConfig('isBuildFeedOpen', !userConfig.value.isBuildFeedOpen);
|
|
}
|
|
|
|
const sortedBuilds = toRef(buildStore, 'sortedBuildFeed');
|
|
const activeBuilds = toRef(buildStore, 'activeBuilds');
|
|
|
|
return {
|
|
toggle,
|
|
isOpen,
|
|
sortedBuilds,
|
|
activeBuilds,
|
|
load: buildStore.loadBuildFeed,
|
|
};
|
|
};
|