Improve getChanges function for edit registries compoment (#15404)

Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
孙世军 2021-08-12 10:08:49 +08:00 committed by GitHub
parent badfcab13d
commit eabff82366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -423,7 +423,7 @@ export class CreateEditEndpointComponent
if (!this.target || !this.initVal) {
return changes;
}
for (let prop of Object.keys(this.target)) {
for (let prop of Object.keys(Object.assign({}, this.target, this.initVal))) {
let field: any = this.initVal[prop];
if (typeof field !== "object") {
if (!compareValue(field, this.target[prop])) {
@ -439,7 +439,7 @@ export class CreateEditEndpointComponent
}
}
} else {
for (let pro of Object.keys(field)) {
for (let pro of Object.keys(Object.assign({}, field, this.target[prop]))) {
if (!compareValue(field[pro], this.target[prop][pro])) {
changes[pro] = this.target[prop][pro];
// Number

View File

@ -567,7 +567,7 @@ export const validateLimit = unitContrl => {
};
export function formatSize(tagSize: string): string {
const size: number = Number.parseInt(tagSize);
const size: number = Number.parseInt(tagSize, 10);
if (Math.pow(1024, 1) <= size && size < Math.pow(1024, 2)) {
return (size / Math.pow(1024, 1)).toFixed(2) + "KiB";
} else if (Math.pow(1024, 2) <= size && size < Math.pow(1024, 3)) {