Skip to content

Commit

Permalink
fix: separate used/allocated units
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <[email protected]>
(cherry picked from commit b5455bc)

# Conflicts:
#	.github/pull_request_template.md
#	.github/workflows/check-plugins.yaml
#	README.md
#	package.json
#	pkg/harvester/components/HarvesterUpgrade.vue
#	pkg/harvester/components/SettingList.vue
#	pkg/harvester/components/UpgradeInfo.vue
#	pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue
#	pkg/harvester/components/settings/csi-driver-config.vue
#	pkg/harvester/components/settings/storage-network.vue
#	pkg/harvester/config/harvester-map.js
#	pkg/harvester/config/harvester.js
#	pkg/harvester/config/labels-annotations.js
#	pkg/harvester/config/settings.js
#	pkg/harvester/config/table-headers.js
#	pkg/harvester/detail/harvesterhci.io.host/HarvesterHostBasic.vue
#	pkg/harvester/detail/harvesterhci.io.host/HarvesterHostDisk.vue
#	pkg/harvester/detail/harvesterhci.io.host/index.vue
#	pkg/harvester/detail/harvesterhci.io.virtualmachinebackup/index.vue
#	pkg/harvester/detail/harvesterhci.io.virtualmachineimage/index.vue
#	pkg/harvester/detail/kubevirt.io.virtualmachine/VirtualMachineTabs/VirtualMachineBasics.vue
#	pkg/harvester/detail/kubevirt.io.virtualmachine/index.vue
#	pkg/harvester/detail/network.harvesterhci.io.vlanconfig.vue
#	pkg/harvester/dialog/CloneVmDialog.vue
#	pkg/harvester/dialog/HarvesterExportImageDialog.vue
#	pkg/harvester/dialog/HarvesterMigrationDialog.vue
#	pkg/harvester/dialog/HarvesterSupportBundle.vue
#	pkg/harvester/dialog/HarvesterVMSnapshotDialog.vue
#	pkg/harvester/dialog/SnapshotDialog.vue
#	pkg/harvester/dialog/VolumeCloneDialog.vue
#	pkg/harvester/edit/harvesterhci.io.host/HarvesterDisk.vue
#	pkg/harvester/edit/harvesterhci.io.host/HarvesterKsmtuned.vue
#	pkg/harvester/edit/harvesterhci.io.host/index.vue
#	pkg/harvester/edit/harvesterhci.io.keypair.vue
#	pkg/harvester/edit/harvesterhci.io.logging.output.vue
#	pkg/harvester/edit/harvesterhci.io.storage/index.vue
#	pkg/harvester/edit/harvesterhci.io.virtualmachinebackup.vue
#	pkg/harvester/edit/harvesterhci.io.virtualmachineimage.vue
#	pkg/harvester/edit/harvesterhci.io.virtualmachinetemplateversion.vue
#	pkg/harvester/edit/harvesterhci.io.vmsnapshot.vue
#	pkg/harvester/edit/harvesterhci.io.volume.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineCloudConfig/index.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/DeviceList.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachinePciDevices/index.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineSSHKey.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVGpuDevices/index.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/index.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/container.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/existing.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/vmImage.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/VirtualMachineVolume/type/volume.vue
#	pkg/harvester/edit/kubevirt.io.virtualmachine/index.vue
#	pkg/harvester/formatters/HarvesterMigrationState.vue
#	pkg/harvester/formatters/HarvesterStorageUsed.vue
#	pkg/harvester/l10n/en-us.yaml
#	pkg/harvester/list/devices.harvesterhci.io.sriovgpudevice.vue
#	pkg/harvester/list/harvesterhci.io.host.vue
#	pkg/harvester/list/harvesterhci.io.setting.vue
#	pkg/harvester/list/harvesterhci.io.virtualmachinebackup.vue
#	pkg/harvester/list/harvesterhci.io.virtualmachineimage.vue
#	pkg/harvester/list/harvesterhci.io.vmsnapshot.vue
#	pkg/harvester/list/harvesterhci.io.volume.vue
#	pkg/harvester/list/kubevirt.io.virtualmachine.vue
#	pkg/harvester/mixins/harvester-vm/impl.js
#	pkg/harvester/mixins/harvester-vm/index.js
#	pkg/harvester/models/devices.harvesterhci.io.pcidevice.js
#	pkg/harvester/models/harvester/namespace.js
#	pkg/harvester/models/harvester/node.js
#	pkg/harvester/models/harvester/persistentvolumeclaim.js
#	pkg/harvester/models/harvester/secret.js
#	pkg/harvester/models/harvester/storage.k8s.io.storageclass.js
#	pkg/harvester/models/harvesterhci.io.addon.js
#	pkg/harvester/models/harvesterhci.io.blockdevice.js
#	pkg/harvester/models/harvesterhci.io.virtualmachinebackup.js
#	pkg/harvester/models/harvesterhci.io.virtualmachineimage.js
#	pkg/harvester/models/kubevirt.io.virtualmachine.js
#	pkg/harvester/package.json
#	pkg/harvester/pages/c/_cluster/support/index.vue
#	pkg/harvester/store/harvester-store/actions.ts
#	pkg/harvester/types.ts
#	pkg/harvester/validators/vm.js
#	pkg/harvester/validators/volume.js
#	pkg/rancher-components/package.json
#	pkg/rancher-components/src/components/Form/LabeledInput/LabeledInput.vue
#	shell/assets/translations/en-us.yaml
#	shell/cloud-credential/generic.vue
#	shell/components/CruResource.vue
#	shell/components/ExplorerProjectsNamespaces.vue
#	shell/components/PromptRemove.vue
#	shell/components/Questions/index.vue
#	shell/components/ResourceDetail/index.vue
#	shell/components/ResourceYaml.vue
#	shell/components/form/KeyValue.vue
#	shell/components/form/ResourceTabs/index.vue
#	shell/components/formatter/IngressTarget.vue
#	shell/components/formatter/Si.vue
#	shell/components/nav/Header.vue
#	shell/config/labels-annotations.js
#	shell/config/table-headers.js
#	shell/config/types.js
#	shell/core/plugin-helpers.js
#	shell/creators/app/app.package.json
#	shell/detail/cis.cattle.io.clusterscan.vue
#	shell/detail/networking.k8s.io.ingress.vue
#	shell/detail/provisioning.cattle.io.cluster.vue
#	shell/edit/cis.cattle.io.clusterscan.vue
#	shell/edit/configmap.vue
#	shell/edit/logging-flow/index.vue
#	shell/edit/logging.banzaicloud.io.output/index.vue
#	shell/edit/management.cattle.io.user.vue
#	shell/edit/monitoring.coreos.com.alertmanagerconfig/index.vue
#	shell/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue
#	shell/edit/networking.k8s.io.ingress/index.vue
#	shell/layouts/default.vue
#	shell/list/cis.cattle.io.clusterscan.vue
#	shell/list/namespace.vue
#	shell/machine-config/generic.vue
#	shell/middleware/authenticated.js
#	shell/mixins/auth-config.js
#	shell/models/cis.cattle.io.clusterscan.js
#	shell/models/monitoring.coreos.com.receiver.js
#	shell/models/monitoring.coreos.com.route.js
#	shell/models/namespace.js
#	shell/models/persistentvolume.js
#	shell/models/schema.js
#	shell/package.json
#	shell/pages/auth/login.vue
#	shell/pages/auth/setup.vue
#	shell/pages/c/_cluster/_product/namespaces.vue
#	shell/pages/c/_cluster/apps/charts/index.vue
#	shell/pages/c/_cluster/monitoring/alertmanagerconfig/_alertmanagerconfigid/receiver.vue
#	shell/pages/prefs.vue
#	shell/plugins/dashboard-store/actions.js
#	shell/plugins/dashboard-store/getters.js
#	shell/plugins/dashboard-store/resource-class.js
#	shell/plugins/steve/getters.js
#	shell/plugins/steve/mutations.js
#	shell/plugins/steve/norman-class.js
#	shell/scripts/test-plugins-build.sh
#	shell/store/i18n.js
#	shell/store/index.js
#	shell/store/plugins.js
#	shell/utils/__tests__/create-yaml.test.ts
#	shell/utils/alertmanagerconfig.js
#	shell/utils/async.ts
#	shell/utils/create-yaml.js
#	shell/utils/router.js
#	yarn.lock
  • Loading branch information
