@nice2dev/ui 1.4.14 → 1.4.16
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 +80 -0
- package/dist/{NiceColorPicker-BLwYNSXJ.cjs → NiceColorPicker-79rkvaSk.cjs} +1 -1
- package/dist/NiceDataGrid-B1AOjgjm.cjs +10 -0
- package/dist/NiceForm-fmePSeA9.cjs +1 -0
- package/dist/{NiceHtmlEditor-BzECmDO3.cjs → NiceHtmlEditor-By7R1wRo.cjs} +1 -1
- package/dist/{NiceMention-CYRqPKGU.cjs → NiceMention-i7n2BoMw.cjs} +1 -1
- package/dist/{NiceModuleLifecyclePanel-CiYbPcHV.cjs → NiceModuleLifecyclePanel-DVHQuhc-.cjs} +1 -1
- package/dist/{NicePagination-BAxwqeEd.cjs → NicePagination-D9JguOl0.cjs} +1 -1
- package/dist/NicePivotGrid-B_7iQJys.cjs +2 -0
- package/dist/NiceSavedQueryPanel-ChY4HwpM.cjs +587 -0
- package/dist/{NiceScheduler-BqYiHPvz.cjs → NiceScheduler-B2DamQ_L.cjs} +1 -1
- package/dist/backup/NiceBackupScheduler.mjs +171 -119
- package/dist/charts/NiceOrganizationChart.mjs +159 -59
- package/dist/charts/orgChartExport.mjs +71 -0
- package/dist/charts/tidyTree.mjs +43 -0
- package/dist/charts-C3Q3r8Yz.cjs +918 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.d.ts +9 -0
- package/dist/{core-lazy-BQexApr7.cjs → core-lazy-ChKRuEPb.cjs} +1 -1
- package/dist/data/NiceDataGrid.mjs +301 -320
- package/dist/data/NiceRowEditDialog.mjs +57 -0
- package/dist/data/NiceTreeGrid.mjs +478 -433
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +43 -2
- package/dist/{devops-cgRBnZVX.cjs → devops-o6Zm0VKB.cjs} +3 -3
- package/dist/devops.cjs +1 -1
- package/dist/editors/forms/NiceForm.mjs +216 -167
- package/dist/editors/inputs/NiceUpload.mjs +238 -238
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +13 -1
- package/dist/feedback.cjs +1 -1
- package/dist/index.cjs +254 -254
- package/dist/index.d.ts +198 -5
- package/dist/index.mjs +928 -920
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +11 -1
- package/dist/navigation.cjs +1 -1
- package/dist/no-code/NiceDataMapper.mjs +398 -361
- package/dist/no-code-CN_q6TcB.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +11 -1
- package/dist/style.css +1 -1
- package/dist/tools/NicePermissionMatrix.mjs +171 -138
- package/dist/tools/NiceRoleEditor.mjs +334 -297
- package/package.json +4 -4
- package/dist/NiceDataGrid-D3qRQSjy.cjs +0 -10
- package/dist/NiceForm-BWb4LTQJ.cjs +0 -1
- package/dist/NicePivotGrid-Cxu5PECg.cjs +0 -152
- package/dist/NiceSavedQueryPanel-C1nxEmMu.cjs +0 -587
- package/dist/charts-BzlvCCg9.cjs +0 -768
- package/dist/no-code-B1jzfUF5.cjs +0 -331
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as r, Fragment as
|
|
2
|
-
import { useNiceTranslation as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsxs as r, Fragment as M, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as H, useControllableState as _, NiceIcon as t, clickOnActivationKey as j } from "@nice2dev/ui-core";
|
|
3
|
+
import v from "react";
|
|
4
|
+
const z = [
|
|
5
5
|
{
|
|
6
6
|
value: "full",
|
|
7
7
|
key: "backup.scope.full",
|
|
@@ -37,14 +37,14 @@ const A = [
|
|
|
37
37
|
descriptionKey: "backup.scope.dataDesc",
|
|
38
38
|
description: "Data only, without the schema"
|
|
39
39
|
}
|
|
40
|
-
],
|
|
40
|
+
], E = [
|
|
41
41
|
{ value: "local", label: "Local disk", icon: "save" },
|
|
42
42
|
{ value: "s3", label: "Amazon S3", icon: "box" },
|
|
43
43
|
{ value: "azure", label: "Azure Blob", icon: "cloud" },
|
|
44
44
|
{ value: "gcs", label: "Google Cloud", icon: "globe" },
|
|
45
45
|
{ value: "sftp", label: "SFTP", icon: "wifi" },
|
|
46
46
|
{ value: "nfs", label: "NFS", icon: "database" }
|
|
47
|
-
],
|
|
47
|
+
], F = [
|
|
48
48
|
{ key: "backup.cron.everyMinute", label: "Every minute", cron: "* * * * *" },
|
|
49
49
|
{ key: "backup.cron.hourly", label: "Hourly", cron: "0 * * * *" },
|
|
50
50
|
{ key: "backup.cron.daily2", label: "Daily at 02:00", cron: "0 2 * * *" },
|
|
@@ -53,7 +53,7 @@ const A = [
|
|
|
53
53
|
{ key: "backup.cron.monthly1", label: "First day of the month", cron: "0 2 1 * *" },
|
|
54
54
|
{ key: "backup.cron.custom", label: "Custom", cron: "custom" }
|
|
55
55
|
];
|
|
56
|
-
function
|
|
56
|
+
function q(i, p) {
|
|
57
57
|
return {
|
|
58
58
|
"* * * * *": i("backup.cron.everyMinute", "Every minute"),
|
|
59
59
|
"0 * * * *": i("backup.cron.hourly", "Hourly"),
|
|
@@ -64,9 +64,9 @@ function T(i, d) {
|
|
|
64
64
|
"@daily": i("backup.cron.everyDay", "Every day"),
|
|
65
65
|
"@weekly": i("backup.cron.everyWeek", "Every week"),
|
|
66
66
|
"@monthly": i("backup.cron.everyMonth", "Every month")
|
|
67
|
-
}[
|
|
67
|
+
}[p] ?? `${i("backup.schedule", "Schedule")}: ${p}`;
|
|
68
68
|
}
|
|
69
|
-
const
|
|
69
|
+
const W = `
|
|
70
70
|
.nbs { display: flex; flex-direction: column; gap: var(--nice-space-5, 20px); font-family: inherit; }
|
|
71
71
|
.nbs-card { border: 1px solid var(--nice-border-color, #dfe6e9); border-radius: var(--nice-radius-lg, 10px); overflow: hidden; }
|
|
72
72
|
.nbs-card-header { padding: var(--nice-space-3, 12px) var(--nice-space-4, 16px); background: var(--nice-bg-subtle, #f8f9fa); border-bottom: 1px solid var(--nice-border-color, #dfe6e9); font-weight: 700; font-size: 0.875rem; display: flex; align-items: center; gap: var(--nice-space-2, 8px); }
|
|
@@ -106,7 +106,7 @@ const $ = `
|
|
|
106
106
|
.nbs-email-input { flex: 1; padding: var(--nice-space-1-25, 5px) var(--nice-space-2-5, 10px); border: 1px solid var(--nice-border-color, #dfe6e9); border-radius: var(--nice-radius-md, 6px); background: var(--nice-input-bg, #fff); color: inherit; font-size: 0.82rem; }
|
|
107
107
|
.nbs-remove-btn { padding: var(--nice-space-1, 4px) var(--nice-space-2, 8px); border: none; background: var(--nice-danger-tint-15, rgba(214, 48, 49, 0.15)); color: var(--nice-danger, #d63031); border-radius: var(--nice-radius-md, 6px); cursor: pointer; font-size: 0.82rem; }
|
|
108
108
|
.nbs-add-email-btn { padding: var(--nice-space-1, 4px) var(--nice-space-2-5, 10px); border: 1px dashed var(--nice-border-color, #dfe6e9); border-radius: var(--nice-radius-md, 6px); background: none; cursor: pointer; font-size: 0.78rem; color: var(--nice-text-muted, #b2bec3); text-align: left; }
|
|
109
|
-
`,
|
|
109
|
+
`, G = {
|
|
110
110
|
enabled: !1,
|
|
111
111
|
cron: "0 2 * * *",
|
|
112
112
|
scope: "full",
|
|
@@ -114,67 +114,73 @@ const $ = `
|
|
|
114
114
|
compressionLevel: 6,
|
|
115
115
|
targets: ["local"]
|
|
116
116
|
};
|
|
117
|
-
function
|
|
117
|
+
function J({
|
|
118
118
|
value: i,
|
|
119
|
-
defaultValue:
|
|
120
|
-
onChange:
|
|
121
|
-
onSave:
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
defaultValue: p,
|
|
120
|
+
onChange: h,
|
|
121
|
+
onSave: f,
|
|
122
|
+
scopes: g,
|
|
123
|
+
targets: y,
|
|
124
|
+
showCompression: k = !0,
|
|
125
|
+
showNotifications: O = !0,
|
|
126
|
+
showRetentionDays: D = !0,
|
|
127
|
+
showReset: R = !0,
|
|
128
|
+
loading: x = !1,
|
|
129
|
+
className: N,
|
|
130
|
+
style: $
|
|
125
131
|
}) {
|
|
126
|
-
const { t: c, lang:
|
|
132
|
+
const { t: c, lang: C } = H(), o = v.useId(), [a, S] = _({
|
|
127
133
|
value: i,
|
|
128
|
-
defaultValue:
|
|
129
|
-
fallbackValue:
|
|
130
|
-
onChange:
|
|
134
|
+
defaultValue: p,
|
|
135
|
+
fallbackValue: G,
|
|
136
|
+
onChange: h,
|
|
131
137
|
componentName: "NiceBackupScheduler"
|
|
132
|
-
}), [
|
|
133
|
-
const l =
|
|
138
|
+
}), [w, b] = v.useState(a.cron ?? "0 2 * * *"), m = v.useRef(a), A = g ? z.filter((e) => g.includes(e.value)) : z, L = y ? E.filter((e) => y.includes(e.value)) : E, s = (e, l) => S({ ...a, [e]: l }), T = (e) => {
|
|
139
|
+
const l = a.targets.includes(e) ? a.targets.filter((d) => d !== e) : [...a.targets, e];
|
|
134
140
|
s("targets", l);
|
|
135
|
-
},
|
|
141
|
+
}, K = (e) => {
|
|
136
142
|
e !== "custom" && (b(e), s("cron", e));
|
|
137
|
-
},
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
const l = [...
|
|
143
|
+
}, u = !F.slice(0, -1).some((e) => e.cron === a.cron), P = () => s("notifyEmails", [...a.notifyEmails ?? [], ""]), B = (e, l) => {
|
|
144
|
+
const d = [...a.notifyEmails ?? []];
|
|
145
|
+
d[e] = l, s("notifyEmails", d);
|
|
146
|
+
}, I = (e) => {
|
|
147
|
+
const l = [...a.notifyEmails ?? []];
|
|
142
148
|
l.splice(e, 1), s("notifyEmails", l);
|
|
143
149
|
};
|
|
144
|
-
return /* @__PURE__ */ r(
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */ r("div", { className: `nbs${
|
|
150
|
+
return /* @__PURE__ */ r(M, { children: [
|
|
151
|
+
/* @__PURE__ */ n("style", { children: W }),
|
|
152
|
+
/* @__PURE__ */ r("div", { className: `nbs${N ? ` ${N}` : ""}`, style: $, children: [
|
|
147
153
|
/* @__PURE__ */ r("div", { className: "nbs-card", children: [
|
|
148
154
|
/* @__PURE__ */ r("div", { className: "nbs-card-header", children: [
|
|
149
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ n(t, { name: "clock", size: 14 }),
|
|
150
156
|
" ",
|
|
151
157
|
c("backup.automaticSchedule", "Automatic backup schedule")
|
|
152
158
|
] }),
|
|
153
159
|
/* @__PURE__ */ r("div", { className: "nbs-card-body", children: [
|
|
154
160
|
/* @__PURE__ */ r("div", { className: "nbs-toggle", children: [
|
|
155
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ n(
|
|
156
162
|
"div",
|
|
157
163
|
{
|
|
158
164
|
role: "switch",
|
|
159
|
-
"aria-checked":
|
|
160
|
-
"aria-label":
|
|
165
|
+
"aria-checked": a.enabled,
|
|
166
|
+
"aria-label": a.enabled ? c("backup.scheduleOn", "Schedule active") : c("backup.scheduleOff", "Schedule disabled"),
|
|
161
167
|
tabIndex: 0,
|
|
162
|
-
onKeyDown:
|
|
163
|
-
className: `nbs-toggle-track${
|
|
164
|
-
onClick: () => s("enabled", !
|
|
165
|
-
children: /* @__PURE__ */
|
|
168
|
+
onKeyDown: j,
|
|
169
|
+
className: `nbs-toggle-track${a.enabled ? " on" : ""}`,
|
|
170
|
+
onClick: () => s("enabled", !a.enabled),
|
|
171
|
+
children: /* @__PURE__ */ n("div", { className: `nbs-toggle-thumb${a.enabled ? " on" : ""}` })
|
|
166
172
|
}
|
|
167
173
|
),
|
|
168
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ n("span", { style: { fontSize: "0.875rem", fontWeight: 600 }, children: a.enabled ? c("backup.scheduleOn", "Schedule active") : c("backup.scheduleOff", "Schedule disabled") })
|
|
169
175
|
] }),
|
|
170
|
-
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
176
|
+
a.description !== void 0 && /* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
177
|
+
/* @__PURE__ */ n("label", { className: "nbs-label", children: c("backup.description", "Description") }),
|
|
178
|
+
/* @__PURE__ */ n(
|
|
173
179
|
"input",
|
|
174
180
|
{
|
|
175
181
|
className: "nbs-input",
|
|
176
182
|
style: { width: "100%" },
|
|
177
|
-
value:
|
|
183
|
+
value: a.description ?? "",
|
|
178
184
|
onChange: (e) => s("description", e.target.value),
|
|
179
185
|
placeholder: c("backup.descriptionPlaceholder", "Schedule description…")
|
|
180
186
|
}
|
|
@@ -184,29 +190,31 @@ function H({
|
|
|
184
190
|
] }),
|
|
185
191
|
/* @__PURE__ */ r("div", { className: "nbs-card", children: [
|
|
186
192
|
/* @__PURE__ */ r("div", { className: "nbs-card-header", children: [
|
|
187
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ n(t, { name: "calendar", size: 14 }),
|
|
188
194
|
" ",
|
|
189
195
|
c("backup.frequency", "Frequency (CRON)")
|
|
190
196
|
] }),
|
|
191
197
|
/* @__PURE__ */ r("div", { className: "nbs-card-body", children: [
|
|
192
198
|
/* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
193
|
-
/* @__PURE__ */
|
|
199
|
+
/* @__PURE__ */ n("label", { className: "nbs-label", children: c("backup.quickPresets", "Quick presets") }),
|
|
194
200
|
/* @__PURE__ */ r("div", { className: "nbs-presets", children: [
|
|
195
|
-
|
|
201
|
+
F.slice(0, -1).map((e) => /* @__PURE__ */ n(
|
|
196
202
|
"button",
|
|
197
203
|
{
|
|
198
|
-
|
|
199
|
-
|
|
204
|
+
type: "button",
|
|
205
|
+
className: `nbs-preset-btn${a.cron === e.cron ? " active" : ""}`,
|
|
206
|
+
onClick: () => K(e.cron),
|
|
200
207
|
children: c(e.key, e.label)
|
|
201
208
|
},
|
|
202
209
|
e.cron
|
|
203
210
|
)),
|
|
204
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ n(
|
|
205
212
|
"button",
|
|
206
213
|
{
|
|
207
|
-
|
|
214
|
+
type: "button",
|
|
215
|
+
className: `nbs-preset-btn${u ? " active" : ""}`,
|
|
208
216
|
onClick: () => {
|
|
209
|
-
b(
|
|
217
|
+
b(a.cron);
|
|
210
218
|
},
|
|
211
219
|
children: c("backup.custom", "Custom")
|
|
212
220
|
}
|
|
@@ -214,43 +222,43 @@ function H({
|
|
|
214
222
|
] })
|
|
215
223
|
] }),
|
|
216
224
|
/* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ n("label", { className: "nbs-label", children: c("backup.cronExpression", "CRON expression") }),
|
|
226
|
+
/* @__PURE__ */ n(
|
|
219
227
|
"input",
|
|
220
228
|
{
|
|
221
229
|
className: "nbs-input nbs-cron-input",
|
|
222
|
-
value:
|
|
230
|
+
value: u ? w : a.cron,
|
|
223
231
|
onChange: (e) => {
|
|
224
|
-
b(e.target.value),
|
|
232
|
+
b(e.target.value), u && s("cron", e.target.value);
|
|
225
233
|
},
|
|
226
234
|
onBlur: () => {
|
|
227
|
-
|
|
235
|
+
u && s("cron", w);
|
|
228
236
|
},
|
|
229
237
|
placeholder: "0 2 * * *"
|
|
230
238
|
}
|
|
231
239
|
),
|
|
232
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ n("div", { className: "nbs-next-run", children: q(c, a.cron) })
|
|
233
241
|
] }),
|
|
234
|
-
|
|
242
|
+
a.nextRunAt && /* @__PURE__ */ r("div", { className: "nbs-next-run", children: [
|
|
235
243
|
c("backup.nextRun", "Next run"),
|
|
236
244
|
":",
|
|
237
245
|
" ",
|
|
238
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ n("strong", { children: new Date(a.nextRunAt).toLocaleString(C) })
|
|
239
247
|
] }),
|
|
240
|
-
|
|
248
|
+
a.lastRunAt && /* @__PURE__ */ r("div", { className: "nbs-next-run", children: [
|
|
241
249
|
c("backup.lastRun", "Last run: {lastRunAt}").replace(
|
|
242
250
|
"{lastRunAt}",
|
|
243
|
-
String(new Date(
|
|
251
|
+
String(new Date(a.lastRunAt).toLocaleString(C))
|
|
244
252
|
),
|
|
245
|
-
|
|
253
|
+
a.lastRunStatus && /* @__PURE__ */ n(
|
|
246
254
|
"span",
|
|
247
255
|
{
|
|
248
256
|
style: {
|
|
249
257
|
marginLeft: 6,
|
|
250
|
-
color:
|
|
258
|
+
color: a.lastRunStatus === "completed" ? "var(--nice-color-success, #00b894)" : "var(--nice-color-error, #d63031)",
|
|
251
259
|
fontWeight: 600
|
|
252
260
|
},
|
|
253
|
-
children:
|
|
261
|
+
children: a.lastRunStatus
|
|
254
262
|
}
|
|
255
263
|
)
|
|
256
264
|
] })
|
|
@@ -258,18 +266,19 @@ function H({
|
|
|
258
266
|
] }),
|
|
259
267
|
/* @__PURE__ */ r("div", { className: "nbs-card", children: [
|
|
260
268
|
/* @__PURE__ */ r("div", { className: "nbs-card-header", children: [
|
|
261
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ n(t, { name: "box", size: 14 }),
|
|
262
270
|
" ",
|
|
263
271
|
c("backup.backupScope", "Backup scope")
|
|
264
272
|
] }),
|
|
265
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ n("div", { className: "nbs-card-body", children: /* @__PURE__ */ n("div", { className: "nbs-scope-grid", children: A.map((e) => /* @__PURE__ */ r(
|
|
266
274
|
"button",
|
|
267
275
|
{
|
|
268
|
-
|
|
276
|
+
type: "button",
|
|
277
|
+
className: `nbs-scope-btn${a.scope === e.value ? " active" : ""}`,
|
|
269
278
|
onClick: () => s("scope", e.value),
|
|
270
279
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ n("span", { className: "nbs-scope-title", children: c(e.key, e.label) }),
|
|
281
|
+
/* @__PURE__ */ n("span", { className: "nbs-scope-desc", children: c(e.descriptionKey, e.description) })
|
|
273
282
|
]
|
|
274
283
|
},
|
|
275
284
|
e.value
|
|
@@ -277,19 +286,21 @@ function H({
|
|
|
277
286
|
] }),
|
|
278
287
|
/* @__PURE__ */ r("div", { className: "nbs-card", children: [
|
|
279
288
|
/* @__PURE__ */ r("div", { className: "nbs-card-header", children: [
|
|
280
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ n(t, { name: "database", size: 14 }),
|
|
281
290
|
" ",
|
|
282
291
|
c("backup.storage", "Storage target")
|
|
283
292
|
] }),
|
|
284
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ n("div", { className: "nbs-card-body", children: /* @__PURE__ */ n("div", { className: "nbs-target-grid", children: L.map((e) => /* @__PURE__ */ r(
|
|
285
294
|
"button",
|
|
286
295
|
{
|
|
287
|
-
|
|
288
|
-
|
|
296
|
+
type: "button",
|
|
297
|
+
className: `nbs-target-btn${a.targets.includes(e.value) ? " active" : ""}`,
|
|
298
|
+
onClick: () => T(e.value),
|
|
299
|
+
"aria-pressed": a.targets.includes(e.value),
|
|
289
300
|
children: [
|
|
290
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ n(t, { name: e.icon, size: 14 }),
|
|
291
302
|
" ",
|
|
292
|
-
e.label
|
|
303
|
+
c(`backup.target.${e.value}`, e.label)
|
|
293
304
|
]
|
|
294
305
|
},
|
|
295
306
|
e.value
|
|
@@ -297,43 +308,64 @@ function H({
|
|
|
297
308
|
] }),
|
|
298
309
|
/* @__PURE__ */ r("div", { className: "nbs-card", children: [
|
|
299
310
|
/* @__PURE__ */ r("div", { className: "nbs-card-header", children: [
|
|
300
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ n(t, { name: "settings", size: 14 }),
|
|
301
312
|
" ",
|
|
302
|
-
c("backup.retentionAndCompression", "Retention and compression")
|
|
313
|
+
k ? c("backup.retentionAndCompression", "Retention and compression") : c("backup.retention", "Retention")
|
|
303
314
|
] }),
|
|
304
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ n("div", { className: "nbs-card-body", children: /* @__PURE__ */ r("div", { className: "nbs-row", children: [
|
|
305
316
|
/* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
306
|
-
/* @__PURE__ */ r("label", { className: "nbs-label", children: [
|
|
317
|
+
/* @__PURE__ */ r("label", { className: "nbs-label", htmlFor: `${o}-count`, children: [
|
|
307
318
|
c("backup.retained", "Backups kept"),
|
|
308
|
-
":
|
|
309
|
-
|
|
319
|
+
":",
|
|
320
|
+
" ",
|
|
321
|
+
/* @__PURE__ */ n("strong", { children: a.retentionCount === 0 ? c("backup.keepAll", "all") : a.retentionCount })
|
|
310
322
|
] }),
|
|
311
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ n(
|
|
312
324
|
"input",
|
|
313
325
|
{
|
|
326
|
+
id: `${o}-count`,
|
|
314
327
|
type: "range",
|
|
315
|
-
min:
|
|
328
|
+
min: 0,
|
|
316
329
|
max: 100,
|
|
317
330
|
step: 1,
|
|
318
331
|
className: "nbs-slider",
|
|
319
|
-
value:
|
|
332
|
+
value: a.retentionCount,
|
|
320
333
|
onChange: (e) => s("retentionCount", Number(e.target.value))
|
|
321
334
|
}
|
|
322
335
|
),
|
|
323
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ n("div", { style: { fontSize: "0.72rem", color: "var(--nice-text-muted)", marginTop: 2 }, children: c(
|
|
324
337
|
"backup.retentionHint",
|
|
325
338
|
"Once the limit is reached, the oldest backups are deleted."
|
|
326
339
|
) })
|
|
327
340
|
] }),
|
|
328
|
-
/* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
341
|
+
D && /* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
342
|
+
/* @__PURE__ */ n("label", { className: "nbs-label", htmlFor: `${o}-days`, children: c("backup.retentionDays", "Keep for (days)") }),
|
|
343
|
+
/* @__PURE__ */ n(
|
|
344
|
+
"input",
|
|
345
|
+
{
|
|
346
|
+
id: `${o}-days`,
|
|
347
|
+
type: "number",
|
|
348
|
+
min: 0,
|
|
349
|
+
className: "nbs-input",
|
|
350
|
+
style: { width: 120 },
|
|
351
|
+
value: a.retentionDays ?? "",
|
|
352
|
+
placeholder: c("backup.retentionDaysNone", "no limit"),
|
|
353
|
+
onChange: (e) => s(
|
|
354
|
+
"retentionDays",
|
|
355
|
+
e.target.value === "" ? void 0 : Math.max(0, Number(e.target.value))
|
|
356
|
+
)
|
|
357
|
+
}
|
|
358
|
+
)
|
|
359
|
+
] }),
|
|
360
|
+
k && /* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
329
361
|
/* @__PURE__ */ r("label", { className: "nbs-label", children: [
|
|
330
362
|
c("backup.compressionLevel", "Compression level"),
|
|
331
363
|
":",
|
|
332
364
|
" ",
|
|
333
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ n("strong", { children: a.compressionLevel }),
|
|
334
366
|
"/9"
|
|
335
367
|
] }),
|
|
336
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ n(
|
|
337
369
|
"input",
|
|
338
370
|
{
|
|
339
371
|
type: "range",
|
|
@@ -341,71 +373,78 @@ function H({
|
|
|
341
373
|
max: 9,
|
|
342
374
|
step: 1,
|
|
343
375
|
className: "nbs-slider",
|
|
344
|
-
value:
|
|
376
|
+
value: a.compressionLevel,
|
|
345
377
|
onChange: (e) => s("compressionLevel", Number(e.target.value))
|
|
346
378
|
}
|
|
347
379
|
),
|
|
348
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ n(
|
|
381
|
+
"div",
|
|
382
|
+
{
|
|
383
|
+
style: { fontSize: "0.72rem", color: "var(--nice-text-muted)", marginTop: 2 },
|
|
384
|
+
children: a.compressionLevel === 0 ? c("backup.noCompression", "No compression") : a.compressionLevel < 4 ? c("backup.fastCompression", "Fast compression") : a.compressionLevel < 7 ? c("backup.normalCompression", "Normal compression") : c("backup.maximumCompression", "Maximum compression")
|
|
385
|
+
}
|
|
386
|
+
)
|
|
349
387
|
] })
|
|
350
388
|
] }) })
|
|
351
389
|
] }),
|
|
352
|
-
/* @__PURE__ */ r("div", { className: "nbs-card", children: [
|
|
390
|
+
O && /* @__PURE__ */ r("div", { className: "nbs-card", children: [
|
|
353
391
|
/* @__PURE__ */ r("div", { className: "nbs-card-header", children: [
|
|
354
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ n(t, { name: "bell", size: 14 }),
|
|
355
393
|
" ",
|
|
356
394
|
c("backup.notifications", "Notifications")
|
|
357
395
|
] }),
|
|
358
396
|
/* @__PURE__ */ r("div", { className: "nbs-card-body", children: [
|
|
359
397
|
/* @__PURE__ */ r("div", { className: "nbs-notify-row", children: [
|
|
360
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ n(
|
|
361
399
|
"input",
|
|
362
400
|
{
|
|
363
|
-
id:
|
|
401
|
+
id: `${o}-onfail`,
|
|
364
402
|
type: "checkbox",
|
|
365
403
|
className: "nbs-checkbox",
|
|
366
|
-
checked:
|
|
404
|
+
checked: a.notifyOnFailure ?? !1,
|
|
367
405
|
onChange: (e) => s("notifyOnFailure", e.target.checked)
|
|
368
406
|
}
|
|
369
407
|
),
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ n("label", { htmlFor: `${o}-onfail`, style: { cursor: "pointer" }, children: c("backup.notifyOnError", "Notify on failure") }),
|
|
409
|
+
/* @__PURE__ */ n(
|
|
372
410
|
"input",
|
|
373
411
|
{
|
|
374
|
-
id:
|
|
412
|
+
id: `${o}-onsuccess`,
|
|
375
413
|
type: "checkbox",
|
|
376
414
|
className: "nbs-checkbox",
|
|
377
|
-
checked:
|
|
415
|
+
checked: a.notifyOnSuccess ?? !1,
|
|
378
416
|
onChange: (e) => s("notifyOnSuccess", e.target.checked)
|
|
379
417
|
}
|
|
380
418
|
),
|
|
381
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ n("label", { htmlFor: `${o}-onsuccess`, style: { cursor: "pointer" }, children: c("backup.notifyOnSuccess", "Notify on success") })
|
|
382
420
|
] }),
|
|
383
|
-
(
|
|
384
|
-
/* @__PURE__ */
|
|
421
|
+
(a.notifyOnFailure || a.notifyOnSuccess) && /* @__PURE__ */ r("div", { className: "nbs-field", children: [
|
|
422
|
+
/* @__PURE__ */ n("label", { className: "nbs-label", children: c("backup.notificationEmails", "Notification e-mail addresses") }),
|
|
385
423
|
/* @__PURE__ */ r("div", { className: "nbs-emails", children: [
|
|
386
|
-
(
|
|
387
|
-
/* @__PURE__ */
|
|
424
|
+
(a.notifyEmails ?? []).map((e, l) => /* @__PURE__ */ r("div", { className: "nbs-email-row", children: [
|
|
425
|
+
/* @__PURE__ */ n(
|
|
388
426
|
"input",
|
|
389
427
|
{
|
|
390
428
|
className: "nbs-email-input",
|
|
391
429
|
type: "email",
|
|
392
430
|
value: e,
|
|
393
|
-
onChange: (
|
|
431
|
+
onChange: (d) => B(l, d.target.value),
|
|
394
432
|
placeholder: c("backup.emailExampleCom", "email@example.com")
|
|
395
433
|
}
|
|
396
434
|
),
|
|
397
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ n(
|
|
398
436
|
"button",
|
|
399
437
|
{
|
|
438
|
+
type: "button",
|
|
400
439
|
className: "nbs-remove-btn",
|
|
401
|
-
onClick: () =>
|
|
440
|
+
onClick: () => I(l),
|
|
402
441
|
"aria-label": c("backup.removeEmail", "Remove e-mail address"),
|
|
403
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ n(t, { name: "close", size: 14 })
|
|
404
443
|
}
|
|
405
444
|
)
|
|
406
445
|
] }, l)),
|
|
407
|
-
/* @__PURE__ */ r("button", { className: "nbs-add-email-btn", onClick:
|
|
408
|
-
/* @__PURE__ */
|
|
446
|
+
/* @__PURE__ */ r("button", { type: "button", className: "nbs-add-email-btn", onClick: P, children: [
|
|
447
|
+
/* @__PURE__ */ n(t, { name: "plus", size: 12 }),
|
|
409
448
|
" ",
|
|
410
449
|
c("backup.addEmail", "Add e-mail address")
|
|
411
450
|
] })
|
|
@@ -413,15 +452,28 @@ function H({
|
|
|
413
452
|
] })
|
|
414
453
|
] })
|
|
415
454
|
] }),
|
|
416
|
-
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
-
|
|
455
|
+
f && /* @__PURE__ */ r("div", { className: "nbs-btn-row", children: [
|
|
456
|
+
R && /* @__PURE__ */ n(
|
|
457
|
+
"button",
|
|
458
|
+
{
|
|
459
|
+
type: "button",
|
|
460
|
+
className: "nbs-btn nbs-btn-ghost",
|
|
461
|
+
onClick: () => {
|
|
462
|
+
b(m.current.cron), S(m.current);
|
|
463
|
+
},
|
|
464
|
+
children: c("backup.reset", "Reset")
|
|
465
|
+
}
|
|
466
|
+
),
|
|
467
|
+
/* @__PURE__ */ n(
|
|
419
468
|
"button",
|
|
420
469
|
{
|
|
470
|
+
type: "button",
|
|
421
471
|
className: "nbs-btn nbs-btn-primary",
|
|
422
|
-
disabled:
|
|
423
|
-
onClick: () =>
|
|
424
|
-
|
|
472
|
+
disabled: x,
|
|
473
|
+
onClick: () => {
|
|
474
|
+
m.current = a, f(a);
|
|
475
|
+
},
|
|
476
|
+
children: x ? c("backup.saving", "Saving…") : c("backup.saveSchedule", "Save schedule")
|
|
425
477
|
}
|
|
426
478
|
)
|
|
427
479
|
] })
|
|
@@ -429,5 +481,5 @@ function H({
|
|
|
429
481
|
] });
|
|
430
482
|
}
|
|
431
483
|
export {
|
|
432
|
-
|
|
484
|
+
J as NiceBackupScheduler
|
|
433
485
|
};
|