Spaces:
Paused
Paused
Create apis.component.html
Browse files
flare-ui/src/app/components/apis/apis.component.html
ADDED
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="apis-container">
|
2 |
+
<div class="toolbar">
|
3 |
+
<div class="toolbar-left">
|
4 |
+
<button mat-raised-button color="primary" (click)="createAPI()">
|
5 |
+
<mat-icon>add</mat-icon>
|
6 |
+
New API
|
7 |
+
</button>
|
8 |
+
<button mat-button (click)="importAPIs()">
|
9 |
+
<mat-icon>upload</mat-icon>
|
10 |
+
Import
|
11 |
+
</button>
|
12 |
+
<button mat-button (click)="exportAPIs()">
|
13 |
+
<mat-icon>download</mat-icon>
|
14 |
+
Export
|
15 |
+
</button>
|
16 |
+
</div>
|
17 |
+
|
18 |
+
<div class="toolbar-right">
|
19 |
+
<mat-form-field appearance="outline" class="search-field">
|
20 |
+
<mat-label>Search APIs</mat-label>
|
21 |
+
<input matInput [(ngModel)]="searchTerm" (ngModelChange)="onSearchChange()">
|
22 |
+
<mat-icon matSuffix>search</mat-icon>
|
23 |
+
</mat-form-field>
|
24 |
+
|
25 |
+
<mat-checkbox [(ngModel)]="showDeleted" (change)="onShowDeletedChange()">
|
26 |
+
Show Deleted
|
27 |
+
</mat-checkbox>
|
28 |
+
</div>
|
29 |
+
</div>
|
30 |
+
|
31 |
+
<div class="table-container">
|
32 |
+
<mat-progress-bar mode="indeterminate" *ngIf="loading"></mat-progress-bar>
|
33 |
+
|
34 |
+
<table mat-table [dataSource]="filteredApis" class="apis-table">
|
35 |
+
<!-- Name Column -->
|
36 |
+
<ng-container matColumnDef="name">
|
37 |
+
<th mat-header-cell *matHeaderCellDef>Name</th>
|
38 |
+
<td mat-cell *matCellDef="let api">
|
39 |
+
{{api.name}}
|
40 |
+
<mat-icon *ngIf="api.deleted" class="deleted-icon"
|
41 |
+
matTooltip="This API is deleted">delete</mat-icon>
|
42 |
+
</td>
|
43 |
+
</ng-container>
|
44 |
+
|
45 |
+
<!-- URL Column -->
|
46 |
+
<ng-container matColumnDef="url">
|
47 |
+
<th mat-header-cell *matHeaderCellDef>URL</th>
|
48 |
+
<td mat-cell *matCellDef="let api" class="url-cell">
|
49 |
+
<span class="url-text" [matTooltip]="api.url">{{api.url}}</span>
|
50 |
+
</td>
|
51 |
+
</ng-container>
|
52 |
+
|
53 |
+
<!-- Method Column -->
|
54 |
+
<ng-container matColumnDef="method">
|
55 |
+
<th mat-header-cell *matHeaderCellDef>Method</th>
|
56 |
+
<td mat-cell *matCellDef="let api">
|
57 |
+
<span class="method-badge" [class.method-{{api.method.toLowerCase()}}">
|
58 |
+
{{api.method}}
|
59 |
+
</span>
|
60 |
+
</td>
|
61 |
+
</ng-container>
|
62 |
+
|
63 |
+
<!-- Timeout Column -->
|
64 |
+
<ng-container matColumnDef="timeout">
|
65 |
+
<th mat-header-cell *matHeaderCellDef>Timeout</th>
|
66 |
+
<td mat-cell *matCellDef="let api">{{api.timeout_seconds}}s</td>
|
67 |
+
</ng-container>
|
68 |
+
|
69 |
+
<!-- Auth Column -->
|
70 |
+
<ng-container matColumnDef="auth">
|
71 |
+
<th mat-header-cell *matHeaderCellDef>Auth</th>
|
72 |
+
<td mat-cell *matCellDef="let api">
|
73 |
+
<mat-icon *ngIf="api.auth?.enabled" class="auth-icon" color="primary">lock</mat-icon>
|
74 |
+
<mat-icon *ngIf="!api.auth?.enabled" class="auth-icon">lock_open</mat-icon>
|
75 |
+
</td>
|
76 |
+
</ng-container>
|
77 |
+
|
78 |
+
<!-- Actions Column -->
|
79 |
+
<ng-container matColumnDef="actions">
|
80 |
+
<th mat-header-cell *matHeaderCellDef>Actions</th>
|
81 |
+
<td mat-cell *matCellDef="let api">
|
82 |
+
<button mat-icon-button (click)="editAPI(api)"
|
83 |
+
matTooltip="Edit API"
|
84 |
+
[disabled]="api.deleted">
|
85 |
+
<mat-icon>edit</mat-icon>
|
86 |
+
</button>
|
87 |
+
<button mat-icon-button (click)="testAPI(api)"
|
88 |
+
matTooltip="Test API"
|
89 |
+
[disabled]="api.deleted">
|
90 |
+
<mat-icon>play_arrow</mat-icon>
|
91 |
+
</button>
|
92 |
+
<button mat-icon-button (click)="duplicateAPI(api)"
|
93 |
+
matTooltip="Duplicate API"
|
94 |
+
[disabled]="api.deleted">
|
95 |
+
<mat-icon>content_copy</mat-icon>
|
96 |
+
</button>
|
97 |
+
<button mat-icon-button (click)="deleteAPI(api)"
|
98 |
+
matTooltip="Delete API"
|
99 |
+
[disabled]="api.deleted">
|
100 |
+
<mat-icon>delete</mat-icon>
|
101 |
+
</button>
|
102 |
+
</td>
|
103 |
+
</ng-container>
|
104 |
+
|
105 |
+
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
106 |
+
<tr mat-row *matRowDef="let row; columns: displayedColumns;"
|
107 |
+
[class.deleted-row]="row.deleted"></tr>
|
108 |
+
</table>
|
109 |
+
|
110 |
+
<div class="no-data" *ngIf="!loading && filteredApis.length === 0">
|
111 |
+
<mat-icon>cloud_off</mat-icon>
|
112 |
+
<p>No APIs found</p>
|
113 |
+
</div>
|
114 |
+
</div>
|
115 |
+
</div>
|