a110605 authored and mergify[bot] committed Dec 10, 2024
1 parent a3cf2fa commit 8da4569
Show file tree
Hide file tree
Showing 180 changed files with 10,973 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pull_request_rules:
- name: Automatically open backport PR to release-harvester-v1.3
conditions:
- base=master
- label="Require backport v1.3"
actions:
backport:
branches:
- "release-harvester-v1.3"
assignees:
- "{{ author }}"
labels:
- "Backport to v1.3"

- name: Automatically open backport PR to release-harvester-v1.4
conditions:
- base=master
- label="Require backport v1.4"
actions:
backport:
branches:
- "release-harvester-v1.4"
assignees:
- "{{ author }}"
labels:
- "Backport to v1.4"

- name: Ask to resolve conflict
conditions:
- conflict
actions:
comment:
message: This pull request is now in conflict. Could you fix it @{{author}}? 🙏
4 changes: 4 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
- Are backend engineers aware of UI changes?
- [ ] Yes, the backend owner is:

<<<<<<< HEAD
Fixes #
=======
Related Issue #
>>>>>>> b5455bcb (fix: separate used/allocated units)
<!-- Define findings related to the feature or bug issue. -->
### Occurred changes and/or fixed issues
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
<<<<<<< HEAD
node-version: '14.x'
=======
node-version: '16.x'
>>>>>>> b5455bcb (fix: separate used/allocated units)
- name: Validate Plugin build system
run: ./shell/scripts/test-plugins-build.sh
shell: bash
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Harvester Dashboard

