@stacksjs/defaults 0.75.528 → 0.75.535

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.
Files changed (248) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-build/SKILL.md +1 -1
  3. package/ai/skills/stacks-dashboard/SKILL.md +2 -2
  4. package/ai/skills/stacks-database/SKILL.md +1 -1
  5. package/ai/skills/stacks-migrations/SKILL.md +2 -2
  6. package/ai/skills/stacks-native/CATALOG.md +4 -4
  7. package/app/Actions/Dashboard/Commerce/CommerceCouponsAction.ts +27 -15
  8. package/app/Actions/Dashboard/Commerce/CommerceCouponsExportAction.ts +45 -0
  9. package/app/Actions/Dashboard/Commerce/CommerceCustomersAction.ts +22 -12
  10. package/app/Actions/Dashboard/Commerce/CommerceCustomersExportAction.ts +44 -0
  11. package/app/Actions/Dashboard/Commerce/CommercePosCheckoutAction.ts +9 -29
  12. package/app/Actions/Dashboard/Commerce/CommercePrintDevicesAction.ts +7 -9
  13. package/app/Actions/Dashboard/Commerce/CommerceProductDetailAction.ts +9 -8
  14. package/app/Actions/Dashboard/Commerce/CommerceTaxesAction.ts +7 -9
  15. package/app/Actions/Dashboard/Commerce/ManufacturerIndexAction.ts +8 -20
  16. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.test.ts +203 -0
  17. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.ts +248 -0
  18. package/app/Actions/Dashboard/Commerce/commerce-customer-list.test.ts +183 -0
  19. package/app/Actions/Dashboard/Commerce/commerce-customer-list.ts +186 -0
  20. package/app/Actions/Dashboard/Commerce/commerce-customer-records.test.ts +1 -34
  21. package/app/Actions/Dashboard/Commerce/commerce-customer-records.ts +0 -11
  22. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.test.ts +118 -0
  23. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.ts +41 -0
  24. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +17 -5
  25. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +17 -3
  26. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.test.ts +99 -0
  27. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.ts +18 -0
  28. package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +5 -5
  29. package/app/Actions/Dashboard/Commerce/commerce-product-options.test.ts +81 -0
  30. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.test.ts +99 -0
  31. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.ts +18 -0
  32. package/app/Actions/Dashboard/Commerce/coupon-records.test.ts +1 -16
  33. package/app/Actions/Dashboard/Commerce/coupon-records.ts +6 -10
  34. package/app/Actions/Dashboard/Commerce/manufacturer-records.test.ts +5 -17
  35. package/app/Actions/Dashboard/Commerce/manufacturer-records.ts +0 -29
  36. package/app/Actions/Dashboard/Email/captured-mail.test.ts +16 -0
  37. package/app/Actions/Dashboard/Email/captured-mail.ts +9 -1
  38. package/app/Actions/Dashboard/Models/model-write.ts +36 -3
  39. package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +13 -58
  40. package/app/Actions/Dashboard/Notifications/notification-delivery-history.ts +74 -0
  41. package/app/Actions/SitemapAction.ts +3 -1
  42. package/app/Models/Notification.ts +3 -1
  43. package/app/Models/NotificationDelivery.ts +4 -0
  44. package/app/Models/User.ts +10 -1
  45. package/bootstrap.ts +10 -2
  46. package/functions/commerce/tax-types.ts +21 -0
  47. package/functions/dashboard-list.test.ts +16 -0
  48. package/functions/dashboard-list.ts +14 -6
  49. package/functions/dashboard-model-record.test.ts +139 -0
  50. package/functions/dashboard-model-record.ts +353 -0
  51. package/functions/monitoring/errors.ts +22 -103
  52. package/functions/notifications/deliveries.ts +7 -38
  53. package/functions/queries.ts +7 -10
  54. package/ide/vscode/package.json +1 -1
  55. package/package.json +5 -5
  56. package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +2 -2
  57. package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +22 -28
  58. package/resources/components/Dashboard/Analytics/EventAnalytics.stx +26 -34
  59. package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +29 -37
  60. package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +12 -16
  61. package/resources/components/Dashboard/Analytics/WebAnalyticsDashboard.stx +43 -53
  62. package/resources/components/Dashboard/App/RequestsOverview.stx +2 -1
  63. package/resources/components/Dashboard/App/SourceInventory.stx +2 -1
  64. package/resources/components/Dashboard/Auth/AccessTokens.stx +3 -5
  65. package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +9 -11
  66. package/resources/components/Dashboard/Billing/BillingSettings.stx +1 -1
  67. package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +4 -6
  68. package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +2 -2
  69. package/resources/components/Dashboard/Commerce/CommerceCategoriesTable.stx +3 -3
  70. package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +2 -2
  71. package/resources/components/Dashboard/Commerce/CommerceCategoryHierarchy.stx +3 -5
  72. package/resources/components/Dashboard/Commerce/CommerceCouponBreakdown.stx +17 -13
  73. package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +1 -1
  74. package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +57 -85
  75. package/resources/components/Dashboard/Commerce/CommerceCouponsTable.stx +32 -9
  76. package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +1 -1
  77. package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +49 -83
  78. package/resources/components/Dashboard/Commerce/CommerceCustomersTable.stx +32 -9
  79. package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +9 -15
  80. package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +1 -1
  81. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +35 -119
  82. package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +3 -3
  83. package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +1 -1
  84. package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +3 -5
  85. package/resources/components/Dashboard/Commerce/CommerceManufacturersTable.stx +2 -2
  86. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +4 -4
  87. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +42 -129
  88. package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +3 -3
  89. package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +1 -1
  90. package/resources/components/Dashboard/Commerce/CommerceOverviewOrdersTable.stx +9 -11
  91. package/resources/components/Dashboard/Commerce/CommerceOverviewProductsTable.stx +5 -7
  92. package/resources/components/Dashboard/Commerce/CommerceOverviewStats.stx +14 -16
  93. package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -18
  94. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +41 -120
  95. package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +1 -1
  96. package/resources/components/Dashboard/Commerce/CommercePosCart.stx +13 -15
  97. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -19
  98. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +2 -2
  99. package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +1 -1
  100. package/resources/components/Dashboard/Commerce/CommercePosReceiptDialog.stx +1 -1
  101. package/resources/components/Dashboard/Commerce/CommerceProductDetailDashboard.stx +5 -5
  102. package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +3 -3
  103. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +41 -122
  104. package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +3 -3
  105. package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +1 -1
  106. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +38 -122
  107. package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +2 -2
  108. package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +3 -3
  109. package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -4
  110. package/resources/components/Dashboard/Commerce/CommerceTaxesTable.stx +4 -3
  111. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +3 -7
  112. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +3 -5
  113. package/resources/components/Dashboard/Commerce/CommerceUnitsTable.stx +2 -2
  114. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +3 -3
  115. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +4 -4
  116. package/resources/components/Dashboard/Commerce/CommerceVariantsTable.stx +3 -5
  117. package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +1 -1
  118. package/resources/components/Dashboard/Commerce/Delivery/CouriersDashboard.stx +1 -1
  119. package/resources/components/Dashboard/Commerce/Delivery/CouriersTable.stx +2 -2
  120. package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +44 -52
  121. package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +2 -2
  122. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +1 -1
  123. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +1 -1
  124. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +2 -2
  125. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveriesDashboard.stx +1 -1
  126. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +2 -2
  127. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +3 -3
  128. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +1 -1
  129. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +2 -2
  130. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsDashboard.stx +1 -1
  131. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +2 -2
  132. package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +2 -2
  133. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesDashboard.stx +1 -1
  134. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +2 -2
  135. package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +1 -1
  136. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesDashboard.stx +1 -1
  137. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +4 -8
  138. package/resources/components/Dashboard/Commerce/PaymentDetailsDialog.stx +1 -3
  139. package/resources/components/Dashboard/Commerce/PrintDeviceBreakdown.stx +9 -15
  140. package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +1 -1
  141. package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +3 -3
  142. package/resources/components/Dashboard/Commerce/PrintDevicesTable.stx +3 -3
  143. package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +3 -9
  144. package/resources/components/Dashboard/Commerce/PrintLogDetailsDialog.stx +1 -1
  145. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +4 -4
  146. package/resources/components/Dashboard/Commerce/PrintLogsTable.stx +8 -10
  147. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +37 -109
  148. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +3 -3
  149. package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +2 -2
  150. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +38 -112
  151. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +2 -2
  152. package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +2 -2
  153. package/resources/components/Dashboard/Content/AuthorsDashboard.stx +4 -4
  154. package/resources/components/Dashboard/Content/BlogDashboard.stx +4 -4
  155. package/resources/components/Dashboard/Content/CommentsDashboard.stx +36 -83
  156. package/resources/components/Dashboard/Content/ContentDashboard.stx +12 -14
  157. package/resources/components/Dashboard/Content/ContentTaxonomyDashboard.stx +2 -2
  158. package/resources/components/Dashboard/Content/FileManagerDashboard.stx +8 -12
  159. package/resources/components/Dashboard/Content/FileStoragePanel.stx +6 -10
  160. package/resources/components/Dashboard/Content/FileUploadDialog.stx +1 -3
  161. package/resources/components/Dashboard/Content/PagesDashboard.stx +39 -78
  162. package/resources/components/Dashboard/Content/PostEditorDialog.stx +4 -8
  163. package/resources/components/Dashboard/Content/PostsDashboard.stx +44 -85
  164. package/resources/components/Dashboard/Content/SeoDashboard.stx +5 -4
  165. package/resources/components/Dashboard/Data/DataRecords.stx +140 -12
  166. package/resources/components/Dashboard/Deployments/DeploymentList.stx +4 -4
  167. package/resources/components/Dashboard/Deployments/DeploymentTable.stx +3 -1
  168. package/resources/components/Dashboard/Elements/DropdownNavigation.stx +5 -7
  169. package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -3
  170. package/resources/components/Dashboard/Email/CapturedMailList.stx +18 -20
  171. package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +24 -28
  172. package/resources/components/Dashboard/Email/EmailSettingsList.stx +6 -8
  173. package/resources/components/Dashboard/Email/EmailSettingsNavigation.stx +10 -12
  174. package/resources/components/Dashboard/Email/EmailSidebar.stx +33 -37
  175. package/resources/components/Dashboard/Email/InboxMessageDetail.stx +1 -1
  176. package/resources/components/Dashboard/Email/InboxMessageList.stx +16 -18
  177. package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
  178. package/resources/components/Dashboard/Environment/EnvironmentDashboard.stx +2 -2
  179. package/resources/components/Dashboard/GlobalSearch.stx +19 -21
  180. package/resources/components/Dashboard/Home/DashboardHome.stx +8 -1
  181. package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
  182. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +27 -13
  183. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
  184. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +46 -8
  185. package/resources/components/Dashboard/Infrastructure/ServerlessDashboard.stx +1 -1
  186. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -1
  187. package/resources/components/Dashboard/Jobs/JobDetail.stx +1 -1
  188. package/resources/components/Dashboard/Jobs/JobHistory.stx +44 -57
  189. package/resources/components/Dashboard/Jobs/JobTable.stx +23 -25
  190. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +1 -1
  191. package/resources/components/Dashboard/Library/ComponentsDashboard.stx +1 -1
  192. package/resources/components/Dashboard/Management/AssignmentDrawer.stx +5 -7
  193. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +35 -43
  194. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +11 -13
  195. package/resources/components/Dashboard/Marketing/CampaignDialog.stx +1 -3
  196. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +2 -2
  197. package/resources/components/Dashboard/Marketing/CampaignsTable.stx +2 -2
  198. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
  199. package/resources/components/Dashboard/Marketing/MarketingListsTable.stx +2 -2
  200. package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +1 -3
  201. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +2 -2
  202. package/resources/components/Dashboard/Marketing/SocialPostsTable.stx +2 -2
  203. package/resources/components/Dashboard/Models/ModelRecordActions.stx +11 -2
  204. package/resources/components/Dashboard/Models/ModelRecordCreate.stx +193 -0
  205. package/resources/components/Dashboard/Models/ModelRecordDetail.stx +144 -0
  206. package/resources/components/Dashboard/Models/ModelRecordEdit.stx +176 -0
  207. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +52 -186
  208. package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -4
  209. package/resources/components/Dashboard/Monitoring/ErrorDashboard.stx +47 -81
  210. package/resources/components/Dashboard/Monitoring/ErrorTable.stx +4 -2
  211. package/resources/components/Dashboard/NotFoundDashboard.stx +4 -4
  212. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +43 -77
  213. package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +15 -17
  214. package/resources/components/Dashboard/Notifications/NotificationDeliveryTable.stx +1 -1
  215. package/resources/components/Dashboard/Operations/AuditDashboard.stx +1 -1
  216. package/resources/components/Dashboard/Operations/ChangeDashboard.stx +1 -1
  217. package/resources/components/Dashboard/Operations/IncidentDashboard.stx +1 -1
  218. package/resources/components/Dashboard/Operations/MigrationDashboard.stx +2 -2
  219. package/resources/components/Dashboard/Operations/RecoveryDashboard.stx +1 -1
  220. package/resources/components/Dashboard/Operations/SchedulerDashboard.stx +1 -1
  221. package/resources/components/Dashboard/Queries/QueryDashboard.stx +60 -86
  222. package/resources/components/Dashboard/Queries/QueryDetail.stx +5 -9
  223. package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +6 -8
  224. package/resources/components/Dashboard/Remote/RemoteConsole.stx +14 -20
  225. package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +48 -54
  226. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +8 -8
  227. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +43 -47
  228. package/resources/components/Dashboard/Teams/TeamInvitationDashboard.stx +2 -2
  229. package/resources/components/Dashboard/UI/ActivityTable.stx +2 -1
  230. package/resources/components/Dashboard/UI/Button.stx +15 -0
  231. package/resources/components/Dashboard/UI/MetricCards.stx +5 -7
  232. package/resources/components/Dashboard/UI/Pagination.stx +3 -5
  233. package/resources/components/Dashboard/UI/QuickLinks.stx +2 -2
  234. package/resources/components/Dashboard/UI/Select.stx +1 -0
  235. package/resources/components/Dashboard/UI/Table.stx +139 -96
  236. package/resources/components/Dashboard/UI/Tabs.stx +18 -20
  237. package/routes/dashboard-api.ts +2 -0
  238. package/routes/dashboard.ts +246 -253
  239. package/routes/storefront.ts +31 -0
  240. package/stx-components-plugin.ts +12 -1
  241. package/views/dashboard/content/categories/index.stx +1 -1
  242. package/views/dashboard/content/tags/index.stx +1 -1
  243. package/views/dashboard/layouts/default.stx +27 -12
  244. package/views/dashboard/models/[model]/[id]/edit.stx +8 -0
  245. package/views/dashboard/models/[model]/[id].stx +8 -0
  246. package/views/dashboard/models/[model]/create.stx +8 -0
  247. package/resources/components/Dashboard/CreateRecordModal.stx +0 -138
  248. package/resources/components/Dashboard/Models/EditRecordModal.stx +0 -81
