Skip to content

Commit 006b3c7

Browse files
authored
UI for Inspect (#1583)
1 parent 1f97f39 commit 006b3c7

File tree

14 files changed

+803
-4
lines changed

14 files changed

+803
-4
lines changed

portal-ui/src/common/SecureComponent/permissions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export const IAM_PAGES = {
132132
DASHBOARD: "/tools/metrics",
133133
TOOLS_HEAL: "/tools/heal",
134134
TOOLS_WATCH: "/tools/watch",
135+
TOOLS_INSPECT: "/tools/inspect",
135136
/* Health */
136137
HEALTH: "/health",
137138

@@ -366,6 +367,7 @@ export const IAM_PAGES_PERMISSIONS = {
366367
[IAM_PAGES.CALL_HOME]: [IAM_SCOPES.ADMIN_HEALTH_INFO],
367368
[IAM_PAGES.PROFILE]: [IAM_SCOPES.ADMIN_HEALTH_INFO],
368369
[IAM_PAGES.HEALTH]: [IAM_SCOPES.ADMIN_HEALTH_INFO],
370+
[IAM_PAGES.TOOLS_INSPECT]: [IAM_SCOPES.ADMIN_HEALTH_INFO],
369371
[IAM_PAGES.LICENSE]: [
370372
IAM_SCOPES.ADMIN_SERVER_INFO,
371373
IAM_SCOPES.ADMIN_CONFIG_UPDATE,

portal-ui/src/common/utils.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,3 +609,20 @@ export const decodeFileName = (text: string) => {
609609
return text;
610610
}
611611
};
612+
613+
export const performDownload = (blob: Blob, fileName: string) => {
614+
const link = document.createElement("a");
615+
link.href = window.URL.createObjectURL(blob);
616+
link.download = fileName;
617+
document.body.appendChild(link);
618+
link.click();
619+
document.body.removeChild(link);
620+
};
621+
622+
export const getCookieValue = (cookieName: string) => {
623+
return (
624+
document.cookie
625+
.match("(^|;)\\s*" + cookieName + "\\s*=\\s*([^;]+)")
626+
?.pop() || ""
627+
);
628+
};

portal-ui/src/screens/Console/Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Grid from "@mui/material/Grid";
2323
import { actionsTray, fieldBasic } from "../common/styleLibrary";
2424
import HelpIcon from "../../../../../icons/HelpIcon";
2525
import clsx from "clsx";
26+
import { InputProps as StandardInputProps } from "@mui/material/Input/Input";
2627

2728
interface IFormSwitch {
2829
label?: string;
@@ -38,6 +39,7 @@ interface IFormSwitch {
3839
checked: boolean;
3940
switchOnly?: boolean;
4041
indicatorLabels?: string[];
42+
extraInputProps?: StandardInputProps["inputProps"];
4143
}
4244

4345
const styles = (theme: Theme) =>
@@ -125,6 +127,7 @@ const FormSwitchWrapper = ({
125127
description = "",
126128
classes,
127129
indicatorLabels,
130+
extraInputProps = {},
128131
}: IFormSwitch) => {
129132
const switchComponent = (
130133
<React.Fragment>
@@ -144,7 +147,7 @@ const FormSwitchWrapper = ({
144147
onChange={onChange}
145148
color="primary"
146149
name={name}
147-
inputProps={{ "aria-label": "primary checkbox" }}
150+
inputProps={{ "aria-label": "primary checkbox", ...extraInputProps }}
148151
disabled={disabled}
149152
disableRipple
150153
disableFocusRipple

portal-ui/src/screens/Console/Common/FormComponents/common/styleLibrary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ export const selectorsCommon = {
414414
},
415415
};
416416

417-
export const settingsCommon = {
417+
export const settingsCommon:any = {
418418
customTitle: {
419419
fontSize: 18,
420420
color: "#000",
@@ -1152,7 +1152,7 @@ export const spacingUtils: any = {
11521152
},
11531153
};
11541154

1155-
export const formFieldStyles = {
1155+
export const formFieldStyles:any = {
11561156
formFieldRow: {
11571157
marginBottom: ".8rem",
11581158
"& .MuiInputLabel-root": {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ const Console = ({
326326
component: Tools,
327327
path: IAM_PAGES.PROFILE,
328328
},
329+
{
330+
component: Tools,
331+
path: IAM_PAGES.TOOLS_INSPECT,
332+
},
329333
{
330334
component: ConfigurationOptions,
331335
path: IAM_PAGES.SETTINGS,

0 commit comments

Comments
 (0)