]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/crud-table/crud-table.component.html
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / datatable / crud-table / crud-table.component.html
diff --git a/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/crud-table/crud-table.component.html b/ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/crud-table/crud-table.component.html
new file mode 100644 (file)
index 0000000..7e1a7f2
--- /dev/null
@@ -0,0 +1,76 @@
+<ul class="nav nav-tabs"
+    *ngIf="tabs">
+  <li class="nav-item"
+      *ngFor="let tab of tabs; keyvalue">
+    <a class="nav-link"
+       [routerLink]="tab.url"
+       routerLinkActive="active"
+       ariaCurrentWhenActive="page"
+       [routerLinkActiveOptions]="{exact: true}"
+       i18n>{{tab.name}}</a>
+  </li>
+</ul>
+
+<ng-container *ngIf="meta">
+  <cd-table
+      [data]="data$ | async"
+      [columns]="meta.table.columns"
+      [columnMode]="meta.table.columnMode"
+      (setExpandedRow)="setExpandedRow($event)"
+      [hasDetails]="meta.detail_columns.length > 0"
+      [selectionType]="meta.table.selectionType"
+      (updateSelection)="updateSelection($event)"
+      [toolHeader]="meta.table.toolHeader">
+    <div class="table-actions btn-toolbar">
+      <cd-table-actions [permission]="permission"
+                        [selection]="selection"
+                        class="btn-group"
+                        id="crud-table-actions"
+                        [tableActions]="meta.actions">
+      </cd-table-actions>
+    </div>
+    <ng-container *ngIf="expandedRow && meta.detail_columns.length > 0"
+                  cdTableDetail>
+      <table class="table table-striped table-bordered">
+        <tbody>
+          <tr *ngFor="let column of meta.detail_columns">
+            <td i18n
+                class="bold">{{ column }}</td>
+            <td> {{ expandedRow[column] }} </td>
+          </tr>
+        </tbody>
+      </table>
+    </ng-container>
+
+  </cd-table>
+</ng-container>
+
+<ng-template #badgeDictTpl
+             let-value="value">
+  <span *ngFor="let instance of value | keyvalue; last as isLast">
+    <span class="badge badge-background-primary" >{{ instance.key }}: {{ instance.value }}</span>
+    <ng-container *ngIf="!isLast">&nbsp;</ng-container>
+  </span>
+</ng-template>
+
+<ng-template #dateTpl
+             let-value="value">
+  <span>{{ value | cdDate }}</span>
+</ng-template>
+
+<ng-template #durationTpl
+             let-value="value">
+  <span>{{ value | duration }}</span>
+</ng-template>
+
+<ng-template #exportDataModalTpl>
+  <div class="d-flex flex-column align-items-center w-100 gap-3">
+    <textarea readonly
+              class="form-control w-100 bg-light height-400"
+              id="authExportArea">{{ modalState.authExportData }}</textarea>
+    <cd-copy-2-clipboard-button class="align-self-end"
+                                source="authExportArea">
+
+    </cd-copy-2-clipboard-button>
+  </div>
+</ng-template>