harvester-ui-extension/pkg/harvester/models/harvester/management.cattle.io.setting.js
Francesco Torchia c983ed8384
Lint - 1
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-10-23 17:00:47 +02:00

46 lines
1.2 KiB
JavaScript

import { clone } from '@shell/utils/object';
import ManagementSetting from '@shell/models/management.cattle.io.setting';
import { HCI } from '../../types';
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '../../config/harvester';
export default class HCIManagementSetting extends ManagementSetting {
get detailLocation() {
const detailLocation = clone(this._detailLocation);
detailLocation.params.resource = HCI.SETTING;
return detailLocation;
}
get doneOverride() {
const detailLocation = clone(this._detailLocation);
delete detailLocation.params.namespace;
delete detailLocation.params.id;
detailLocation.params.resource = HCI.SETTING;
detailLocation.name = `${ HARVESTER_PRODUCT }-c-cluster-resource`;
return detailLocation;
}
get doneRoute() {
return null;
}
get parentNameOverride() {
return this.$rootGetters['i18n/t'](`typeLabel."${ HCI.SETTING }"`, { count: 1 })?.trim();
}
get parentLocationOverride() {
return this.doneOverride;
}
get doneParams() {
return {
product: this.$rootGetters['productId'],
cluster: this.$rootGetters['clusterId'],
resource: HCI.SETTING,
};
}
}