Compare commits

..
Author SHA1 Message Date
jialin 4ab6e1d2cf feat: add antv/g6 2026-05-13 17:54:10 +08:00
@@ -27,8 +27,7 @@ const clusterActionList = [
{ {
key: 'edit', key: 'edit',
label: 'common.button.edit', label: 'common.button.edit',
icon: icons.EditOutlined, icon: icons.EditOutlined
order: 10
}, },
{ {
label: 'resources.metrics.details', label: 'resources.metrics.details',
@@ -37,38 +36,33 @@ const clusterActionList = [
<span className="flex-center"> <span className="flex-center">
<GrafanaIcon style={{ width: 14, height: 14 }}></GrafanaIcon> <GrafanaIcon style={{ width: 14, height: 14 }}></GrafanaIcon>
</span> </span>
), )
order: 20
}, },
{ {
key: 'add_worker', key: 'add_worker',
label: 'resources.button.create', label: 'resources.button.create',
provider: ProviderValueMap.Docker, provider: ProviderValueMap.Docker,
locale: true, locale: true,
icon: icons.DockerOutlined, icon: icons.DockerOutlined
order: 30
}, },
{ {
key: 'register_cluster', key: 'register_cluster',
label: 'clusters.button.register', label: 'clusters.button.register',
provider: ProviderValueMap.Kubernetes, provider: ProviderValueMap.Kubernetes,
locale: true, locale: true,
icon: icons.KubernetesOutlined, icon: icons.KubernetesOutlined
order: 40
}, },
{ {
key: 'addPool', key: 'addPool',
label: 'clusters.button.addNodePool', label: 'clusters.button.addNodePool',
provider: ProviderValueMap.DigitalOcean, provider: ProviderValueMap.DigitalOcean,
locale: true, locale: true,
icon: icons.Catalog1, icon: icons.Catalog1
order: 50
}, },
{ {
key: 'isDefault', key: 'isDefault',
label: 'clusters.form.setDefault', label: 'clusters.form.setDefault',
icon: icons.StarOutlined, icon: icons.StarOutlined
order: 60
}, },
{ {
key: 'delete', key: 'delete',
@@ -76,8 +70,7 @@ const clusterActionList = [
icon: icons.DeleteOutlined, icon: icons.DeleteOutlined,
props: { props: {
danger: true danger: true
}, }
order: 99
} }
]; ];
@@ -93,13 +86,11 @@ const useClusterColumns = (
// `clusterDetail.linkableName`. Without a plugin we render the // `clusterDetail.linkableName`. Without a plugin we render the
// name as plain text (matches the pre-restore behaviour); with one // name as plain text (matches the pre-restore behaviour); with one
// we use Typography.Link wired to the parent's `onCellClick`. // we use Typography.Link wired to the parent's `onCellClick`.
const { nameLinkable, useGenerateActions } = const nameLinkable: boolean = !!getGPUStackPlugin()?.clusterDetail
getGPUStackPlugin()?.clusterDetail || {}; ?.linkableName;
const actions: typeof clusterActionList =
useGenerateActions?.({ actions: clusterActionList }) || clusterActionList;
const setActionsItems = (row: ClusterListItem) => { const setActionsItems = (row: ClusterListItem) => {
return actions.filter((item) => { return clusterActionList.filter((item) => {
if (item.provider) { if (item.provider) {
return item.provider === row.provider; return item.provider === row.provider;
} }
@@ -121,7 +112,9 @@ const useClusterColumns = (
<> <>
<AutoTooltip ghost title={text}> <AutoTooltip ghost title={text}>
{nameLinkable ? ( {nameLinkable ? (
<Typography.Link onClick={() => onCellClick?.(record, 'name')}> <Typography.Link
onClick={() => onCellClick?.(record, 'name')}
>
{record.name} {record.name}
</Typography.Link> </Typography.Link>
) : ( ) : (