mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-02-04 15:01:46 +00:00
feat: skip ksmtuned updated if there no related change
Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
facc74ca51
commit
0366cecd12
@ -7,6 +7,8 @@ import { Checkbox } from '@components/Form/Checkbox';
|
|||||||
import { HCI } from '../../types';
|
import { HCI } from '../../types';
|
||||||
import { DOC } from '../../config/doc-links';
|
import { DOC } from '../../config/doc-links';
|
||||||
import { docLink } from '../../utils/feature-flags';
|
import { docLink } from '../../utils/feature-flags';
|
||||||
|
import isEqual from 'lodash/isEqual';
|
||||||
|
import { clone } from '@shell/utils/object';
|
||||||
|
|
||||||
export const ksmtunedMode = [{
|
export const ksmtunedMode = [{
|
||||||
value: 'standard',
|
value: 'standard',
|
||||||
@ -64,11 +66,13 @@ export default {
|
|||||||
|
|
||||||
this.enableMergeAcrossNodes = !!this.ksmtuned.spec?.mergeAcrossNodes;
|
this.enableMergeAcrossNodes = !!this.ksmtuned.spec?.mergeAcrossNodes;
|
||||||
this.spec = this.ksmtuned.spec;
|
this.spec = this.ksmtuned.spec;
|
||||||
|
this.originSpec = clone(this.ksmtuned.spec);
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ksmtuned: {},
|
ksmtuned: {},
|
||||||
|
originSpec: {},
|
||||||
spec: {},
|
spec: {},
|
||||||
thresCoef: 30,
|
thresCoef: 30,
|
||||||
ksmtunedMode,
|
ksmtunedMode,
|
||||||
@ -99,6 +103,11 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
async saveKsmtuned() {
|
async saveKsmtuned() {
|
||||||
|
// no ksmtuned spec change, skip save
|
||||||
|
if (isEqual(this.spec, this.originSpec)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.spec.mergeAcrossNodes = this.enableMergeAcrossNodes ? 1 : 0;
|
this.spec.mergeAcrossNodes = this.enableMergeAcrossNodes ? 1 : 0;
|
||||||
this.ksmtuned['spec'] = this.spec;
|
this.ksmtuned['spec'] = this.spec;
|
||||||
|
|
||||||
|
|||||||
@ -527,7 +527,6 @@ export default {
|
|||||||
id: this.longhornNode.id,
|
id: this.longhornNode.id,
|
||||||
opt: { force: true },
|
opt: { force: true },
|
||||||
});
|
});
|
||||||
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, '5000'));
|
await new Promise((resolve) => setTimeout(resolve, '5000'));
|
||||||
await retrySave();
|
await retrySave();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user