mirror of
https://github.com/goharbor/harbor.git
synced 2025-02-18 12:51:27 +01:00
Merge pull request #4720 from ninjadq/fix_default_view_to_card_view
Fix default view problem and styles issues
This commit is contained in:
commit
9a2b522a2f
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harbor-ui",
|
"name": "harbor-ui",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"description": "Harbor shared UI components based on Clarity and Angular4",
|
"description": "Harbor shared UI components based on Clarity and Angular4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "ng serve --host 0.0.0.0 --port 4500 --proxy-config proxy.config.json",
|
"start": "ng serve --host 0.0.0.0 --port 4500 --proxy-config proxy.config.json",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harbor-ui",
|
"name": "harbor-ui",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"description": "Harbor shared UI components based on Clarity and Angular4",
|
"description": "Harbor shared UI components based on Clarity and Angular4",
|
||||||
"author": "VMware",
|
"author": "VMware",
|
||||||
"module": "index.js",
|
"module": "index.js",
|
||||||
|
@ -36,16 +36,20 @@ export const REPOSITORY_GRIDVIEW_STYLE = `
|
|||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.card-media-block {
|
|
||||||
margin-top: 12px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-media-block > img {
|
.card-media-block > img {
|
||||||
height: 45px;
|
height: 45px;
|
||||||
width: 45px;
|
width: 45px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-media-title {
|
||||||
|
overflow: hidden;
|
||||||
|
height: 24px;
|
||||||
|
}
|
||||||
|
.card-media-text {
|
||||||
|
overflow: hidden;
|
||||||
|
height: 21px
|
||||||
|
}
|
||||||
|
|
||||||
.card-media-description {
|
.card-media-description {
|
||||||
height: 45px;
|
height: 45px;
|
||||||
}
|
}
|
||||||
|
@ -50,12 +50,10 @@ export const REPOSITORY_GRIDVIEW_TEMPLATE = `
|
|||||||
<ng-template let-item="item">
|
<ng-template let-item="item">
|
||||||
<a class="card clickable" (click)="watchRepoClickEvt(item)">
|
<a class="card clickable" (click)="watchRepoClickEvt(item)">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div [ngClass]="{'card-media-block': withAdmiral, 'card-media-block wrap': !withAdmiral }">
|
<div [ngClass]="{'card-media-block': true, 'wrap': !withAdmiral }">
|
||||||
<img *ngIf="withAdmiral" [src]="getImgLink(item)"/>
|
<img *ngIf="withAdmiral" [src]="getImgLink(item)"/>
|
||||||
<div class="card-media-description">
|
<div class="card-media-description">
|
||||||
<span class="card-media-title">
|
<span class="card-media-title">{{item.name}}</span>
|
||||||
{{ (item.name?.length>29) ? (item.name | slice:0:29) + '...' : (item.name)}}
|
|
||||||
</span>
|
|
||||||
<p class="card-media-text">{{registryUrl}}</p>
|
<p class="card-media-text">{{registryUrl}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,6 +32,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit {
|
|||||||
@Input() urlPrefix: string;
|
@Input() urlPrefix: string;
|
||||||
@Input() hasSignedIn: boolean;
|
@Input() hasSignedIn: boolean;
|
||||||
@Input() hasProjectAdminRole: boolean;
|
@Input() hasProjectAdminRole: boolean;
|
||||||
|
@Input() mode = 'admiral';
|
||||||
@Output() repoClickEvent = new EventEmitter<RepositoryItem>();
|
@Output() repoClickEvent = new EventEmitter<RepositoryItem>();
|
||||||
@Output() repoProvisionEvent = new EventEmitter<RepositoryItem>();
|
@Output() repoProvisionEvent = new EventEmitter<RepositoryItem>();
|
||||||
@Output() addInfoEvent = new EventEmitter<RepositoryItem>();
|
@Output() addInfoEvent = new EventEmitter<RepositoryItem>();
|
||||||
@ -87,7 +88,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get withAdmiral(): boolean {
|
public get withAdmiral(): boolean {
|
||||||
return this.systemInfo ? this.systemInfo.with_admiral : false;
|
return this.mode === 'admiral'
|
||||||
}
|
}
|
||||||
|
|
||||||
public get showDBStatusWarning(): boolean {
|
public get showDBStatusWarning(): boolean {
|
||||||
@ -106,7 +107,7 @@ export class RepositoryGridviewComponent implements OnChanges, OnInit {
|
|||||||
.then(systemInfo => this.systemInfo = systemInfo)
|
.then(systemInfo => this.systemInfo = systemInfo)
|
||||||
.catch(error => this.errorHandler.error(error));
|
.catch(error => this.errorHandler.error(error));
|
||||||
|
|
||||||
if (this.withAdmiral) {
|
if (this.mode === 'admiral') {
|
||||||
this.isCardView = true;
|
this.isCardView = true;
|
||||||
} else {
|
} else {
|
||||||
this.isCardView = false;
|
this.isCardView = false;
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
"clarity-icons": "0.10.24",
|
"clarity-icons": "0.10.24",
|
||||||
"clarity-ui": "0.10.24",
|
"clarity-ui": "0.10.24",
|
||||||
"core-js": "^2.4.1",
|
"core-js": "^2.4.1",
|
||||||
"harbor-ui": "0.7.1",
|
"harbor-ui": "0.7.2",
|
||||||
"intl": "^1.2.5",
|
"intl": "^1.2.5",
|
||||||
"mutationobserver-shim": "^0.3.2",
|
"mutationobserver-shim": "^0.3.2",
|
||||||
"ngx-cookie": "^1.0.0",
|
"ngx-cookie": "^1.0.0",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div style="margin-top: 4px;">
|
<div style="margin-top: 4px;">
|
||||||
<hbr-repository-gridview [projectId]="projectId" [projectName]="projectName" [hasSignedIn]="hasSignedIn"
|
<hbr-repository-gridview [projectId]="projectId" [projectName]="projectName" [hasSignedIn]="hasSignedIn"
|
||||||
[hasProjectAdminRole]="hasProjectAdminRole"
|
[hasProjectAdminRole]="hasProjectAdminRole" [mode]="mode"
|
||||||
(repoClickEvent)="watchRepoClickEvent($event)"></hbr-repository-gridview>
|
(repoClickEvent)="watchRepoClickEvent($event)"></hbr-repository-gridview>
|
||||||
</div>
|
</div>
|
@ -28,6 +28,7 @@ export class RepositoryPageComponent implements OnInit {
|
|||||||
hasProjectAdminRole: boolean;
|
hasProjectAdminRole: boolean;
|
||||||
hasSignedIn: boolean;
|
hasSignedIn: boolean;
|
||||||
projectName: string;
|
projectName: string;
|
||||||
|
mode = 'standalone';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
|
Loading…
Reference in New Issue
Block a user