woodpecker/web/src/compositions/useConfig.ts
6543 74f6824d03
Add option to disable version check in admin web UI (#3040)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
2023-12-27 22:16:15 +01:00

23 lines
805 B
TypeScript

import { User } from '~/lib/api/types';
declare global {
interface Window {
WOODPECKER_USER: User | undefined;
WOODPECKER_VERSION: string | undefined;
WOODPECKER_SKIP_VERSION_CHECK: boolean | undefined;
WOODPECKER_CSRF: string | undefined;
WOODPECKER_FORGE: 'github' | 'gitlab' | 'gitea' | 'bitbucket' | undefined;
WOODPECKER_ROOT_PATH: string | undefined;
WOODPECKER_ENABLE_SWAGGER: boolean | undefined;
}
}
export default () => ({
user: window.WOODPECKER_USER || null,
version: window.WOODPECKER_VERSION,
skipVersionCheck: window.WOODPECKER_SKIP_VERSION_CHECK || false,
csrf: window.WOODPECKER_CSRF || null,
forge: window.WOODPECKER_FORGE || null,
rootPath: window.WOODPECKER_ROOT_PATH || '',
enableSwagger: window.WOODPECKER_ENABLE_SWAGGER || false,
});