@abpjs/ui 0.2.0-next.4 → 0.2.0-next.40
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 +428 -0
- package/dist/agent.d.ts +800 -0
- package/dist/agent.js +2468 -0
- package/dist/agent.js.map +1 -0
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +25 -9
- package/dist/ai.js.map +1 -1
- package/dist/guard.d.ts +1686 -0
- package/dist/guard.js +4194 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.d.ts +740 -41
- package/dist/index.js +4060 -1379
- package/dist/index.js.map +1 -1
- package/dist/languages.d.ts +162 -0
- package/dist/languages.js +771 -0
- package/dist/languages.js.map +1 -0
- package/dist/rules.d.ts +23 -1
- package/dist/rules.js +35 -0
- package/dist/rules.js.map +1 -1
- package/dist/storage.d.ts +102 -0
- package/dist/storage.js +315 -0
- package/dist/storage.js.map +1 -0
- package/package.json +24 -1
package/dist/storage.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/areas/storage/StorageScreen.tsx
|
|
4
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
|
+
import { HStack, Stack, Text } from "@chakra-ui/react";
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
DataTable,
|
|
9
|
+
EMPTY_VALUE,
|
|
10
|
+
HostSlot,
|
|
11
|
+
InlineAlert,
|
|
12
|
+
PageHeader,
|
|
13
|
+
Panel,
|
|
14
|
+
PropertyList,
|
|
15
|
+
StatusPill,
|
|
16
|
+
useApiAction,
|
|
17
|
+
useAbpLocale,
|
|
18
|
+
useApiQuery,
|
|
19
|
+
useAreaRequest,
|
|
20
|
+
useFormatters
|
|
21
|
+
} from "@abpjs/ui";
|
|
22
|
+
|
|
23
|
+
// src/areas/storage/texts.ts
|
|
24
|
+
import { createAreaTexts } from "@abpjs/ui";
|
|
25
|
+
|
|
26
|
+
// src/areas/storage/texts/ar.json
|
|
27
|
+
var ar_default = {
|
|
28
|
+
title: "\u0627\u0644\u062A\u062E\u0632\u064A\u0646",
|
|
29
|
+
description: "\u062D\u064A\u062B \u064A\u062D\u0641\u0638 {product} \u0645\u0644\u0641\u0627\u062A\u0647. \u064A\u064F\u0636\u0628\u0637 \u0641\u064A \u0625\u0639\u062F\u0627\u062F\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645\u060C \u0644\u0627 \u0645\u0646 \u0647\u0646\u0627.",
|
|
30
|
+
whereTitle: "\u0623\u064A\u0646 \u062A\u064F\u062D\u0641\u0638 \u0627\u0644\u0645\u0644\u0641\u0627\u062A",
|
|
31
|
+
whereHint: "\u0646\u0638\u0627\u0645 \u0645\u0644\u0641\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645\u060C \u0623\u0648 \u062D\u0627\u0648\u064A\u0629 S3 (\u0645\u0646 AWS \u0623\u0648 \u062E\u0627\u062F\u0645 \u064A\u062A\u062D\u062F\u062B S3 \u0645\u062B\u0644 MinIO)\u060C \u0623\u0648 Azure Blob. \u0644\u0627 \u064A\u064F\u0648\u0635\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0625\u0644\u0627 \u0639\u0628\u0631 {product}\u060C \u0627\u0644\u0630\u064A \u064A\u062A\u062D\u0642\u0642 \u0645\u0645\u0646 \u064A\u062D\u0642 \u0644\u0647 \u0642\u0631\u0627\u0621\u062A\u0647\u0627.",
|
|
32
|
+
provider: "\u0627\u0644\u0646\u0648\u0639",
|
|
33
|
+
location: "\u0627\u0644\u0645\u0643\u0627\u0646",
|
|
34
|
+
stores: "\u0645\u0627 \u064A\u064F\u062D\u0641\u0638 \u0647\u0646\u0627\u0643",
|
|
35
|
+
"providers.FileSystem": "\u0646\u0638\u0627\u0645 \u0645\u0644\u0641\u0627\u062A \u0627\u0644\u062E\u0627\u062F\u0645",
|
|
36
|
+
"providers.S3": "\u062D\u0627\u0648\u064A\u0629 S3",
|
|
37
|
+
"providers.Azure": "Azure Blob",
|
|
38
|
+
previousTitle: "\u062A\u064F\u0646\u0642\u0644 \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0622\u0646",
|
|
39
|
+
previousBody: "\u0627\u0644\u0645\u0644\u0641 \u0627\u0644\u0630\u064A \u0644\u0645 \u064A\u064F\u0646\u0642\u0644 \u0628\u0639\u062F \u064A\u064F\u0642\u0631\u0623 \u0645\u0646 \u0645\u0643\u0627\u0646\u0647 \u0627\u0644\u0633\u0627\u0628\u0642: {provider}\u060C {location}.",
|
|
40
|
+
test: "\u0627\u062E\u062A\u0628\u0627\u0631",
|
|
41
|
+
testTitle: "\u0627\u0644\u0627\u062E\u062A\u0628\u0627\u0631",
|
|
42
|
+
store: "\u0627\u0644\u0645\u062E\u0632\u0646",
|
|
43
|
+
result: "\u0627\u0644\u0646\u062A\u064A\u062C\u0629",
|
|
44
|
+
works: "\u064A\u0639\u0645\u0644",
|
|
45
|
+
fails: "\u0644\u0627 \u064A\u0639\u0645\u0644",
|
|
46
|
+
time: "\u0627\u0644\u0648\u0642\u062A",
|
|
47
|
+
ms: "{ms} \u0645\u0644\u0651\u064A \u062B\u0627\u0646\u064A\u0629",
|
|
48
|
+
copyTitle: "\u0627\u0644\u0646\u0633\u062E \u0645\u0646 \u0627\u0644\u062A\u062E\u0632\u064A\u0646 \u0627\u0644\u0633\u0627\u0628\u0642",
|
|
49
|
+
copyHint: "\u064A\u0646\u0633\u062E \u0643\u0644 \u0645\u0644\u0641 \u0645\u0627 \u0632\u0627\u0644 \u0641\u064A \u0627\u0644\u062A\u062E\u0632\u064A\u0646 \u0627\u0644\u0633\u0627\u0628\u0642 \u0625\u0644\u0649 \u0627\u0644\u062A\u062E\u0632\u064A\u0646 \u0627\u0644\u062D\u0627\u0644\u064A\u060C \u0648\u064A\u062A\u062D\u0642\u0642 \u0645\u0646 \u0643\u0644 \u0645\u0644\u0641 \u0645\u0642\u0627\u0628\u0644 \u0627\u0644\u0628\u0635\u0645\u0629 \u0627\u0644\u0645\u062D\u0641\u0648\u0638\u0629 \u0644\u0647. \u0627\u0644\u0645\u0644\u0641\u0627\u062A \u0627\u0644\u0645\u0648\u062C\u0648\u062F\u0629 \u0623\u0635\u0644\u064B\u0627 \u062A\u064F\u062A\u0631\u0643 \u0643\u0645\u0627 \u0647\u064A\u060C \u0644\u0630\u0627 \u064A\u0645\u0643\u0646 \u062A\u0634\u063A\u064A\u0644\u0647 \u0645\u0631\u0629 \u0623\u062E\u0631\u0649. \u0639\u0646\u062F\u0645\u0627 \u0644\u0627 \u064A\u062A\u0628\u0642\u0649 \u0634\u064A\u0621\u060C \u0623\u0632\u0644 Storage:Previous \u0645\u0646 \u0627\u0644\u0625\u0639\u062F\u0627\u062F\u0627\u062A.",
|
|
50
|
+
copyStart: "\u0646\u0633\u062E",
|
|
51
|
+
"copyStates.idle": "\u0644\u0645 \u064A\u064F\u0634\u063A\u064E\u0651\u0644",
|
|
52
|
+
"copyStates.running": "\u062C\u0627\u0631\u064D \u0627\u0644\u0646\u0633\u062E",
|
|
53
|
+
"copyStates.done": "\u062A\u0645",
|
|
54
|
+
"copyStates.failed": "\u062A\u0648\u0642\u0641",
|
|
55
|
+
copyCounts: "{total, plural, zero {\u0644\u0627 \u0645\u0644\u0641\u0627\u062A} one {\u0645\u0644\u0641 \u0648\u0627\u062D\u062F} two {\u0645\u0644\u0641\u0627\u0646} few {# \u0645\u0644\u0641\u0627\u062A} many {# \u0645\u0644\u0641\u064B\u0627} other {# \u0645\u0644\u0641}}: \u0646\u064F\u0633\u062E {copied}\u060C \u0645\u0648\u062C\u0648\u062F \u0623\u0635\u0644\u064B\u0627 {skipped}\u060C \u063A\u064A\u0631 \u0645\u0648\u062C\u0648\u062F \u0641\u064A \u0623\u064A \u0645\u0646\u0647\u0645\u0627 {missing}\u060C \u062A\u0639\u0630\u0651\u0631 \u0646\u0633\u062E\u0647 {failed}",
|
|
56
|
+
copyProblems: "\u0645\u0644\u0641\u0627\u062A \u062A\u0639\u0630\u0651\u0631 \u0646\u0633\u062E\u0647\u0627",
|
|
57
|
+
copyFile: "\u0627\u0644\u0645\u0644\u0641",
|
|
58
|
+
copyProblem: "\u0627\u0644\u0633\u0628\u0628",
|
|
59
|
+
notFound: "\u0644\u0627 \u062A\u0648\u062C\u062F \u0635\u0641\u062D\u0629 \u0643\u0647\u0630\u0647."
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// src/areas/storage/texts/en.json
|
|
63
|
+
var en_default = {
|
|
64
|
+
title: "Storage",
|
|
65
|
+
description: "Where {product} keeps its files. It's set in the server's configuration, not here.",
|
|
66
|
+
whereTitle: "Where files are kept",
|
|
67
|
+
whereHint: "The file system, an S3 bucket (AWS or a server that speaks S3, such as MinIO), or Azure Blob. Files are only ever reached through {product}, which checks who may read them.",
|
|
68
|
+
provider: "Kind",
|
|
69
|
+
location: "Where",
|
|
70
|
+
stores: "What's kept there",
|
|
71
|
+
"providers.FileSystem": "The server's file system",
|
|
72
|
+
"providers.S3": "S3 bucket",
|
|
73
|
+
"providers.Azure": "Azure Blob",
|
|
74
|
+
previousTitle: "Files are being moved",
|
|
75
|
+
previousBody: "A file not moved yet is read from where they were before: {provider}, {location}.",
|
|
76
|
+
test: "Test",
|
|
77
|
+
testTitle: "Test",
|
|
78
|
+
store: "Store",
|
|
79
|
+
result: "Result",
|
|
80
|
+
works: "Works",
|
|
81
|
+
fails: "Fails",
|
|
82
|
+
time: "Time",
|
|
83
|
+
ms: "{ms} ms",
|
|
84
|
+
copyTitle: "Copy from the previous storage",
|
|
85
|
+
copyHint: "Copies every file still in the previous storage to the one in use, each checked against the hash kept for it. Files already there are left as they are, so it can be run again. When nothing's left, remove Storage:Previous from the configuration.",
|
|
86
|
+
copyStart: "Copy",
|
|
87
|
+
"copyStates.idle": "Not run",
|
|
88
|
+
"copyStates.running": "Copying",
|
|
89
|
+
"copyStates.done": "Done",
|
|
90
|
+
"copyStates.failed": "Stopped",
|
|
91
|
+
copyCounts: "{total, plural, one {# file} other {# files}}: {copied} copied, {skipped} already there, {missing} in neither, {failed} couldn't be copied",
|
|
92
|
+
copyProblems: "Files that couldn't be copied",
|
|
93
|
+
copyFile: "File",
|
|
94
|
+
copyProblem: "Why",
|
|
95
|
+
notFound: "There is no such page."
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// src/areas/storage/texts.ts
|
|
99
|
+
var useStorageTexts = createAreaTexts("storage", { en: en_default, ar: ar_default });
|
|
100
|
+
|
|
101
|
+
// src/areas/storage/StorageScreen.tsx
|
|
102
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
103
|
+
var COPY_POLL_MS = 1e3;
|
|
104
|
+
var isolate = (text) => `\u2068${text}\u2069`;
|
|
105
|
+
function StorageScreen({ onChanged, storeName }) {
|
|
106
|
+
const t = useStorageTexts();
|
|
107
|
+
const request = useAreaRequest("storage");
|
|
108
|
+
const storage = useApiQuery("storage", "");
|
|
109
|
+
const action = useApiAction();
|
|
110
|
+
const { number } = useFormatters();
|
|
111
|
+
const { locale } = useAbpLocale();
|
|
112
|
+
const [tests, setTests] = useState(null);
|
|
113
|
+
const nameOf = useCallback(
|
|
114
|
+
(store) => {
|
|
115
|
+
const key = `storeNames.${store}`;
|
|
116
|
+
const text = t(key);
|
|
117
|
+
return text !== key ? text : storeName?.(store) ?? store;
|
|
118
|
+
},
|
|
119
|
+
[t, storeName]
|
|
120
|
+
);
|
|
121
|
+
const provider = (p) => {
|
|
122
|
+
const key = `providers.${p}`;
|
|
123
|
+
const text = t(key);
|
|
124
|
+
return text !== key ? text : p;
|
|
125
|
+
};
|
|
126
|
+
async function test() {
|
|
127
|
+
setTests(null);
|
|
128
|
+
const result = await action.run(() => request("/test", { method: "POST" }));
|
|
129
|
+
if (result) setTests(result);
|
|
130
|
+
}
|
|
131
|
+
const data = storage.data;
|
|
132
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "section", children: [
|
|
133
|
+
/* @__PURE__ */ jsx(PageHeader, { title: t("title"), description: t("description"), actions: /* @__PURE__ */ jsx(HostSlot, { name: "storage.page.actions" }) }),
|
|
134
|
+
/* @__PURE__ */ jsx(InlineAlert, { tone: "danger", children: storage.error ?? action.error }),
|
|
135
|
+
(data || storage.loading) && /* @__PURE__ */ jsx(
|
|
136
|
+
Panel,
|
|
137
|
+
{
|
|
138
|
+
title: t("whereTitle"),
|
|
139
|
+
description: t("whereHint"),
|
|
140
|
+
"data-testid": "storage-where",
|
|
141
|
+
loading: storage.loading && !data,
|
|
142
|
+
actions: /* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => void test(), loading: action.busy, disabled: !data, children: t("test") }),
|
|
143
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "4", children: [
|
|
144
|
+
/* @__PURE__ */ jsx(
|
|
145
|
+
PropertyList,
|
|
146
|
+
{
|
|
147
|
+
loading: storage.loading && !data,
|
|
148
|
+
items: [
|
|
149
|
+
{ label: t("provider"), value: data ? provider(data.current.provider) : null },
|
|
150
|
+
{
|
|
151
|
+
label: t("location"),
|
|
152
|
+
value: data ? /* @__PURE__ */ jsx(Text, { as: "span", fontFamily: "mono", dir: "ltr", children: data.current.location }) : null
|
|
153
|
+
},
|
|
154
|
+
{ label: t("stores"), value: data ? new Intl.ListFormat(locale, { type: "conjunction" }).format(data.stores.map(nameOf)) : null }
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
data?.previous && /* @__PURE__ */ jsx(InlineAlert, { tone: "info", title: t("previousTitle"), children: t("previousBody", { provider: provider(data.previous.provider), location: isolate(data.previous.location) }) })
|
|
159
|
+
] })
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
data?.previous && /* @__PURE__ */ jsx(CopyPanel, { onChanged }),
|
|
163
|
+
tests && /* @__PURE__ */ jsx(Panel, { title: t("testTitle"), flush: true, "data-testid": "storage-test", children: /* @__PURE__ */ jsx(
|
|
164
|
+
DataTable,
|
|
165
|
+
{
|
|
166
|
+
"aria-label": t("testTitle"),
|
|
167
|
+
rows: tests,
|
|
168
|
+
getRowId: (r) => r.store,
|
|
169
|
+
columns: [
|
|
170
|
+
{ id: "store", header: t("store"), cell: (r) => nameOf(r.store) },
|
|
171
|
+
{
|
|
172
|
+
id: "result",
|
|
173
|
+
header: t("result"),
|
|
174
|
+
cell: (r) => /* @__PURE__ */ jsxs(HStack, { gap: "2", children: [
|
|
175
|
+
/* @__PURE__ */ jsx(StatusPill, { tone: r.ok ? "success" : "danger", children: r.ok ? t("works") : t("fails") }),
|
|
176
|
+
r.error && /* @__PURE__ */ jsx(Text, { textStyle: "sm", color: "fg.muted", children: r.error })
|
|
177
|
+
] })
|
|
178
|
+
},
|
|
179
|
+
{ id: "time", header: t("time"), numeric: true, cell: (r) => t("ms", { ms: number(Number(r.milliseconds)) }) }
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
) })
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
function CopyPanel({ onChanged }) {
|
|
186
|
+
const t = useStorageTexts();
|
|
187
|
+
const request = useAreaRequest("storage");
|
|
188
|
+
const copy = useApiQuery("storage", "/copy");
|
|
189
|
+
const action = useApiAction();
|
|
190
|
+
const { number } = useFormatters();
|
|
191
|
+
const running = copy.data?.state === "running";
|
|
192
|
+
const { reload } = copy;
|
|
193
|
+
useEffect(() => {
|
|
194
|
+
if (!running) return;
|
|
195
|
+
let stopped = false;
|
|
196
|
+
let timer;
|
|
197
|
+
const next = () => {
|
|
198
|
+
timer = setTimeout(async () => {
|
|
199
|
+
await reload();
|
|
200
|
+
if (!stopped) next();
|
|
201
|
+
}, COPY_POLL_MS);
|
|
202
|
+
};
|
|
203
|
+
next();
|
|
204
|
+
return () => {
|
|
205
|
+
stopped = true;
|
|
206
|
+
clearTimeout(timer);
|
|
207
|
+
};
|
|
208
|
+
}, [running, reload]);
|
|
209
|
+
const last = useRef(void 0);
|
|
210
|
+
const state = copy.data?.state;
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
if (last.current === "running" && state && state !== "running") void onChanged?.();
|
|
213
|
+
last.current = state;
|
|
214
|
+
}, [state, onChanged]);
|
|
215
|
+
async function start() {
|
|
216
|
+
const started = await action.run(() => request("/copy", { method: "POST" }));
|
|
217
|
+
if (started) {
|
|
218
|
+
copy.setData(started);
|
|
219
|
+
await onChanged?.();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
const c = copy.data;
|
|
223
|
+
const n = (value) => number(Number(value));
|
|
224
|
+
const stateName = (value) => {
|
|
225
|
+
const key = `copyStates.${value}`;
|
|
226
|
+
const text = t(key);
|
|
227
|
+
return text !== key ? text : value;
|
|
228
|
+
};
|
|
229
|
+
return /* @__PURE__ */ jsx(
|
|
230
|
+
Panel,
|
|
231
|
+
{
|
|
232
|
+
title: t("copyTitle"),
|
|
233
|
+
description: t("copyHint"),
|
|
234
|
+
"data-testid": "storage-copy",
|
|
235
|
+
loading: copy.loading && !c && !copy.error,
|
|
236
|
+
actions: /* @__PURE__ */ jsx(Button, { size: "sm", onClick: () => void start(), loading: action.busy || running, disabled: running || !c, children: t("copyStart") }),
|
|
237
|
+
children: /* @__PURE__ */ jsxs(Stack, { gap: "3", children: [
|
|
238
|
+
/* @__PURE__ */ jsx(InlineAlert, { tone: "danger", children: copy.error ?? action.error }),
|
|
239
|
+
c && c.state !== "idle" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
240
|
+
/* @__PURE__ */ jsxs(HStack, { gap: "2", flexWrap: "wrap", role: "status", "aria-live": "polite", children: [
|
|
241
|
+
/* @__PURE__ */ jsx(
|
|
242
|
+
StatusPill,
|
|
243
|
+
{
|
|
244
|
+
tone: c.state === "done" ? Number(c.failed) > 0 || Number(c.missing) > 0 ? "warning" : "success" : c.state === "failed" ? "danger" : "info",
|
|
245
|
+
children: stateName(c.state)
|
|
246
|
+
}
|
|
247
|
+
),
|
|
248
|
+
/* @__PURE__ */ jsx(Text, { textStyle: "sm", children: t("copyCounts", { total: Number(c.total), copied: n(c.copied), skipped: n(c.skipped), missing: n(c.missing), failed: n(c.failed) }) })
|
|
249
|
+
] }),
|
|
250
|
+
c.problems.length > 0 && /* @__PURE__ */ jsx(
|
|
251
|
+
DataTable,
|
|
252
|
+
{
|
|
253
|
+
"aria-label": t("copyProblems"),
|
|
254
|
+
rows: c.problems.map((p, i) => ({ ...p, row: i })),
|
|
255
|
+
getRowId: (p) => String(p.row),
|
|
256
|
+
columns: [
|
|
257
|
+
{
|
|
258
|
+
id: "file",
|
|
259
|
+
header: t("copyFile"),
|
|
260
|
+
cell: (p) => /* @__PURE__ */ jsx(Text, { fontFamily: "mono", textStyle: "sm", dir: "ltr", children: p.store ? `${p.store}/${p.name}` : p.name || EMPTY_VALUE })
|
|
261
|
+
},
|
|
262
|
+
{ id: "problem", header: t("copyProblem"), cell: (p) => /* @__PURE__ */ jsx(Text, { textStyle: "sm", children: p.problem }) }
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
] })
|
|
267
|
+
] })
|
|
268
|
+
}
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
function StorageNotFound({ href }) {
|
|
272
|
+
const t = useStorageTexts();
|
|
273
|
+
return /* @__PURE__ */ jsx(PageHeader, { breadcrumbs: [{ label: t("title"), href }], title: t("notFound") });
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// src/areas/storage/pages.tsx
|
|
277
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
278
|
+
var pages = /* @__PURE__ */ new Map();
|
|
279
|
+
function pageFor(href, options) {
|
|
280
|
+
const kept = pages.get(href);
|
|
281
|
+
if (kept) {
|
|
282
|
+
kept.options = options;
|
|
283
|
+
return kept.component;
|
|
284
|
+
}
|
|
285
|
+
const entry = { options, component: (() => null) };
|
|
286
|
+
const onChanged = () => entry.options.onChanged?.();
|
|
287
|
+
const storeName = (store) => entry.options.storeName?.(store) ?? store;
|
|
288
|
+
entry.component = function StoragePage({ path }) {
|
|
289
|
+
return path.length > 0 ? /* @__PURE__ */ jsx2(StorageNotFound, { href }) : /* @__PURE__ */ jsx2(StorageScreen, { onChanged, storeName });
|
|
290
|
+
};
|
|
291
|
+
pages.set(href, entry);
|
|
292
|
+
return entry.component;
|
|
293
|
+
}
|
|
294
|
+
function storagePages(options) {
|
|
295
|
+
const href = options.href.replace(/\/$/, "");
|
|
296
|
+
return [
|
|
297
|
+
{
|
|
298
|
+
id: "storage.admin",
|
|
299
|
+
section: options.section,
|
|
300
|
+
weight: options.weight ?? 100,
|
|
301
|
+
title: options.title ?? en_default.title,
|
|
302
|
+
href,
|
|
303
|
+
about: options.about,
|
|
304
|
+
plugin: "storage",
|
|
305
|
+
visible: options.visible ?? (options.host?.can ? () => options.host.can("storage.site.admin") : void 0),
|
|
306
|
+
component: pageFor(href, options)
|
|
307
|
+
}
|
|
308
|
+
];
|
|
309
|
+
}
|
|
310
|
+
export {
|
|
311
|
+
StorageScreen,
|
|
312
|
+
storagePages,
|
|
313
|
+
useStorageTexts
|
|
314
|
+
};
|
|
315
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/areas/storage/StorageScreen.tsx","../src/areas/storage/texts.ts","../src/areas/storage/texts/ar.json","../src/areas/storage/texts/en.json","../src/areas/storage/pages.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { HStack, Stack, Text } from '@chakra-ui/react';\nimport {\n Button,\n DataTable,\n EMPTY_VALUE,\n HostSlot,\n InlineAlert,\n PageHeader,\n Panel,\n PropertyList,\n StatusPill,\n useApiAction,\n useAbpLocale,\n useApiQuery,\n useAreaRequest,\n useFormatters,\n} from '@abpjs/ui';\nimport { useStorageTexts } from './texts';\nimport type { StorageCopy, StorageInfo, StorageTest } from './types';\n\nexport interface StorageScreenProps {\n /** Told after a change the server has taken: a copy started, and a copy that finished or stopped. */\n onChanged?: () => void | Promise<void>;\n /**\n * A store's name for people. By default the area's text `storeNames.<store>` (a host gives those through\n * `AbpHost.texts.storage`), else the store's own key.\n */\n storeName?: (store: string) => string;\n}\n\n/** How long after each answer a running copy is read again. */\nconst COPY_POLL_MS = 1000;\n\n/** A path or URL set apart from the sentence around it (U+2068 … U+2069), so it keeps its order in right-to-left text. */\nconst isolate = (text: string) => `\\u2068${text}\\u2069`;\n\n/**\n * The site's storage (AbpCluster.Storage): where its files are kept (the provider and its place, never a key), what's\n * kept there, a test of each store, and, while a previous storage is being left, the copy from it with its progress.\n * Storage is set in the server's configuration, so nothing here changes where files go. Starting the copy is the one\n * sensitive action: a host's step-up answers its 403 through the host's request. The host's own links go in the\n * `storage.page.actions` slot.\n */\nexport function StorageScreen({ onChanged, storeName }: StorageScreenProps) {\n const t = useStorageTexts();\n const request = useAreaRequest('storage');\n // The package's root route: the base path itself, with no slash after it.\n const storage = useApiQuery<StorageInfo>('storage', '');\n const action = useApiAction();\n const { number } = useFormatters();\n const { locale } = useAbpLocale();\n const [tests, setTests] = useState<StorageTest[] | null>(null);\n\n const nameOf = useCallback(\n (store: string) => {\n const key = `storeNames.${store}`;\n const text = t(key);\n return text !== key ? text : (storeName?.(store) ?? store);\n },\n [t, storeName],\n );\n const provider = (p: string) => {\n const key = `providers.${p}`;\n const text = t(key);\n return text !== key ? text : p;\n };\n\n async function test() {\n // Last time's results go first, so a test that fails never leaves them saying \"Works\".\n setTests(null);\n const result = await action.run(() => request<StorageTest[]>('/test', { method: 'POST' }));\n if (result) setTests(result);\n }\n\n const data = storage.data;\n return (\n <Stack gap=\"section\">\n <PageHeader title={t('title')} description={t('description')} actions={<HostSlot name=\"storage.page.actions\" />} />\n <InlineAlert tone=\"danger\">{storage.error ?? action.error}</InlineAlert>\n {(data || storage.loading) && (\n <Panel\n title={t('whereTitle')}\n description={t('whereHint')}\n data-testid=\"storage-where\"\n loading={storage.loading && !data}\n actions={\n <Button size=\"sm\" onClick={() => void test()} loading={action.busy} disabled={!data}>\n {t('test')}\n </Button>\n }\n >\n <Stack gap=\"4\">\n <PropertyList\n loading={storage.loading && !data}\n items={[\n { label: t('provider'), value: data ? provider(data.current.provider) : null },\n {\n label: t('location'),\n value: data ? (\n <Text as=\"span\" fontFamily=\"mono\" dir=\"ltr\">\n {data.current.location}\n </Text>\n ) : null,\n },\n { label: t('stores'), value: data ? new Intl.ListFormat(locale, { type: 'conjunction' }).format(data.stores.map(nameOf)) : null },\n ]}\n />\n {data?.previous && (\n <InlineAlert tone=\"info\" title={t('previousTitle')}>\n {t('previousBody', { provider: provider(data.previous.provider), location: isolate(data.previous.location) })}\n </InlineAlert>\n )}\n </Stack>\n </Panel>\n )}\n {data?.previous && <CopyPanel onChanged={onChanged} />}\n {tests && (\n <Panel title={t('testTitle')} flush data-testid=\"storage-test\">\n <DataTable\n aria-label={t('testTitle')}\n rows={tests}\n getRowId={(r) => r.store}\n columns={[\n { id: 'store', header: t('store'), cell: (r) => nameOf(r.store) },\n {\n id: 'result',\n header: t('result'),\n cell: (r) => (\n <HStack gap=\"2\">\n <StatusPill tone={r.ok ? 'success' : 'danger'}>{r.ok ? t('works') : t('fails')}</StatusPill>\n {r.error && (\n <Text textStyle=\"sm\" color=\"fg.muted\">\n {r.error}\n </Text>\n )}\n </HStack>\n ),\n },\n { id: 'time', header: t('time'), numeric: true, cell: (r) => t('ms', { ms: number(Number(r.milliseconds)) }) },\n ]}\n />\n </Panel>\n )}\n </Stack>\n );\n}\n\n/**\n * The copy from the previous storage: started by a site admin (the host's step-up, when it asks for one), read again\n * every second while it runs, then its counts and the first problems.\n */\nfunction CopyPanel({ onChanged }: { onChanged?: () => void | Promise<void> }) {\n const t = useStorageTexts();\n const request = useAreaRequest('storage');\n const copy = useApiQuery<StorageCopy>('storage', '/copy');\n const action = useApiAction();\n const { number } = useFormatters();\n const running = copy.data?.state === 'running';\n\n // Read again a second after each answer, never on a fixed beat, so slow answers don't pile up.\n const { reload } = copy;\n useEffect(() => {\n if (!running) return;\n let stopped = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const next = () => {\n timer = setTimeout(async () => {\n await reload();\n if (!stopped) next();\n }, COPY_POLL_MS);\n };\n next();\n return () => {\n stopped = true;\n clearTimeout(timer);\n };\n }, [running, reload]);\n\n // A copy that was running and has now finished or stopped is a change the host may want to hear of.\n const last = useRef<string | undefined>(undefined);\n const state = copy.data?.state;\n useEffect(() => {\n if (last.current === 'running' && state && state !== 'running') void onChanged?.();\n last.current = state;\n }, [state, onChanged]);\n\n async function start() {\n const started = await action.run(() => request<StorageCopy>('/copy', { method: 'POST' }));\n if (started) {\n copy.setData(started);\n await onChanged?.();\n }\n }\n\n const c = copy.data;\n const n = (value: number | string) => number(Number(value));\n const stateName = (value: string) => {\n const key = `copyStates.${value}`;\n const text = t(key);\n return text !== key ? text : value;\n };\n return (\n <Panel\n title={t('copyTitle')}\n description={t('copyHint')}\n data-testid=\"storage-copy\"\n loading={copy.loading && !c && !copy.error}\n actions={\n <Button size=\"sm\" onClick={() => void start()} loading={action.busy || running} disabled={running || !c}>\n {t('copyStart')}\n </Button>\n }\n >\n <Stack gap=\"3\">\n <InlineAlert tone=\"danger\">{copy.error ?? action.error}</InlineAlert>\n {c && c.state !== 'idle' && (\n <>\n <HStack gap=\"2\" flexWrap=\"wrap\" role=\"status\" aria-live=\"polite\">\n <StatusPill\n tone={c.state === 'done' ? (Number(c.failed) > 0 || Number(c.missing) > 0 ? 'warning' : 'success') : c.state === 'failed' ? 'danger' : 'info'}\n >\n {stateName(c.state)}\n </StatusPill>\n <Text textStyle=\"sm\">\n {t('copyCounts', { total: Number(c.total), copied: n(c.copied), skipped: n(c.skipped), missing: n(c.missing), failed: n(c.failed) })}\n </Text>\n </HStack>\n {c.problems.length > 0 && (\n <DataTable\n aria-label={t('copyProblems')}\n rows={c.problems.map((p, i) => ({ ...p, row: i }))}\n getRowId={(p) => String(p.row)}\n columns={[\n {\n id: 'file',\n header: t('copyFile'),\n cell: (p) => (\n <Text fontFamily=\"mono\" textStyle=\"sm\" dir=\"ltr\">\n {p.store ? `${p.store}/${p.name}` : p.name || EMPTY_VALUE}\n </Text>\n ),\n },\n { id: 'problem', header: t('copyProblem'), cell: (p) => <Text textStyle=\"sm\">{p.problem}</Text> },\n ]}\n />\n )}\n </>\n )}\n </Stack>\n </Panel>\n );\n}\n\n/** An address under the storage page, which has none: a header that says so, with the way back. */\nexport function StorageNotFound({ href }: { href: string }) {\n const t = useStorageTexts();\n return <PageHeader breadcrumbs={[{ label: t('title'), href }]} title={t('notFound')} />;\n}\n","import { createAreaTexts } from '@abpjs/ui';\nimport ar from './texts/ar.json';\nimport en from './texts/en.json';\n\n/** The area's words, in English and Arabic; a host overrides any key through `AbpHost.texts.storage`. */\nexport const useStorageTexts = createAreaTexts('storage', { en, ar });\n","{\n \"title\": \"التخزين\",\n \"description\": \"حيث يحفظ {product} ملفاته. يُضبط في إعدادات الخادم، لا من هنا.\",\n \"whereTitle\": \"أين تُحفظ الملفات\",\n \"whereHint\": \"نظام ملفات الخادم، أو حاوية S3 (من AWS أو خادم يتحدث S3 مثل MinIO)، أو Azure Blob. لا يُوصل إلى الملفات إلا عبر {product}، الذي يتحقق ممن يحق له قراءتها.\",\n \"provider\": \"النوع\",\n \"location\": \"المكان\",\n \"stores\": \"ما يُحفظ هناك\",\n \"providers.FileSystem\": \"نظام ملفات الخادم\",\n \"providers.S3\": \"حاوية S3\",\n \"providers.Azure\": \"Azure Blob\",\n \"previousTitle\": \"تُنقل الملفات الآن\",\n \"previousBody\": \"الملف الذي لم يُنقل بعد يُقرأ من مكانه السابق: {provider}، {location}.\",\n \"test\": \"اختبار\",\n \"testTitle\": \"الاختبار\",\n \"store\": \"المخزن\",\n \"result\": \"النتيجة\",\n \"works\": \"يعمل\",\n \"fails\": \"لا يعمل\",\n \"time\": \"الوقت\",\n \"ms\": \"{ms} ملّي ثانية\",\n \"copyTitle\": \"النسخ من التخزين السابق\",\n \"copyHint\": \"ينسخ كل ملف ما زال في التخزين السابق إلى التخزين الحالي، ويتحقق من كل ملف مقابل البصمة المحفوظة له. الملفات الموجودة أصلًا تُترك كما هي، لذا يمكن تشغيله مرة أخرى. عندما لا يتبقى شيء، أزل Storage:Previous من الإعدادات.\",\n \"copyStart\": \"نسخ\",\n \"copyStates.idle\": \"لم يُشغَّل\",\n \"copyStates.running\": \"جارٍ النسخ\",\n \"copyStates.done\": \"تم\",\n \"copyStates.failed\": \"توقف\",\n \"copyCounts\": \"{total, plural, zero {لا ملفات} one {ملف واحد} two {ملفان} few {# ملفات} many {# ملفًا} other {# ملف}}: نُسخ {copied}، موجود أصلًا {skipped}، غير موجود في أي منهما {missing}، تعذّر نسخه {failed}\",\n \"copyProblems\": \"ملفات تعذّر نسخها\",\n \"copyFile\": \"الملف\",\n \"copyProblem\": \"السبب\",\n \"notFound\": \"لا توجد صفحة كهذه.\"\n}\n","{\n \"title\": \"Storage\",\n \"description\": \"Where {product} keeps its files. It's set in the server's configuration, not here.\",\n \"whereTitle\": \"Where files are kept\",\n \"whereHint\": \"The file system, an S3 bucket (AWS or a server that speaks S3, such as MinIO), or Azure Blob. Files are only ever reached through {product}, which checks who may read them.\",\n \"provider\": \"Kind\",\n \"location\": \"Where\",\n \"stores\": \"What's kept there\",\n \"providers.FileSystem\": \"The server's file system\",\n \"providers.S3\": \"S3 bucket\",\n \"providers.Azure\": \"Azure Blob\",\n \"previousTitle\": \"Files are being moved\",\n \"previousBody\": \"A file not moved yet is read from where they were before: {provider}, {location}.\",\n \"test\": \"Test\",\n \"testTitle\": \"Test\",\n \"store\": \"Store\",\n \"result\": \"Result\",\n \"works\": \"Works\",\n \"fails\": \"Fails\",\n \"time\": \"Time\",\n \"ms\": \"{ms} ms\",\n \"copyTitle\": \"Copy from the previous storage\",\n \"copyHint\": \"Copies every file still in the previous storage to the one in use, each checked against the hash kept for it. Files already there are left as they are, so it can be run again. When nothing's left, remove Storage:Previous from the configuration.\",\n \"copyStart\": \"Copy\",\n \"copyStates.idle\": \"Not run\",\n \"copyStates.running\": \"Copying\",\n \"copyStates.done\": \"Done\",\n \"copyStates.failed\": \"Stopped\",\n \"copyCounts\": \"{total, plural, one {# file} other {# files}}: {copied} copied, {skipped} already there, {missing} in neither, {failed} couldn't be copied\",\n \"copyProblems\": \"Files that couldn't be copied\",\n \"copyFile\": \"File\",\n \"copyProblem\": \"Why\",\n \"notFound\": \"There is no such page.\"\n}\n","import type { ComponentType } from 'react';\nimport type { AbpHost, SettingsPage } from '@abpjs/ui';\nimport { StorageNotFound, StorageScreen } from './StorageScreen';\nimport en from './texts/en.json';\n\nexport interface StoragePageOptions {\n section: string;\n href: string;\n weight?: number;\n title?: string;\n about?: string;\n visible?: SettingsPage['visible'];\n host?: Pick<AbpHost, 'can'>;\n /** After a change the server has taken (a copy started, a copy that ended): the host reads what it shows again. */\n onChanged?: () => void | Promise<void>;\n /** A store's name for people, when the host doesn't give `storeNames.<store>` as words; the store's key by default. */\n storeName?: (store: string) => string;\n}\n\n/**\n * One page component per address, kept across calls: a host's `onChanged` refreshes its pages, which builds its settings\n * again, and a new component there would start the screen afresh, a running copy's progress and a test's results gone.\n * It reads the latest call's options. The map is the module's, shared by every host in the process; a host whose\n * options differ by request uses `StorageScreen` in a page of its own instead.\n */\nconst pages = new Map<string, { options: StoragePageOptions; component: ComponentType<{ path: string[] }> }>();\n\nfunction pageFor(href: string, options: StoragePageOptions): ComponentType<{ path: string[] }> {\n const kept = pages.get(href);\n if (kept) {\n kept.options = options;\n return kept.component;\n }\n const entry = { options, component: (() => null) as ComponentType<{ path: string[] }> };\n const onChanged = () => entry.options.onChanged?.();\n const storeName = (store: string) => entry.options.storeName?.(store) ?? store;\n entry.component = function StoragePage({ path }: { path: string[] }) {\n // The page has no pages under it: an address below it is one that doesn't exist.\n return path.length > 0 ? <StorageNotFound href={href} /> : <StorageScreen onChanged={onChanged} storeName={storeName} />;\n };\n pages.set(href, entry);\n return entry.component;\n}\n\n/**\n * The area's settings page for a host to file under its sections: `storage.admin` at `href`, drawn by the host's\n * catch-all route. Who sees it is the host's `storage.site.admin` when `host` is given. The title is the area's English\n * word unless given; the server checks every call.\n */\nexport function storagePages(options: StoragePageOptions): SettingsPage[] {\n const href = options.href.replace(/\\/$/, '');\n return [\n {\n id: 'storage.admin',\n section: options.section,\n weight: options.weight ?? 100,\n title: options.title ?? en.title,\n href,\n about: options.about,\n plugin: 'storage',\n visible: options.visible ?? (options.host?.can ? () => options.host!.can!('storage.site.admin') : undefined),\n component: pageFor(href, options),\n },\n ];\n}\n"],"mappings":";;;AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAAS,QAAQ,OAAO,YAAY;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACjBP,SAAS,uBAAuB;;;ACAhC;AAAA,EACE,OAAS;AAAA,EACT,aAAe;AAAA,EACf,YAAc;AAAA,EACd,WAAa;AAAA,EACb,UAAY;AAAA,EACZ,UAAY;AAAA,EACZ,QAAU;AAAA,EACV,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,eAAiB;AAAA,EACjB,cAAgB;AAAA,EAChB,MAAQ;AAAA,EACR,WAAa;AAAA,EACb,OAAS;AAAA,EACT,QAAU;AAAA,EACV,OAAS;AAAA,EACT,OAAS;AAAA,EACT,MAAQ;AAAA,EACR,IAAM;AAAA,EACN,WAAa;AAAA,EACb,UAAY;AAAA,EACZ,WAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB,qBAAqB;AAAA,EACrB,YAAc;AAAA,EACd,cAAgB;AAAA,EAChB,UAAY;AAAA,EACZ,aAAe;AAAA,EACf,UAAY;AACd;;;ACjCA;AAAA,EACE,OAAS;AAAA,EACT,aAAe;AAAA,EACf,YAAc;AAAA,EACd,WAAa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AAAA,MACA,OAAO,QAAQ;AAAA,MACf,QAAQ;AAAA,MACR,SAAS,QAAQ,YAAY,QAAQ,MAAM,MAAM,MAAM,QAAQ,KAAM,IAAK,oBAAoB,IAAI;AAAA,MAClG,WAAW,QAAQ,MAAM,OAAO;AAAA,IAClC;AAAA,EACF;AACF;","names":["jsx"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abpjs/ui",
|
|
3
|
-
"version": "0.2.0-next.
|
|
3
|
+
"version": "0.2.0-next.40",
|
|
4
4
|
"description": "The design system for ABP applications on Chakra UI v3 and React 19: tokens, recipes, the app shell, tables, lists, boards, forms and a settings frame. Names no product: the host gives its prefix, colours and words.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -39,6 +39,26 @@
|
|
|
39
39
|
"import": "./dist/ai.js",
|
|
40
40
|
"default": "./dist/ai.js"
|
|
41
41
|
},
|
|
42
|
+
"./agent": {
|
|
43
|
+
"types": "./dist/agent.d.ts",
|
|
44
|
+
"import": "./dist/agent.js",
|
|
45
|
+
"default": "./dist/agent.js"
|
|
46
|
+
},
|
|
47
|
+
"./guard": {
|
|
48
|
+
"types": "./dist/guard.d.ts",
|
|
49
|
+
"import": "./dist/guard.js",
|
|
50
|
+
"default": "./dist/guard.js"
|
|
51
|
+
},
|
|
52
|
+
"./languages": {
|
|
53
|
+
"types": "./dist/languages.d.ts",
|
|
54
|
+
"import": "./dist/languages.js",
|
|
55
|
+
"default": "./dist/languages.js"
|
|
56
|
+
},
|
|
57
|
+
"./storage": {
|
|
58
|
+
"types": "./dist/storage.d.ts",
|
|
59
|
+
"import": "./dist/storage.js",
|
|
60
|
+
"default": "./dist/storage.js"
|
|
61
|
+
},
|
|
42
62
|
"./package.json": "./package.json"
|
|
43
63
|
},
|
|
44
64
|
"files": [
|
|
@@ -71,9 +91,12 @@
|
|
|
71
91
|
},
|
|
72
92
|
"dependencies": {
|
|
73
93
|
"@chakra-ui/charts": "3.38.0",
|
|
94
|
+
"@dagrejs/dagre": "3.1.1",
|
|
74
95
|
"@dnd-kit/core": "6.3.1",
|
|
75
96
|
"@dnd-kit/sortable": "10.0.0",
|
|
76
97
|
"@dnd-kit/utilities": "3.2.2",
|
|
98
|
+
"@emotion/cache": "^11.14.0",
|
|
99
|
+
"@xyflow/react": "12.12.0",
|
|
77
100
|
"lucide-react": "1.52.0",
|
|
78
101
|
"motion": "13.5.1",
|
|
79
102
|
"recharts": "3.10.1"
|