@h-ai/ui 1.0.0-beta.3 → 1.0.0-beta.30
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/README.en.md +251 -71
- package/README.ja.md +250 -70
- package/README.md +252 -73
- package/auto-import.d.ts +5 -0
- package/auto-import.js +242 -65
- package/dist/components/compounds/Accordion.svelte +6 -2
- package/dist/components/compounds/BottomNav.svelte +14 -2
- package/dist/components/compounds/Card.svelte +3 -1
- package/dist/components/compounds/Combobox.svelte +41 -5
- package/dist/components/compounds/DataTable.svelte +28 -8
- package/dist/components/compounds/DatePicker.svelte +6 -1
- package/dist/components/compounds/Drawer.svelte +12 -4
- package/dist/components/compounds/Dropdown.svelte +135 -59
- package/dist/components/compounds/Empty.svelte +10 -2
- package/dist/components/compounds/FormField.svelte +10 -2
- package/dist/components/compounds/JsonViewer.svelte +18 -6
- package/dist/components/compounds/Modal.svelte +8 -2
- package/dist/components/compounds/Pagination.svelte +22 -7
- package/dist/components/compounds/Popover.svelte +93 -12
- package/dist/components/compounds/Steps.svelte +24 -8
- package/dist/components/compounds/SwipeCell.svelte +3 -1
- package/dist/components/compounds/TableToolbar.svelte +32 -9
- package/dist/components/compounds/Tabs.svelte +25 -5
- package/dist/components/compounds/TagInput.svelte +2 -0
- package/dist/components/compounds/Timeline.svelte +6 -2
- package/dist/components/compounds/ToastContainer.svelte +41 -10
- package/dist/components/compounds/Tooltip.svelte +1 -1
- package/dist/components/compounds/Tooltip.svelte.d.ts +1 -1
- package/dist/components/control-size.js +48 -8
- package/dist/components/primitives/Avatar.svelte +9 -3
- package/dist/components/primitives/BareInput.svelte +3 -1
- package/dist/components/primitives/Button.svelte +6 -2
- package/dist/components/primitives/Checkbox.svelte +5 -0
- package/dist/components/primitives/IconButton.svelte +3 -1
- package/dist/components/primitives/Input.svelte +19 -3
- package/dist/components/primitives/Radio.svelte +4 -1
- package/dist/components/primitives/Range.svelte +3 -1
- package/dist/components/primitives/Rating.svelte +9 -3
- package/dist/components/primitives/Select.svelte +21 -5
- package/dist/components/primitives/Tag.svelte +6 -10
- package/dist/components/primitives/Textarea.svelte +14 -2
- package/dist/components/scenes/ai/AiDocumentEditor.svelte +45 -69
- package/dist/components/scenes/ai/document-download.js +6 -2
- package/dist/components/scenes/ai/document-parse.js +24 -8
- package/dist/components/scenes/ai/document-types.d.ts +0 -12
- package/dist/components/scenes/ai/editor-markdown-extensions.js +9 -3
- package/dist/components/scenes/ai/highlight.js +3 -1
- package/dist/components/scenes/ai/index.d.ts +1 -1
- package/dist/components/scenes/ai/markdown-parse.js +36 -10
- package/dist/components/scenes/ai/mermaid-render.js +13 -1
- package/dist/components/scenes/ai/safe-html.js +9 -3
- package/dist/components/scenes/ai/table/AiTableEditor.svelte +28 -16
- package/dist/components/scenes/app/FeedbackDetail.svelte +102 -24
- package/dist/components/scenes/app/FeedbackForm.svelte +70 -16
- package/dist/components/scenes/app/FeedbackList.svelte +138 -21
- package/dist/components/scenes/app/FeedbackRecorder.svelte +18 -5
- package/dist/components/scenes/app/FeedbackReplay.svelte +15 -3
- package/dist/components/scenes/app/FeedbackScreenshot.svelte +64 -13
- package/dist/components/scenes/app/LanguageSwitch.svelte +6 -2
- package/dist/components/scenes/app/SettingsLayout.svelte +3 -1
- package/dist/components/scenes/app/ThemeSelector.svelte +29 -5
- package/dist/components/scenes/app/ThemeToggle.svelte +6 -2
- package/dist/components/scenes/app/WorkspaceLayout.svelte +1 -1
- package/dist/components/scenes/app/feedback-functions.js +6 -2
- package/dist/components/scenes/charts/Chart.svelte +55 -21
- package/dist/components/scenes/charts/Chart.svelte.d.ts +0 -1
- package/dist/components/scenes/charts/ChartLoadError.svelte +13 -0
- package/dist/components/scenes/charts/ChartLoadError.svelte.d.ts +6 -0
- package/dist/components/scenes/charts/DashboardGrid.svelte +34 -0
- package/dist/components/scenes/charts/DashboardGrid.svelte.d.ts +15 -0
- package/dist/components/scenes/charts/MetricCard.svelte +69 -0
- package/dist/components/scenes/charts/MetricCard.svelte.d.ts +15 -0
- package/dist/components/scenes/charts/ReportCard.svelte +48 -0
- package/dist/components/scenes/charts/ReportCard.svelte.d.ts +15 -0
- package/dist/components/scenes/charts/chart-presets.d.ts +15 -0
- package/dist/components/scenes/charts/chart-presets.js +56 -0
- package/dist/components/scenes/charts/chart-types.d.ts +13 -2
- package/dist/components/scenes/charts/dashboard-types.d.ts +79 -0
- package/dist/components/scenes/charts/dashboard-types.js +1 -0
- package/dist/components/scenes/charts/index.d.ts +6 -2
- package/dist/components/scenes/charts/index.js +4 -1
- package/dist/components/scenes/charts/renderers/AreaChart.svelte +1 -0
- package/dist/components/scenes/charts/renderers/AreaChart.svelte.d.ts +1 -0
- package/dist/components/scenes/charts/renderers/BarChart.svelte +1 -0
- package/dist/components/scenes/charts/renderers/BarChart.svelte.d.ts +1 -0
- package/dist/components/scenes/charts/renderers/LineChart.svelte +39 -12
- package/dist/components/scenes/charts/renderers/LineChart.svelte.d.ts +1 -0
- package/dist/components/scenes/charts/renderers/PieChart.svelte +1 -0
- package/dist/components/scenes/charts/renderers/PieChart.svelte.d.ts +1 -0
- package/dist/components/scenes/charts/renderers/ScatterChart.svelte +1 -0
- package/dist/components/scenes/charts/renderers/ScatterChart.svelte.d.ts +1 -0
- package/dist/components/scenes/code/CodeWorkspace.svelte +946 -0
- package/dist/components/scenes/code/CodeWorkspace.svelte.d.ts +21 -0
- package/dist/components/scenes/code/CodeWorkspaceEditor.svelte +737 -0
- package/dist/components/scenes/code/CodeWorkspaceEditor.svelte.d.ts +37 -0
- package/dist/components/scenes/code/CodeWorkspaceGutter.svelte +246 -0
- package/dist/components/scenes/code/CodeWorkspaceGutter.svelte.d.ts +23 -0
- package/dist/components/scenes/code/CodeWorkspaceSearch.svelte +234 -0
- package/dist/components/scenes/code/CodeWorkspaceSearch.svelte.d.ts +23 -0
- package/dist/components/scenes/code/CodeWorkspaceTree.svelte +519 -0
- package/dist/components/scenes/code/CodeWorkspaceTree.svelte.d.ts +26 -0
- package/dist/components/scenes/code/code-editor.d.ts +12 -0
- package/dist/components/scenes/code/code-editor.js +93 -0
- package/dist/components/scenes/code/code-types.d.ts +346 -0
- package/dist/components/scenes/code/code-types.js +1 -0
- package/dist/components/scenes/code/index.d.ts +2 -0
- package/dist/components/scenes/code/index.js +1 -0
- package/dist/components/scenes/code/workers/css.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/css.worker.js +1 -0
- package/dist/components/scenes/code/workers/editor.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/editor.worker.js +1 -0
- package/dist/components/scenes/code/workers/html.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/html.worker.js +1 -0
- package/dist/components/scenes/code/workers/json.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/json.worker.js +1 -0
- package/dist/components/scenes/code/workers/ts.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/ts.worker.js +1 -0
- package/dist/components/scenes/crud/CrudDetailDrawer.svelte +6 -2
- package/dist/components/scenes/crud/CrudDetailPanel.svelte +6 -2
- package/dist/components/scenes/crud/CrudEditPanel.svelte +41 -12
- package/dist/components/scenes/crud/CrudPage.svelte +34 -9
- package/dist/components/scenes/crud/crud-controller.svelte.js +23 -8
- package/dist/components/scenes/crud/crud-form-validation.js +27 -9
- package/dist/components/scenes/crypto/EncryptedInput.svelte +9 -3
- package/dist/components/scenes/error/error-presets.js +30 -5
- package/dist/components/scenes/guide/GuideHostContent.svelte +7 -1
- package/dist/components/scenes/guide/HelpCenter.svelte +23 -4
- package/dist/components/scenes/iam/AgreementNotice.svelte +9 -3
- package/dist/components/scenes/iam/AuthPanel.svelte +74 -16
- package/dist/components/scenes/iam/ChangePasswordForm.svelte +6 -2
- package/dist/components/scenes/iam/ForgotPasswordForm.svelte +9 -3
- package/dist/components/scenes/iam/LoginForm.svelte +32 -8
- package/dist/components/scenes/iam/PasswordInput.svelte +50 -12
- package/dist/components/scenes/iam/RegisterForm.svelte +11 -3
- package/dist/components/scenes/iam/ResetPasswordForm.svelte +6 -2
- package/dist/components/scenes/iam/SensitiveOperationsForm.svelte +3 -1
- package/dist/components/scenes/iam/SessionRecoveryDialog.svelte +4 -1
- package/dist/components/scenes/iam/UserProfile.svelte +41 -14
- package/dist/components/scenes/iam/auth-captcha.js +9 -2
- package/dist/components/scenes/iam/auth-error-message.d.ts +2 -2
- package/dist/components/scenes/iam/auth-error-message.js +16 -3
- package/dist/components/scenes/iam/password-utils.js +9 -2
- package/dist/components/scenes/iam/sensitive-actions.svelte.js +4 -1
- package/dist/components/scenes/index.d.ts +1 -0
- package/dist/components/scenes/index.js +2 -0
- package/dist/components/scenes/storage/FileList.svelte +3 -1
- package/dist/components/scenes/storage/FileUpload.svelte +7 -2
- package/dist/components/scenes/types.d.ts +2 -2
- package/dist/guide-storage.js +12 -4
- package/dist/guide.svelte.js +59 -16
- package/dist/i18n.svelte.js +9 -3
- package/dist/internal/dialog-focus.d.ts +19 -0
- package/dist/internal/dialog-focus.js +104 -4
- package/dist/internal/form-validation.svelte.js +46 -15
- package/dist/internal/icon-safety.js +6 -2
- package/dist/message.svelte.js +6 -2
- package/dist/messagebox.svelte.js +6 -2
- package/dist/messages/en-US.json +60 -2
- package/dist/messages/ja-JP.json +60 -2
- package/dist/messages/zh-CN.json +60 -2
- package/dist/styles/eye-care.css +55 -0
- package/dist/styles/global.css +16 -0
- package/dist/styles/theme.css +1 -0
- package/dist/theme-config.d.ts +1 -3
- package/dist/theme-config.js +137 -22
- package/dist/toast.svelte.js +27 -7
- package/dist/types.d.ts +3 -3
- package/dist/utils.js +6 -2
- package/package.json +25 -19
|
@@ -230,7 +230,9 @@
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
function normalizeColumnType(value: unknown): AiTableColumnType {
|
|
233
|
-
return value === 'number' || value === 'tag'
|
|
233
|
+
return value === 'number' || value === 'tag'
|
|
234
|
+
? value
|
|
235
|
+
: 'text'
|
|
234
236
|
}
|
|
235
237
|
|
|
236
238
|
function serializeTableDataForComparison(
|
|
@@ -265,7 +267,9 @@
|
|
|
265
267
|
|
|
266
268
|
const key = typeof item.key === 'string' && item.key.trim()
|
|
267
269
|
? item.key.trim()
|
|
268
|
-
: (typeof item.name === 'string'
|
|
270
|
+
: (typeof item.name === 'string'
|
|
271
|
+
? item.name.trim()
|
|
272
|
+
: '')
|
|
269
273
|
if (!key || usedKeys.has(key)) {
|
|
270
274
|
continue
|
|
271
275
|
}
|
|
@@ -515,10 +519,14 @@
|
|
|
515
519
|
if (isRecord(parsedWhole)) {
|
|
516
520
|
const columns = Array.isArray(parsedWhole.table_columns)
|
|
517
521
|
? normalizeTableColumns(parsedWhole.table_columns)
|
|
518
|
-
: (Array.isArray(parsedWhole.columns)
|
|
522
|
+
: (Array.isArray(parsedWhole.columns)
|
|
523
|
+
? normalizeTableColumns(parsedWhole.columns)
|
|
524
|
+
: [])
|
|
519
525
|
const rows = Array.isArray(parsedWhole.table_rows)
|
|
520
526
|
? normalizeTableRows(parsedWhole.table_rows)
|
|
521
|
-
: (Array.isArray(parsedWhole.rows)
|
|
527
|
+
: (Array.isArray(parsedWhole.rows)
|
|
528
|
+
? normalizeTableRows(parsedWhole.rows)
|
|
529
|
+
: [])
|
|
522
530
|
|
|
523
531
|
if (columns.length > 0 || rows.length > 0) {
|
|
524
532
|
return {
|
|
@@ -540,8 +548,12 @@
|
|
|
540
548
|
return null
|
|
541
549
|
}
|
|
542
550
|
|
|
543
|
-
const columns = columnsChunk
|
|
544
|
-
|
|
551
|
+
const columns = columnsChunk
|
|
552
|
+
? parseTableColumnsFromChunk(columnsChunk)
|
|
553
|
+
: []
|
|
554
|
+
const rows = rowsChunk
|
|
555
|
+
? parseTableRowsFromChunk(rowsChunk)
|
|
556
|
+
: []
|
|
545
557
|
if (columns.length === 0 && rows.length === 0) {
|
|
546
558
|
return null
|
|
547
559
|
}
|
|
@@ -781,7 +793,9 @@
|
|
|
781
793
|
}
|
|
782
794
|
|
|
783
795
|
const rowBounds = currentTarget.getBoundingClientRect()
|
|
784
|
-
return event.clientY < rowBounds.top + rowBounds.height / 2
|
|
796
|
+
return event.clientY < rowBounds.top + rowBounds.height / 2
|
|
797
|
+
? 'before'
|
|
798
|
+
: 'after'
|
|
785
799
|
}
|
|
786
800
|
|
|
787
801
|
function updateRowDropHint(rowId: string, event: DragEvent): void {
|
|
@@ -1067,7 +1081,9 @@
|
|
|
1067
1081
|
function resolveBodyRowClass(rowId: string): string {
|
|
1068
1082
|
return cn(
|
|
1069
1083
|
'hai-ai-table-body-row',
|
|
1070
|
-
draggingRowId === rowId
|
|
1084
|
+
draggingRowId === rowId
|
|
1085
|
+
? 'hai-ai-table-body-row--dragging'
|
|
1086
|
+
: '',
|
|
1071
1087
|
isDropIndicatorVisible(rowId, 'before')
|
|
1072
1088
|
? 'hai-ai-table-body-row--drop-before'
|
|
1073
1089
|
: '',
|
|
@@ -1175,7 +1191,9 @@
|
|
|
1175
1191
|
<td>
|
|
1176
1192
|
<input
|
|
1177
1193
|
class={resolveCellInputClass(column.type)}
|
|
1178
|
-
type={column.type === 'number'
|
|
1194
|
+
type={column.type === 'number'
|
|
1195
|
+
? 'number'
|
|
1196
|
+
: 'text'}
|
|
1179
1197
|
value={cellInputValue}
|
|
1180
1198
|
title={cellInputValue}
|
|
1181
1199
|
disabled={!editable}
|
|
@@ -1242,13 +1260,7 @@
|
|
|
1242
1260
|
|
|
1243
1261
|
<style>
|
|
1244
1262
|
.hai-ai-table-pane {
|
|
1245
|
-
|
|
1246
|
-
主题变量兼容层:
|
|
1247
|
-
- hai-mate Web 端主要使用 daisyUI v5 的 `--color-*` 语义变量;
|
|
1248
|
-
- 组件库内部分场景仍可能提供旧版 `--b1/--bc/--p` 通道变量;
|
|
1249
|
-
- 这里统一抽象为 AiTableEditor 私有变量,确保在两套主题体系下都能稳定着色。
|
|
1250
|
-
*/
|
|
1251
|
-
--hai-ai-table-bg: var(--color-base-100, var(--color-base-100, oklch(1 0 0)));
|
|
1263
|
+
--hai-ai-table-bg: var(--color-base-100, oklch(1 0 0));
|
|
1252
1264
|
--hai-ai-table-bg-soft: var(--color-base-200, var(--color-base-200, oklch(0.97 0 0)));
|
|
1253
1265
|
--hai-ai-table-fg: var(--color-base-content, var(--color-base-content, oklch(0.22 0 0)));
|
|
1254
1266
|
--hai-ai-table-primary: var(--color-primary, var(--color-primary, oklch(0.62 0.2 258)));
|
|
@@ -27,7 +27,12 @@
|
|
|
27
27
|
|
|
28
28
|
let {
|
|
29
29
|
report,
|
|
30
|
-
evidence = {
|
|
30
|
+
evidence = {
|
|
31
|
+
items: [],
|
|
32
|
+
total: 0,
|
|
33
|
+
page: 1,
|
|
34
|
+
pageSize: 20,
|
|
35
|
+
},
|
|
31
36
|
attachments = [],
|
|
32
37
|
history = [],
|
|
33
38
|
webhook,
|
|
@@ -78,13 +83,34 @@
|
|
|
78
83
|
let errorId = $derived(evidenceQuery.errorId ?? '')
|
|
79
84
|
let kind = $derived(evidenceQuery.kind ?? '')
|
|
80
85
|
const tabs = $derived([
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
{
|
|
87
|
+
key: 'overview',
|
|
88
|
+
label: uiM('feedback_overview'),
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: 'scene',
|
|
92
|
+
label: uiM('feedback_scene'),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'replay',
|
|
96
|
+
label: uiM('feedback_replay'),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
key: 'logs',
|
|
100
|
+
label: uiM('feedback_logs'),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: 'business',
|
|
104
|
+
label: uiM('feedback_business'),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: 'environment',
|
|
108
|
+
label: uiM('feedback_environment'),
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: 'history',
|
|
112
|
+
label: uiM('feedback_history'),
|
|
113
|
+
},
|
|
88
114
|
])
|
|
89
115
|
|
|
90
116
|
async function run(action: (() => void | Promise<void>) | undefined) {
|
|
@@ -103,7 +129,10 @@
|
|
|
103
129
|
}
|
|
104
130
|
}
|
|
105
131
|
async function query(next: Partial<FeedbackEvidenceQuery>) {
|
|
106
|
-
evidenceQuery = {
|
|
132
|
+
evidenceQuery = {
|
|
133
|
+
...evidenceQuery,
|
|
134
|
+
...next,
|
|
135
|
+
}
|
|
107
136
|
const generation = ++queryGeneration
|
|
108
137
|
querying = true
|
|
109
138
|
actionError = ''
|
|
@@ -120,18 +149,41 @@
|
|
|
120
149
|
}
|
|
121
150
|
}
|
|
122
151
|
function changeTab(tab: string) {
|
|
123
|
-
if (tab === 'environment')
|
|
124
|
-
void query({
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
152
|
+
if (tab === 'environment') {
|
|
153
|
+
void query({
|
|
154
|
+
page: 1,
|
|
155
|
+
kind: 'environment',
|
|
156
|
+
requestId: undefined,
|
|
157
|
+
errorId: undefined,
|
|
158
|
+
})
|
|
159
|
+
}
|
|
160
|
+
else if (tab === 'scene') {
|
|
161
|
+
void query({
|
|
162
|
+
page: 1,
|
|
163
|
+
kind: 'interaction',
|
|
164
|
+
requestId: undefined,
|
|
165
|
+
errorId: undefined,
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
else if (tab === 'logs') {
|
|
128
169
|
void query({ page: 1, kind: undefined })
|
|
129
|
-
|
|
130
|
-
|
|
170
|
+
}
|
|
171
|
+
else if (tab === 'business') {
|
|
172
|
+
void query({
|
|
173
|
+
page: 1,
|
|
174
|
+
kind: 'business',
|
|
175
|
+
requestId: undefined,
|
|
176
|
+
errorId: undefined,
|
|
177
|
+
})
|
|
178
|
+
}
|
|
131
179
|
}
|
|
132
180
|
useToastFeedback(() => error || actionError)
|
|
133
|
-
useToastFeedback(() => permissions.read === false
|
|
134
|
-
|
|
181
|
+
useToastFeedback(() => permissions.read === false
|
|
182
|
+
? uiM('feedback_permission_denied')
|
|
183
|
+
: '', 'warning')
|
|
184
|
+
useToastFeedback(() => failedPreviews.length
|
|
185
|
+
? uiM('feedback_preview_failed')
|
|
186
|
+
: '', 'warning')
|
|
135
187
|
</script>
|
|
136
188
|
|
|
137
189
|
<section {...dataAttributes} class={`feedback-detail min-w-0 space-y-4 ${className}`} aria-label={uiM('feedback_details')}>
|
|
@@ -139,7 +191,11 @@
|
|
|
139
191
|
<header class='flex flex-wrap items-center justify-between gap-3'>
|
|
140
192
|
<div class='min-w-0'><h2 class='text-xl font-semibold break-all'>{report.number}</h2><p class='text-sm text-base-content/65'>{report.appId} · {report.appVersion || '—'} · {feedbackTime(report.createdAt)}</p></div>
|
|
141
193
|
<div class='flex flex-wrap items-center gap-2'>
|
|
142
|
-
<Badge variant={report.status === 'handled'
|
|
194
|
+
<Badge variant={report.status === 'handled'
|
|
195
|
+
? 'success'
|
|
196
|
+
: 'ghost'}>{uiM(report.status === 'handled'
|
|
197
|
+
? 'feedback_handled'
|
|
198
|
+
: 'feedback_pending')}</Badge>
|
|
143
199
|
{#if permissions.export && onexport}<Button size='sm' disabled={busy} onclick={() => run(() => onexport(report!))}>{uiM('feedback_export')}</Button>{/if}
|
|
144
200
|
{#if onclose}<Button size='sm' variant='ghost' onclick={onclose}>{uiM('feedback_close')}</Button>{/if}
|
|
145
201
|
</div>
|
|
@@ -154,7 +210,11 @@
|
|
|
154
210
|
<div><dt class='text-base-content/55'>{uiM('feedback_collection')}</dt><dd>{collectionLabel(report.collectionStatus)}</dd></div>
|
|
155
211
|
<div><dt class='text-base-content/55'>{uiM('feedback_notification')}</dt><dd>{notificationLabel(report.notificationStatus)}</dd></div>
|
|
156
212
|
{#if webhook}
|
|
157
|
-
<div><dt class='text-base-content/55'>{uiM('feedback_webhook')}</dt><dd>{notificationLabel(webhook.status === 'succeeded'
|
|
213
|
+
<div><dt class='text-base-content/55'>{uiM('feedback_webhook')}</dt><dd>{notificationLabel(webhook.status === 'succeeded'
|
|
214
|
+
? 'sent'
|
|
215
|
+
: webhook.status === 'running'
|
|
216
|
+
? 'sending'
|
|
217
|
+
: webhook.status)} · {uiM('feedback_attempts')}: {webhook.attempts}</dd>{#if webhook.lastError}<dd><Button variant='ghost' size='sm' onclick={() => toast.error(webhook!.lastError!)}>{uiM('toast_diagnostics')}</Button></dd>{/if}</div>
|
|
158
218
|
{/if}
|
|
159
219
|
<div><dt class='text-base-content/55'>{uiM('feedback_submitter')}</dt><dd class='break-all'>{report.userId || '—'}</dd></div>
|
|
160
220
|
<div><dt class='text-base-content/55'>{uiM('feedback_revision')}</dt><dd>{report.evidenceRevision}</dd></div>
|
|
@@ -186,7 +246,12 @@
|
|
|
186
246
|
{#if tab === 'logs'}
|
|
187
247
|
<form onsubmit={(event) => {
|
|
188
248
|
event.preventDefault()
|
|
189
|
-
void query({
|
|
249
|
+
void query({
|
|
250
|
+
page: 1,
|
|
251
|
+
kind: kind || undefined,
|
|
252
|
+
requestId: requestId || undefined,
|
|
253
|
+
errorId: errorId || undefined,
|
|
254
|
+
})
|
|
190
255
|
}}>
|
|
191
256
|
<FormLayout columns={2}>
|
|
192
257
|
<FormField label={uiM('feedback_kind')}><Input bind:value={kind} /></FormField>
|
|
@@ -212,16 +277,29 @@
|
|
|
212
277
|
{#if onstatus && ((report.status === 'pending' && permissions.process) || (report.status === 'handled' && permissions.reopen))}
|
|
213
278
|
<form class='space-y-3' onsubmit={(event) => {
|
|
214
279
|
event.preventDefault()
|
|
215
|
-
void run(() => onstatus({
|
|
280
|
+
void run(() => onstatus({
|
|
281
|
+
id: report!.id,
|
|
282
|
+
status: report!.status === 'pending'
|
|
283
|
+
? 'handled'
|
|
284
|
+
: 'pending',
|
|
285
|
+
expectedVersion: report!.version,
|
|
286
|
+
note: note.trim() || undefined,
|
|
287
|
+
}))
|
|
216
288
|
}}>
|
|
217
289
|
<FormLayout><FormField label={uiM('feedback_note')}><Textarea bind:value={note} maxlength={4000} disabled={busy} /></FormField></FormLayout>
|
|
218
|
-
<Button type='submit' variant='primary' loading={busy}>{uiM(report.status === 'pending'
|
|
290
|
+
<Button type='submit' variant='primary' loading={busy}>{uiM(report.status === 'pending'
|
|
291
|
+
? 'feedback_handle'
|
|
292
|
+
: 'feedback_reopen')}</Button>
|
|
219
293
|
</form>
|
|
220
294
|
{/if}
|
|
221
295
|
{#if permissions.retry && onretry && (report.notificationStatus === 'failed' || report.collectionStatus === 'partial' || report.collectionStatus === 'failed')}<Button size='sm' disabled={busy} onclick={() => run(() => onretry(report!))}>{uiM('feedback_retry')}</Button>{/if}
|
|
222
296
|
<ol class='space-y-3'>
|
|
223
297
|
{#each history as change (change.id)}
|
|
224
|
-
<li class='rounded-lg border border-base-content/10 p-3 text-sm'><p class='text-base-content/60'>{feedbackTime(change.createdAt)} · {change.actorId}</p><p>{uiM(change.fromStatus === 'handled'
|
|
298
|
+
<li class='rounded-lg border border-base-content/10 p-3 text-sm'><p class='text-base-content/60'>{feedbackTime(change.createdAt)} · {change.actorId}</p><p>{uiM(change.fromStatus === 'handled'
|
|
299
|
+
? 'feedback_handled'
|
|
300
|
+
: 'feedback_pending')} → {uiM(change.toStatus === 'handled'
|
|
301
|
+
? 'feedback_handled'
|
|
302
|
+
: 'feedback_pending')}</p>{#if change.note}<p class='mt-1 whitespace-pre-wrap break-words'>{change.note}</p>{/if}</li>
|
|
225
303
|
{/each}
|
|
226
304
|
</ol>
|
|
227
305
|
</div>
|
|
@@ -115,15 +115,37 @@
|
|
|
115
115
|
let previousKey = $state(untrack(() => resetKey))
|
|
116
116
|
const visibleAttachments = $derived(attachments.filter(item => !removedAttachmentIds.includes(item.id)))
|
|
117
117
|
const attachmentBytes = $derived(visibleAttachments.reduce((total, file) => total + (file.size ?? 0), 0))
|
|
118
|
-
const recordingBytes = $derived(budget
|
|
119
|
-
|
|
118
|
+
const recordingBytes = $derived(budget
|
|
119
|
+
? Math.max(0, Math.min(budget.maxAttachmentBytes, budget.maxAttachmentsBytes - attachmentBytes))
|
|
120
|
+
: undefined)
|
|
121
|
+
const attachmentLimitReached = $derived(budget
|
|
122
|
+
? visibleAttachments.length >= budget.maxAttachmentCount || attachmentBytes >= budget.maxAttachmentsBytes
|
|
123
|
+
: false)
|
|
120
124
|
const materialGroups = $derived([
|
|
121
|
-
{
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{
|
|
126
|
-
|
|
125
|
+
{
|
|
126
|
+
label: uiM('feedback_environment'),
|
|
127
|
+
kinds: ['environment'],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
label: uiM('feedback_logs'),
|
|
131
|
+
kinds: ['log', 'error', 'request'],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
label: uiM('feedback_scene'),
|
|
135
|
+
kinds: ['interaction', 'snapshot', 'business'],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: uiM('feedback_replay'),
|
|
139
|
+
kinds: ['replay'],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: uiM('feedback_missing'),
|
|
143
|
+
kinds: ['missing'],
|
|
144
|
+
},
|
|
145
|
+
].map(group => ({
|
|
146
|
+
...group,
|
|
147
|
+
items: evidence.filter(item => group.kinds.includes(item.kind)),
|
|
148
|
+
})).filter(group => group.items.length))
|
|
127
149
|
const typeOptions = $derived([
|
|
128
150
|
{ value: 'bug', label: labels.types?.bug ?? uiM('feedback_type_bug') },
|
|
129
151
|
{ value: 'feature', label: labels.types?.feature ?? uiM('feedback_type_feature') },
|
|
@@ -145,7 +167,13 @@
|
|
|
145
167
|
})
|
|
146
168
|
|
|
147
169
|
function values(): FeedbackFormData {
|
|
148
|
-
return {
|
|
170
|
+
return {
|
|
171
|
+
description: description.trim(),
|
|
172
|
+
type: feedbackType,
|
|
173
|
+
contact: contact.trim() || undefined,
|
|
174
|
+
files: [...files],
|
|
175
|
+
removedAttachmentIds: [...removedAttachmentIds],
|
|
176
|
+
}
|
|
149
177
|
}
|
|
150
178
|
|
|
151
179
|
async function submit(event: SubmitEvent) {
|
|
@@ -222,7 +250,10 @@
|
|
|
222
250
|
}
|
|
223
251
|
|
|
224
252
|
function selectFiles(event: Event & { currentTarget: HTMLInputElement }) {
|
|
225
|
-
files = [
|
|
253
|
+
files = [
|
|
254
|
+
...files,
|
|
255
|
+
...Array.from(event.currentTarget.files ?? []),
|
|
256
|
+
]
|
|
226
257
|
// 清空原生选择值允许再次选择同名文件,不绑定浏览器的文件路径。
|
|
227
258
|
event.currentTarget.value = ''
|
|
228
259
|
if (onfileschange)
|
|
@@ -243,13 +274,20 @@
|
|
|
243
274
|
await stageFiles()
|
|
244
275
|
}
|
|
245
276
|
useToastFeedback(() => error)
|
|
246
|
-
useToastFeedback(() => receipt
|
|
277
|
+
useToastFeedback(() => receipt
|
|
278
|
+
? uiM('feedback_accepted', { number: receipt.number })
|
|
279
|
+
: '', 'success')
|
|
247
280
|
</script>
|
|
248
281
|
|
|
249
282
|
<form {...dataAttributes} class={`feedback-form flex min-h-0 min-w-0 flex-1 flex-col gap-4 ${className}`} onsubmit={submit} data-feedback-ui='true' data-feedback-ignore='true'>
|
|
250
283
|
<div class='min-h-0 flex-1 space-y-4 overflow-y-auto'>
|
|
251
284
|
{#if budget}
|
|
252
|
-
<p class='text-xs text-base-content/60'>{uiM('feedback_capacity_hint', {
|
|
285
|
+
<p class='text-xs text-base-content/60'>{uiM('feedback_capacity_hint', {
|
|
286
|
+
used: (attachments.filter(item => !removedAttachmentIds.includes(item.id)).reduce((sum, item) => sum + (item.size ?? 0), 0) / 1048576).toFixed(1),
|
|
287
|
+
total: (budget.maxAttachmentsBytes / 1048576).toFixed(1),
|
|
288
|
+
single: (budget.maxAttachmentBytes / 1048576).toFixed(1),
|
|
289
|
+
count: budget.maxAttachmentCount,
|
|
290
|
+
})}</p>
|
|
253
291
|
{/if}
|
|
254
292
|
{#if receipt}
|
|
255
293
|
<div data-testid='feedback-receipt' class='rounded-lg border border-base-content/10 bg-base-200/50 p-4 space-y-2 break-words'>
|
|
@@ -287,7 +325,9 @@
|
|
|
287
325
|
<Button size='xs' variant='ghost' disabled={loading || annotating || exporting} ariaLabel={`${uiM('feedback_remove')} ${attachment.name}`} onclick={() => removedAttachmentIds = [...removedAttachmentIds, attachment.id]}>{uiM('feedback_remove')}</Button>
|
|
288
326
|
</div>
|
|
289
327
|
</div>
|
|
290
|
-
{#if attachment.mimeType?.startsWith('image/') && attachment.url}<FeedbackScreenshot {attachment} onannotate={!loading && !exporting && !staging && onannotate
|
|
328
|
+
{#if attachment.mimeType?.startsWith('image/') && attachment.url}<FeedbackScreenshot {attachment} onannotate={!loading && !exporting && !staging && onannotate
|
|
329
|
+
? annotate
|
|
330
|
+
: undefined} />{/if}
|
|
291
331
|
{#if attachment.mimeType?.startsWith('video/') && attachment.url}<!-- svelte-ignore a11y_media_has_caption (用户上传的无声录屏) -->
|
|
292
332
|
<video src={attachment.url} controls preload='metadata' class='max-w-full rounded' aria-label={attachment.name}></video>{/if}
|
|
293
333
|
{#if attachment.missingReason}<Button size='sm' variant='ghost' onclick={() => toast.warning(`${uiM('feedback_missing')}: ${attachment.missingReason}`)}>{uiM('feedback_missing')}</Button>{/if}
|
|
@@ -313,7 +353,9 @@
|
|
|
313
353
|
<dt class='font-medium'>{group.label} · {group.items.length}</dt>
|
|
314
354
|
<dd class='space-y-2 pt-2'>
|
|
315
355
|
{#each group.items as item (item.id)}
|
|
316
|
-
<details class='rounded bg-base-200 p-2' ontoggle={event => expandedMaterials = event.currentTarget.open
|
|
356
|
+
<details class='rounded bg-base-200 p-2' ontoggle={event => expandedMaterials = event.currentTarget.open
|
|
357
|
+
? [...expandedMaterials, item.id]
|
|
358
|
+
: expandedMaterials.filter(id => id !== item.id)}>
|
|
317
359
|
<summary class='cursor-pointer break-all text-xs'>{feedbackTime(item.timestamp)} · {item.kind} · {item.source} #{item.sequence}</summary>
|
|
318
360
|
{#if expandedMaterials.includes(item.id)}<pre class='mt-2 max-h-64 max-w-full overflow-auto whitespace-pre-wrap break-all text-xs'>{evidenceText(item.data)}</pre>{/if}
|
|
319
361
|
</details>
|
|
@@ -322,7 +364,17 @@
|
|
|
322
364
|
</div>
|
|
323
365
|
{/each}
|
|
324
366
|
{#each evidenceSummary as item, index (`${item.label}:${index}`)}
|
|
325
|
-
<div class='min-w-0'><dt class='font-medium'>{item.label}{item.count === undefined
|
|
367
|
+
<div class='min-w-0'><dt class='font-medium'>{item.label}{item.count === undefined
|
|
368
|
+
? ''
|
|
369
|
+
: ` · ${item.count}`}</dt><dd class='text-base-content/65 break-words'>{item.status === 'missing'
|
|
370
|
+
? uiM('feedback_missing')
|
|
371
|
+
: item.status === 'not-applicable'
|
|
372
|
+
? uiM('feedback_not_applicable')
|
|
373
|
+
: item.status === 'partial'
|
|
374
|
+
? uiM('feedback_partial')
|
|
375
|
+
: uiM('feedback_complete')}{item.detail
|
|
376
|
+
? ` · ${item.detail}`
|
|
377
|
+
: ''}</dd></div>
|
|
326
378
|
{/each}
|
|
327
379
|
</dl>
|
|
328
380
|
</details>
|
|
@@ -331,7 +383,9 @@
|
|
|
331
383
|
</div>
|
|
332
384
|
<div class='shrink-0 flex flex-wrap justify-end gap-2 border-t border-base-content/10 bg-base-100 pt-4 pb-2'>
|
|
333
385
|
{#if onexport}<Button variant='ghost' loading={exporting} disabled={annotating || staging} onclick={saveLocal}>{uiM('feedback_local_export')}</Button>{/if}
|
|
334
|
-
{#if oncancel}<Button variant='ghost' onclick={oncancel}>{receipt
|
|
386
|
+
{#if oncancel}<Button variant='ghost' onclick={oncancel}>{receipt
|
|
387
|
+
? uiM('feedback_close')
|
|
388
|
+
: labels.cancel ?? uiM('feedback_cancel')}</Button>{/if}
|
|
335
389
|
{#if !receipt}<Button type='submit' variant='primary' loading={loading || staging} disabled={annotating || exporting || recording || Boolean(onfileschange && filesError)}>{labels.submit ?? uiM('feedback_submit')}</Button>{/if}
|
|
336
390
|
</div>
|
|
337
391
|
</form>
|
|
@@ -50,33 +50,114 @@
|
|
|
50
50
|
|
|
51
51
|
const dataAttributes = $derived(getDataAttributes(restProps))
|
|
52
52
|
const effectiveQuery = $derived(query ?? { page: data.page, pageSize: data.pageSize })
|
|
53
|
-
const pageSizeOptions = $derived([
|
|
53
|
+
const pageSizeOptions = $derived([
|
|
54
|
+
...new Set([data.pageSize, 10, 20, 50, 100]),
|
|
55
|
+
].sort((left, right) => left - right))
|
|
54
56
|
let actionError = $state('')
|
|
55
57
|
let busyId = $state('')
|
|
56
58
|
let search = $derived(effectiveQuery.search ?? '')
|
|
57
59
|
const sortDirection = $derived(effectiveQuery.sortDirection ?? 'desc')
|
|
58
|
-
let filterValues = $derived<Record<string, unknown>>({
|
|
60
|
+
let filterValues = $derived<Record<string, unknown>>({
|
|
61
|
+
status: effectiveQuery.status ?? '',
|
|
62
|
+
collectionStatus: effectiveQuery.collectionStatus ?? '',
|
|
63
|
+
appId: effectiveQuery.appId ?? '',
|
|
64
|
+
appVersion: effectiveQuery.appVersion ?? '',
|
|
65
|
+
from: feedbackDateValue(effectiveQuery.from),
|
|
66
|
+
to: feedbackDateValue(effectiveQuery.to),
|
|
67
|
+
})
|
|
59
68
|
const columns = $derived([
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
+
{
|
|
70
|
+
key: 'number',
|
|
71
|
+
label: uiM('feedback_number'),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'description',
|
|
75
|
+
label: uiM('feedback_summary'),
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: 'appId',
|
|
79
|
+
label: uiM('feedback_application'),
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: 'appVersion',
|
|
83
|
+
label: uiM('feedback_version'),
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: 'userId',
|
|
87
|
+
label: uiM('feedback_submitter'),
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: 'createdAt',
|
|
91
|
+
label: uiM('feedback_created_at'),
|
|
92
|
+
sortable: true,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'status',
|
|
96
|
+
label: uiM('feedback_processing'),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
key: 'collectionStatus',
|
|
100
|
+
label: uiM('feedback_collection'),
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
key: 'notificationStatus',
|
|
104
|
+
label: uiM('feedback_notification'),
|
|
105
|
+
},
|
|
69
106
|
])
|
|
70
107
|
const filterFields = $derived([
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
108
|
+
{
|
|
109
|
+
id: 'status',
|
|
110
|
+
label: uiM('feedback_processing'),
|
|
111
|
+
type: 'select',
|
|
112
|
+
options: [
|
|
113
|
+
{
|
|
114
|
+
label: uiM('feedback_pending'),
|
|
115
|
+
value: 'pending',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: uiM('feedback_handled'),
|
|
119
|
+
value: 'handled',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: 'collectionStatus',
|
|
125
|
+
label: uiM('feedback_collection'),
|
|
126
|
+
type: 'select',
|
|
127
|
+
options: [
|
|
128
|
+
'collecting',
|
|
129
|
+
'complete',
|
|
130
|
+
'partial',
|
|
131
|
+
'failed',
|
|
132
|
+
].map(value => ({
|
|
133
|
+
value,
|
|
134
|
+
label: collectionLabel(value as FeedbackReportView['collectionStatus']),
|
|
135
|
+
})),
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
id: 'appId',
|
|
139
|
+
label: uiM('feedback_application'),
|
|
140
|
+
type: 'text',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 'appVersion',
|
|
144
|
+
label: uiM('feedback_version'),
|
|
145
|
+
type: 'text',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: 'createdAt',
|
|
149
|
+
label: uiM('feedback_date_range'),
|
|
150
|
+
type: 'date-range',
|
|
151
|
+
startKey: 'from',
|
|
152
|
+
endKey: 'to',
|
|
153
|
+
},
|
|
76
154
|
])
|
|
77
155
|
|
|
78
156
|
function update(next: Partial<FeedbackListQuery>) {
|
|
79
|
-
return applyQuery({
|
|
157
|
+
return applyQuery({
|
|
158
|
+
...effectiveQuery,
|
|
159
|
+
...next,
|
|
160
|
+
})
|
|
80
161
|
}
|
|
81
162
|
async function applyQuery(next: FeedbackListQuery) {
|
|
82
163
|
query = next
|
|
@@ -91,7 +172,29 @@
|
|
|
91
172
|
function filter(values: Record<string, unknown>) {
|
|
92
173
|
const from = feedbackDayBoundary(values.from, 'start')
|
|
93
174
|
const to = feedbackDayBoundary(values.to, 'end')
|
|
94
|
-
void update({
|
|
175
|
+
void update({
|
|
176
|
+
page: 1,
|
|
177
|
+
search: search.trim() || undefined,
|
|
178
|
+
status: values.status === 'pending' || values.status === 'handled'
|
|
179
|
+
? values.status
|
|
180
|
+
: undefined,
|
|
181
|
+
collectionStatus: [
|
|
182
|
+
'collecting',
|
|
183
|
+
'complete',
|
|
184
|
+
'partial',
|
|
185
|
+
'failed',
|
|
186
|
+
].includes(String(values.collectionStatus))
|
|
187
|
+
? values.collectionStatus as FeedbackReportView['collectionStatus']
|
|
188
|
+
: undefined,
|
|
189
|
+
appId: String(values.appId ?? '') || undefined,
|
|
190
|
+
appVersion: String(values.appVersion ?? '') || undefined,
|
|
191
|
+
from: Number.isFinite(from)
|
|
192
|
+
? from
|
|
193
|
+
: undefined,
|
|
194
|
+
to: Number.isFinite(to)
|
|
195
|
+
? to
|
|
196
|
+
: undefined,
|
|
197
|
+
})
|
|
95
198
|
}
|
|
96
199
|
async function run(report: FeedbackReportView, action: (() => void | Promise<void>) | undefined) {
|
|
97
200
|
if (!action || busyId)
|
|
@@ -109,7 +212,9 @@
|
|
|
109
212
|
}
|
|
110
213
|
}
|
|
111
214
|
useToastFeedback(() => error || actionError)
|
|
112
|
-
useToastFeedback(() => permissions.read === false
|
|
215
|
+
useToastFeedback(() => permissions.read === false
|
|
216
|
+
? uiM('feedback_permission_denied')
|
|
217
|
+
: '', 'warning')
|
|
113
218
|
</script>
|
|
114
219
|
|
|
115
220
|
<section {...dataAttributes} class={`feedback-list flex min-h-0 min-w-0 flex-1 flex-col gap-3 ${className}`} aria-label={uiM('feedback_list_title')}>
|
|
@@ -126,7 +231,11 @@
|
|
|
126
231
|
{:else if key === 'appVersion'}{item.appVersion || '—'}
|
|
127
232
|
{:else if key === 'userId'}<span class='block max-w-36 truncate' title={item.userId}>{item.userId || '—'}</span>
|
|
128
233
|
{:else if key === 'createdAt'}{feedbackTime(item.createdAt)}
|
|
129
|
-
{:else if key === 'status'}<Badge size='sm' variant={item.status === 'handled'
|
|
234
|
+
{:else if key === 'status'}<Badge size='sm' variant={item.status === 'handled'
|
|
235
|
+
? 'success'
|
|
236
|
+
: 'ghost'}>{uiM(item.status === 'handled'
|
|
237
|
+
? 'feedback_handled'
|
|
238
|
+
: 'feedback_pending')}</Badge>
|
|
130
239
|
{:else if key === 'collectionStatus'}<span class:text-warning={item.collectionStatus === 'failed' || item.collectionStatus === 'partial'}>{collectionLabel(item.collectionStatus)}</span>
|
|
131
240
|
{:else if key === 'notificationStatus'}{notificationLabel(item.notificationStatus)}{/if}
|
|
132
241
|
{/snippet}
|
|
@@ -134,7 +243,15 @@
|
|
|
134
243
|
<div class='inline-flex flex-nowrap items-center gap-1'>
|
|
135
244
|
{#if onview}<Button size='xs' variant='ghost' disabled={Boolean(busyId)} onclick={() => run(item, () => onview(item))}>{uiM('feedback_details')}</Button>{/if}
|
|
136
245
|
{#if onstatus && ((item.status === 'pending' && permissions.process) || (item.status === 'handled' && permissions.reopen))}
|
|
137
|
-
<Button size='xs' variant='ghost' loading={busyId === item.id} disabled={Boolean(busyId)} onclick={() => run(item, () => onstatus({
|
|
246
|
+
<Button size='xs' variant='ghost' loading={busyId === item.id} disabled={Boolean(busyId)} onclick={() => run(item, () => onstatus({
|
|
247
|
+
id: item.id,
|
|
248
|
+
status: item.status === 'pending'
|
|
249
|
+
? 'handled'
|
|
250
|
+
: 'pending',
|
|
251
|
+
expectedVersion: item.version,
|
|
252
|
+
}))}>{uiM(item.status === 'pending'
|
|
253
|
+
? 'feedback_handle'
|
|
254
|
+
: 'feedback_reopen')}</Button>
|
|
138
255
|
{/if}
|
|
139
256
|
{#if permissions.export && onexport}<Button size='xs' variant='ghost' disabled={Boolean(busyId)} onclick={() => run(item, () => onexport(item))}>{uiM('feedback_export')}</Button>{/if}
|
|
140
257
|
{#if permissions.retry && onretry && (item.collectionStatus === 'partial' || item.collectionStatus === 'failed' || item.notificationStatus === 'failed')}<Button size='xs' variant='ghost' disabled={Boolean(busyId)} onclick={() => run(item, () => onretry(item))}>{uiM('feedback_retry')}</Button>{/if}
|