Skip to content

Commit

Permalink
Hide / disable monitoring graphs for embedded clusters (#4465)
Browse files Browse the repository at this point in the history
* Hide / disable monitoring graphs for embedded clusters
  • Loading branch information
sgalsaleh committed Feb 22, 2024
1 parent d824aca commit c23ca7e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
1 change: 1 addition & 0 deletions web/src/components/apps/AppDetailPage.tsx
Expand Up @@ -410,6 +410,7 @@ function AppDetailPage(props: Props) {
displayErrorModal: state.displayErrorModal,
isBundleUploading: isBundleUploading,
isHelmManaged: props.isHelmManaged,
isEmbeddedCluster: props.isEmbeddedCluster,
isVeleroInstalled: isVeleroInstalled,
logo: selectedApp?.iconUri,
makeCurrentVersion: makeCurrentRelease,
Expand Down
30 changes: 12 additions & 18 deletions web/src/features/Dashboard/components/Dashboard.tsx
Expand Up @@ -54,6 +54,7 @@ type OutletContext = {
};
isBundleUploading: boolean;
isHelmManaged: boolean;
isEmbeddedCluster: boolean;
isVeleroInstalled: boolean;
makeCurrentVersion: (
slug: string,
Expand Down Expand Up @@ -155,9 +156,9 @@ const Dashboard = () => {

const {
app,
//cluster,
isBundleUploading,
isHelmManaged,
isEmbeddedCluster,
isVeleroInstalled,
makeCurrentVersion,
ping,
Expand All @@ -167,7 +168,6 @@ const Dashboard = () => {
updateCallback,
}: OutletContext = useOutletContext();
const params = useParams();
// const { app, isBundleUploading, isVeleroInstalled } = props;
const airgapUploader = useRef<AirgapUploader | null>(null);

const timer = useRef<NodeJS.Timeout[]>([]);
Expand Down Expand Up @@ -722,24 +722,18 @@ const Dashboard = () => {
syncCallback={() => getAppLicense()}
refetchLicense={getAppLicense}
gettingAppLicenseErrMsg={state.gettingAppLicenseErrMsg}
>
{/* leaving this here as an example: please delete later */}
{/* <LicenseTester
appSlug={app.slug}
setLoader={(e: boolean) =>
setState({ slowLoader: e })
}
/> */}
</DashboardLicenseCard>
/>
</div>
</div>
<div className="u-marginTop--30 flex flex1">
<DashboardGraphsCard
prometheusAddress={state.dashboard?.prometheusAddress}
metrics={state.dashboard?.metrics}
isHelmManaged={isHelmManaged}
/>
</div>
{!isEmbeddedCluster && (
<div className="u-marginTop--30 flex flex1">
<DashboardGraphsCard
prometheusAddress={state.dashboard?.prometheusAddress}
metrics={state.dashboard?.metrics}
isHelmManaged={isHelmManaged}
/>
</div>
)}
</div>
</div>
{state.viewAirgapUploadError && (
Expand Down
@@ -1,4 +1,4 @@
import { ReactNode, useReducer } from "react";
import { useReducer } from "react";
import size from "lodash/size";
// @ts-ignore
import yaml from "js-yaml";
Expand All @@ -24,7 +24,6 @@ type Props = {
appLicense: AppLicense | null;
gettingAppLicenseErrMsg: string | null;
syncCallback: () => void;
children: ReactNode;
refetchLicense: () => void;
};

Expand Down Expand Up @@ -280,8 +279,6 @@ const DashboardLicenseCard = (props: Props) => {
)}
</div>
<div className="card-item u-marginTop--10">
{/* license tester component to try out the useLicense hook! */}
{props.children}
{size(appLicense) > 0 ? (
<div className="flex">
<div className="flex-column flex1">
Expand Down

0 comments on commit c23ca7e

Please sign in to comment.