Merge "fix: Fix attachments in volume list and tag in instance list"

This commit is contained in:
Zuul 2022-09-01 12:08:05 +00:00 committed by Gerrit Code Review
commit ca4bb7baf2
3 changed files with 7 additions and 5 deletions

View File

@ -198,6 +198,7 @@ export class Instance extends Base {
dataIndex: 'tags',
render: (tags) => tags.map((tag, index) => SimpleTag({ tag, index })),
isHideable: true,
sorter: false,
},
{
title: t('Locked'),

View File

@ -54,6 +54,10 @@ export class Volume extends Base {
return this.inDetailPage && this.path.includes('storage/snapshot');
}
get isInstanceDetail() {
return this.inDetailPage && this.path.includes('compute/instance');
}
get actionConfigs() {
if (this.isRecycleBinDetail) {
return emptyActionConfig;

View File

@ -247,7 +247,7 @@ export const snapshotTypeTip = (
);
export const getVolumeColumnsList = (self) => {
const columns = [
return [
{
title: t('ID/Name'),
dataIndex: 'name',
@ -298,6 +298,7 @@ export const getVolumeColumnsList = (self) => {
dataIndex: 'attachments',
isHideable: true,
sorter: false,
hidden: self.isInstanceDetail,
render: (value) => {
if (value && value.length > 0) {
return value.map((it) => (
@ -351,10 +352,6 @@ export const getVolumeColumnsList = (self) => {
stringify: (value) => toLocalTimeFilter(value),
},
];
if (self.inDetailPage) {
return columns.filter((it) => it.dataIndex !== 'attachments');
}
return columns;
};
// deal with quota