@kinetis/vector-ui 0.11.3 → 0.12.0
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/CHANGELOG.md +70 -1
- package/app/components/Vx/CommandPalette.vue +5 -2
- package/app/components/Vx/Confirm.vue +19 -3
- package/app/components/Vx/Input/Markdown.vue +2 -1
- package/app/components/Vx/Input/RichText.vue +3 -1
- package/app/components/Vx/Queues/Failed.vue +243 -0
- package/app/components/Vx/Queues/FailedDetail.vue +106 -0
- package/app/components/Vx/Queues/Metrics.vue +118 -0
- package/app/components/Vx/Queues/Overview.vue +167 -0
- package/app/components/Vx/Widget/Card.vue +11 -3
- package/app/components/Vx/Widget/Queues.vue +51 -0
- package/app/composables/useConfirm.ts +34 -5
- package/app/composables/useVectorExtensions.ts +16 -2
- package/app/composables/useVectorQueues.ts +81 -0
- package/app/composables/useVectorSchema.ts +1 -1
- package/app/i18n/ar/dashboard.ts +1 -0
- package/app/i18n/ar/index.ts +2 -1
- package/app/i18n/ar/queues.ts +118 -0
- package/app/i18n/de/dashboard.ts +1 -0
- package/app/i18n/de/index.ts +2 -1
- package/app/i18n/de/queues.ts +118 -0
- package/app/i18n/en/dashboard.ts +1 -0
- package/app/i18n/en/index.ts +2 -1
- package/app/i18n/en/queues.ts +118 -0
- package/app/i18n/es/dashboard.ts +1 -0
- package/app/i18n/es/index.ts +2 -1
- package/app/i18n/es/queues.ts +118 -0
- package/app/i18n/fr/dashboard.ts +1 -0
- package/app/i18n/fr/index.ts +2 -1
- package/app/i18n/fr/queues.ts +118 -0
- package/app/i18n/he/dashboard.ts +1 -0
- package/app/i18n/he/index.ts +2 -1
- package/app/i18n/he/queues.ts +118 -0
- package/app/i18n/it/dashboard.ts +1 -0
- package/app/i18n/it/index.ts +2 -1
- package/app/i18n/it/queues.ts +118 -0
- package/app/i18n/ja/dashboard.ts +1 -0
- package/app/i18n/ja/index.ts +2 -1
- package/app/i18n/ja/queues.ts +118 -0
- package/app/i18n/ko/dashboard.ts +1 -0
- package/app/i18n/ko/index.ts +2 -1
- package/app/i18n/ko/queues.ts +118 -0
- package/app/i18n/nl/dashboard.ts +1 -0
- package/app/i18n/nl/index.ts +2 -1
- package/app/i18n/nl/queues.ts +118 -0
- package/app/i18n/pl/dashboard.ts +1 -0
- package/app/i18n/pl/index.ts +2 -1
- package/app/i18n/pl/queues.ts +118 -0
- package/app/i18n/pt/dashboard.ts +1 -0
- package/app/i18n/pt/index.ts +2 -1
- package/app/i18n/pt/queues.ts +118 -0
- package/app/i18n/pt-BR/dashboard.ts +1 -0
- package/app/i18n/pt-BR/index.ts +2 -1
- package/app/i18n/pt-BR/queues.ts +118 -0
- package/app/i18n/ru/dashboard.ts +1 -0
- package/app/i18n/ru/index.ts +2 -1
- package/app/i18n/ru/queues.ts +118 -0
- package/app/i18n/tr/dashboard.ts +1 -0
- package/app/i18n/tr/index.ts +2 -1
- package/app/i18n/tr/queues.ts +118 -0
- package/app/i18n/uk/dashboard.ts +1 -0
- package/app/i18n/uk/index.ts +2 -1
- package/app/i18n/uk/queues.ts +118 -0
- package/app/i18n/zh-Hans/dashboard.ts +1 -0
- package/app/i18n/zh-Hans/index.ts +2 -1
- package/app/i18n/zh-Hans/queues.ts +118 -0
- package/app/layouts/vector.vue +5 -3
- package/app/pages/p/[name].vue +4 -2
- package/app/pages/queues/index.vue +58 -0
- package/app/plugins/vector-extensions.client.ts +30 -14
- package/app/types/vector.ts +95 -3
- package/app/utils/extensionLoader.ts +36 -0
- package/app/utils/queues.ts +153 -0
- package/dist/static/200.html +1 -1
- package/dist/static/404.html +1 -1
- package/dist/static/_nuxt/-CLe6vUm.js +1 -0
- package/dist/static/_nuxt/{qpVO-NAo.js → A_YrkIh-.js} +1 -1
- package/dist/static/_nuxt/B0taRzJN.js +1 -0
- package/dist/static/_nuxt/BC4n0Ghf.js +1 -0
- package/dist/static/_nuxt/{DzOxWOFX.js → BDLoIbc4.js} +1 -1
- package/dist/static/_nuxt/{CHpNSaGi.js → BDwgkdzs.js} +1 -1
- package/dist/static/_nuxt/BFBN0MCm.js +1 -0
- package/dist/static/_nuxt/BMS510w1.js +1 -0
- package/dist/static/_nuxt/BQH4NHkG.js +1 -0
- package/dist/static/_nuxt/BSYV8YR9.js +1 -0
- package/dist/static/_nuxt/{BOc3bd5G.js → BWmtnGCr.js} +1 -1
- package/dist/static/_nuxt/BZKBoSZy.js +1 -0
- package/dist/static/_nuxt/BhY1yzIk.js +1 -0
- package/dist/static/_nuxt/Bi_p8utQ.js +1 -0
- package/dist/static/_nuxt/{BH3E4sUK.js → BnRGraEc.js} +1 -1
- package/dist/static/_nuxt/{5WvxG0mj.js → BqBjYl5i.js} +1 -1
- package/dist/static/_nuxt/Br-v6nfV.js +1 -0
- package/dist/static/_nuxt/{C5Ez1FXH.js → BsCAElgq.js} +1 -1
- package/dist/static/_nuxt/{BwHwQnM0.js → BtSHpy4S.js} +1 -1
- package/dist/static/_nuxt/BzY34lc1.js +1 -0
- package/dist/static/_nuxt/C64NUw_T.js +1 -0
- package/dist/static/_nuxt/C6P-usW8.js +1 -0
- package/dist/static/_nuxt/{BVRr96yG.js → CCev1aKa.js} +1 -1
- package/dist/static/_nuxt/{Dorn4eG1.js → CEAJldjl.js} +1 -1
- package/dist/static/_nuxt/{Bs6-HCEW.js → CNKBVevI.js} +1 -1
- package/dist/static/_nuxt/{DGOB4cMy.js → C_g8bZuk.js} +1 -1
- package/dist/static/_nuxt/CgxSerDc.js +1 -0
- package/dist/static/_nuxt/CuG-8Z4K.js +105 -0
- package/dist/static/_nuxt/{2oUN-NEf.js → CvqfGMjv.js} +1 -1
- package/dist/static/_nuxt/CxlUCc9r.js +1 -0
- package/dist/static/_nuxt/D1Z538bJ.js +1 -0
- package/dist/static/_nuxt/{CXIZ5vIr.js → D1nKViyT.js} +1 -1
- package/dist/static/_nuxt/{D8kTmNUH.js → D7as59Fa.js} +1 -1
- package/dist/static/_nuxt/{B1-Pqo_7.js → D8QRJNA1.js} +1 -1
- package/dist/static/_nuxt/DB9Px0Zg.js +1 -0
- package/dist/static/_nuxt/DJsVN_9p.js +1 -0
- package/dist/static/_nuxt/DSIjvNuw.js +2 -0
- package/dist/static/_nuxt/{C_Ouo24Z.js → DayrADeq.js} +1 -1
- package/dist/static/_nuxt/DhiDhXgK.js +2 -0
- package/dist/static/_nuxt/{Dialog.B6aT2GLZ.css → Dialog.al_QQir4.css} +1 -1
- package/dist/static/_nuxt/DjPCgCyJ.js +1 -0
- package/dist/static/_nuxt/{BSfpIrlx.js → Dm7hGi3P.js} +1 -1
- package/dist/static/_nuxt/DqjZ16aB.js +1 -0
- package/dist/static/_nuxt/DssSpQf8.js +1 -0
- package/dist/static/_nuxt/VBtn.DYtpaadd.css +1 -0
- package/dist/static/_nuxt/{CADHRY6v.js → ZVCqzuKT.js} +1 -1
- package/dist/static/_nuxt/builds/latest.json +1 -1
- package/dist/static/_nuxt/builds/meta/f5ce5132-6b99-4f7d-9c7c-6cef19f59d51.json +1 -0
- package/dist/static/_nuxt/{entry.BW8eGVIg.css → entry.Sg6-iCOx.css} +1 -1
- package/dist/static/_nuxt/error-404.B9sBsxLH.css +1 -0
- package/dist/static/_nuxt/error-500.Dy1PcAYT.css +1 -0
- package/dist/static/_nuxt/mbGIOAkp.js +1 -0
- package/dist/static/_nuxt/qzTYEKJ1.js +2 -0
- package/dist/static/_nuxt/{BKxQp7go.js → rVO8WoV9.js} +3 -3
- package/dist/static/_nuxt/rkb3Oe3x.js +1 -0
- package/dist/static/_nuxt/sIY_uPia.js +1 -0
- package/dist/static/_nuxt/tm30M8Ch.js +1 -0
- package/dist/static/_nuxt/vab0LrNP.js +67 -0
- package/dist/static/_nuxt/{DmrPXKlp.js → vmqqxV_Q.js} +1 -1
- package/dist/static/_nuxt/{UfoGua8K.js → xd2mj56f.js} +1 -1
- package/dist/static/index.html +1 -1
- package/dist/static/jobs/index.html +1 -1
- package/dist/static/login/index.html +1 -1
- package/dist/static/queues/index.html +1 -0
- package/dist/static/settings/index.html +1 -1
- package/dist/static/vector-bundle.json +70 -71
- package/package.json +17 -17
- package/dist/static/_nuxt/B1NXg37X.js +0 -1
- package/dist/static/_nuxt/BHPSB5VN.js +0 -1
- package/dist/static/_nuxt/BQKTPMnh.js +0 -1
- package/dist/static/_nuxt/BZweJiQx.js +0 -1
- package/dist/static/_nuxt/B_RjakRk.js +0 -1
- package/dist/static/_nuxt/BfsupGyC.js +0 -1
- package/dist/static/_nuxt/BgRi2kFj.js +0 -1
- package/dist/static/_nuxt/BpaVnQT3.js +0 -1
- package/dist/static/_nuxt/C32HLL_3.js +0 -1
- package/dist/static/_nuxt/C3XkRFds.js +0 -1
- package/dist/static/_nuxt/C4rsQhBq.js +0 -1
- package/dist/static/_nuxt/CEMM7MyS.js +0 -100
- package/dist/static/_nuxt/CJCvPySI.js +0 -1
- package/dist/static/_nuxt/CQnAjs6t.js +0 -1
- package/dist/static/_nuxt/CXxZ_oTv.js +0 -1
- package/dist/static/_nuxt/C_zyLiGr.js +0 -1
- package/dist/static/_nuxt/CsTzOWPJ.js +0 -1
- package/dist/static/_nuxt/CtrzPVjw.js +0 -1
- package/dist/static/_nuxt/Cuw0Qa9p.js +0 -1
- package/dist/static/_nuxt/CxFDmUjN.js +0 -67
- package/dist/static/_nuxt/Cya8cjkR.js +0 -2
- package/dist/static/_nuxt/DFQG9ZD0.js +0 -1
- package/dist/static/_nuxt/DS8Zc0uz.js +0 -1
- package/dist/static/_nuxt/DZwwQ4WY.js +0 -1
- package/dist/static/_nuxt/DcteQ4TC.js +0 -1
- package/dist/static/_nuxt/DdqPXmq8.js +0 -1
- package/dist/static/_nuxt/DjL4J8kw.js +0 -2
- package/dist/static/_nuxt/F676SWHd.js +0 -1
- package/dist/static/_nuxt/Form.BfskSJ5D.css +0 -1
- package/dist/static/_nuxt/K6puNuXp.js +0 -2
- package/dist/static/_nuxt/VDialog.CZWf1yfq.css +0 -1
- package/dist/static/_nuxt/VSkeletonLoader.BXLoM9sb.css +0 -1
- package/dist/static/_nuxt/VTabs.buBMAvtA.css +0 -1
- package/dist/static/_nuxt/builds/meta/ba4cc360-829e-4272-bb1c-7391e700bb32.json +0 -1
- package/dist/static/_nuxt/error-404.B1_4-op0.css +0 -1
- package/dist/static/_nuxt/error-500.ueligmdw.css +0 -1
- package/dist/static/_nuxt/xkua0wtW.js +0 -1
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import * as vue from 'vue'
|
|
2
2
|
import { Extension as TiptapExtension, Mark as TiptapMark, Node as TiptapNode, mergeAttributes } from '@tiptap/core'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
VAlert, VAutocomplete, VBtn, VCard, VCheckbox, VChip, VDialog, VDivider, VExpansionPanel, VExpansionPanels, VExpansionPanelText,
|
|
5
|
+
VExpansionPanelTitle, VIcon, VList, VListItem, VMenu, VPagination, VProgressLinear, VRating, VSelect, VSkeletonLoader, VSwitch,
|
|
6
|
+
VTab, VTable, VTabs, VTabsWindow, VTabsWindowItem, VTextField, VTextarea, VTooltip,
|
|
7
|
+
} from 'vuetify/components'
|
|
8
|
+
import type { VectorPageLabel } from '../composables/useVectorExtensions'
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
|
-
* Runtime UI extensions
|
|
11
|
+
* Runtime UI extensions. `window.Vector` is the
|
|
7
12
|
* registration API an extension module calls; the URLs come from the
|
|
8
|
-
* hosted shell (`VECTOR_UI_EXTENSIONS`) or
|
|
9
|
-
*
|
|
13
|
+
* hosted shell (`VECTOR_UI_EXTENSIONS`) or, in standalone mode, from
|
|
14
|
+
* runtime config, and are imported after the app is created. Vue and a
|
|
10
15
|
* curated set of Vuetify components are handed over so an extension
|
|
11
16
|
* needs no bundler and no copy of either library.
|
|
12
17
|
*/
|
|
@@ -17,8 +22,13 @@ export default defineNuxtPlugin(() => {
|
|
|
17
22
|
const notifications = useVectorNotifications()
|
|
18
23
|
const appConfig = useAppConfig()
|
|
19
24
|
const config = useRuntimeConfig()
|
|
20
|
-
//
|
|
21
|
-
|
|
25
|
+
// Tree-shaking keeps only what is imported here, so this is every Vuetify component an extension can reach.
|
|
26
|
+
// VTable for a custom page's tables: its wrapper, not a bare <table>, carries Vuetify's table styles.
|
|
27
|
+
const vuetify = {
|
|
28
|
+
VAlert, VAutocomplete, VBtn, VCard, VCheckbox, VChip, VDialog, VDivider, VExpansionPanel, VExpansionPanels, VExpansionPanelText,
|
|
29
|
+
VExpansionPanelTitle, VIcon, VList, VListItem, VMenu, VPagination, VProgressLinear, VRating, VSelect, VSkeletonLoader, VSwitch,
|
|
30
|
+
VTab, VTable, VTabs, VTabsWindow, VTabsWindowItem, VTextField, VTextarea, VTooltip,
|
|
31
|
+
}
|
|
22
32
|
|
|
23
33
|
const api = {
|
|
24
34
|
version: 1,
|
|
@@ -36,8 +46,11 @@ export default defineNuxtPlugin(() => {
|
|
|
36
46
|
defineRichTextExtension: (name: string, extension: import('@tiptap/core').AnyExtension) => registries.richText.set(name, vue.markRaw(extension)),
|
|
37
47
|
/** Adds or overrides UI messages for a locale: defineMessages('de', { common: { save: 'Speichern' } }). */
|
|
38
48
|
defineMessages: (locale: string, messages: Record<string, unknown>) => i18n.global.mergeLocaleMessage(locale, messages),
|
|
39
|
-
/**
|
|
40
|
-
|
|
49
|
+
/**
|
|
50
|
+
* A custom page at `/p/{name}`, listed in the menu: definePage('stock', { title: 'Stock', icon: 'mdi-warehouse', component }).
|
|
51
|
+
* `title` and `group` may be functions, `() => t('stock.title')`, called each time they are shown, so they follow the language.
|
|
52
|
+
*/
|
|
53
|
+
definePage: (name: string, page: { title: VectorPageLabel, icon?: string, group?: VectorPageLabel, component: vue.Component }) => {
|
|
41
54
|
if (!/^[a-z0-9][a-z0-9-]*$/.test(name)) throw new Error(`Vector page name "${name}" must be lowercase letters, digits and dashes.`)
|
|
42
55
|
registries.pages.set(name, { ...page, component: vue.markRaw(page.component) })
|
|
43
56
|
},
|
|
@@ -54,12 +67,15 @@ export default defineNuxtPlugin(() => {
|
|
|
54
67
|
|
|
55
68
|
window.Vector = api
|
|
56
69
|
|
|
57
|
-
const
|
|
70
|
+
const vectorConfig = config.public.vector as { extensions?: string[] }
|
|
58
71
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
// see loadVectorExtensions: the hosted shell's list, or runtime config's, at once
|
|
73
|
+
void loadVectorExtensions({
|
|
74
|
+
initial: [...(window.__VECTOR__?.extensions ?? []), ...(vectorConfig.extensions ?? [])],
|
|
75
|
+
ready: registries.ready,
|
|
76
|
+
importModule: url => import(/* @vite-ignore */ url),
|
|
77
|
+
run: module => (typeof (module as { default?: unknown }).default === 'function' ? (module as { default: (vector: typeof api) => unknown }).default(api) : undefined),
|
|
78
|
+
})
|
|
63
79
|
})
|
|
64
80
|
|
|
65
81
|
declare global {
|
|
@@ -74,7 +90,7 @@ declare global {
|
|
|
74
90
|
defineWidget: (type: string, component: vue.Component) => void
|
|
75
91
|
defineRichTextExtension: (name: string, extension: import('@tiptap/core').AnyExtension) => void
|
|
76
92
|
defineMessages: (locale: string, messages: Record<string, unknown>) => void
|
|
77
|
-
definePage: (name: string, page: { title:
|
|
93
|
+
definePage: (name: string, page: { title: VectorPageLabel, icon?: string, group?: VectorPageLabel, component: vue.Component }) => void
|
|
78
94
|
api: import('nitropack').$Fetch
|
|
79
95
|
notify: { success: (message: string) => void, error: (message: string) => void }
|
|
80
96
|
navigate: (path: string) => unknown
|
package/app/types/vector.ts
CHANGED
|
@@ -128,7 +128,16 @@ export interface VectorActionResponse {
|
|
|
128
128
|
jobId?: number | null
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
/** The built-in cards' types; `queues` is the queue dashboard's card, which loads its own figures. */
|
|
132
|
+
export type VectorBuiltInWidgetType = 'stat' | 'trend' | 'partition' | 'progress' | 'table' | 'queues'
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A built-in type, or an extension type: a kebab-case name whose card the
|
|
136
|
+
* application registers, through defineWidget in its runtime extension or
|
|
137
|
+
* vector.widgets in its app.config. Its data is whatever the widget
|
|
138
|
+
* answered, beside `type`, `range` and `cached`.
|
|
139
|
+
*/
|
|
140
|
+
export type VectorWidgetType = VectorBuiltInWidgetType | (string & {})
|
|
132
141
|
|
|
133
142
|
export interface VectorWidget {
|
|
134
143
|
name: string
|
|
@@ -184,6 +193,84 @@ export interface VectorJob {
|
|
|
184
193
|
finishedAt: string | null
|
|
185
194
|
}
|
|
186
195
|
|
|
196
|
+
/** One watched queue on the queue dashboard: `size` null when the backend cannot count, `failed` null without failed jobs. */
|
|
197
|
+
export interface VectorQueue {
|
|
198
|
+
name: string
|
|
199
|
+
size: number | null
|
|
200
|
+
clearable: boolean
|
|
201
|
+
failed: number | null
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** What the queue dashboard's policy lets this user do; `clear` per watched queue. */
|
|
205
|
+
export interface VectorQueuePermissions {
|
|
206
|
+
view: true
|
|
207
|
+
retry: boolean
|
|
208
|
+
forget: boolean
|
|
209
|
+
prune: boolean
|
|
210
|
+
clear: Record<string, boolean>
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** A failed job as the list shows it; the detail adds its redacted `args` and an always-null `trace`. */
|
|
214
|
+
export interface VectorFailedJob {
|
|
215
|
+
id: string
|
|
216
|
+
connection: string | null
|
|
217
|
+
queue: string
|
|
218
|
+
class: string
|
|
219
|
+
attempts: number
|
|
220
|
+
maxAttempts: number | null
|
|
221
|
+
exception: { class: string, message: string, trace?: string | null }
|
|
222
|
+
/** RFC 3339, UTC */
|
|
223
|
+
failedAt: string
|
|
224
|
+
args?: unknown
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface VectorFailedJobPage {
|
|
228
|
+
data: VectorFailedJob[]
|
|
229
|
+
nextCursor: string | null
|
|
230
|
+
hasMore: boolean
|
|
231
|
+
limit: number
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** The failed-job list's filters, as the user typed them: `failedFrom`/`failedTo` are `datetime-local` values. */
|
|
235
|
+
export interface VectorFailedJobFilters {
|
|
236
|
+
queue: string
|
|
237
|
+
class: string
|
|
238
|
+
failedFrom: string
|
|
239
|
+
failedTo: string
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface VectorRetryResult {
|
|
243
|
+
id: string
|
|
244
|
+
status: 'retried' | 'not_found' | 'failed'
|
|
245
|
+
class: string | null
|
|
246
|
+
queue: string | null
|
|
247
|
+
reason: string | null
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface VectorQueueMetricsCounts {
|
|
251
|
+
succeeded: number
|
|
252
|
+
released: number
|
|
253
|
+
failed: number
|
|
254
|
+
averageDurationMs: number
|
|
255
|
+
maxDurationMs: number
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** A queue's or a job class's totals over the window; `lastProcessedAt` in unix seconds. */
|
|
259
|
+
export interface VectorQueueMetricsTotals extends VectorQueueMetricsCounts {
|
|
260
|
+
failureRate: number | null
|
|
261
|
+
lastProcessedAt: number
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** GET /vector/queues/metrics: per-minute buckets (unix seconds), and totals per queue and per class. */
|
|
265
|
+
export interface VectorQueueMetrics {
|
|
266
|
+
from: number
|
|
267
|
+
to: number
|
|
268
|
+
bucketSeconds: number
|
|
269
|
+
buckets: (VectorQueueMetricsCounts & { bucket: number })[]
|
|
270
|
+
queues: (VectorQueueMetricsTotals & { queue: string })[]
|
|
271
|
+
classes: (VectorQueueMetricsTotals & { class: string })[]
|
|
272
|
+
}
|
|
273
|
+
|
|
187
274
|
export interface VectorNotification {
|
|
188
275
|
id: number
|
|
189
276
|
kind: 'info' | 'success' | 'warning' | 'error'
|
|
@@ -389,8 +476,13 @@ export interface VectorSchema {
|
|
|
389
476
|
menu: VectorMenuGroup[]
|
|
390
477
|
settings: { name: string, label: string, icon: string | null }[]
|
|
391
478
|
dashboards: { name: string, label: string, icon: string | null }[]
|
|
392
|
-
/**
|
|
393
|
-
|
|
479
|
+
/**
|
|
480
|
+
* `exportFormats`: what the export menu offers — csv always, xlsx where the server can write it (in the queue).
|
|
481
|
+
* `queues`: the queue dashboard is there for this user (a queue configured, the policy lets them view);
|
|
482
|
+
* `failedJobs`: it shows failed jobs too (kinetis/queue-failed-jobs installed and wired). Absent is false.
|
|
483
|
+
* `queueMetrics`: it shows the job metrics too (VECTOR_QUEUE_METRICS not turned off). Absent is false.
|
|
484
|
+
*/
|
|
485
|
+
capabilities: { impersonation: boolean, queue: boolean, uploads?: boolean, exportFormats?: VectorExportFormat[], queues?: boolean, failedJobs?: boolean, queueMetrics?: boolean }
|
|
394
486
|
branding: VectorBranding | null
|
|
395
487
|
/** The language this descriptor is in, and the ones this user may switch to. */
|
|
396
488
|
i18n?: VectorSchemaI18n
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Imports the runtime extension modules and turns `ready` true once every
|
|
5
|
+
* one has settled, loaded or failed. Separate from the plugin so the
|
|
6
|
+
* order and the waiting can be tested without a browser importing real
|
|
7
|
+
* URLs.
|
|
8
|
+
*
|
|
9
|
+
* The list is known at boot: the hosted shell's (`VECTOR_UI_EXTENSIONS`)
|
|
10
|
+
* and runtime config's, imported as given, at once. A custom page an
|
|
11
|
+
* extension defines, opened straight from a link, stays a loading bar
|
|
12
|
+
* until they settle rather than reading "unknown page".
|
|
13
|
+
* The modules are fetched at once but run in the order listed, a later
|
|
14
|
+
* one waiting for those before it to load or fail, so the custom pages
|
|
15
|
+
* they define reach the menu in the same order on every load. A module
|
|
16
|
+
* that fails is logged and never holds the admin back.
|
|
17
|
+
*/
|
|
18
|
+
export interface ExtensionLoaderOptions {
|
|
19
|
+
initial: string[]
|
|
20
|
+
ready: Ref<boolean>
|
|
21
|
+
importModule: (url: string) => Promise<unknown>
|
|
22
|
+
/** Runs a loaded module, its default export called with `window.Vector`. */
|
|
23
|
+
run: (module: unknown, url: string) => void
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function loadVectorExtensions(options: ExtensionLoaderOptions): Promise<void> {
|
|
27
|
+
// fetched in parallel, run one after another in the order listed, so what they register (the
|
|
28
|
+
// menu's custom pages and groups) comes in that order rather than whichever arrived first
|
|
29
|
+
const imports = options.initial.map(url => options.importModule(url))
|
|
30
|
+
|
|
31
|
+
return options.initial
|
|
32
|
+
.reduce<Promise<void>>((previous, url, index) => previous.then(() => imports[index]!
|
|
33
|
+
.then(module => options.run(module, url))
|
|
34
|
+
.catch(error => console.error(`Vector extension ${url} failed to load`, error))), Promise.resolve())
|
|
35
|
+
.then(() => { options.ready.value = true })
|
|
36
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { VectorQueueMetrics, VectorRetryResult } from '#vector/app/types/vector'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The server's own limits, kept in step with kinetis/vector:
|
|
5
|
+
* QueuesController::MAX_RETRY_BATCH and its prune age (MAX_PRUNE_DAYS),
|
|
6
|
+
* and MetricsQuery::MAX_MINUTES, the longest window (the last of
|
|
7
|
+
* QUEUE_WINDOWS).
|
|
8
|
+
*/
|
|
9
|
+
export const QUEUE_MAX_RETRY_BATCH = 50
|
|
10
|
+
export const QUEUE_MAX_PRUNE_DAYS = 36500
|
|
11
|
+
export const QUEUE_METRICS_MAX_MINUTES = 7 * 24 * 60
|
|
12
|
+
|
|
13
|
+
/** How often the overview asks again while it is shown. */
|
|
14
|
+
export const QUEUE_POLL_MS = 5000
|
|
15
|
+
|
|
16
|
+
/** The metrics window shown first, in minutes: the last hour, one of QUEUE_WINDOWS (at the end of this file). */
|
|
17
|
+
export const QUEUE_DEFAULT_WINDOW = 60
|
|
18
|
+
|
|
19
|
+
/** The most points the throughput sparkline draws: a longer window sums neighbouring minutes. */
|
|
20
|
+
export const QUEUE_SPARK_POINTS = 240
|
|
21
|
+
|
|
22
|
+
/** The HTTP status of an API client error, whichever field the client put it in. */
|
|
23
|
+
export function queueErrorStatus(error: unknown): number | null {
|
|
24
|
+
const failure = error as { status?: number, statusCode?: number, response?: { status?: number } } | null
|
|
25
|
+
return failure?.status ?? failure?.statusCode ?? failure?.response?.status ?? null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** A notice for a failed call: 403, 404, 409 and 422 in words of their own, anything else with the server's reason. */
|
|
29
|
+
export function describeQueueError(error: unknown): string {
|
|
30
|
+
switch (queueErrorStatus(error)) {
|
|
31
|
+
case 403: return vt('queues.errors.forbidden')
|
|
32
|
+
case 404: return vt('queues.errors.notFound')
|
|
33
|
+
case 409: return vt('queues.errors.conflict', { detail: vectorErrorMessage(error) })
|
|
34
|
+
case 422: return vt('queues.errors.invalid', { detail: vectorErrorMessage(error) })
|
|
35
|
+
default: return vt('queues.errors.failed', { detail: vectorErrorMessage(error) })
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Whether a page-level read was refused because the dashboard is not there for this user: 403, or the 404 the gate answers. */
|
|
40
|
+
export function queueAccessRefused(error: unknown): boolean {
|
|
41
|
+
const status = queueErrorStatus(error)
|
|
42
|
+
return status === 403 || status === 404
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Drops the empty filters, so an unset one is absent rather than an empty string the server refuses. */
|
|
46
|
+
export function compactQuery<T extends Record<string, string | number | null | undefined>>(query: T): Record<string, string | number> {
|
|
47
|
+
return Object.fromEntries(Object.entries(query).filter(([, value]) => value !== '' && value !== null && value !== undefined)) as Record<string, string | number>
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A `datetime-local` value in the browser's zone as RFC 3339 in whole seconds, UTC; '' when unset or invalid.
|
|
52
|
+
* An invalid one must not reach it unnoticed — '' drops the filter — so a form checks queueLocalDateValid() first.
|
|
53
|
+
*/
|
|
54
|
+
export function toRfc3339(local: string): string {
|
|
55
|
+
if (!local) return ''
|
|
56
|
+
const date = new Date(local)
|
|
57
|
+
return Number.isNaN(date.getTime()) ? '' : date.toISOString().replace(/\.\d{3}Z$/, 'Z')
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Whether a `datetime-local` value is unset or a date toRfc3339() can read. */
|
|
61
|
+
export function queueLocalDateValid(local: string): boolean {
|
|
62
|
+
return !local || !Number.isNaN(new Date(local).getTime())
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** A count, or the dashboard's dash for none. */
|
|
66
|
+
export function queueNumber(value: number | null | undefined): string {
|
|
67
|
+
return typeof value === 'number' ? formatNumber(value) : vt('queues.none')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Milliseconds, to at most one decimal. */
|
|
71
|
+
export function queueMs(value: number | null | undefined): string {
|
|
72
|
+
return typeof value === 'number' ? formatNumber(Math.round(value * 10) / 10) : vt('queues.none')
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** A share of 0 to 1 as a percentage with one decimal. */
|
|
76
|
+
export function queueRate(value: number | null | undefined): string {
|
|
77
|
+
return typeof value === 'number' ? vt('queues.percent', { value: (value * 100).toFixed(1) }) : vt('queues.none')
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** An RFC 3339 time, or unix seconds, in the UI's language. */
|
|
81
|
+
export function queueTime(value: string | number | null | undefined): string {
|
|
82
|
+
if (value === null || value === undefined || value === '') return vt('queues.none')
|
|
83
|
+
return formatDateTime(typeof value === 'number' ? new Date(value * 1000).toISOString() : value)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** A failed job's attempts: "3 of 5", or the count alone when it had no limit. */
|
|
87
|
+
export function queueAttempts(job: { attempts: number, maxAttempts: number | null }): string {
|
|
88
|
+
return job.maxAttempts === null ? queueNumber(job.attempts) : vt('queues.failed.attemptsOf', { attempts: job.attempts, max: job.maxAttempts })
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** A retry's outcome in one line, and whether every job was retried. */
|
|
92
|
+
export function queueRetrySummary(results: VectorRetryResult[]): { text: string, ok: boolean } {
|
|
93
|
+
const count = (status: VectorRetryResult['status']) => results.filter(result => result.status === status).length
|
|
94
|
+
return {
|
|
95
|
+
text: vt('queues.failed.retried', { retried: count('retried'), notFound: count('not_found'), failed: count('failed') }),
|
|
96
|
+
ok: count('retried') === results.length,
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** The days a prune field holds, as a whole number from 1 to the server's limit; null for anything else. */
|
|
101
|
+
export function queuePruneDays(value: string | number | null | undefined): number | null {
|
|
102
|
+
const text = String(value ?? '').trim()
|
|
103
|
+
if (!/^[1-9]\d*$/.test(text)) return null
|
|
104
|
+
const days = Number(text)
|
|
105
|
+
return days > QUEUE_MAX_PRUNE_DAYS ? null : days
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** The window's totals across every queue: failure rate over finished attempts, average over all of them. */
|
|
109
|
+
export function queueMetricsTotals(metrics: VectorQueueMetrics | null) {
|
|
110
|
+
const sum = { succeeded: 0, released: 0, failed: 0, max: null as number | null, duration: 0 }
|
|
111
|
+
for (const row of metrics?.queues ?? []) {
|
|
112
|
+
sum.succeeded += row.succeeded
|
|
113
|
+
sum.released += row.released
|
|
114
|
+
sum.failed += row.failed
|
|
115
|
+
sum.duration += row.averageDurationMs * (row.succeeded + row.released + row.failed)
|
|
116
|
+
sum.max = Math.max(sum.max ?? 0, row.maxDurationMs)
|
|
117
|
+
}
|
|
118
|
+
const attempts = sum.succeeded + sum.released + sum.failed
|
|
119
|
+
const finished = sum.succeeded + sum.failed
|
|
120
|
+
return {
|
|
121
|
+
succeeded: sum.succeeded,
|
|
122
|
+
released: sum.released,
|
|
123
|
+
failed: sum.failed,
|
|
124
|
+
maxDurationMs: sum.max,
|
|
125
|
+
failureRate: finished === 0 ? null : sum.failed / finished,
|
|
126
|
+
averageDurationMs: attempts === 0 ? null : sum.duration / attempts,
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* The sparkline of attempts per minute: the buckets summed into at most
|
|
132
|
+
* QUEUE_SPARK_POINTS points, as an SVG polyline in a 40-unit-high box.
|
|
133
|
+
*/
|
|
134
|
+
export function queueSparkline(buckets: VectorQueueMetrics['buckets']): { width: number, points: string } {
|
|
135
|
+
const totals = buckets.map(bucket => bucket.succeeded + bucket.released + bucket.failed)
|
|
136
|
+
const size = Math.max(1, Math.ceil(totals.length / QUEUE_SPARK_POINTS))
|
|
137
|
+
const sums: number[] = []
|
|
138
|
+
for (let index = 0; index < totals.length; index += size) {
|
|
139
|
+
sums.push(totals.slice(index, index + size).reduce((sum, value) => sum + value, 0))
|
|
140
|
+
}
|
|
141
|
+
const peak = Math.max(1, ...sums)
|
|
142
|
+
return {
|
|
143
|
+
width: Math.max(1, sums.length - 1),
|
|
144
|
+
points: sums.map((value, index) => `${index},${(40 - (value / peak) * 38 - 1).toFixed(2)}`).join(' '),
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The metrics windows offered, in minutes, QUEUE_DEFAULT_WINDOW among them. Kept the
|
|
150
|
+
* last declaration in this file: Nuxt's export scan misses a declaration that
|
|
151
|
+
* follows an `as const`, so nothing may come after it.
|
|
152
|
+
*/
|
|
153
|
+
export const QUEUE_WINDOWS = [15, 60, 360, 1440, QUEUE_METRICS_MAX_MINUTES] as const
|
package/dist/static/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/vector/ui/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/vector/ui/_nuxt/CuG-8Z4K.js"}}</script><link rel="stylesheet" href="/vector/ui/_nuxt/entry.Sg6-iCOx.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VSelect.4i15hLH6.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/ripple.BF-Re9AG.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VList.DLBes6Xg.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VIcon.DTxGzRyY.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VAvatar.DDw3_L_i.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VImg.DG7aP0kv.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VDivider.DvkP_iX7.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VMenu.DCy1EQlK.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VOverlay.DObTzQ9r.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VSelectionControl.B4WFlrqD.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VInput.BzI_hIki.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VChip.DriYwOm3.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VSlideGroup.BEHBZMHn.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/autofocus.Dpzbb23r.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VProgressLinear.QSXru69E.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VBtn.DYtpaadd.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VProgressCircular.CHg-6LCa.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CuG-8Z4K.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CPAF2hi7.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DZo3dYLJ.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/51OWHj8c.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BBBFJ6ov.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BiIirvgR.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BW3xJdEx.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/go_nGSOr.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BDLrTt6l.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CmQyigb3.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BQnpCLjt.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/ORpfF6Nb.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CTHeqfU5.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/csgWgQhm.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/D7DEE4gN.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/rSy2G_Qb.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Dnv1kjao.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/OMRlJR6k.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Dg_tXu9P.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CIQLz04l.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/D-rB2fWZ.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/bmIlMXFn.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/E-mWtnN5.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DBgKGXIj.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CQQ-wIWC.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/rSRjHK_a.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B4joN-Do.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BHcm7bNA.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Lj7y5-JX.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B_DG2saj.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BIv9Nyve.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B9psIVnP.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/iEEDTq6e.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BVjSh6vC.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DVIiT5EL.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BKlyjday.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/COHV16dX.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BKpxsGPP.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DvnG2kZK.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/9MD1hlLT.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DQ1z3A04.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/2c1vZ90H.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/C_2GgX80.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/ChHm6L68.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CCr9dqOM.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B_fQu_h2.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BzKz2oL1.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/MAzsrRZz.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Ci1-hOA9.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CSzw4ySZ.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DLzA6Iec.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DDEIDAa0.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CxlUCc9r.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/1aNtrH5X.js"><script type="module" src="/vector/ui/_nuxt/CuG-8Z4K.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/C6FXj6mJ.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/R0rf_l_C.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/Notifications.BvaCltQH.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/CvqfGMjv.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/C64NUw_T.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BDNMzG2s.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/vector.ClRRJOjR.css"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/VContainer.ku9EbwM-.css"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/VSpacer.DfbUir7X.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BFBN0MCm.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/DVRz0uUW.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/DI2U4Yky.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/C_ix0rE_.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BiGgsuAF.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BFZ46Edz.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/D9BNw4XE.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BE_w8iyq.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/DB9Px0Zg.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/D1nKViyT.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/CNKBVevI.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/error-404.B9sBsxLH.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BsCAElgq.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/error-500.Dy1PcAYT.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/D8QRJNA1.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{vector:{apiBase:"http://localhost:8080",extensions:[],uiVersion:"0.12.0"}},app:{baseURL:"/vector/ui/",buildId:"f5ce5132-6b99-4f7d-9c7c-6cef19f59d51",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1793709438460,false]</script></body></html>
|
package/dist/static/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/vector/ui/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/vector/ui/_nuxt/CuG-8Z4K.js"}}</script><link rel="stylesheet" href="/vector/ui/_nuxt/entry.Sg6-iCOx.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VSelect.4i15hLH6.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/ripple.BF-Re9AG.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VList.DLBes6Xg.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VIcon.DTxGzRyY.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VAvatar.DDw3_L_i.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VImg.DG7aP0kv.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VDivider.DvkP_iX7.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VMenu.DCy1EQlK.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VOverlay.DObTzQ9r.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VSelectionControl.B4WFlrqD.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VInput.BzI_hIki.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VChip.DriYwOm3.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VSlideGroup.BEHBZMHn.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/autofocus.Dpzbb23r.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VProgressLinear.QSXru69E.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VBtn.DYtpaadd.css" crossorigin><link rel="stylesheet" href="/vector/ui/_nuxt/VProgressCircular.CHg-6LCa.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CuG-8Z4K.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CPAF2hi7.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DZo3dYLJ.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/51OWHj8c.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BBBFJ6ov.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BiIirvgR.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BW3xJdEx.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/go_nGSOr.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BDLrTt6l.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CmQyigb3.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BQnpCLjt.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/ORpfF6Nb.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CTHeqfU5.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/csgWgQhm.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/D7DEE4gN.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/rSy2G_Qb.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Dnv1kjao.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/OMRlJR6k.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Dg_tXu9P.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CIQLz04l.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/D-rB2fWZ.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/bmIlMXFn.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/E-mWtnN5.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DBgKGXIj.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CQQ-wIWC.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/rSRjHK_a.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B4joN-Do.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BHcm7bNA.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Lj7y5-JX.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B_DG2saj.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BIv9Nyve.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B9psIVnP.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/iEEDTq6e.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BVjSh6vC.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DVIiT5EL.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BKlyjday.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/COHV16dX.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BKpxsGPP.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DvnG2kZK.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/9MD1hlLT.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DQ1z3A04.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/2c1vZ90H.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/C_2GgX80.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/ChHm6L68.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CCr9dqOM.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/B_fQu_h2.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/BzKz2oL1.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/MAzsrRZz.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/Ci1-hOA9.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CSzw4ySZ.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DLzA6Iec.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/DDEIDAa0.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/CxlUCc9r.js"><link rel="modulepreload" as="script" crossorigin href="/vector/ui/_nuxt/1aNtrH5X.js"><script type="module" src="/vector/ui/_nuxt/CuG-8Z4K.js" crossorigin></script><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/C6FXj6mJ.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/R0rf_l_C.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/Notifications.BvaCltQH.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/CvqfGMjv.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/C64NUw_T.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BDNMzG2s.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/vector.ClRRJOjR.css"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/VContainer.ku9EbwM-.css"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/VSpacer.DfbUir7X.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BFBN0MCm.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/DVRz0uUW.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/DI2U4Yky.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/C_ix0rE_.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BiGgsuAF.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BFZ46Edz.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/D9BNw4XE.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BE_w8iyq.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/DB9Px0Zg.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/D1nKViyT.js"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/CNKBVevI.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/error-404.B9sBsxLH.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/BsCAElgq.js"><link rel="prefetch" as="style" crossorigin href="/vector/ui/_nuxt/error-500.Dy1PcAYT.css"><link rel="prefetch" as="script" crossorigin href="/vector/ui/_nuxt/D8QRJNA1.js"></head><body><div id="__nuxt"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{vector:{apiBase:"http://localhost:8080",extensions:[],uiVersion:"0.12.0"}},app:{baseURL:"/vector/ui/",buildId:"f5ce5132-6b99-4f7d-9c7c-6cef19f59d51",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1793709438460,false]</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,g as c,k as l,mt as u,o as d,qt as f,tr as p,y as m}from"./DZo3dYLJ.js";import{C as h,w as g}from"./51OWHj8c.js";import{c as _}from"./BiIirvgR.js";import{t as v}from"./CmQyigb3.js";import{t as y}from"./DLzA6Iec.js";import{t as b}from"./CxlUCc9r.js";import{Ut as x,m as S,t as C}from"#entry";import{t as w}from"./BE_w8iyq.js";var T=[`tabindex`,`role`,`onClick`,`onKeydown`],E={key:0},D=[`colspan`],O={key:0,class:`text-end mt-2`},k=Object.assign(l({__name:`Table`,props:{data:{}},setup(l){let k=l,A=y(),{t:j}=C(),M=c(()=>k.data.rows??[]),N=e=>typeof e._link==`string`&&w(e._link);async function P(e){if(N(e))try{await _(`${A.vector.basePath}${e._link}`)}catch(e){v().error(x(e))}}return(c,_)=>(u(),a(`div`,null,[e(S,{density:`compact`,hover:``},{default:f(()=>[i(`thead`,null,[i(`tr`,null,[(u(!0),a(d,null,o(l.data.columns??[],e=>(u(),a(`th`,{key:e.key,scope:`col`,class:r(e.align===`end`?`text-end`:``)},p(e.label),3))),128))])]),i(`tbody`,null,[(u(!0),a(d,null,o(n(M),(e,t)=>(u(),a(`tr`,{key:t,style:s(N(e)?`cursor: pointer`:``),tabindex:N(e)?0:void 0,role:N(e)?`link`:void 0,onClick:t=>P(e),onKeydown:[h(g(t=>P(e),[`self`,`prevent`]),[`enter`]),h(g(t=>P(e),[`self`,`prevent`]),[`space`])]},[(u(!0),a(d,null,o(l.data.columns??[],t=>(u(),a(`td`,{key:t.key,class:r(t.align===`end`?`text-end`:``)},p(e[t.key]),3))),128))],44,T))),128)),n(M).length===0?(u(),a(`tr`,E,[i(`td`,{colspan:(l.data.columns??[]).length,class:`text-medium-emphasis`},p(n(j)(`dashboard.table.empty`)),9,D)])):m(``,!0)])]),_:1}),l.data.link?(u(),a(`div`,O,[e(b,{size:`small`,variant:`text`,to:`${n(A).vector.basePath}${l.data.link}`,"append-icon":`mdi-arrow-right`},{default:f(()=>[t(p(n(j)(`dashboard.table.seeAll`)),1)]),_:1},8,[`to`])])):m(``,!0)]))}}),{__name:`VxWidgetTable`});export{k as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,Ft as t,k as n,mt as r,v as i}from"./DZo3dYLJ.js";import{
|
|
1
|
+
import{$ as e,Ft as t,k as n,mt as r,v as i}from"./DZo3dYLJ.js";import{s as a}from"#entry";var o=Object.assign(n({__name:`Boolean`,props:e({field:{},rules:{},errorMessages:{},record:{},resource:{}},{modelValue:{type:[Boolean,null]},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let n=t(e,`modelValue`);return(t,o)=>(r(),i(a,{modelValue:n.value,"onUpdate:modelValue":o[0]||=e=>n.value=e,label:e.field.label,"error-messages":e.errorMessages,hint:e.field.help??void 0,"persistent-hint":!!e.field.help,color:`primary`,inset:``},null,8,[`modelValue`,`label`,`error-messages`,`hint`,`persistent-hint`]))}}),{__name:`VxInputBoolean`});export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,L as t,On as n,Ut as r,ct as i,fn as a,it as o,k as s,nn as c,tt as l,vn as u,xn as d}from"./DZo3dYLJ.js";import{O as f}from"#entry";function p(e){return c((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var m=class extends f{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=p(this.view.state),this.reactiveExtensionStorage=p(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),a(this)}get state(){var e;return(e=this.reactiveState)==null||e.value,super.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},h=s({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let i=u(),a=t();return r(()=>{let t=e.editor;t&&t.options.element&&i.value&&l(()=>{if(!i.value||!t.view.dom?.parentNode)return;let e=n(i.value);i.value.append(...t.view.dom.parentNode.childNodes),t.contentComponent=a.ctx._,a&&(t.appContext={...a.appContext,provides:a.provides}),t.setOptions({element:e}),t.createNodeViews()})}),o(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:i}},render(){return e(`div`,{ref:e=>{this.rootEl=e}})}});s({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return e(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),s({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var t;return e(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(t=this.$slots).default?.call(t))}});var g=(e={})=>{let t=d();return i(()=>{t.value=new m(e)}),o(()=>{var e;(e=t.value)==null||e.destroy()}),t};s({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return e(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});export{g as n,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,_ as o,b as s,bt as c,ct as l,g as u,k as d,mt as f,o as p,qt as m,tr as h,v as g,vn as _,wt as v}from"./DZo3dYLJ.js";import{t as y}from"./CxlUCc9r.js";import{n as b,t as x}from"./DR4qylKa.js";import{t as S}from"./DI2U4Yky.js";import{D as C,Wt as w,t as T,v as E}from"#entry";import{t as D}from"./BDNMzG2s.js";import{i as O,r as k}from"./qzTYEKJ1.js";var A={class:`d-flex align-center mb-2`},j={class:`text-subtitle-2`},M={class:`text-caption text-medium-emphasis`},N={key:0,class:`text-medium-emphasis text-body-2`},P=[`aria-label`],F=Object.assign(D(d({__name:`Repeater`,props:e({field:{},rules:{},errorMessages:{},resource:{},record:{},serverErrors:{},disabled:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let d=e,D=r(e,`modelValue`),{t:F,noun:I}=T(),{resource:L}=w(),{inputFor:R}=O(),z=u(()=>d.field.relation?L(d.field.relation.resource):void 0),B=u(()=>(d.field.repeater?.fields??[]).map(e=>z.value?.fields.find(t=>t.name===e)).filter(e=>e!==void 0)),V=u(()=>d.field.repeater?.min??0),H=u(()=>d.field.repeater?.max??100),U=u(()=>Array.isArray(D.value)?D.value:[]),W=u(()=>Math.max(3,Math.floor(12/Math.max(1,Math.min(B.value.length,4))))),G=0,K=_([]);i(()=>U.value.length,e=>{K.value.length!==e&&(K.value=Array.from({length:e},()=>G++))},{immediate:!0});function q(e){return e.hasDefault?e.default:e.type!==`boolean`&&null}function J(){return Object.fromEntries(B.value.map(e=>[e.name,q(e)]))}function Y(){K.value=[...K.value,G++],D.value=[...U.value,J()]}function X(e){K.value=K.value.filter((t,n)=>n!==e),D.value=U.value.filter((t,n)=>n!==e),Q()}function Z(e,t,n){D.value=U.value.map((r,i)=>i===e?{...r,[t]:n}:r),d.serverErrors&&delete d.serverErrors[`${d.field.name}.${e}.${t}`]}function Q(){for(let e of Object.keys(d.serverErrors??{}))e.startsWith(`${d.field.name}.`)&&delete d.serverErrors[e]}let $=u(()=>d.field.relation?.inverse),ee=e=>$.value?{...e,[$.value]:d.record??{}}:e,te=(e,t)=>d.serverErrors?.[`${d.field.name}.${e}.${t}`]??[];return l(()=>{z.value&&U.value.length<V.value&&!d.record?.id&&(D.value=[...U.value,...Array.from({length:V.value-U.value.length},J)])}),(r,i)=>(f(),g(E,{variant:`outlined`,class:`pa-3`,role:`group`,"aria-label":e.field.label},{default:m(()=>[o(`div`,A,[o(`span`,j,h(e.field.label),1),t(S),o(`span`,M,h(a(F)(`fields.repeater.count`,{count:a(U).length,max:a(H)})),1)]),(f(!0),s(p,null,c(e.errorMessages,e=>(f(),g(C,{key:e,type:`error`,variant:`tonal`,density:`compact`,class:`mb-2`,text:e},null,8,[`text`]))),128)),a(z)?(f(),s(p,{key:1},[(f(!0),s(p,null,c(a(U),(n,i)=>(f(),s(`fieldset`,{key:a(K)[i],class:`vx-fieldset d-flex ga-2 align-start mb-1`,"aria-label":a(F)(`fields.repeater.row`,{label:a(z).labelSingular,n:i+1})},[t(x,{density:`compact`,class:`flex-grow-1`},{default:m(()=>[(f(!0),s(p,null,c(a(B),t=>(f(),g(b,{key:t.name,cols:`12`,md:a(W)},{default:m(()=>[(f(),g(v(a(R)(t)),{"model-value":n[t.name],field:t,rules:(`rulesFor`in r?r.rulesFor:a(k))(t,n.id?`update`:`create`),"error-messages":te(i,t.name),record:ee(n),resource:a(z).slug,disabled:e.disabled,density:`compact`,"onUpdate:modelValue":e=>Z(i,t.name,e)},null,8,[`model-value`,`field`,`rules`,`error-messages`,`record`,`resource`,`disabled`,`onUpdate:modelValue`]))]),_:2},1032,[`md`]))),128))]),_:2},1024),t(y,{icon:`mdi-close`,variant:`text`,size:`small`,class:`mt-2`,disabled:e.disabled||a(U).length<=a(V),"aria-label":a(F)(`fields.repeater.remove`,{label:a(I)(a(z).labelSingular),n:i+1}),onClick:e=>X(i)},null,8,[`disabled`,`aria-label`,`onClick`])],8,P))),128)),t(y,{variant:`tonal`,size:`small`,"prepend-icon":`mdi-plus`,disabled:e.disabled||a(U).length>=a(H),onClick:Y},{default:m(()=>[n(h(a(F)(`fields.repeater.add`,{label:a(I)(a(z).labelSingular)})),1)]),_:1},8,[`disabled`])],64)):(f(),s(`p`,N,h(a(F)(`fields.repeater.unavailable`)),1))]),_:1},8,[`aria-label`]))}}),[[`__scopeId`,`data-v-03b8dc5d`]]),{__name:`VxInputRepeater`});export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,Ft as t,On as n,g as r,k as i,mt as a,v as o}from"./DZo3dYLJ.js";import{n as s}from"./DDEIDAa0.js";import{
|
|
1
|
+
import{$ as e,Ft as t,On as n,g as r,k as i,mt as a,v as o}from"./DZo3dYLJ.js";import{n as s}from"./DDEIDAa0.js";import{T as c,t as l}from"#entry";var u=Object.assign(i({__name:`Currency`,props:e({field:{},rules:{},errorMessages:{},record:{},resource:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let i=e,u=t(e,`modelValue`),{locale:d}=l(),f=r(()=>(i.field.options??[]).map(e=>({value:String(e.value),title:s(String(e.value),d.value)})));return(t,r)=>(a(),o(c,{modelValue:u.value,"onUpdate:modelValue":r[0]||=e=>u.value=e,label:e.field.label,items:n(f),rules:e.rules,"error-messages":e.errorMessages,clearable:e.field.nullable===!0,hint:e.field.help??void 0,"persistent-hint":!!e.field.help,"auto-select-first":``},null,8,[`modelValue`,`label`,`items`,`rules`,`error-messages`,`clearable`,`hint`,`persistent-hint`]))}}),{__name:`VxInputCurrency`});export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{On as e,b as t,bt as n,g as r,k as i,mt as a,o,qt as s,v as c,wt as l}from"./DZo3dYLJ.js";import{r as u}from"./BDLrTt6l.js";import{n as d,t as f}from"./DR4qylKa.js";import{
|
|
1
|
+
import{On as e,b as t,bt as n,g as r,k as i,mt as a,o,qt as s,v as c,wt as l}from"./DZo3dYLJ.js";import{r as u}from"./BDLrTt6l.js";import{n as d,t as f}from"./DR4qylKa.js";import{Ut as p}from"#entry";import{i as m,n as h,r as g,t as _}from"./qzTYEKJ1.js";var v=Object.assign(i({__name:`FieldsForm`,props:{fields:{},values:{},serverErrors:{},resource:{}},emits:[`clear`],setup(i,{emit:u}){let p=i,_=u,{inputFor:v}=m(),y=e=>[`markdown`,`richtext`,`text`,`json`].includes(e.type),b=r(()=>Object.fromEntries(p.fields.map(e=>[e.name,h(e,p.values)]))),x=r(()=>p.fields.filter(e=>b.value[e.name]?.visible!==!1));function S(e,t){p.values[e]=t,_(`clear`,e)}return(r,u)=>(a(),c(f,{density:`compact`},{default:s(()=>[(a(!0),t(o,null,n(e(x),t=>(a(),c(d,{key:t.name,cols:`12`,md:y(t)||i.fields.length===1?12:6},{default:s(()=>[(a(),c(l(e(v)(t)),{"model-value":i.values[t.name],field:t,disabled:e(b)[t.name]?.disabled===!0,rules:(`rulesFor`in r?r.rulesFor:e(g))(t,`create`,e(b)[t.name]),"error-messages":i.serverErrors[t.name]??[],record:i.values,resource:i.resource??``,"onUpdate:modelValue":e=>S(t.name,e)},null,8,[`model-value`,`field`,`disabled`,`rules`,`error-messages`,`record`,`resource`,`onUpdate:modelValue`]))]),_:2},1032,[`md`]))),128))]),_:1}))}}),{__name:`VxFieldsForm`});function y(e){return e.hasDefault?e.default:e.type===`boolean`?!1:e.type===`manyToMany`?[]:null}function b(e,t,n){let r=e,i=r?.data?.errors;if((r?.status??r?.statusCode)!==422||!Array.isArray(i))return p(e);let a=null;for(let e of _(i)){let r=String(e.path[0]??``);r&&r in t?(n[r]??=[],n[r].push(`${e.message.charAt(0).toUpperCase()}${e.message.slice(1)}`)):a=e.message}return a??(Object.keys(n).length===0?u(`common.serverRejected`):null)}export{y as n,v as r,b as t};
|