mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-12-02 05:08:50 +08:00
Latest changes from harvester/master
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
56 files changed
+1498
-2197
No files matched your search
@@ -5,6 +5,7 @@ import SYSTEM_NAMESPACES from '@shell/config/system-namespaces';
|
||||
import { get } from '@shell/utils/object';
|
||||
import { NAMESPACE } from '@shell/config/types';
|
||||
import { PRODUCT_NAME as HARVESTER_PRODUCT } from '@pkg/harvester/config/harvester';
|
||||
import { HCI } from '../../types';
|
||||
|
||||
const OBSCURE_NAMESPACE_PREFIX = [
|
||||
'c-', // cluster namespace
|
||||
@@ -37,15 +38,32 @@ export default class HciNamespace extends namespace {
|
||||
weight: -10,
|
||||
};
|
||||
|
||||
const editQuotaAction = {
|
||||
action: 'editNSQuota',
|
||||
label: this.t('harvester.modal.quota.editQuota'),
|
||||
icon: 'icon icon-storage',
|
||||
enabled: !!this?.actions?.updateResourceQuota && !!this?.actions?.deleteResourceQuota,
|
||||
weight: -11,
|
||||
};
|
||||
|
||||
if (remove > -1) {
|
||||
out.splice(remove, 1);
|
||||
}
|
||||
|
||||
insertAt(out, out.length - 1, promptRemove);
|
||||
insertAt(out, out.length - 5, editQuotaAction);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
editNSQuota(resources = this) {
|
||||
this.$dispatch('promptModal', {
|
||||
resources,
|
||||
snapshotSizeQuota: this.snapshotSizeQuota,
|
||||
component: 'HarvesterQuotaDialog'
|
||||
});
|
||||
}
|
||||
|
||||
promptRemove(resources = this) {
|
||||
this.$dispatch('promptModal', {
|
||||
resources,
|
||||
@@ -54,6 +72,17 @@ export default class HciNamespace extends namespace {
|
||||
});
|
||||
}
|
||||
|
||||
get nsResourceQuota() {
|
||||
const inStore = this.$rootGetters['currentProduct'].inStore;
|
||||
const allResQuotas = this.$rootGetters[`${ inStore }/all`](HCI.RESOURCE_QUOTA);
|
||||
|
||||
return allResQuotas.find( RQ => RQ.metadata.namespace === this.id);
|
||||
}
|
||||
|
||||
get snapshotSizeQuota() {
|
||||
return this.nsResourceQuota?.spec?.snapshotLimit?.namespaceTotalSnapshotSizeQuota;
|
||||
}
|
||||
|
||||
get isSystem() {
|
||||
const systemNamespaces = ['fleet-default'];
|
||||
|
||||
|
||||
Reference in new issue
Block a user