Merge pull request #12589 from AllForNothing/fc-bug-css

Fix css bugs with label target 2.1.0
This commit is contained in:
Will Sun 2020-07-27 15:43:23 +08:00 committed by GitHub
commit 7367227462
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 40 additions and 23 deletions

View File

@ -16,11 +16,10 @@ export class Robot {
constructor () { constructor () {
this.access = <any>{}; this.access = <any>{};
// this.access[0].action = true;
this.access.isPullImage = false; this.access.isPullImage = false;
this.access.isPushOrPullImage = true; this.access.isPushOrPullImage = true;
this.access.isPushChart = false; this.access.isPushChart = true;
this.access.isPullChart = false; this.access.isPullChart = true;
} }
} }

View File

@ -1164,7 +1164,7 @@
"DAY_AGO": " day(s) ago", "DAY_AGO": " day(s) ago",
"HOUR_AGO": " hour(s) ago", "HOUR_AGO": " hour(s) ago",
"MINUTE_AGO": " minute(s) ago", "MINUTE_AGO": " minute(s) ago",
"SECOND_AGO": "less 1 minute", "SECOND_AGO": "less than 1 minute",
"EVENT_LOG": "EVENT LOG" "EVENT_LOG": "EVENT LOG"
}, },
"UNKNOWN_ERROR": "Unknown errors have occurred. Please try again later.", "UNKNOWN_ERROR": "Unknown errors have occurred. Please try again later.",

View File

@ -1162,7 +1162,7 @@
"DAY_AGO": " day(s) ago", "DAY_AGO": " day(s) ago",
"HOUR_AGO": " hour(s) ago", "HOUR_AGO": " hour(s) ago",
"MINUTE_AGO": " minute(s) ago", "MINUTE_AGO": " minute(s) ago",
"SECOND_AGO": "less 1 minute", "SECOND_AGO": "less than 1 minute",
"EVENT_LOG": "EVENT LOG" "EVENT_LOG": "EVENT LOG"
}, },
"UNKNOWN_ERROR": "Ha ocurrido un error desconocido. Por favor, inténtelo de nuevo más tarde.", "UNKNOWN_ERROR": "Ha ocurrido un error desconocido. Por favor, inténtelo de nuevo más tarde.",

View File

@ -1133,7 +1133,7 @@
"DAY_AGO": " day(s) ago", "DAY_AGO": " day(s) ago",
"HOUR_AGO": " hour(s) ago", "HOUR_AGO": " hour(s) ago",
"MINUTE_AGO": " minute(s) ago", "MINUTE_AGO": " minute(s) ago",
"SECOND_AGO": "less 1 minute", "SECOND_AGO": "less than 1 minute",
"EVENT_LOG": "EVENT LOG" "EVENT_LOG": "EVENT LOG"
}, },
"UNKNOWN_ERROR": "Des erreurs inconnues sont survenues. Veuillez réessayer plus tard.", "UNKNOWN_ERROR": "Des erreurs inconnues sont survenues. Veuillez réessayer plus tard.",

View File

@ -35,8 +35,12 @@
</div> </div>
<div class="state-container" [style.width]="totalWidth+'px'"> <div class="state-container" [style.width]="totalWidth+'px'">
<div class="clr-row m-0" *ngFor="let item of scanningMetrics?.metrics | keyvalue"> <div class="clr-row m-0" *ngFor="let item of scanningMetrics?.metrics | keyvalue">
<div class="state">{{getI18nKey(item?.key)|translate}}</div> <div class="state">
<div class="value">{{item?.value}}</div> <span class="badge" [ngClass]="{ error: isError(item?.key),
finished: isFinished(item?.key),
'in-progress': isInProgress(item?.key)}">{{item?.value}}</span>
</div>
<div class="value">{{getI18nKey(item?.key)|translate}}</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -80,18 +80,9 @@
height: 18px; height: 18px;
display: flex; display: flex;
background-color:#eee; background-color:#eee;
.error {
background-color: #e62700;
}
.finished {
background-color: #62a420;
}
.in-progress {
background-color: #0079b8;
}
} }
.state { .state {
flex: 2; flex: 1;
padding-left: 3px; padding-left: 3px;
} }
.value { .value {
@ -102,4 +93,16 @@
} }
.display-flex { .display-flex {
display: flex; display: flex;
} }
.error {
background-color: #e62700;
}
.finished {
background-color: #62a420;
}
.in-progress {
background-color: #0079b8;
}
.badge {
min-width: 30px;
}

View File

@ -332,4 +332,13 @@ export class VulnerabilityConfigComponent implements OnInit, OnDestroy {
); );
} }
} }
isError(status: string): boolean {
return status === VULNERABILITY_SCAN_STATUS.ERROR;
}
isFinished(status: string): boolean {
return status === VULNERABILITY_SCAN_STATUS.SUCCESS;
}
isInProgress(status: string): boolean {
return status === VULNERABILITY_SCAN_STATUS.RUNNING;
}
} }

View File

@ -9,7 +9,7 @@ export class OperateInfo {
this.state = ''; this.state = '';
this.data = {id: -1, name: '', errorInf: ''}; this.data = {id: -1, name: '', errorInf: ''};
this.timeStamp = new Date().getTime(); this.timeStamp = new Date().getTime();
this.timeDiff = 'less 1 minute'; this.timeDiff = 'OPERATION.SECOND_AGO';
} }
} }

View File

@ -13,7 +13,7 @@
.infoArea{ margin-left: 10px; width: 270px;} .infoArea{ margin-left: 10px; width: 270px;}
.eventName{display: block; margin-bottom: -5px;font-size: 16px; } .eventName{display: block; margin-bottom: -5px;font-size: 16px; }
.eventErrorInf {display:block; font-size: 12px;color:red;line-height: .6rem;} .eventErrorInf {display:block; font-size: 12px;color:red;line-height: .6rem;}
.eventTarget{display: inline-flex; width: 172px; font-size: 12px; flex-shrink:1; overflow: hidden; text-overflow: ellipsis;white-space: nowrap;} .eventTarget{display: inline-flex; width: 160px; font-size: 12px; flex-shrink:1; overflow: hidden; text-overflow: ellipsis;white-space: nowrap;}
.eventTime{ float: right; font-size: 12px;} .eventTime{ float: right; font-size: 12px;}
:host >>> .nav{padding-left: 38px;} :host >>> .nav{padding-left: 38px;}
@ -75,4 +75,4 @@
} }
.margin-left-5 { .margin-left-5 {
margin-left: 5px; margin-left: 5px;
} }

View File

@ -130,6 +130,8 @@ export class OperationComponent implements OnInit, OnDestroy {
this.animationState = this.animationState === 'out' ? 'in' : 'out'; this.animationState = this.animationState === 'out' ? 'in' : 'out';
if (this.animationState === 'in') { if (this.animationState === 'in') {
this.resetNewMessageCount(); this.resetNewMessageCount();
// refresh when open
this.TabEvent();
} }
} }

View File

@ -18,6 +18,6 @@ describe('OperationService', () => {
operateInfo = res; operateInfo = res;
}); });
operationService.publishInfo(new OperateInfo()); operationService.publishInfo(new OperateInfo());
expect(operateInfo.timeDiff).toEqual("less 1 minute"); expect(operateInfo.timeDiff).toEqual("OPERATION.SECOND_AGO");
}); });
}); });