mirror of https://github.com/rancher/dashboard.git
HARVESTER: fix pr review comment
This commit is contained in:
parent
78cf15909f
commit
db5aa024f7
|
|
@ -5196,6 +5196,8 @@ harvester:
|
||||||
unplug:
|
unplug:
|
||||||
title: 'Are you sure that you want to detach volume {name} ?'
|
title: 'Are you sure that you want to detach volume {name} ?'
|
||||||
actionLabel: Detach
|
actionLabel: Detach
|
||||||
|
detachVolume:
|
||||||
|
Detach Volume
|
||||||
restartTip: Restart the virtual machine now to take effect of the configuration changes.
|
restartTip: Restart the virtual machine now to take effect of the configuration changes.
|
||||||
createRunning: Start virtual machine on creation
|
createRunning: Start virtual machine on creation
|
||||||
restartNow: Restart Now
|
restartNow: Restart Now
|
||||||
|
|
|
||||||
|
|
@ -4308,6 +4308,8 @@ harvester:
|
||||||
unplug:
|
unplug:
|
||||||
title: '你确定要拔掉卷{name} ?'
|
title: '你确定要拔掉卷{name} ?'
|
||||||
actionLabel: 拔出
|
actionLabel: 拔出
|
||||||
|
detachVolume:
|
||||||
|
拔出卷
|
||||||
restartTip: 现在重新启动虚拟机以使配置更改生效.
|
restartTip: 现在重新启动虚拟机以使配置更改生效.
|
||||||
createRunning: 创建时启动虚拟机
|
createRunning: 创建时启动虚拟机
|
||||||
restartNow: 现在重启
|
restartNow: 现在重启
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import ArrayList from '@/components/form/ArrayList';
|
import ArrayList from '@/components/form/ArrayList';
|
||||||
import { NAME as HARVESTER } from '@/config/product/harvester';
|
|
||||||
import Row from './Row';
|
import Row from './Row';
|
||||||
|
|
||||||
export const TYPES = [
|
export const TYPES = [
|
||||||
|
|
@ -71,13 +70,6 @@ export const TYPES = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const HARVESTER_TYPES = [
|
|
||||||
'limitsCpu',
|
|
||||||
'limitsMemory',
|
|
||||||
'requestsCpu',
|
|
||||||
'requestsMemory',
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { ArrayList, Row },
|
components: { ArrayList, Row },
|
||||||
|
|
||||||
|
|
@ -91,6 +83,12 @@ export default {
|
||||||
default: () => {
|
default: () => {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
typeOverride: {
|
||||||
|
type: Array,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -99,26 +97,21 @@ export default {
|
||||||
this.$set(this.value.spec, 'namespaceDefaultResourceQuota', this.value.spec.namespaceDefaultResourceQuota || { limit: {} });
|
this.$set(this.value.spec, 'namespaceDefaultResourceQuota', this.value.spec.namespaceDefaultResourceQuota || { limit: {} });
|
||||||
this.$set(this.value.spec, 'resourceQuota', this.value.spec.resourceQuota || { limit: {} });
|
this.$set(this.value.spec, 'resourceQuota', this.value.spec.resourceQuota || { limit: {} });
|
||||||
|
|
||||||
return { types: Object.keys(this.value.spec.resourceQuota.limit) };
|
return {
|
||||||
|
types: Object.keys(this.value.spec.resourceQuota.limit),
|
||||||
|
TYPES_OVERRIDE: this.typeOverride.length > 0 ? this.typeOverride : TYPES
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
mappedTypes() {
|
mappedTypes() {
|
||||||
return (this.isHarvester ? this.harvesterTypes : TYPES)
|
return this.TYPES_OVERRIDE
|
||||||
.map(type => ({
|
.map(type => ({
|
||||||
label: this.t(type.labelKey),
|
label: this.t(type.labelKey),
|
||||||
units: type.units,
|
units: type.units,
|
||||||
value: type.key
|
value: type.key
|
||||||
}));
|
}));
|
||||||
},
|
}
|
||||||
|
|
||||||
isHarvester() {
|
|
||||||
return this.$store.getters['currentProduct'].inStore === HARVESTER;
|
|
||||||
},
|
|
||||||
|
|
||||||
harvesterTypes() {
|
|
||||||
return TYPES.filter(t => HARVESTER_TYPES.includes(t.key));
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ export default {
|
||||||
<i class="icon icon-2x icon-x" />
|
<i class="icon icon-2x icon-x" />
|
||||||
</button>
|
</button>
|
||||||
<button v-if="unplugAble(volume)" type="button" class="role-link btn btn-sm remove-vol" @click="unplugVolume(volume)">
|
<button v-if="unplugAble(volume)" type="button" class="role-link btn btn-sm remove-vol" @click="unplugVolume(volume)">
|
||||||
Detach Volume
|
{{ t('harvester.virtualMachine.unplug.detachVolume') }}
|
||||||
</button>
|
</button>
|
||||||
<h3>
|
<h3>
|
||||||
<n-link v-if="volume.to && !isView" :to="volume.to">
|
<n-link v-if="volume.to && !isView" :to="volume.to">
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,29 @@ import ProjectMembershipEditor from '@/components/form/Members/ProjectMembership
|
||||||
import { canViewProjectMembershipEditor } from '@/components/form/Members/ProjectMembershipEditor.vue';
|
import { canViewProjectMembershipEditor } from '@/components/form/Members/ProjectMembershipEditor.vue';
|
||||||
import { NAME as HARVESTER } from '@/config/product/harvester';
|
import { NAME as HARVESTER } from '@/config/product/harvester';
|
||||||
|
|
||||||
|
const HARVESTER_TYPES = [
|
||||||
|
{
|
||||||
|
key: 'limitsCpu',
|
||||||
|
units: 'cpu',
|
||||||
|
labelKey: 'resourceQuota.limitsCpu'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'limitsMemory',
|
||||||
|
units: 'memory',
|
||||||
|
labelKey: 'resourceQuota.limitsMemory'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'requestsCpu',
|
||||||
|
units: 'cpu',
|
||||||
|
labelKey: 'resourceQuota.requestsCpu'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'requestsMemory',
|
||||||
|
units: 'memory',
|
||||||
|
labelKey: 'resourceQuota.requestsMemory'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
ContainerResourceLimit, CruResource, Labels, LabeledSelect, NameNsDescription, ProjectMembershipEditor, ResourceQuota, Tabbed, Tab
|
ContainerResourceLimit, CruResource, Labels, LabeledSelect, NameNsDescription, ProjectMembershipEditor, ResourceQuota, Tabbed, Tab
|
||||||
|
|
@ -45,7 +68,8 @@ export default {
|
||||||
resource: MANAGEMENT.PROJECT_ROLE_TEMPLATE_BINDING,
|
resource: MANAGEMENT.PROJECT_ROLE_TEMPLATE_BINDING,
|
||||||
saveBindings: null,
|
saveBindings: null,
|
||||||
membershipHasOwner: false,
|
membershipHasOwner: false,
|
||||||
membershipUpdate: {}
|
membershipUpdate: {},
|
||||||
|
HARVESTER_TYPES
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -187,7 +211,7 @@ export default {
|
||||||
<ProjectMembershipEditor :mode="mode" :parent-id="value.id" @has-owner-changed="onHasOwnerChanged" @membership-update="onMembershipUpdate" />
|
<ProjectMembershipEditor :mode="mode" :parent-id="value.id" @has-owner-changed="onHasOwnerChanged" @membership-update="onMembershipUpdate" />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab name="resource-quotas" :label="t('project.resourceQuotas')" :weight="9">
|
<Tab name="resource-quotas" :label="t('project.resourceQuotas')" :weight="9">
|
||||||
<ResourceQuota v-model="value" :mode="mode" />
|
<ResourceQuota v-model="value" :mode="mode" :type-override="isHarvester ? HARVESTER_TYPES : []" />
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab name="container-default-resource-limit" :label="resourceQuotaLabel" :weight="8">
|
<Tab name="container-default-resource-limit" :label="resourceQuotaLabel" :weight="8">
|
||||||
<ContainerResourceLimit v-model="value.spec.containerDefaultResourceLimit" :mode="mode" :show-tip="false" :register-before-hook="registerBeforeHook" />
|
<ContainerResourceLimit v-model="value.spec.containerDefaultResourceLimit" :mode="mode" :show-tip="false" :register-before-hook="registerBeforeHook" />
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
showProductFooter() {
|
showProductFooter() {
|
||||||
if (this.isVirtualProduct) {
|
if (this.isVirtualProduct && this.isSingleVirtualCluster) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -88,8 +88,8 @@ export default {
|
||||||
settings: this.fetchClusterResources(HCI.SETTING),
|
settings: this.fetchClusterResources(HCI.SETTING),
|
||||||
services: this.fetchClusterResources(SERVICE),
|
services: this.fetchClusterResources(SERVICE),
|
||||||
metric: this.fetchClusterResources(METRIC.NODE),
|
metric: this.fetchClusterResources(METRIC.NODE),
|
||||||
longhornNode: this.fetchClusterResources(LONGHORN.NODES),
|
longhornNode: this.fetchClusterResources(LONGHORN.NODES) || [],
|
||||||
pods: this.$store.dispatch('harvester/findAll', { type: POD }),
|
_pods: this.$store.dispatch('harvester/findAll', { type: POD }),
|
||||||
};
|
};
|
||||||
|
|
||||||
(this.accessibleResources || []).map((a) => {
|
(this.accessibleResources || []).map((a) => {
|
||||||
|
|
@ -256,7 +256,7 @@ export default {
|
||||||
storageUsage() {
|
storageUsage() {
|
||||||
let out = 0;
|
let out = 0;
|
||||||
|
|
||||||
this.longhornNode.forEach((node) => {
|
(this.longhornNode || []).forEach((node) => {
|
||||||
const diskStatus = node?.status?.diskStatus || {};
|
const diskStatus = node?.status?.diskStatus || {};
|
||||||
|
|
||||||
Object.values(diskStatus).map((disk) => {
|
Object.values(diskStatus).map((disk) => {
|
||||||
|
|
@ -272,7 +272,7 @@ export default {
|
||||||
storageTotal() {
|
storageTotal() {
|
||||||
let out = 0;
|
let out = 0;
|
||||||
|
|
||||||
this.longhornNode.forEach((node) => {
|
(this.longhornNode || []).forEach((node) => {
|
||||||
const diskStatus = node?.status?.diskStatus || {};
|
const diskStatus = node?.status?.diskStatus || {};
|
||||||
|
|
||||||
Object.values(diskStatus).map((disk) => {
|
Object.values(diskStatus).map((disk) => {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,9 @@ export default {
|
||||||
out.splice(-1, 0, ...metricCol);
|
out.splice(-1, 0, ...metricCol);
|
||||||
}
|
}
|
||||||
|
|
||||||
return [...out, AGE];
|
out.push(AGE);
|
||||||
|
|
||||||
|
return out;
|
||||||
},
|
},
|
||||||
|
|
||||||
schema() {
|
schema() {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import BannerGraphic from '@/components/BannerGraphic';
|
import BannerGraphic from '@/components/BannerGraphic';
|
||||||
import IndentedPanel from '@/components/IndentedPanel';
|
import IndentedPanel from '@/components/IndentedPanel';
|
||||||
import SupportBundle from '@/components/dialog/SupportBundle';
|
import SupportBundle from '@/components/dialog/harvester/SupportBundle';
|
||||||
import CommunityLinks from '@/components/CommunityLinks';
|
import CommunityLinks from '@/components/CommunityLinks';
|
||||||
import { SCHEMA, HCI } from '@/config/types';
|
import { SCHEMA, HCI } from '@/config/types';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue