mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 18:25:56 +01:00
Improve getChanges function for edit registries compoment (#15404)
Signed-off-by: AllForNothing <sshijun@vmware.com>
This commit is contained in:
parent
badfcab13d
commit
eabff82366
@ -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
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user