web-mojo 2.2.18 → 2.2.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/admin.es.js CHANGED
@@ -10,7 +10,7 @@ import { F as FormView, a as applyFileDropMixin } from "./chunks/FormView-D_VTD2
10
10
  import { MapView } from "./map.es.js";
11
11
  import { M as Model, C as Collection } from "./chunks/Collection-sSP1JF8d.js";
12
12
  import { L as LightboxGallery, P as PDFViewer } from "./chunks/PDFViewer-C9hCxlyT.js";
13
- import { B, a, V, b, c, d } from "./chunks/version-WosnMiWn.js";
13
+ import { B, a, V, b, c, d } from "./chunks/version-OWYBowgn.js";
14
14
  class AdminHeaderView extends View {
15
15
  constructor(options = {}) {
16
16
  super({
@@ -6711,8 +6711,8 @@ class JobsAdminPage extends Page {
6711
6711
  <i class="bi bi-arrow-clockwise"></i> Refresh
6712
6712
  </button>
6713
6713
  <button type="button" class="btn btn-outline-primary btn-sm"
6714
- data-action="export-data" title="Export Data">
6715
- <i class="bi bi-download"></i> Export
6714
+ data-action="view-all-jobs" title="View All Jobs">
6715
+ <i class="bi bi-table"></i> View All
6716
6716
  </button>
6717
6717
  <div class="dropdown">
6718
6718
  <button class="btn btn-outline-secondary btn-sm dropdown-toggle"
@@ -6812,12 +6812,9 @@ class JobsAdminPage extends Page {
6812
6812
  </div>
6813
6813
  </div>
6814
6814
 
6815
- <div class="card shadow-sm mb-5">
6815
+ <div class="card shadow-sm mb-5">
6816
6816
  <div class="card-header d-flex justify-content-between align-items-center">
6817
6817
  <h5 class="mb-0"><i class="bi bi-tools me-2"></i>Operations</h5>
6818
- <button class="btn btn-outline-secondary btn-sm" data-action="view-all-jobs">
6819
- <i class="bi bi-table"></i> View All Jobs
6820
- </button>
6821
6818
  </div>
6822
6819
  <div class="card-body">
6823
6820
  <div class="d-flex flex-wrap gap-2">
@@ -7458,12 +7455,104 @@ class JobsAdminPage extends Page {
7458
7455
  });
7459
7456
  }
7460
7457
  async onActionViewAllJobs() {
7461
- const router = this.getApp()?.router;
7462
- if (router) {
7463
- router.navigateTo("/admin/jobs/table");
7464
- } else {
7465
- this.getApp()?.toast?.info("Router unavailable.");
7466
- }
7458
+ const jobList = new JobList({
7459
+ params: {
7460
+ sort: "-created",
7461
+ size: 25
7462
+ }
7463
+ });
7464
+ const view = new TableView({
7465
+ collection: jobList,
7466
+ fetchOnMount: true,
7467
+ columns: [
7468
+ {
7469
+ key: "id",
7470
+ label: "Job",
7471
+ template: `
7472
+ <div class="fw-semibold font-monospace">{{model.id}}</div>
7473
+ <div class="text-muted small">{{model.func|default('Unknown')}}</div>
7474
+ `
7475
+ },
7476
+ {
7477
+ key: "channel",
7478
+ label: "Channel",
7479
+ formatter: "badge"
7480
+ },
7481
+ {
7482
+ key: "status",
7483
+ label: "Status",
7484
+ formatter: (value, context) => {
7485
+ const job = context.row;
7486
+ const badgeClass = job.getStatusBadgeClass ? job.getStatusBadgeClass() : "bg-secondary";
7487
+ const icon = job.getStatusIcon ? job.getStatusIcon() : "bi-question";
7488
+ return `<span class="badge ${badgeClass}"><i class="${icon} me-1"></i>${value?.toUpperCase() || "UNKNOWN"}</span>`;
7489
+ }
7490
+ },
7491
+ {
7492
+ key: "created",
7493
+ label: "Created",
7494
+ formatter: "datetime"
7495
+ },
7496
+ {
7497
+ key: "finished_at",
7498
+ label: "Finished",
7499
+ formatter: "datetime"
7500
+ },
7501
+ {
7502
+ key: "duration_ms",
7503
+ label: "Duration",
7504
+ formatter: "duration"
7505
+ }
7506
+ ],
7507
+ filters: [
7508
+ {
7509
+ key: "func__icontains",
7510
+ label: "Function",
7511
+ type: "text"
7512
+ },
7513
+ {
7514
+ key: "status",
7515
+ label: "Status",
7516
+ type: "select",
7517
+ options: [
7518
+ { label: "Pending", value: "pending" },
7519
+ { label: "Running", value: "running" },
7520
+ { label: "Completed", value: "completed" },
7521
+ { label: "Failed", value: "failed" },
7522
+ { label: "Canceled", value: "canceled" },
7523
+ { label: "Expired", value: "expired" }
7524
+ ]
7525
+ },
7526
+ {
7527
+ key: "channel",
7528
+ label: "Channel",
7529
+ type: "text"
7530
+ }
7531
+ ],
7532
+ itemView: JobDetailsView,
7533
+ viewDialogOptions: {
7534
+ title: "Job Details",
7535
+ size: "xl",
7536
+ scrollable: true
7537
+ },
7538
+ searchable: true,
7539
+ filterable: true,
7540
+ paginated: true,
7541
+ tableOptions: {
7542
+ striped: true,
7543
+ hover: true,
7544
+ responsive: true
7545
+ }
7546
+ });
7547
+ await this.getApp().showDialog({
7548
+ title: '<i class="bi bi-table me-2"></i>All Jobs',
7549
+ body: view,
7550
+ size: "xl",
7551
+ scrollable: true,
7552
+ buttons: [
7553
+ { text: "Close", class: "btn-secondary", dismiss: true }
7554
+ ]
7555
+ });
7467
7556
  }
7468
7557
  }
7469
7558
  class TaskDetailsView extends View {