Skip to content

Commit cde6d1b

Browse files
authored
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>
1 parent be60569 commit cde6d1b

File tree

10 files changed

+27
-0
lines changed

10 files changed

+27
-0
lines changed

models/login_details.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/src/api/consoleApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,7 @@ export interface LoginDetails {
468468
redirectRules?: RedirectRule[];
469469
isDirectPV?: boolean;
470470
isK8S?: boolean;
471+
animatedLogin?: boolean;
471472
}
472473

473474
export interface LoginOauth2AuthRequest {

portal-ui/src/screens/LoginPage/LoginPage.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ const Login = () => {
266266

267267
const isK8S = useSelector((state: AppState) => state.login.isK8S);
268268

269+
const backgroundAnimation = useSelector(
270+
(state: AppState) => state.login.backgroundAnimation
271+
);
272+
269273
useEffect(() => {
270274
if (navigateTo !== "") {
271275
dispatch(resetForm());
@@ -393,6 +397,7 @@ const Login = () => {
393397
.
394398
</span>
395399
}
400+
backgroundAnimation={backgroundAnimation}
396401
/>
397402
</Fragment>
398403
);

portal-ui/src/screens/LoginPage/loginSlice.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface LoginState {
2727
secretKey: string;
2828
sts: string;
2929
useSTS: boolean;
30+
backgroundAnimation: boolean;
3031

3132
loginStrategy: ILoginDetails;
3233

@@ -56,6 +57,7 @@ const initialState: LoginState = {
5657
loadingVersion: true,
5758
isDirectPV: false,
5859
isK8S: false,
60+
backgroundAnimation: false,
5961

6062
navigateTo: "",
6163
};
@@ -107,6 +109,7 @@ export const loginSlice = createSlice({
107109
state.loginStrategy = action.payload;
108110
state.isDirectPV = !!action.payload.isDirectPV;
109111
state.isK8S = !!action.payload.isK8S;
112+
state.backgroundAnimation = !!action.payload.animatedLogin;
110113
}
111114
})
112115
.addCase(doLoginAsync.pending, (state, action) => {

portal-ui/src/screens/LoginPage/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface ILoginDetails {
1919
redirectRules: redirectRule[];
2020
isDirectPV?: boolean;
2121
isK8S?: boolean;
22+
animatedLogin?: boolean;
2223
}
2324

2425
export interface redirectRule {

restapi/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,7 @@ func getMaxConcurrentDownloadsLimit() int64 {
276276
func getConsoleDevMode() bool {
277277
return strings.ToLower(env.Get(ConsoleDevMode, "off")) == "on"
278278
}
279+
280+
func getConsoleAnimatedLogin() bool {
281+
return strings.ToLower(env.Get(ConsoleAnimatedLogin, "on")) == "on"
282+
}

restapi/consts.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const (
5454
ConsoleMaxConcurrentUploads = "CONSOLE_MAX_CONCURRENT_UPLOADS"
5555
ConsoleMaxConcurrentDownloads = "CONSOLE_MAX_CONCURRENT_DOWNLOADS"
5656
ConsoleDevMode = "CONSOLE_DEV_MODE"
57+
ConsoleAnimatedLogin = "CONSOLE_ANIMATED_LOGIN"
5758
LogSearchQueryAuthToken = "LOGSEARCH_QUERY_AUTH_TOKEN"
5859
SlashSeparator = "/"
5960
)

restapi/embedded_spec.go

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

restapi/user_login.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams, openIDProviders o
216216
LoginStrategy: loginStrategy,
217217
RedirectRules: redirectRules,
218218
IsK8S: isKubernetes(),
219+
AnimatedLogin: getConsoleAnimatedLogin(),
219220
}
220221
return loginDetails, nil
221222
}

swagger.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4355,6 +4355,8 @@ definitions:
43554355
type: boolean
43564356
isK8S:
43574357
type: boolean
4358+
animatedLogin:
4359+
type: boolean
43584360
loginOauth2AuthRequest:
43594361
type: object
43604362
required:

0 commit comments

Comments
 (0)