feat: Update fixed ip filter for instance

Update the fixed ip filter for the instance list in the server group detail page which filter data by the frontend.

Change-Id: I4bf10e82b6f3aba514b2a56766aabd719bc989a9
Signed-off-by: Jingwei Zhang <zhang.jingwei@99cloud.net>
This commit is contained in:
zhangjingwei
2025-08-12 02:18:54 +00:00
parent 447d83bb35
commit 12766cf8cf

View File

@@ -246,15 +246,26 @@ export class Instance extends Base {
} }
get searchFilters() { get searchFilters() {
const ipFilter = this.isFilterByBackend
? {
label: t('Fixed IP'),
name: 'ip',
}
: {
label: t('Fixed IP'),
name: 'fixed_addresses',
filterFunc: (val, filterVal) => {
return (val || []).some((v) =>
v.includes((filterVal || '').trim())
);
},
};
return [ return [
{ {
label: t('Name'), label: t('Name'),
name: 'name', name: 'name',
}, },
{ ipFilter,
label: t('Fixed IP'),
name: 'ip',
},
...(this.isAdminPage ...(this.isAdminPage
? [ ? [
{ {