@@ -55,26 +55,24 @@ function listClass(): string {
55
55
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Try another filter or wait for mail to arrive.</p>
56
56
  </div>
57
57
  <ul :if="!loading() && !error() && rows().length > 0" class="divide-gray-200 divide-y dark:divide-neutral-600">
58
- <template :for="email in rows()">
59
- <li>
60
- <button type="button" :class="rowClass(email)" @click="emit('select', email)">
61
- <div class="flex gap-3 items-start justify-between">
62
- <div class="min-w-0">
63
- <div class="flex gap-2 items-center">
64
- <span :if="!email.read" class="flex-shrink-0 h-2 w-2 bg-blue-600 rounded-full"></span>
65
- <p class="font-medium text-gray-900 text-sm truncate dark:text-white">{{ email.from }}</p>
66
- </div>
67
- <p class="mt-1 text-gray-900 text-sm truncate dark:text-white">{{ email.subject }}</p>
68
- <p class="mt-1 text-gray-500 text-xs truncate dark:text-neutral-400">{{ email.preview }}</p>
69
- </div>
70
- <div class="flex flex-shrink-0 gap-2 items-center">
71
- <span :if="email.hasAttachments" class="h-4 w-4 text-gray-400 i-hugeicons-attachment-01" x-tooltip="Has attachments" title="Has attachments"></span>
72
- <time class="text-gray-500 text-xs dark:text-neutral-400" :datetime="email.date">{{ formatDate(email.date) }}</time>
58
+ <li :for="email in rows()">
59
+ <button type="button" :class="rowClass(email)" @click="emit('select', email)">
60
+ <div class="flex gap-3 items-start justify-between">
61
+ <div class="min-w-0">
62
+ <div class="flex gap-2 items-center">
63
+ <span :if="!email.read" class="flex-shrink-0 h-2 w-2 bg-blue-600 rounded-full"></span>
64
+ <p class="font-medium text-gray-900 text-sm truncate dark:text-white">{{ email.from }}</p>
73
65
  </div>
66
+ <p class="mt-1 text-gray-900 text-sm truncate dark:text-white">{{ email.subject }}</p>
67
+ <p class="mt-1 text-gray-500 text-xs truncate dark:text-neutral-400">{{ email.preview }}</p>
68
+ </div>
69
+ <div class="flex flex-shrink-0 gap-2 items-center">
70
+ <span :if="email.hasAttachments" class="h-4 w-4 text-gray-400 i-hugeicons-attachment-01" x-tooltip="Has attachments" title="Has attachments"></span>
71
+ <time class="text-gray-500 text-xs dark:text-neutral-400" :datetime="email.date">{{ formatDate(email.date) }}</time>
74
72
  </div>
75
- </button>
76
- </li>
77
- </template>
73
+ </div>
74
+ </button>
75
+ </li>
78
76
  </ul>
79
77
  </div>
80
78
  </section>
@@ -192,7 +192,7 @@
192
192
  </div>
193
193
  </div>
194
194
 
195
- <div :show="isFiltersSection" class="space-y-6">
195
+ <div :show="isFiltersSection" class="flex flex-col gap-6">
196
196
  <EmailSettingsList
197
197
  title="Filter Rules"
198
198
  description="Keep a reusable list of mailbox filter expressions."
@@ -195,7 +195,7 @@ onMount(() => void loadEnvironment())
195
195
  </script>
196
196
 
197
197
  <template>
198
- <div class="mx-auto pb-12 pt-6 px-4 space-y-6 sm:px-6 lg:px-8 max-w-7xl">
198
+ <div class="flex flex-col gap-6 mx-auto pb-12 pt-6 px-4 sm:px-6 lg:px-8 max-w-7xl">
199
199
  <PageHeader
200
200
  title="Environment Variables"
201
201
  description="Edit the project .env file with validation, conflict protection, and an automatic backup."
@@ -273,7 +273,7 @@ onMount(() => void loadEnvironment())
273
273
  size="sm"
274
274
  @close="closeAddModal"
275
275
  >
276
- <form class="space-y-4" @submit.prevent="addVariable">
276
+ <form class="flex flex-col gap-4" @submit.prevent="addVariable">
277
277
  <Input v-model:value="newVarKey" label="Key" placeholder="APP_NAME" required />
278
278
  <Input v-model:value="newVarValue" label="Value" placeholder="My App" />
279
279
  <Input v-model:value="newVarDescription" label="Description" placeholder="Used in emails and the interface" hint="Optional comment placed above the variable." />
@@ -168,33 +168,31 @@ onDestroy(() => {
168
168
  </div>
169
169
 
170
170
  <template :if="!error() && Object.keys(results()).length > 0">
171
- <template :for="group in resultGroups()">
171
+ <div :for="group in resultGroups()" class="contents">
172
172
  <div class="pb-1 pt-3 px-3">
173
173
  <h3 class="px-1 font-semibold text-neutral-500 text-xs tracking-wider uppercase dark:text-neutral-400">
174
174
  {{ group.type }}
175
175
  </h3>
176
176
  </div>
177
- <template :for="item in group.items">
178
- <button
179
- type="button"
180
- class="flex gap-3 items-center px-4 py-2.5 w-full text-left transition-colors"
181
- :class="resultIndex(item) === selectedIndex() ? 'bg-blue-50 dark:bg-blue-950/40' : 'hover:bg-neutral-50 dark:hover:bg-neutral-800'"
182
- @mouseenter="selectedIndex.set(resultIndex(item))"
183
- @click="openResult(item)"
184
- >
185
- <span :class="'shrink-0 h-5 w-5 text-neutral-400 ' + item.icon"></span>
186
- <span class="flex-1 min-w-0">
187
- <span class="block font-medium text-neutral-900 text-sm truncate dark:text-white">
188
- {{ item.title }}
189
- </span>
190
- <span :if="item.subtitle" class="block text-neutral-500 text-xs truncate dark:text-neutral-400">
191
- {{ item.subtitle }}
192
- </span>
177
+ <button :for="item in group.items"
178
+ type="button"
179
+ class="flex gap-3 items-center px-4 py-2.5 w-full text-left transition-colors"
180
+ :class="resultIndex(item) === selectedIndex() ? 'bg-blue-50 dark:bg-blue-950/40' : 'hover:bg-neutral-50 dark:hover:bg-neutral-800'"
181
+ @mouseenter="selectedIndex.set(resultIndex(item))"
182
+ @click="openResult(item)"
183
+ >
184
+ <span :class="'shrink-0 h-5 w-5 text-neutral-400 ' + item.icon"></span>
185
+ <span class="flex-1 min-w-0">
186
+ <span class="block font-medium text-neutral-900 text-sm truncate dark:text-white">
187
+ {{ item.title }}
193
188
  </span>
194
- <span class="shrink-0 h-4 w-4 text-neutral-300 dark:text-neutral-600 i-hugeicons-arrow-right-01"></span>
195
- </button>
196
- </template>
197
- </template>
189
+ <span :if="item.subtitle" class="block text-neutral-500 text-xs truncate dark:text-neutral-400">
190
+ {{ item.subtitle }}
191
+ </span>
192
+ </span>
193
+ <span class="shrink-0 h-4 w-4 text-neutral-300 dark:text-neutral-600 i-hugeicons-arrow-right-01"></span>
194
+ </button>
195
+ </div>
198
196
  </template>
199
197
 
200
198
  <div :if="!error() && query().trim() && !isSearching() && Object.keys(results()).length === 0" class="px-4 py-8 text-center">
@@ -53,6 +53,13 @@ function quickLinks() {
53
53
  return allQuickLinks.filter(link => !link.section || available[link.section] !== false)
54
54
  }
55
55
 
56
+ /** Orders are part of the feed only with commerce on, so they are named only then. */
57
+ function activityDescription(): string {
58
+ return dashboard.sections.value.commerce === true
59
+ ? 'Persisted orders and user registrations.'
60
+ : 'Persisted user registrations.'
61
+ }
62
+
56
63
  const resourceLinks = [
57
64
  {
58
65
  title: 'Documentation',
@@ -175,7 +182,7 @@ onMount(() => {
175
182
 
176
183
  <div class="grid gap-6 grid-cols-1 lg:grid-cols-2 mt-8">
177
184
  <ServiceHealth :services="services()" :loading="dashboard.isLoading.value" />
178
- <ActivityTable :activities="activities()" :loading="dashboard.isLoading.value">
185
+ <ActivityTable :activities="activities()" :description="activityDescription()" :loading="dashboard.isLoading.value">
179
186
  <template #actions>
180
187
  <StxLink to="/data/activity" class="text-neutral-500 text-sm hover:text-neutral-700 dark:hover:text-neutral-300">View all</StxLink>
181
188
  </template>
@@ -114,7 +114,7 @@ onMount(() => {
114
114
  })
115
115
  </script>
116
116
 
117
- <div class="space-y-6">
117
+ <div class="flex flex-col gap-6">
118
118
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
119
119
  <div>
120
120
  <div class="flex gap-2 items-center">
@@ -51,6 +51,19 @@ function typeWidth(item: DashboardDnsTypeCount): string {
51
51
  return `${Math.round((item.count / maxTypeCount()) * 100)}%`
52
52
  }
53
53
 
54
+ // What each record type does, for someone who has never edited DNS.
55
+ const TYPE_MEANINGS: Record<string, string> = {
56
+ A: 'Points the name at an IPv4 address',
57
+ AAAA: 'Points the name at an IPv6 address',
58
+ CNAME: 'Makes the name an alias of another name',
59
+ MX: 'Names the server that receives email for the domain',
60
+ TXT: 'Holds text, such as a domain verification code',
61
+ }
62
+
63
+ function typeMeaning(type: string): string {
64
+ return TYPE_MEANINGS[type] ?? `${type} record`
65
+ }
66
+
54
67
  function typeColor(type: string): string {
55
68
  if (type === 'A')
56
69
  return 'bg-blue-500'
@@ -69,13 +82,14 @@ const COLUMNS = [
69
82
  {
70
83
  key: 'type',
71
84
  label: 'Type',
85
+ description: 'The kind of record. A and AAAA point to an IP address, CNAME to another name, MX to a mail server, and TXT holds text such as a verification code.',
72
86
  type: 'badge' as const,
73
87
  sortable: true,
74
88
  badgeClasses: { A: TYPE_BADGE, AAAA: TYPE_BADGE, CNAME: TYPE_BADGE, MX: TYPE_BADGE, TXT: TYPE_BADGE },
75
89
  },
76
90
  { key: 'name', label: 'Name', sortable: true, class: 'font-mono text-neutral-900 whitespace-nowrap dark:text-white' },
77
91
  { key: 'value', label: 'Value', sortable: true, emptyText: 'Not set', class: 'max-w-md font-mono truncate' },
78
- { key: 'ttlLabel', label: 'TTL', class: 'whitespace-nowrap' },
92
+ { key: 'ttlLabel', label: 'TTL', description: 'Time to live: how long other servers may cache this record before asking again.', class: 'whitespace-nowrap' },
79
93
  ]
80
94
 
81
95
  const ROW_ACTIONS = [
@@ -135,7 +149,7 @@ onMount(() => {
135
149
  })
136
150
  </script>
137
151
 
138
- <div class="space-y-6">
152
+ <div class="flex flex-col gap-6">
139
153
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
140
154
  <div>
141
155
  <div class="flex gap-2 items-center">
@@ -165,11 +179,11 @@ onMount(() => {
165
179
  <p class="mt-2 font-semibold text-neutral-900 text-xl dark:text-white">{{ records().length }}</p>
166
180
  </div>
167
181
  <div class="p-4 bg-white dark:bg-neutral-900 border border-neutral-200 rounded-xl dark:border-neutral-700">
168
- <p class="text-neutral-500 text-xs uppercase dark:text-neutral-400">Nameservers</p>
182
+ <p class="text-neutral-500 text-xs uppercase dark:text-neutral-400"><abbr title="The servers that answer DNS lookups for your domain" class="no-underline cursor-help">Nameservers</abbr></p>
169
183
  <p class="mt-2 font-semibold text-neutral-900 text-xl dark:text-white">{{ nameservers().length }}</p>
170
184
  </div>
171
185
  <div class="p-4 bg-white dark:bg-neutral-900 border border-neutral-200 rounded-xl dark:border-neutral-700">
172
- <p class="text-neutral-500 text-xs uppercase dark:text-neutral-400">Hosted zone</p>
186
+ <p class="text-neutral-500 text-xs uppercase dark:text-neutral-400"><abbr title="The ID of the record set your DNS provider keeps for this domain, such as a Route 53 hosted zone" class="no-underline cursor-help">Hosted zone</abbr></p>
173
187
  <p class="mt-2 font-medium text-neutral-900 text-sm truncate dark:text-white">{{ primaryDomain()?.hostedZoneId || 'Not set' }}</p>
174
188
  </div>
175
189
  </section>
@@ -179,7 +193,7 @@ onMount(() => {
179
193
  <div class="flex gap-3 items-start justify-between">
180
194
  <div>
181
195
  <h2 class="font-semibold text-neutral-900 dark:text-white">Configured entry point</h2>
182
- <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">Configuration only. This is not a live DNS resolution or provider health check.</p>
196
+ <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">Read from your configuration. This page does not look the domain up live or check your DNS provider.</p>
183
197
  </div>
184
198
  <CloudStatusBadge :status="primaryDomain() ? 'configured' : 'inactive'" />
185
199
  </div>
@@ -198,7 +212,7 @@ onMount(() => {
198
212
  <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">Exact counts from config/dns.ts.</p>
199
213
  <div class="mt-5 space-y-3">
200
214
  <div :for="item in typeCounts()" class="grid gap-3 grid-cols-[3.5rem_minmax(0,1fr)_2rem] items-center">
201
- <span class="font-mono font-semibold text-neutral-700 text-xs dark:text-neutral-300">{{ item.type }}</span>
215
+ <abbr :title="typeMeaning(item.type)" class="font-mono font-semibold no-underline text-neutral-700 text-xs dark:text-neutral-300 cursor-help">{{ item.type }}</abbr>
202
216
  <div class="overflow-hidden h-2 bg-neutral-100 dark:bg-neutral-800 rounded-full">
203
217
  <div :class="'h-full rounded-full ' + typeColor(item.type)" :style="{ width: typeWidth(item) }"></div>
204
218
  </div>
@@ -212,7 +226,7 @@ onMount(() => {
212
226
  <div class="flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between">
213
227
  <div>
214
228
  <h2 class="font-semibold text-neutral-900 dark:text-white">Configured records</h2>
215
- <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">Source-controlled declarations. Provider mutations are intentionally not inferred from this page.</p>
229
+ <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">The records declared in config/dns.ts. Changes made directly at your DNS provider do not appear here.</p>
216
230
  </div>
217
231
  <div class="flex flex-col gap-2 sm:flex-row">
218
232
  <label class="block relative sm:w-72">
@@ -224,11 +238,11 @@ onMount(() => {
224
238
  <span class="sr-only">Filter DNS record type</span>
225
239
  <select x-model="typeFilter" class="px-3 py-2 h-10 w-full text-neutral-900 text-sm dark:text-white bg-white dark:bg-neutral-900 border border-neutral-300 rounded-lg dark:border-neutral-700 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20">
226
240
  <option value="all">All types</option>
227
- <option value="A">A</option>
228
- <option value="AAAA">AAAA</option>
229
- <option value="CNAME">CNAME</option>
230
- <option value="MX">MX</option>
231
- <option value="TXT">TXT</option>
241
+ <option value="A">A (IPv4 address)</option>
242
+ <option value="AAAA">AAAA (IPv6 address)</option>
243
+ <option value="CNAME">CNAME (alias)</option>
244
+ <option value="MX">MX (mail server)</option>
245
+ <option value="TXT">TXT (text)</option>
232
246
  </select>
233
247
  </label>
234
248
  </div>
@@ -253,7 +267,7 @@ onMount(() => {
253
267
 
254
268
  <section class="overflow-hidden bg-white dark:bg-neutral-900 border border-neutral-200 rounded-xl dark:border-neutral-700">
255
269
  <header class="flex items-center justify-between px-5 py-4 border-b border-neutral-200 dark:border-neutral-700">
256
- <div><h2 class="font-semibold text-neutral-900 dark:text-white">Nameservers</h2><p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">Configured delegation targets.</p></div>
270
+ <div><h2 class="font-semibold text-neutral-900 dark:text-white">Nameservers</h2><p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">The servers your domain hands DNS lookups to.</p></div>
257
271
  <span class="font-mono text-neutral-500 text-xs dark:text-neutral-400">{{ nameservers().length }}</span>
258
272
  </header>
259
273
  <div :if="nameservers().length > 0" class="grid gap-3 sm:grid-cols-2 p-5">
@@ -204,7 +204,7 @@ onDestroy(() => {
204
204
  })
205
205
  </script>
206
206
 
207
- <div class="space-y-6">
207
+ <div class="flex flex-col gap-6">
208
208
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
209
209
  <div>
210
210
  <div class="flex gap-2 items-center">
@@ -46,12 +46,47 @@ function formatDate(value: string): string {
46
46
  : new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(date)
47
47
  }
48
48
 
49
+ // The protocol names as they are written, and what each does for someone who
50
+ // has never set up a mail server. Keyed by the config name, lowercased.
51
+ const FEATURES: Record<string, { label: string, meaning: string }> = {
52
+ imap: { label: 'IMAP', meaning: 'Mail apps read mail that stays on the server' },
53
+ pop3: { label: 'POP3', meaning: 'Mail apps download mail to one device' },
54
+ webmail: { label: 'Webmail', meaning: 'Read and send mail in a browser' },
55
+ caldav: { label: 'CalDAV', meaning: 'Calendar sync' },
56
+ carddav: { label: 'CardDAV', meaning: 'Contacts sync' },
57
+ activesync: { label: 'ActiveSync', meaning: 'Mail, calendar and contacts sync for phones' },
58
+ }
59
+
60
+ const PORTS: Record<string, { label: string, meaning: string }> = {
61
+ smtp: { label: 'SMTP', meaning: 'Receives mail from other servers' },
62
+ smtps: { label: 'SMTPS', meaning: 'Sending mail, encrypted from the start' },
63
+ submission: { label: 'Submission', meaning: 'Sending mail from mail apps, upgraded to encrypted (STARTTLS)' },
64
+ imap: { label: 'IMAP', meaning: 'Reading mail, unencrypted' },
65
+ imaps: { label: 'IMAPS', meaning: 'Reading mail, encrypted' },
66
+ pop3: { label: 'POP3', meaning: 'Downloading mail, unencrypted' },
67
+ pop3s: { label: 'POP3S', meaning: 'Downloading mail, encrypted' },
68
+ }
69
+
70
+ // A name with no entry reads as words: `spamFilter` becomes "Spam filter".
71
+ function words(name: string): string {
72
+ const spaced = name.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase()
73
+ return spaced.charAt(0).toUpperCase() + spaced.slice(1)
74
+ }
75
+
49
76
  function featureLabel(feature: DashboardMailboxFeature): string {
50
- return feature.name.replace(/([a-z])([A-Z])/g, '$1 $2')
77
+ return FEATURES[feature.name.toLowerCase()]?.label ?? words(feature.name)
78
+ }
79
+
80
+ function featureMeaning(feature: DashboardMailboxFeature): string {
81
+ return FEATURES[feature.name.toLowerCase()]?.meaning ?? ''
51
82
  }
52
83
 
53
84
  function portLabel(port: DashboardMailboxPort): string {
54
- return port.name.replace(/([a-z])([A-Z])/g, '$1 $2')
85
+ return PORTS[port.name.toLowerCase()]?.label ?? words(port.name)
86
+ }
87
+
88
+ function portMeaning(port: DashboardMailboxPort): string {
89
+ return PORTS[port.name.toLowerCase()]?.meaning ?? ''
55
90
  }
56
91
 
57
92
  function storageLabel(item: DashboardMailboxStorage): string {
@@ -116,14 +151,14 @@ onMount(() => {
116
151
  })
117
152
  </script>
118
153
 
119
- <div class="space-y-6">
154
+ <div class="flex flex-col gap-6">
120
155
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
121
156
  <div>
122
157
  <div class="flex gap-2 items-center">
123
158
  <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Mailboxes</h1>
124
159
  <CloudStatusBadge :status="server().enabled ? 'configured' : 'inactive'" />
125
160
  </div>
126
- <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">Mailbox and mail-server declarations from config/email.ts. No delivery or provider health is inferred.</p>
161
+ <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">The mailboxes and mail server set up in config/email.ts. This page shows your settings, not whether mail is being delivered.</p>
127
162
  </div>
128
163
  <div class="flex gap-2 items-center">
129
164
  <Button tag="a" href="/inbox/activity" variant="secondary">Mail activity</Button>
@@ -172,17 +207,20 @@ onMount(() => {
172
207
  <div class="grid gap-2 sm:grid-cols-2 lg:grid-cols-3 mt-5">
173
208
  <div :for="feature in server().features" class="flex gap-3 items-center p-3 bg-neutral-50 dark:bg-neutral-800 rounded-lg">
174
209
  <span :class="'shrink-0 h-4 w-4 ' + (feature.enabled ? 'text-green-500 i-hugeicons-checkmark-circle-02' : 'text-neutral-400 i-hugeicons-cancel-circle')"></span>
175
- <span class="capitalize text-neutral-700 text-sm dark:text-neutral-300">{{ featureLabel(feature) }}</span>
210
+ <span class="min-w-0">
211
+ <span class="block text-neutral-700 text-sm dark:text-neutral-300">{{ featureLabel(feature) }}</span>
212
+ <span :if="featureMeaning(feature)" class="block text-neutral-500 text-xs dark:text-neutral-400">{{ featureMeaning(feature) }}</span>
213
+ </span>
176
214
  </div>
177
215
  </div>
178
216
  </div>
179
217
 
180
218
  <div class="p-5 bg-white dark:bg-neutral-900 border border-neutral-200 rounded-xl dark:border-neutral-700">
181
219
  <h2 class="font-semibold text-neutral-900 dark:text-white">Ports</h2>
182
- <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">Configured listener ports.</p>
220
+ <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">The ports this mail server listens on.</p>
183
221
  <dl class="grid gap-x-5 gap-y-3 grid-cols-2 mt-5 text-sm">
184
222
  <div :for="port in server().ports" class="flex gap-3 items-center justify-between">
185
- <dt class="capitalize text-neutral-500 dark:text-neutral-400">{{ portLabel(port) }}</dt>
223
+ <dt class="text-neutral-500 dark:text-neutral-400"><abbr :title="portMeaning(port) || portLabel(port)" class="no-underline cursor-help">{{ portLabel(port) }}</abbr></dt>
186
224
  <dd class="font-mono font-semibold text-neutral-900 dark:text-white">{{ port.port }}</dd>
187
225
  </div>
188
226
  </dl>
@@ -191,7 +229,7 @@ onMount(() => {
191
229
 
192
230
  <section>
193
231
  <div class="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between">
194
- <div><h2 class="font-semibold text-neutral-900 dark:text-white">Configured mailboxes</h2><p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">Addresses are source-controlled in config/email.ts.</p></div>
232
+ <div><h2 class="font-semibold text-neutral-900 dark:text-white">Configured mailboxes</h2><p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">Add or change addresses in config/email.ts.</p></div>
195
233
  <label class="block relative sm:w-72">
196
234
  <span class="sr-only">Search mailboxes</span>
197
235
  <span class="absolute left-3 top-2.5 h-4 w-4 text-neutral-400 i-hugeicons-search-01"></span>
@@ -125,7 +125,7 @@ onMount(() => {
125
125
  })
126
126
  </script>
127
127
 
128
- <div class="space-y-6">
128
+ <div class="flex flex-col gap-6">
129
129
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
130
130
  <div>
131
131
  <div class="flex gap-2 items-center">
@@ -210,7 +210,7 @@ onMount(() => {
210
210
  })
211
211
  </script>
212
212
 
213
- <div class="space-y-6">
213
+ <div class="flex flex-col gap-6">
214
214
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
215
215
  <div>
216
216
  <div class="flex gap-2 items-center">
@@ -91,7 +91,7 @@ onMount(() => {
91
91
  })
92
92
  </script>
93
93
 
94
- <div class="space-y-6">
94
+ <div class="flex flex-col gap-6">
95
95
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
96
96
  <div>
97
97
  <StxLink to="/jobs" class="inline-flex gap-1 items-center mb-3 font-medium text-neutral-500 text-sm dark:text-neutral-400 hover:text-blue-600 dark:hover:text-blue-400">
@@ -1,18 +1,42 @@
1
1
  <script client>
2
- import type { DashboardJob } from '../../../../functions/jobs'
3
- import { fetchJobs, retryJob } from '../../../../functions/jobs'
2
+ import type { DashboardJob, JobListResponse } from '../../../../functions/jobs'
3
+ import { dashboardApi } from '../../../../functions/dashboard-api'
4
+ import { useServerList } from '../../../../functions/dashboard-list'
5
+ import { retryJob } from '../../../../functions/jobs'
4
6
  import { pushToast } from '../../../../functions/toasts'
5
7
 
6
- const jobs = state<DashboardJob[]>([])
7
8
  const queues = state<string[]>([])
8
- const currentPage = state(1)
9
- const perPage = state(25)
10
- const total = state(0)
11
9
  const selectedQueue = state('all')
12
10
  const selectedStatus = state('all')
13
- const searchQuery = state('')
14
- const isLoading = state(true)
15
- const loadError = state('')
11
+
12
+ // The server searches, filters and pages across the waiting and failed jobs
13
+ // (stacksjs/stacks#3201); useServerList keeps the request order, paging and
14
+ // search debounce this page used to keep itself. Only the newest answer
15
+ // lands, so a slow page can no longer overwrite the one asked for after it.
16
+ // The history is newest first and has no order to choose, so no sort is sent.
17
+ const {
18
+ records: jobs,
19
+ total,
20
+ page: currentPage,
21
+ perPage,
22
+ search: searchQuery,
23
+ loading: isLoading,
24
+ loadError,
25
+ load,
26
+ changePage,
27
+ } = useServerList<DashboardJob>({
28
+ fetch: async (query) => {
29
+ const data = await dashboardApi<JobListResponse>(`/api/dashboard/jobs?${query}`)
30
+ return { ...data, records: data.data }
31
+ },
32
+ filters: () => ({ queue: selectedQueue(), status: selectedStatus() }),
33
+ searchParam: 'search',
34
+ onLoad: (result) => {
35
+ const data = result as unknown as JobListResponse
36
+ queues.set(Array.isArray(data.queues) ? data.queues : [])
37
+ },
38
+ onError: error => pushToast('error', 'Could not load job history', { detail: error instanceof Error ? error.message : String(error) }),
39
+ })
16
40
 
17
41
  function totalPages(): number {
18
42
  return Math.max(1, Math.ceil(total() / perPage()))
@@ -26,49 +50,14 @@ function rangeEnd(): number {
26
50
  return Math.min(currentPage() * perPage(), total())
27
51
  }
28
52
 
29
- function reloadFilters(): void {
30
- currentPage.set(1)
31
- void loadJobs()
32
- }
33
-
34
- const reloadSearch = useDebounce(reloadFilters, 250)
35
-
36
- async function loadJobs(): Promise<void> {
37
- isLoading.set(true)
38
- loadError.set('')
39
- try {
40
- const data = await fetchJobs({
41
- page: currentPage(),
42
- perPage: perPage(),
43
- queue: selectedQueue(),
44
- status: selectedStatus(),
45
- search: searchQuery().trim(),
46
- })
47
- jobs.set(data.data)
48
- queues.set(data.queues)
49
- total.set(data.total)
50
- }
51
- catch (error) {
52
- loadError.set('Job history could not be loaded.')
53
- pushToast('error', 'Could not load job history', { detail: String(error) })
54
- }
55
- finally {
56
- isLoading.set(false)
57
- }
58
- }
59
-
60
53
  function previousPage(): void {
61
- if (currentPage() <= 1)
62
- return
63
- currentPage.set(currentPage() - 1)
64
- void loadJobs()
54
+ if (currentPage() > 1)
55
+ changePage(currentPage() - 1)
65
56
  }
66
57
 
67
58
  function nextPage(): void {
68
- if (currentPage() >= totalPages())
69
- return
70
- currentPage.set(currentPage() + 1)
71
- void loadJobs()
59
+ if (currentPage() < totalPages())
60
+ changePage(currentPage() + 1)
72
61
  }
73
62
 
74
63
  async function handleRetry(id: string | CustomEvent<string>): Promise<void> {
@@ -78,7 +67,7 @@ async function handleRetry(id: string | CustomEvent<string>): Promise<void> {
78
67
  if (!result.success)
79
68
  throw new Error(result.message)
80
69
  pushToast('success', result.message)
81
- await loadJobs()
70
+ await load()
82
71
  }
83
72
  catch (error) {
84
73
  pushToast('error', 'Could not retry job', { detail: String(error) })
@@ -86,11 +75,11 @@ async function handleRetry(id: string | CustomEvent<string>): Promise<void> {
86
75
  }
87
76
 
88
77
  onMount(() => {
89
- void loadJobs()
78
+ void load()
90
79
  })
91
80
  </script>
92
81
 
93
- <div class="space-y-6">
82
+ <div class="flex flex-col gap-6">
94
83
  <header>
95
84
  <h1 class="font-bold text-2xl text-gray-900 dark:text-white">Job History</h1>
96
85
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Search active and failed jobs recorded by the configured queue.</p>
@@ -99,15 +88,13 @@ onMount(() => {
99
88
  <div class="grid gap-3 grid-cols-1 md:grid-cols-[minmax(0,1fr)_12rem_12rem]">
100
89
  <div>
101
90
  <label for="job-search" class="sr-only">Search jobs</label>
102
- <input id="job-search" x-model="searchQuery" type="search" placeholder="Search job names" class="block px-3 py-2 w-full text-gray-900 text-sm dark:text-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" @input="reloadSearch" />
91
+ <input id="job-search" x-model="searchQuery" type="search" placeholder="Search job names" class="block px-3 py-2 w-full text-gray-900 text-sm dark:text-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" />
103
92
  </div>
104
- <select x-model="selectedQueue" aria-label="Queue" class="block px-3 py-2 text-gray-900 text-sm dark:text-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" @change="reloadFilters">
93
+ <select x-model="selectedQueue" aria-label="Queue" class="block px-3 py-2 text-gray-900 text-sm dark:text-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
105
94
  <option value="all">All queues</option>
106
- <template :for="queue in queues()">
107
- <option :value="queue">{{ queue }}</option>
108
- </template>
95
+ <option :for="queue in queues()" :value="queue">{{ queue }}</option>
109
96
  </select>
110
- <select x-model="selectedStatus" aria-label="Status" class="block px-3 py-2 text-gray-900 text-sm dark:text-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700" @change="reloadFilters">
97
+ <select x-model="selectedStatus" aria-label="Status" class="block px-3 py-2 text-gray-900 text-sm dark:text-white dark:bg-neutral-800 border border-gray-300 rounded-md dark:border-neutral-700">
111
98
  <option value="all">All statuses</option>
112
99
  <option value="queued">Queued</option>
113
100
  <option value="processing">Processing</option>
@@ -60,31 +60,29 @@ function attemptsLabel(job: DashboardJob): string {
60
60
  </tr>
61
61
  </thead>
62
62
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
63
- <template :for="job in rows()">
64
- <tr>
65
- <td class="px-4 py-3">
66
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ job.name }}</p>
67
- <p class="mt-0.5 font-mono text-gray-500 text-xs dark:text-neutral-400">{{ job.id }}</p>
68
- </td>
69
- <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ job.queue }}</td>
70
- <td class="px-4 py-3">
71
- <span :class="'inline-flex px-2 py-1 font-medium text-xs rounded-md ' + statusClass(job.status)">{{ job.status }}</span>
72
- </td>
73
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ attemptsLabel(job) }}</td>
74
- <td class="px-4 py-3 font-mono text-gray-500 text-right text-sm dark:text-neutral-300">{{ job.duration || 'Not recorded' }}</td>
75
- <td class="px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300">{{ formatDate(job.created_at) }}</td>
76
- <td class="px-4 py-3 text-right">
77
- <div class="inline-flex gap-3 items-center">
78
- <StxLink :to="'/jobs/' + encodeURIComponent(job.id)" class="font-medium text-neutral-600 text-sm dark:text-neutral-300 hover:text-blue-600 dark:hover:text-blue-400">
79
- View
80
- </StxLink>
81
- <Button :if="job.status === 'failed'" size="sm" @click="emit('retry', job.id)">
82
- Retry
83
- </Button>
84
- </div>
85
- </td>
86
- </tr>
87
- </template>
63
+ <tr :for="job in rows()">
64
+ <td class="px-4 py-3">
65
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ job.name }}</p>
66
+ <p class="mt-0.5 font-mono text-gray-500 text-xs dark:text-neutral-400">{{ job.id }}</p>
67
+ </td>
68
+ <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ job.queue }}</td>
69
+ <td class="px-4 py-3">
70
+ <span :class="'inline-flex px-2 py-1 font-medium text-xs rounded-md ' + statusClass(job.status)">{{ job.status }}</span>
71
+ </td>
72
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ attemptsLabel(job) }}</td>
73
+ <td class="px-4 py-3 font-mono text-gray-500 text-right text-sm dark:text-neutral-300">{{ job.duration || 'Not recorded' }}</td>
74
+ <td class="px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300">{{ formatDate(job.created_at) }}</td>
75
+ <td class="px-4 py-3 text-right">
76
+ <div class="inline-flex gap-3 items-center">
77
+ <StxLink :to="'/jobs/' + encodeURIComponent(job.id)" class="font-medium text-neutral-600 text-sm dark:text-neutral-300 hover:text-blue-600 dark:hover:text-blue-400">
78
+ View
79
+ </StxLink>
80
+ <Button :if="job.status === 'failed'" size="sm" @click="emit('retry', job.id)">
81
+ Retry
82
+ </Button>
83
+ </div>
84
+ </td>
85
+ </tr>
88
86
  </tbody>
89
87
  </table>
90
88
  </div>