<<<<<<< HEAD
[![Build Status](http://drone-publish.rancher.io/api/badges/harvester/dashboard/status.svg)](http://drone-publish.rancher.io/harvester/dashboard)

=======
>>>>>>> b5455bcb (fix: separate used/allocated units)
Harvester Dashboard UI, Harvester is an open-source hyper-converged infrastructure (HCI) software built on Kubernetes.

## Running for Development
Expand Down Expand Up @@ -33,7 +36,11 @@ In this mode, you need to have Rancher and import Harvester, more detail in [Har
yarn build-pkg harvester && yarn serve-pkgs

# Open another terminal
<<<<<<< HEAD
HARVESTER_PKG_URL=http://127.0.0.1:4500/harvester-${version}/harvester-${version}.umd.min.js API=https://your-rancher-ip yarn mem-dev
=======
HARVESTER_PKG_URL=http://127.0.0.1:4500/harvester-${version}/harvester-${version}.umd.min.js API=https://your-rancher-ip RANCHER_ENV=harvester yarn mem-dev
>>>>>>> b5455bcb (fix: separate used/allocated units)

# Example
# HARVESTER_PKG_URL=http://127.0.0.1:4500/harvester-1.2.0/harvester-1.2.0.umd.min.js API=https://192.168.1.122 yarn mem-dev
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,13 @@
"clipboard-polyfill": "4.0.1",
"cookie": "0.5.0",
"cookie-universal-nuxt": "2.1.4",
<<<<<<< HEAD
"cron-validator": "1.2.0",
"cronstrue": "1.95.0",
=======
"cron-validator": "1.3.1",
"cronstrue": "2.50.0",
>>>>>>> b5455bcb (fix: separate used/allocated units)
"cross-env": "6.0.3",
"d3": "7.3.0",
"d3-selection": "1.4.1",
Expand Down
119 changes: 119 additions & 0 deletions pkg/harvester/components/FilterVMSchedule.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<script>
import { RadioGroup } from '@components/Form/Radio';
export default {
name: 'HarvesterFilterVMSchedule',
components: { RadioGroup },
props: {
rows: {
type: Array,
required: true,
},
},
data() {
return { selected: '' };
},
computed: {
scheduleOptions() {
const options = this.rows.map(r => r.sourceSchedule).filter(r => r);
return Array.from(new Set(options));
},
},
methods: {
onSelect(selected) {
this.selected = selected;
this.filterRows();
},
remove() {
this.selected = '';
this.filterRows();
},
filterRows() {
if (!this.selected) {
this.$emit('change-rows', this.rows);
return;
}
const filteredRows = this.rows.filter(row => row.sourceSchedule === this.selected);
this.$emit('change-rows', filteredRows, this.selected);
}
},
watch: {
rows: {
deep: true,
immediate: false,
handler() {
this.filterRows();
}
}
}
};
</script>

<template>
<div class="vm-schedule-filter">
<template>
<span v-if="selected" class="banner-item bg-warning">
{{ t('harvester.tableHeaders.vmSchedule') }}{{ selected ? ` = ${selected}`: '' }}<i class="icon icon-close ml-5" @click="remove" />
</span>
</template>

<v-popover
:trigger="scheduleOptions.length ? 'click' : 'manual'"
placement="bottom-end"
>
<slot name="header">
<button ref="actionDropDown" class="btn bg-primary mr-10">
<slot name="title">
{{ t('harvester.fields.filterSchedule') }}
</slot>
</button>
</slot>
<template slot="popover">
<div class="filter-popup">
<RadioGroup
v-model="selected"
class="mr-10 ml-10"
name="model"
:options="scheduleOptions"
:labels="scheduleOptions"
@input="onSelect"
/>
</div>
</template>
</v-popover>
</div>
</template>

<style lang="scss" scoped>
.vm-schedule-filter {
display: inline-block;
.banner-item {
display: inline-block;
font-size: 16px;
margin-right: 10px;
padding: 6px;
border-radius: 2px;
i {
cursor: pointer;
vertical-align: middle;
}
}
}
.filter-popup {
width: max-content;
}
</style>
4 changes: 4 additions & 0 deletions pkg/harvester/components/HarvesterUpgrade.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ export default {
<Checkbox v-model="readyReleaseNote" class="check" type="checkbox" label-key="harvester.upgradePage.checkReady" />
</div>
<<<<<<< HEAD
<Banner v-if="errors.length" color="warning">
=======
<Banner v-if="errors.length" color="error">
>>>>>>> b5455bcb (fix: separate used/allocated units)
{{ errors }}
</Banner>
</div>
Expand Down
45 changes: 45 additions & 0 deletions pkg/harvester/components/SettingList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
},
data() {
<<<<<<< HEAD
const categorySettings = this.settings.filter((s) => {
if (this.category !== 'advanced') {
return (CATEGORY[this.category] || []).find(item => item === s.id);
Expand All @@ -43,6 +44,9 @@ export default {
return !allCategory.some(category => (CATEGORY[category] || []).find(item => item === s.id));
}
}) || [];
=======
const categorySettings = this.filterCategorySettings();
>>>>>>> b5455bcb (fix: separate used/allocated units)
return {
HCI_SETTING,
Expand All @@ -52,7 +56,31 @@ export default {
computed: { ...mapGetters({ t: 'i18n/t' }) },
<<<<<<< HEAD
methods: {
=======
watch: {
settings: {
deep: true,
handler() {
this.$set(this, 'categorySettings', this.filterCategorySettings());
}
}
},
methods: {
filterCategorySettings() {
return this.settings.filter((s) => {
if (this.category !== 'advanced') {
return (CATEGORY[this.category] || []).find(item => item === s.id);
} else if (this.category === 'advanced') {
const allCategory = Object.keys(CATEGORY);
return !allCategory.some(category => (CATEGORY[category] || []).find(item => item === s.id));
}
}) || [];
},
>>>>>>> b5455bcb (fix: separate used/allocated units)
showActionMenu(e, setting) {
const actionElement = e.srcElement;
Expand Down Expand Up @@ -112,6 +140,12 @@ export default {
<span v-if="setting.customized" class="modified">
Modified
</span>
<<<<<<< HEAD
=======
<span v-if="setting.experimental" v-clean-tooltip="t('advancedSettings.experimental')" class="experimental">
Experimental
</span>
>>>>>>> b5455bcb (fix: separate used/allocated units)
</h1>
<h2 v-clean-html="t(setting.description, {}, true)">
</h2>
Expand Down Expand Up @@ -200,4 +234,15 @@ export default {
padding: 2px 10px;
font-size: 12px;
}
<<<<<<< HEAD
=======
.experimental {
margin-left: 10px;
border: 1px solid var(--error);
border-radius: 5px;
padding: 2px 10px;
font-size: 12px;
}
>>>>>>> b5455bcb (fix: separate used/allocated units)
</style>
19 changes: 19 additions & 0 deletions pkg/harvester/components/UpgradeInfo.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script>
import { Banner } from '@components/Banner';
<<<<<<< HEAD
=======
import { DOC_LINKS } from '../config/doc-links';
>>>>>>> b5455bcb (fix: separate used/allocated units)
export default {
name: 'HarvesterUpgradeInfo',
Expand All @@ -16,6 +20,13 @@ export default {
computed: {
releaseVersion() {
return !!this.version ? `https://github.com/harvester/harvester/releases/tag/${ this.version }` : `https://github.com/harvester/harvester/releases`;
<<<<<<< HEAD
=======
},
upgradeLink() {
return DOC_LINKS.UPGRADE_URL;
>>>>>>> b5455bcb (fix: separate used/allocated units)
}
},
};
Expand All @@ -26,15 +37,23 @@ export default {
<Banner color="warning">
<div>
<strong>{{ t('harvester.upgradePage.upgradeInfo.warning') }}:</strong>
<<<<<<< HEAD
<p v-clean-html="t('harvester.upgradePage.upgradeInfo.doc', {}, true)" class="mb-5">
</p>
=======
<p v-clean-html="t('harvester.upgradePage.upgradeInfo.doc', {url: upgradeLink}, true)" class="mb-5"></p>
>>>>>>> b5455bcb (fix: separate used/allocated units)

<p class="mb-5">
{{ t('harvester.upgradePage.upgradeInfo.tip') }}
</p>

<p class="mb-5">
<<<<<<< HEAD
{{ t('harvester.upgradePage.upgradeInfo.moreNotes') }} <a :href="releaseVersion" target="_blank">{{ t('generic.moreInfo') }} </a>
=======
{{ t('harvester.upgradePage.upgradeInfo.moreNotes') }} <a :href="releaseVersion" target="_blank">{{ t('generic.moreInfo') }}</a>
>>>>>>> b5455bcb (fix: separate used/allocated units)
</p>
</div>
</Banner>
Expand Down
4 changes: 4 additions & 0 deletions pkg/harvester/components/novnc/NovncConsoleCustomKeys.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ export default {
.actions {
width: 100%;
display: flex;
<<<<<<< HEAD
justify-content: end;
=======
justify-content: flex-end;
>>>>>>> b5455bcb (fix: separate used/allocated units)
}
</style>
Loading

0 comments on commit 8da4569

Please sign in to comment.