mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-22 00:24:58 +00:00
Add option to disable version check in admin web UI (#3040)
Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ 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;
|
||||
@@ -14,6 +15,7 @@ declare global {
|
||||
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 || '',
|
||||
|
@@ -42,7 +42,7 @@ export function useVersion() {
|
||||
const usesNext = current.startsWith('next');
|
||||
|
||||
const { user } = useAuthentication();
|
||||
if (!user?.admin) {
|
||||
if (config.skipVersionCheck || !user?.admin) {
|
||||
version.value = {
|
||||
latest: undefined,
|
||||
current,
|
||||
|
Reference in New Issue
Block a user