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