feat: update name column in the keypair list page
1. Update nameRender to support without id 2. Update name column in the keypair list page: only show the name with link to the detail page 3. Fix the id value in the keypair detail page Change-Id: I8c983875425b1c9b31f8b3ea8eb80667b5cfabf6
This commit is contained in:
parent
d158a05bfb
commit
115015821f
@ -35,6 +35,10 @@ export class KeypairDetail extends Base {
|
||||
return actionConfigs;
|
||||
}
|
||||
|
||||
get titleValue() {
|
||||
return this.detailData.origin_id;
|
||||
}
|
||||
|
||||
get detailInfos() {
|
||||
return [
|
||||
// {
|
||||
|
@ -48,6 +48,7 @@ export class Keypair extends Base {
|
||||
dataIndex: 'name',
|
||||
idKey: 'name',
|
||||
routeName: this.getRouteName('keypairDetail'),
|
||||
withoutId: true,
|
||||
},
|
||||
{
|
||||
title: t('Fingerprint'),
|
||||
|
@ -36,6 +36,7 @@ export class KeypairStore extends Base {
|
||||
return (data) => {
|
||||
const { keypair } = data;
|
||||
const item = keypair ? { ...keypair } : data;
|
||||
item.origin_id = item.id;
|
||||
item.id = item.name;
|
||||
return item;
|
||||
};
|
||||
|
@ -255,6 +255,7 @@ export const getNameRenderByRouter = (render, column, rowKey) => {
|
||||
copyable = true,
|
||||
boldName,
|
||||
title,
|
||||
withoutId = false,
|
||||
} = column;
|
||||
return (value, record) => {
|
||||
const nameValue = value || get(record, dataIndex) || '-';
|
||||
@ -272,18 +273,27 @@ export const getNameRenderByRouter = (render, column, rowKey) => {
|
||||
? routeParamsFunc(record)
|
||||
: { [routeParamsKey]: idValue };
|
||||
const query = routeQuery;
|
||||
if (!withoutId) {
|
||||
const link = getLinkRender({
|
||||
key: routeName,
|
||||
params,
|
||||
query,
|
||||
value: idRender,
|
||||
});
|
||||
return (
|
||||
<div>
|
||||
<div>{link}</div>
|
||||
{!withoutName && nameRender}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const link = getLinkRender({
|
||||
key: routeName,
|
||||
params,
|
||||
query,
|
||||
value: idRender,
|
||||
value: nameRender,
|
||||
});
|
||||
return (
|
||||
<div>
|
||||
<div>{link}</div>
|
||||
{!withoutName && nameRender}
|
||||
</div>
|
||||
);
|
||||
return <div>{link}</div>;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user