Compare commits
1
Commits
test
...
cluster/topology
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f405e4823 |
@@ -27,7 +27,8 @@ 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',
|
||||||
@@ -36,33 +37,38 @@ 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',
|
||||||
@@ -70,7 +76,8 @@ const clusterActionList = [
|
|||||||
icon: icons.DeleteOutlined,
|
icon: icons.DeleteOutlined,
|
||||||
props: {
|
props: {
|
||||||
danger: true
|
danger: true
|
||||||
}
|
},
|
||||||
|
order: 99
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -86,11 +93,13 @@ 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: boolean = !!getGPUStackPlugin()?.clusterDetail
|
const { nameLinkable, useGenerateActions } =
|
||||||
?.linkableName;
|
getGPUStackPlugin()?.clusterDetail || {};
|
||||||
|
const actions: typeof clusterActionList =
|
||||||
|
useGenerateActions?.({ actions: clusterActionList }) || clusterActionList;
|
||||||
|
|
||||||
const setActionsItems = (row: ClusterListItem) => {
|
const setActionsItems = (row: ClusterListItem) => {
|
||||||
return clusterActionList.filter((item) => {
|
return actions.filter((item) => {
|
||||||
if (item.provider) {
|
if (item.provider) {
|
||||||
return item.provider === row.provider;
|
return item.provider === row.provider;
|
||||||
}
|
}
|
||||||
@@ -112,9 +121,7 @@ const useClusterColumns = (
|
|||||||
<>
|
<>
|
||||||
<AutoTooltip ghost title={text}>
|
<AutoTooltip ghost title={text}>
|
||||||
{nameLinkable ? (
|
{nameLinkable ? (
|
||||||
<Typography.Link
|
<Typography.Link onClick={() => onCellClick?.(record, 'name')}>
|
||||||
onClick={() => onCellClick?.(record, 'name')}
|
|
||||||
>
|
|
||||||
{record.name}
|
{record.name}
|
||||||
</Typography.Link>
|
</Typography.Link>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user