Skip to content

Commit

Permalink
Added Disable login animation with env variable (#2799)
Browse files Browse the repository at this point in the history
Set CONSOLE_ANIMATED_LOGIN=off env variable before running Console binary

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
  • Loading branch information
bexsoft committed May 3, 2023
1 parent be60569 commit cde6d1b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/login_details.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions portal-ui/src/api/consoleApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ export interface LoginDetails {
redirectRules?: RedirectRule[];
isDirectPV?: boolean;
isK8S?: boolean;
animatedLogin?: boolean;
}

export interface LoginOauth2AuthRequest {
Expand Down
5 changes: 5 additions & 0 deletions portal-ui/src/screens/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -393,6 +397,7 @@ const Login = () => {
.
</span>
}
backgroundAnimation={backgroundAnimation}
/>
</Fragment>
);
Expand Down
3 changes: 3 additions & 0 deletions portal-ui/src/screens/LoginPage/loginSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface LoginState {
secretKey: string;
sts: string;
useSTS: boolean;
backgroundAnimation: boolean;

loginStrategy: ILoginDetails;

Expand Down Expand Up @@ -56,6 +57,7 @@ const initialState: LoginState = {
loadingVersion: true,
isDirectPV: false,
isK8S: false,
backgroundAnimation: false,

navigateTo: "",
};
Expand Down Expand Up @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions portal-ui/src/screens/LoginPage/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface ILoginDetails {
redirectRules: redirectRule[];
isDirectPV?: boolean;
isK8S?: boolean;
animatedLogin?: boolean;
}

export interface redirectRule {
Expand Down
4 changes: 4 additions & 0 deletions restapi/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions restapi/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "/"
)
6 changes: 6 additions & 0 deletions restapi/embedded_spec.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions restapi/user_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams, openIDProviders o
LoginStrategy: loginStrategy,
RedirectRules: redirectRules,
IsK8S: isKubernetes(),
AnimatedLogin: getConsoleAnimatedLogin(),
}
return loginDetails, nil
}
Expand Down
2 changes: 2 additions & 0 deletions swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4355,6 +4355,8 @@ definitions:
type: boolean
isK8S:
type: boolean
animatedLogin:
type: boolean
loginOauth2AuthRequest:
type: object
required:
Expand Down

0 comments on commit cde6d1b

Please sign in to comment.