Added Disable login animation with env variable (#2799)

Set CONSOLE_ANIMATED_LOGIN=off env variable before running Console binary

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2023-05-03 11:36:41 -06:00
committed by GitHub
parent be60569a14
commit cde6d1b0e0
10 changed files with 27 additions and 0 deletions

View File

@@ -38,6 +38,9 @@ import (
// swagger:model loginDetails
type LoginDetails struct {
// animated login
AnimatedLogin bool `json:"animatedLogin,omitempty"`
// is direct p v
IsDirectPV bool `json:"isDirectPV,omitempty"`

View File

@@ -468,6 +468,7 @@ export interface LoginDetails {
redirectRules?: RedirectRule[];
isDirectPV?: boolean;
isK8S?: boolean;
animatedLogin?: boolean;
}
export interface LoginOauth2AuthRequest {

View File

@@ -266,6 +266,10 @@ const Login = () => {
const isK8S = useSelector((state: AppState) => state.login.isK8S);
const backgroundAnimation = useSelector(
(state: AppState) => state.login.backgroundAnimation
);
useEffect(() => {
if (navigateTo !== "") {
dispatch(resetForm());
@@ -393,6 +397,7 @@ const Login = () => {
.
</span>
}
backgroundAnimation={backgroundAnimation}
/>
</Fragment>
);

View File

@@ -27,6 +27,7 @@ export interface LoginState {
secretKey: string;
sts: string;
useSTS: boolean;
backgroundAnimation: boolean;
loginStrategy: ILoginDetails;
@@ -56,6 +57,7 @@ const initialState: LoginState = {
loadingVersion: true,
isDirectPV: false,
isK8S: false,
backgroundAnimation: false,
navigateTo: "",
};
@@ -107,6 +109,7 @@ export const loginSlice = createSlice({
state.loginStrategy = action.payload;
state.isDirectPV = !!action.payload.isDirectPV;
state.isK8S = !!action.payload.isK8S;
state.backgroundAnimation = !!action.payload.animatedLogin;
}
})
.addCase(doLoginAsync.pending, (state, action) => {

View File

@@ -19,6 +19,7 @@ export interface ILoginDetails {
redirectRules: redirectRule[];
isDirectPV?: boolean;
isK8S?: boolean;
animatedLogin?: boolean;
}
export interface redirectRule {

View File

@@ -276,3 +276,7 @@ func getMaxConcurrentDownloadsLimit() int64 {
func getConsoleDevMode() bool {
return strings.ToLower(env.Get(ConsoleDevMode, "off")) == "on"
}
func getConsoleAnimatedLogin() bool {
return strings.ToLower(env.Get(ConsoleAnimatedLogin, "on")) == "on"
}

View File

@@ -54,6 +54,7 @@ const (
ConsoleMaxConcurrentUploads = "CONSOLE_MAX_CONCURRENT_UPLOADS"
ConsoleMaxConcurrentDownloads = "CONSOLE_MAX_CONCURRENT_DOWNLOADS"
ConsoleDevMode = "CONSOLE_DEV_MODE"
ConsoleAnimatedLogin = "CONSOLE_ANIMATED_LOGIN"
LogSearchQueryAuthToken = "LOGSEARCH_QUERY_AUTH_TOKEN"
SlashSeparator = "/"
)

View File

@@ -7026,6 +7026,9 @@ func init() {
"loginDetails": {
"type": "object",
"properties": {
"animatedLogin": {
"type": "boolean"
},
"isDirectPV": {
"type": "boolean"
},
@@ -16157,6 +16160,9 @@ func init() {
"loginDetails": {
"type": "object",
"properties": {
"animatedLogin": {
"type": "boolean"
},
"isDirectPV": {
"type": "boolean"
},

View File

@@ -216,6 +216,7 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams, openIDProviders o
LoginStrategy: loginStrategy,
RedirectRules: redirectRules,
IsK8S: isKubernetes(),
AnimatedLogin: getConsoleAnimatedLogin(),
}
return loginDetails, nil
}

View File

@@ -4355,6 +4355,8 @@ definitions:
type: boolean
isK8S:
type: boolean
animatedLogin:
type: boolean
loginOauth2AuthRequest:
type: object
required: