admin-resource-catalog.component.html 1.3 KB

12345678910111213141516171819202122
  1. <header class="page-header"><div><p>DATA DIRECTORY</p><h1>全部数据类</h1><span>只展示管理员云函数白名单内的规范化业务类</span></div><strong>{{ catalog()?.total ?? '—' }} 类</strong></header>
  2. <label class="search-box"><lucide-icon [img]="icons.Search" [size]="18" /><input [ngModel]="query()" (ngModelChange)="query.set($event)" placeholder="搜索中文名称或 Parse Class" /></label>
  3. @if (loading()) {
  4. <div class="state"><lucide-icon class="spin" [img]="icons.LoaderCircle" [size]="25" />正在通过云函数读取目录…</div>
  5. } @else if (error()) {
  6. <div class="state error"><strong>目录加载失败</strong><span>{{ error() }}</span><button type="button" (click)="load()">重新加载</button></div>
  7. } @else {
  8. <section class="resource-grid">
  9. @for (item of resources(); track item.className) {
  10. <a [routerLink]="item.route">
  11. <div class="resource-icon"><lucide-icon [img]="icons.Database" [size]="20" /></div>
  12. <div><strong>{{ item.label }}</strong><code>{{ item.className }}</code></div>
  13. <span [class.readonly]="!item.writable">{{ item.writable ? '可管理' : '只读' }}</span>
  14. <lucide-icon class="arrow" [img]="icons.ArrowRight" [size]="18" />
  15. </a>
  16. } @empty {
  17. <div class="state">没有匹配的数据类</div>
  18. }
  19. </section>
  20. }