Skip to content

feat: redirect to embedded #1732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/containers/Clusters/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {ProgressViewer} from '../../components/ProgressViewer/ProgressViewer';
import {UserCard} from '../../components/User/User';
import type {PreparedCluster} from '../../store/reducers/clusters/types';
import {formatStorageValuesToTb} from '../../utils/dataFormatters/dataFormatters';
import {createDeveloperUIMonitoringPageHref} from '../../utils/developerUI/developerUI';
import {getCleanBalancerValue, removeViewerPathname} from '../../utils/parseBalancer';
import {clusterTabsIds, getClusterPath} from '../Cluster/utils';

Expand All @@ -26,11 +27,14 @@ export const CLUSTERS_COLUMNS: Column<PreparedCluster>[] = [
header: COLUMNS_TITLES[COLUMNS_NAMES.TITLE],
width: 230,
render: ({row}) => {
const {balancer, name: clusterName} = row;
const {balancer, name: clusterName, use_embedded_ui: useEmbeddedUi} = row;

const backend = balancer && removeViewerPathname(balancer);

const clusterPath = getClusterPath(undefined, {backend, clusterName});
const clusterPath =
useEmbeddedUi && backend
? createDeveloperUIMonitoringPageHref(backend)
: getClusterPath(undefined, {backend, clusterName});

const clusterStatus = row.cluster?.Overall;

Expand Down
1 change: 1 addition & 0 deletions src/types/api/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface MetaBaseClusterInfo {
service?: string;
trace_view?: string;
trace_check?: string;
use_embedded_ui?: boolean;
}

export interface MetaGeneralClusterInfo extends MetaBaseClusterInfo {
Expand Down
4 changes: 4 additions & 0 deletions src/utils/developerUI/developerUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export function createDeveloperUIInternalPageHref(host = backend) {
return host + '/internal';
}

export function createDeveloperUIMonitoringPageHref(host = backend) {
return host + '/monitoring';
}

// Current node connects with target node by itself using nodeId
export const createDeveloperUILinkWithNodeId = (nodeId: number | string, host = backend) => {
const nodePathRegexp = /\/node\/\d+\/?$/g;
Expand Down
Loading