dnet-applications/frontends/dnet-is-application/src/app/dsm/dsm-results.component.html

107 lines
4.1 KiB
HTML

<h2>Datasource Manager: Results</h2>
<p>
<span *ngIf="field">Searching for <b>{{field}}</b> = <i>"{{value}}"</i></span>
<span *ngIf="!field && value">Searching for <i>"{{value}}"</i></span>
<span *ngIf="!field && !value">Returning all the datasources</span>
</p>
<mat-form-field appearance="fill" floatLabel="always" style="width: 100%; margin-top: 10px;">
<mat-label><b>Filter in current page</b> (Total: {{(results | searchFilter: filterText).length}})</mat-label>
<input matInput [(ngModel)]="filterText" placeholder="Filter..." autofocus />
</mat-form-field>
<mat-paginator (page)="changePage($event)"
[pageIndex]="currPage"
[pageSize]="pageSize"
[length]="nResults"
[pageSize]="pageSize"
[pageSizeOptions]="[10, 25, 50, 100]"
aria-label="Select page">
</mat-paginator>
<mat-card *ngFor="let r of results | searchFilter: filterText" style="margin-top: 10px;">
<mat-card-header>
<mat-card-title>{{r.name}}</mat-card-title>
<mat-card-subtitle *ngIf="r.otherName && r.name != r.otherName">{{r.otherName}}</mat-card-subtitle>
</mat-card-header>
<mat-card-content>
<table class="dsm-result-table">
<tr>
<th>Id</th>
<td>{{r.id}}</td>
</tr>
<tr>
<th>Type</th>
<td>{{r.type}}</td>
</tr>
<tr>
<th>Namespace Prefix</th>
<td>{{r.nsprefix}}</td>
</tr>
<tr>
<th>Collected From</th>
<td>{{r.collectedFrom}}</td>
</tr>
<tr *ngIf="r.websiteUrl">
<th>URL</th><td><a href="{{r.websiteUrl}}" target="_blank">{{r.websiteUrl}}</a></td>
</tr>
<tr *ngIf="r.organizations && r.organizations.length > 0">
<th>Organization(s)</th>
<td>
<span *ngFor="let o of r.organizations">
{{o.name}}
<img src="assets/images/flags/{{o.country}}.gif" title="{{o.country}}" alt="{{o.country}}" *ngIf="o.country"/>
<br />
</span>
</td>
</tr>
<tr>
<th>APIs</th>
<td>
<ng-container *ngFor="let a of r.apis">
<p *ngIf="a.id" style="border-bottom: 1px solid lightgrey;">
<a [routerLink]="['/dsm/api']" [queryParams]="{id: a.id}" style="margin-right: 0.5em;">{{a.id}}</a>
<span class="badge-label badge-default" title="protocol">{{a.protocol}}</span>
<span class="badge-label badge-info" title="compliance">{{a.compliance}}</span>
<span class="badge-label badge-success" *ngIf="a.active">active</span>
<span class="badge-label badge-failure" *ngIf="!a.active">not active</span>
<span *ngIf="a.aggrDate">
<br/>
<b>Last aggregation:</b>
{{a.aggrDate}}
<b>(total: {{a.aggrTotal}})</b>
</span>
</p>
</ng-container>
<button mat-raised-button color="primary" (click)="openAddApiDialog(r.id, r.name)">add api</button>
</td>
</tr>
<tr *ngIf="r.consenttermsofuse">
<th>Consent Terms of Use</th>
<td>YES</td>
</tr>
<tr *ngIf="r.fulltextdownload">
<th>Fulltext Download</th>
<td>YES</td>
</tr>
</table>
</mat-card-content>
</mat-card>
<mat-paginator (page)="changePage($event)"
[pageIndex]="currPage"
[pageSize]="pageSize"
[length]="nResults"
[pageSize]="pageSize"
[pageSizeOptions]="[10, 25, 50, 100]"
aria-label="Select page">
</mat-paginator>