@cundi/refine-xaf 1.0.4 → 1.0.6
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.md +41 -1
- package/dist/index.d.mts +140 -1
- package/dist/index.d.ts +140 -1
- package/dist/index.js +761 -201
- package/dist/index.mjs +707 -141
- package/package.json +3 -1
package/dist/index.mjs
CHANGED
|
@@ -7,13 +7,13 @@ var TOKEN_KEY = "refine-auth";
|
|
|
7
7
|
var MAX_RETRIES = 3;
|
|
8
8
|
var BASE_RETRY_DELAY = 1e3;
|
|
9
9
|
var HttpError = class _HttpError extends Error {
|
|
10
|
-
constructor(statusCode,
|
|
11
|
-
super(
|
|
10
|
+
constructor(statusCode, message3, body) {
|
|
11
|
+
super(message3);
|
|
12
12
|
__publicField(this, "statusCode");
|
|
13
13
|
__publicField(this, "message");
|
|
14
14
|
__publicField(this, "body");
|
|
15
15
|
this.statusCode = statusCode;
|
|
16
|
-
this.message =
|
|
16
|
+
this.message = message3;
|
|
17
17
|
this.body = body;
|
|
18
18
|
Object.setPrototypeOf(this, _HttpError.prototype);
|
|
19
19
|
}
|
|
@@ -552,7 +552,7 @@ var parseFilter = (filter) => {
|
|
|
552
552
|
// src/dataProvider.ts
|
|
553
553
|
var dataProvider = (apiUrl) => ({
|
|
554
554
|
getList: async ({ resource, pagination, sorters, filters }) => {
|
|
555
|
-
const url = new URL(`${apiUrl}/${resource}
|
|
555
|
+
const url = new URL(`${apiUrl}/${resource}`, window.location.origin);
|
|
556
556
|
if (pagination) {
|
|
557
557
|
const { current, pageSize } = pagination;
|
|
558
558
|
if (current && pageSize) {
|
|
@@ -580,7 +580,7 @@ var dataProvider = (apiUrl) => ({
|
|
|
580
580
|
};
|
|
581
581
|
},
|
|
582
582
|
getOne: async ({ resource, id, meta }) => {
|
|
583
|
-
const url = new URL(`${apiUrl}/${resource}(${id})
|
|
583
|
+
const url = new URL(`${apiUrl}/${resource}(${id})`, window.location.origin);
|
|
584
584
|
if (meta?.expand) {
|
|
585
585
|
const expand = meta.expand.map((item) => item.field ?? item).join(",");
|
|
586
586
|
if (expand) {
|
|
@@ -593,7 +593,8 @@ var dataProvider = (apiUrl) => ({
|
|
|
593
593
|
return { data: { ...data, id: data.Oid } };
|
|
594
594
|
},
|
|
595
595
|
create: async ({ resource, variables }) => {
|
|
596
|
-
const
|
|
596
|
+
const url = new URL(`${apiUrl}/${resource}`, window.location.origin);
|
|
597
|
+
const response = await httpClient(url.toString(), {
|
|
597
598
|
method: "POST",
|
|
598
599
|
body: JSON.stringify(variables)
|
|
599
600
|
});
|
|
@@ -602,7 +603,8 @@ var dataProvider = (apiUrl) => ({
|
|
|
602
603
|
return { data };
|
|
603
604
|
},
|
|
604
605
|
update: async ({ resource, id, variables }) => {
|
|
605
|
-
const
|
|
606
|
+
const url = new URL(`${apiUrl}/${resource}(${id})`, window.location.origin);
|
|
607
|
+
const response = await httpClient(url.toString(), {
|
|
606
608
|
method: "PATCH",
|
|
607
609
|
body: JSON.stringify(variables)
|
|
608
610
|
});
|
|
@@ -613,14 +615,15 @@ var dataProvider = (apiUrl) => ({
|
|
|
613
615
|
return { data };
|
|
614
616
|
},
|
|
615
617
|
deleteOne: async ({ resource, id }) => {
|
|
616
|
-
|
|
618
|
+
const url = new URL(`${apiUrl}/${resource}(${id})`, window.location.origin);
|
|
619
|
+
await httpClient(url.toString(), {
|
|
617
620
|
method: "DELETE"
|
|
618
621
|
});
|
|
619
622
|
return { data: { id } };
|
|
620
623
|
},
|
|
621
624
|
getApiUrl: () => apiUrl,
|
|
622
625
|
getMany: async ({ resource, ids }) => {
|
|
623
|
-
const url = new URL(`${apiUrl}/${resource}
|
|
626
|
+
const url = new URL(`${apiUrl}/${resource}`, window.location.origin);
|
|
624
627
|
const filter = ids.map((id) => {
|
|
625
628
|
const isGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id.toString());
|
|
626
629
|
return `Oid eq ${isGuid ? id : `'${id}'`}`;
|
|
@@ -645,7 +648,10 @@ var dataProvider = (apiUrl) => ({
|
|
|
645
648
|
throw new Error("Not implemented");
|
|
646
649
|
},
|
|
647
650
|
custom: async ({ url, method, filters, sorters, payload, query, headers }) => {
|
|
648
|
-
let requestUrl = new URL(
|
|
651
|
+
let requestUrl = new URL(
|
|
652
|
+
url.startsWith("http") ? url : `${apiUrl}${url}`,
|
|
653
|
+
window.location.origin
|
|
654
|
+
);
|
|
649
655
|
if (filters) {
|
|
650
656
|
const filterString = generateFilterString(filters);
|
|
651
657
|
if (filterString) {
|
|
@@ -795,6 +801,9 @@ var en = {
|
|
|
795
801
|
math: "Math (LaTeX)",
|
|
796
802
|
youtube: "YouTube",
|
|
797
803
|
enterYoutubeUrl: "Enter YouTube URL"
|
|
804
|
+
},
|
|
805
|
+
drawioEditor: {
|
|
806
|
+
loading: "Loading diagram editor..."
|
|
798
807
|
}
|
|
799
808
|
},
|
|
800
809
|
common: {
|
|
@@ -810,9 +819,61 @@ var en = {
|
|
|
810
819
|
dashboard: "Dashboard",
|
|
811
820
|
dataTypeExamples: "Data Type Examples",
|
|
812
821
|
tiptapExamples: "Tiptap Examples",
|
|
822
|
+
drawioExamples: "Drawio Examples",
|
|
813
823
|
users: "Users",
|
|
814
824
|
roles: "Roles",
|
|
815
|
-
settings: "Settings"
|
|
825
|
+
settings: "Settings",
|
|
826
|
+
backgroundJobs: "Background Jobs"
|
|
827
|
+
},
|
|
828
|
+
backgroundJobs: {
|
|
829
|
+
title: "Background Jobs",
|
|
830
|
+
tabs: {
|
|
831
|
+
recurring: "Recurring",
|
|
832
|
+
succeeded: "Succeeded",
|
|
833
|
+
failed: "Failed",
|
|
834
|
+
processing: "Processing"
|
|
835
|
+
},
|
|
836
|
+
columns: {
|
|
837
|
+
id: "ID",
|
|
838
|
+
jobId: "Job ID",
|
|
839
|
+
jobName: "Job Name",
|
|
840
|
+
cron: "Cron",
|
|
841
|
+
queue: "Queue",
|
|
842
|
+
nextExecution: "Next Execution",
|
|
843
|
+
lastState: "Last State",
|
|
844
|
+
succeededAt: "Succeeded At",
|
|
845
|
+
failedAt: "Failed At",
|
|
846
|
+
startedAt: "Started At",
|
|
847
|
+
duration: "Duration (ms)",
|
|
848
|
+
exception: "Exception",
|
|
849
|
+
serverId: "Server ID",
|
|
850
|
+
actions: "Actions"
|
|
851
|
+
},
|
|
852
|
+
status: {
|
|
853
|
+
succeeded: "Succeeded",
|
|
854
|
+
failed: "Failed",
|
|
855
|
+
processing: "Processing",
|
|
856
|
+
scheduled: "Scheduled",
|
|
857
|
+
unknown: "Unknown"
|
|
858
|
+
},
|
|
859
|
+
actions: {
|
|
860
|
+
trigger: "Trigger Now",
|
|
861
|
+
delete: "Delete",
|
|
862
|
+
triggerSuccess: "Job triggered successfully",
|
|
863
|
+
deleteSuccess: "Job deleted successfully",
|
|
864
|
+
triggerError: "Failed to trigger job",
|
|
865
|
+
deleteError: "Failed to delete job"
|
|
866
|
+
},
|
|
867
|
+
drawer: {
|
|
868
|
+
title: "Job Details",
|
|
869
|
+
jobName: "Job Name",
|
|
870
|
+
createdAt: "Created At",
|
|
871
|
+
history: "History",
|
|
872
|
+
state: "State",
|
|
873
|
+
reason: "Reason",
|
|
874
|
+
data: "Data",
|
|
875
|
+
noData: "No Data"
|
|
876
|
+
}
|
|
816
877
|
}
|
|
817
878
|
};
|
|
818
879
|
var zhTW = {
|
|
@@ -890,6 +951,9 @@ var zhTW = {
|
|
|
890
951
|
math: "\u6578\u5B78\u516C\u5F0F (LaTeX)",
|
|
891
952
|
youtube: "YouTube \u5F71\u7247",
|
|
892
953
|
enterYoutubeUrl: "\u8F38\u5165 YouTube \u7DB2\u5740"
|
|
954
|
+
},
|
|
955
|
+
drawioEditor: {
|
|
956
|
+
loading: "\u8F09\u5165\u5716\u8868\u7DE8\u8F2F\u5668\u4E2D..."
|
|
893
957
|
}
|
|
894
958
|
},
|
|
895
959
|
common: {
|
|
@@ -905,9 +969,61 @@ var zhTW = {
|
|
|
905
969
|
dashboard: "\u5100\u8868\u677F",
|
|
906
970
|
dataTypeExamples: "\u8CC7\u6599\u985E\u578B\u7BC4\u4F8B",
|
|
907
971
|
tiptapExamples: "Tiptap \u7BC4\u4F8B",
|
|
972
|
+
drawioExamples: "Drawio \u7BC4\u4F8B",
|
|
908
973
|
users: "\u4F7F\u7528\u8005",
|
|
909
974
|
roles: "\u89D2\u8272",
|
|
910
|
-
settings: "\u8A2D\u5B9A"
|
|
975
|
+
settings: "\u8A2D\u5B9A",
|
|
976
|
+
backgroundJobs: "\u80CC\u666F\u6392\u7A0B"
|
|
977
|
+
},
|
|
978
|
+
backgroundJobs: {
|
|
979
|
+
title: "\u80CC\u666F\u6392\u7A0B",
|
|
980
|
+
tabs: {
|
|
981
|
+
recurring: "\u9031\u671F\u6027\u4EFB\u52D9",
|
|
982
|
+
succeeded: "\u6210\u529F",
|
|
983
|
+
failed: "\u5931\u6557",
|
|
984
|
+
processing: "\u57F7\u884C\u4E2D"
|
|
985
|
+
},
|
|
986
|
+
columns: {
|
|
987
|
+
id: "ID",
|
|
988
|
+
jobId: "\u4EFB\u52D9 ID",
|
|
989
|
+
jobName: "\u4EFB\u52D9\u540D\u7A31",
|
|
990
|
+
cron: "\u6392\u7A0B\u8868\u9054\u5F0F",
|
|
991
|
+
queue: "\u4F47\u5217",
|
|
992
|
+
nextExecution: "\u4E0B\u6B21\u57F7\u884C",
|
|
993
|
+
lastState: "\u6700\u5F8C\u72C0\u614B",
|
|
994
|
+
succeededAt: "\u6210\u529F\u6642\u9593",
|
|
995
|
+
failedAt: "\u5931\u6557\u6642\u9593",
|
|
996
|
+
startedAt: "\u958B\u59CB\u6642\u9593",
|
|
997
|
+
duration: "\u8017\u6642 (\u6BEB\u79D2)",
|
|
998
|
+
exception: "\u4F8B\u5916",
|
|
999
|
+
serverId: "\u4F3A\u670D\u5668 ID",
|
|
1000
|
+
actions: "\u64CD\u4F5C"
|
|
1001
|
+
},
|
|
1002
|
+
status: {
|
|
1003
|
+
succeeded: "\u6210\u529F",
|
|
1004
|
+
failed: "\u5931\u6557",
|
|
1005
|
+
processing: "\u57F7\u884C\u4E2D",
|
|
1006
|
+
scheduled: "\u5DF2\u6392\u7A0B",
|
|
1007
|
+
unknown: "\u672A\u77E5"
|
|
1008
|
+
},
|
|
1009
|
+
actions: {
|
|
1010
|
+
trigger: "\u7ACB\u5373\u57F7\u884C",
|
|
1011
|
+
delete: "\u522A\u9664",
|
|
1012
|
+
triggerSuccess: "\u4EFB\u52D9\u5DF2\u6210\u529F\u89F8\u767C",
|
|
1013
|
+
deleteSuccess: "\u4EFB\u52D9\u5DF2\u6210\u529F\u522A\u9664",
|
|
1014
|
+
triggerError: "\u89F8\u767C\u4EFB\u52D9\u5931\u6557",
|
|
1015
|
+
deleteError: "\u522A\u9664\u4EFB\u52D9\u5931\u6557"
|
|
1016
|
+
},
|
|
1017
|
+
drawer: {
|
|
1018
|
+
title: "\u4EFB\u52D9\u8A73\u60C5",
|
|
1019
|
+
jobName: "\u4EFB\u52D9\u540D\u7A31",
|
|
1020
|
+
createdAt: "\u5EFA\u7ACB\u6642\u9593",
|
|
1021
|
+
history: "\u6B77\u53F2\u7D00\u9304",
|
|
1022
|
+
state: "\u72C0\u614B",
|
|
1023
|
+
reason: "\u539F\u56E0",
|
|
1024
|
+
data: "\u8CC7\u6599",
|
|
1025
|
+
noData: "\u7121\u8CC7\u6599"
|
|
1026
|
+
}
|
|
911
1027
|
}
|
|
912
1028
|
};
|
|
913
1029
|
var refineXafTranslations = {
|
|
@@ -5173,8 +5289,8 @@ var StepResult = class _StepResult {
|
|
|
5173
5289
|
/**
|
|
5174
5290
|
Create a failed step result.
|
|
5175
5291
|
*/
|
|
5176
|
-
static fail(
|
|
5177
|
-
return new _StepResult(null,
|
|
5292
|
+
static fail(message3) {
|
|
5293
|
+
return new _StepResult(null, message3);
|
|
5178
5294
|
}
|
|
5179
5295
|
/**
|
|
5180
5296
|
Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
|
|
@@ -6386,8 +6502,8 @@ var DocAttrStep = class _DocAttrStep extends Step {
|
|
|
6386
6502
|
Step.jsonID("docAttr", DocAttrStep);
|
|
6387
6503
|
var TransformError = class extends Error {
|
|
6388
6504
|
};
|
|
6389
|
-
TransformError = function TransformError2(
|
|
6390
|
-
let err = Error.call(this,
|
|
6505
|
+
TransformError = function TransformError2(message3) {
|
|
6506
|
+
let err = Error.call(this, message3);
|
|
6391
6507
|
err.__proto__ = TransformError2.prototype;
|
|
6392
6508
|
return err;
|
|
6393
6509
|
};
|
|
@@ -19102,10 +19218,109 @@ var TiptapEditor = ({ value, onChange, disabled }) => {
|
|
|
19102
19218
|
);
|
|
19103
19219
|
};
|
|
19104
19220
|
|
|
19221
|
+
// src/components/DrawioEditor.tsx
|
|
19222
|
+
import React7, { useRef, useState as useState4, useMemo as useMemo2 } from "react";
|
|
19223
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
19224
|
+
import { DrawIoEmbed } from "react-drawio";
|
|
19225
|
+
import { theme as theme4, Spin } from "antd/lib";
|
|
19226
|
+
var mapLanguageToDrawio = (lang) => {
|
|
19227
|
+
const langMap = {
|
|
19228
|
+
"zh-TW": "zh-tw",
|
|
19229
|
+
"zh-CN": "zh",
|
|
19230
|
+
"zh": "zh",
|
|
19231
|
+
"en": "en",
|
|
19232
|
+
"ja": "ja",
|
|
19233
|
+
"ko": "ko",
|
|
19234
|
+
"de": "de",
|
|
19235
|
+
"fr": "fr",
|
|
19236
|
+
"es": "es",
|
|
19237
|
+
"pt": "pt",
|
|
19238
|
+
"ru": "ru"
|
|
19239
|
+
};
|
|
19240
|
+
return langMap[lang] || lang.toLowerCase();
|
|
19241
|
+
};
|
|
19242
|
+
var DrawioEditor = ({
|
|
19243
|
+
value,
|
|
19244
|
+
onChange,
|
|
19245
|
+
disabled = false,
|
|
19246
|
+
height = 500,
|
|
19247
|
+
autosave = true
|
|
19248
|
+
}) => {
|
|
19249
|
+
const { token } = theme4.useToken();
|
|
19250
|
+
const { t, i18n } = useTranslation6();
|
|
19251
|
+
const drawioRef = useRef(null);
|
|
19252
|
+
const [isLoading, setIsLoading] = useState4(true);
|
|
19253
|
+
const drawioLang = useMemo2(() => mapLanguageToDrawio(i18n.language), [i18n.language]);
|
|
19254
|
+
const handleSave = (data) => {
|
|
19255
|
+
if (onChange && data.xml) {
|
|
19256
|
+
onChange(data.xml);
|
|
19257
|
+
}
|
|
19258
|
+
};
|
|
19259
|
+
const handleAutoSave = (data) => {
|
|
19260
|
+
if (onChange && data.xml) {
|
|
19261
|
+
onChange(data.xml);
|
|
19262
|
+
}
|
|
19263
|
+
};
|
|
19264
|
+
const handleLoad = () => {
|
|
19265
|
+
setIsLoading(false);
|
|
19266
|
+
};
|
|
19267
|
+
return /* @__PURE__ */ React7.createElement(
|
|
19268
|
+
"div",
|
|
19269
|
+
{
|
|
19270
|
+
style: {
|
|
19271
|
+
border: `1px solid ${token.colorBorder}`,
|
|
19272
|
+
borderRadius: token.borderRadiusLG,
|
|
19273
|
+
overflow: "hidden",
|
|
19274
|
+
backgroundColor: token.colorBgContainer,
|
|
19275
|
+
position: "relative",
|
|
19276
|
+
height: typeof height === "number" ? `${height}px` : height
|
|
19277
|
+
}
|
|
19278
|
+
},
|
|
19279
|
+
isLoading && /* @__PURE__ */ React7.createElement(
|
|
19280
|
+
"div",
|
|
19281
|
+
{
|
|
19282
|
+
style: {
|
|
19283
|
+
position: "absolute",
|
|
19284
|
+
top: 0,
|
|
19285
|
+
left: 0,
|
|
19286
|
+
right: 0,
|
|
19287
|
+
bottom: 0,
|
|
19288
|
+
display: "flex",
|
|
19289
|
+
alignItems: "center",
|
|
19290
|
+
justifyContent: "center",
|
|
19291
|
+
backgroundColor: token.colorBgContainer,
|
|
19292
|
+
zIndex: 10
|
|
19293
|
+
}
|
|
19294
|
+
},
|
|
19295
|
+
/* @__PURE__ */ React7.createElement(Spin, { tip: t("components.drawioEditor.loading", "Loading diagram editor...") })
|
|
19296
|
+
),
|
|
19297
|
+
/* @__PURE__ */ React7.createElement(
|
|
19298
|
+
DrawIoEmbed,
|
|
19299
|
+
{
|
|
19300
|
+
ref: drawioRef,
|
|
19301
|
+
xml: value,
|
|
19302
|
+
autosave: autosave && !disabled,
|
|
19303
|
+
urlParameters: {
|
|
19304
|
+
ui: "kennedy",
|
|
19305
|
+
spin: true,
|
|
19306
|
+
libraries: true,
|
|
19307
|
+
saveAndExit: false,
|
|
19308
|
+
noSaveBtn: disabled,
|
|
19309
|
+
noExitBtn: true,
|
|
19310
|
+
lang: drawioLang
|
|
19311
|
+
},
|
|
19312
|
+
onLoad: handleLoad,
|
|
19313
|
+
onSave: handleSave,
|
|
19314
|
+
onAutoSave: handleAutoSave
|
|
19315
|
+
}
|
|
19316
|
+
)
|
|
19317
|
+
);
|
|
19318
|
+
};
|
|
19319
|
+
|
|
19105
19320
|
// src/pages/login/index.tsx
|
|
19106
|
-
import
|
|
19321
|
+
import React8 from "react";
|
|
19107
19322
|
import { useLogin, useTranslate } from "@refinedev/core";
|
|
19108
|
-
import { Button as Button5, Form as Form4, Input as Input4, Card, Typography as Typography2, Layout as Layout2, theme as
|
|
19323
|
+
import { Button as Button5, Form as Form4, Input as Input4, Card, Typography as Typography2, Layout as Layout2, theme as theme5, Checkbox as Checkbox2, Divider } from "antd/lib";
|
|
19109
19324
|
import { ThemedTitle } from "@refinedev/antd";
|
|
19110
19325
|
import { useNavigate } from "react-router";
|
|
19111
19326
|
var { Title, Link } = Typography2;
|
|
@@ -19114,12 +19329,12 @@ var LoginPage = () => {
|
|
|
19114
19329
|
const { mutate: login, isPending } = useLogin();
|
|
19115
19330
|
const isLoading = isPending;
|
|
19116
19331
|
const translate = useTranslate();
|
|
19117
|
-
const { token } =
|
|
19332
|
+
const { token } = theme5.useToken();
|
|
19118
19333
|
const navigate = useNavigate();
|
|
19119
19334
|
const onFinish = async (values) => {
|
|
19120
19335
|
login(values);
|
|
19121
19336
|
};
|
|
19122
|
-
return /* @__PURE__ */
|
|
19337
|
+
return /* @__PURE__ */ React8.createElement(
|
|
19123
19338
|
Layout2,
|
|
19124
19339
|
{
|
|
19125
19340
|
style: {
|
|
@@ -19129,14 +19344,14 @@ var LoginPage = () => {
|
|
|
19129
19344
|
backgroundColor: token.colorBgContainer
|
|
19130
19345
|
}
|
|
19131
19346
|
},
|
|
19132
|
-
/* @__PURE__ */
|
|
19347
|
+
/* @__PURE__ */ React8.createElement("div", { style: { marginBottom: "24px" } }, /* @__PURE__ */ React8.createElement(
|
|
19133
19348
|
ThemedTitle,
|
|
19134
19349
|
{
|
|
19135
19350
|
collapsed: false,
|
|
19136
19351
|
wrapperStyles: { fontSize: "22px", justifyContent: "center" }
|
|
19137
19352
|
}
|
|
19138
19353
|
)),
|
|
19139
|
-
/* @__PURE__ */
|
|
19354
|
+
/* @__PURE__ */ React8.createElement(
|
|
19140
19355
|
Card,
|
|
19141
19356
|
{
|
|
19142
19357
|
style: {
|
|
@@ -19146,8 +19361,8 @@ var LoginPage = () => {
|
|
|
19146
19361
|
boxShadow: "0 4px 24px -4px rgba(0, 0, 0, 0.1)"
|
|
19147
19362
|
}
|
|
19148
19363
|
},
|
|
19149
|
-
/* @__PURE__ */
|
|
19150
|
-
/* @__PURE__ */
|
|
19364
|
+
/* @__PURE__ */ React8.createElement("div", { style: { textAlign: "center", marginBottom: "32px" } }, /* @__PURE__ */ React8.createElement(Title, { level: 3, style: { color: token.colorPrimary, margin: 0 } }, translate("pages.login.title", "Sign in to your account")), /* @__PURE__ */ React8.createElement(Typography2.Text, { type: "secondary", style: { fontSize: "14px", marginTop: "8px", display: "block" } }, "Log in using a local account")),
|
|
19365
|
+
/* @__PURE__ */ React8.createElement(
|
|
19151
19366
|
Form4,
|
|
19152
19367
|
{
|
|
19153
19368
|
layout: "vertical",
|
|
@@ -19157,7 +19372,7 @@ var LoginPage = () => {
|
|
|
19157
19372
|
remember: false
|
|
19158
19373
|
}
|
|
19159
19374
|
},
|
|
19160
|
-
/* @__PURE__ */
|
|
19375
|
+
/* @__PURE__ */ React8.createElement(
|
|
19161
19376
|
Form4.Item,
|
|
19162
19377
|
{
|
|
19163
19378
|
label: translate("pages.login.fields.username", "Username"),
|
|
@@ -19172,9 +19387,9 @@ var LoginPage = () => {
|
|
|
19172
19387
|
}
|
|
19173
19388
|
]
|
|
19174
19389
|
},
|
|
19175
|
-
/* @__PURE__ */
|
|
19390
|
+
/* @__PURE__ */ React8.createElement(Input4, { size: "large", placeholder: "Username" })
|
|
19176
19391
|
),
|
|
19177
|
-
/* @__PURE__ */
|
|
19392
|
+
/* @__PURE__ */ React8.createElement(
|
|
19178
19393
|
Form4.Item,
|
|
19179
19394
|
{
|
|
19180
19395
|
label: translate("pages.login.fields.password", "Password"),
|
|
@@ -19189,9 +19404,9 @@ var LoginPage = () => {
|
|
|
19189
19404
|
}
|
|
19190
19405
|
]
|
|
19191
19406
|
},
|
|
19192
|
-
/* @__PURE__ */
|
|
19407
|
+
/* @__PURE__ */ React8.createElement(Input4.Password, { size: "large", placeholder: "Password" })
|
|
19193
19408
|
),
|
|
19194
|
-
/* @__PURE__ */
|
|
19409
|
+
/* @__PURE__ */ React8.createElement(
|
|
19195
19410
|
"div",
|
|
19196
19411
|
{
|
|
19197
19412
|
style: {
|
|
@@ -19200,8 +19415,8 @@ var LoginPage = () => {
|
|
|
19200
19415
|
marginBottom: "24px"
|
|
19201
19416
|
}
|
|
19202
19417
|
},
|
|
19203
|
-
/* @__PURE__ */
|
|
19204
|
-
/* @__PURE__ */
|
|
19418
|
+
/* @__PURE__ */ React8.createElement(Form4.Item, { name: "remember", valuePropName: "checked", noStyle: true }, /* @__PURE__ */ React8.createElement(Checkbox2, null, translate("pages.login.buttons.rememberMe", "Remember me"))),
|
|
19419
|
+
/* @__PURE__ */ React8.createElement(
|
|
19205
19420
|
Link,
|
|
19206
19421
|
{
|
|
19207
19422
|
onClick: () => {
|
|
@@ -19211,7 +19426,7 @@ var LoginPage = () => {
|
|
|
19211
19426
|
translate("pages.login.buttons.forgotPassword", "Forgot password?")
|
|
19212
19427
|
)
|
|
19213
19428
|
),
|
|
19214
|
-
/* @__PURE__ */
|
|
19429
|
+
/* @__PURE__ */ React8.createElement(Form4.Item, null, /* @__PURE__ */ React8.createElement(
|
|
19215
19430
|
Button5,
|
|
19216
19431
|
{
|
|
19217
19432
|
type: "primary",
|
|
@@ -19222,8 +19437,8 @@ var LoginPage = () => {
|
|
|
19222
19437
|
},
|
|
19223
19438
|
translate("pages.login.signin", "Sign in")
|
|
19224
19439
|
)),
|
|
19225
|
-
/* @__PURE__ */
|
|
19226
|
-
/* @__PURE__ */
|
|
19440
|
+
/* @__PURE__ */ React8.createElement(Divider, { plain: true }, "or"),
|
|
19441
|
+
/* @__PURE__ */ React8.createElement(
|
|
19227
19442
|
Button5,
|
|
19228
19443
|
{
|
|
19229
19444
|
block: true,
|
|
@@ -19238,9 +19453,9 @@ var LoginPage = () => {
|
|
|
19238
19453
|
};
|
|
19239
19454
|
|
|
19240
19455
|
// src/pages/login/keycloak.tsx
|
|
19241
|
-
import
|
|
19456
|
+
import React9 from "react";
|
|
19242
19457
|
import { useLogin as useLogin2, useTranslate as useTranslate2 } from "@refinedev/core";
|
|
19243
|
-
import { Button as Button6, Card as Card2, Typography as Typography3, Layout as Layout3, theme as
|
|
19458
|
+
import { Button as Button6, Card as Card2, Typography as Typography3, Layout as Layout3, theme as theme6, Divider as Divider2 } from "antd/lib";
|
|
19244
19459
|
import { ThemedTitle as ThemedTitle2 } from "@refinedev/antd";
|
|
19245
19460
|
import { useNavigate as useNavigate2 } from "react-router";
|
|
19246
19461
|
var { Title: Title2 } = Typography3;
|
|
@@ -19248,12 +19463,12 @@ var KeycloakLoginPage = () => {
|
|
|
19248
19463
|
const { mutate: login, isPending } = useLogin2();
|
|
19249
19464
|
const isLoading = isPending;
|
|
19250
19465
|
const translate = useTranslate2();
|
|
19251
|
-
const { token } =
|
|
19466
|
+
const { token } = theme6.useToken();
|
|
19252
19467
|
const navigate = useNavigate2();
|
|
19253
19468
|
const handleKeycloakLogin = () => {
|
|
19254
19469
|
login({ provider: "keycloak" });
|
|
19255
19470
|
};
|
|
19256
|
-
return /* @__PURE__ */
|
|
19471
|
+
return /* @__PURE__ */ React9.createElement(
|
|
19257
19472
|
Layout3,
|
|
19258
19473
|
{
|
|
19259
19474
|
style: {
|
|
@@ -19263,14 +19478,14 @@ var KeycloakLoginPage = () => {
|
|
|
19263
19478
|
backgroundColor: token.colorBgContainer
|
|
19264
19479
|
}
|
|
19265
19480
|
},
|
|
19266
|
-
/* @__PURE__ */
|
|
19481
|
+
/* @__PURE__ */ React9.createElement("div", { style: { marginBottom: "24px" } }, /* @__PURE__ */ React9.createElement(
|
|
19267
19482
|
ThemedTitle2,
|
|
19268
19483
|
{
|
|
19269
19484
|
collapsed: false,
|
|
19270
19485
|
wrapperStyles: { fontSize: "22px", justifyContent: "center" }
|
|
19271
19486
|
}
|
|
19272
19487
|
)),
|
|
19273
|
-
/* @__PURE__ */
|
|
19488
|
+
/* @__PURE__ */ React9.createElement(
|
|
19274
19489
|
Card2,
|
|
19275
19490
|
{
|
|
19276
19491
|
style: {
|
|
@@ -19280,8 +19495,8 @@ var KeycloakLoginPage = () => {
|
|
|
19280
19495
|
boxShadow: "0 4px 24px -4px rgba(0, 0, 0, 0.1)"
|
|
19281
19496
|
}
|
|
19282
19497
|
},
|
|
19283
|
-
/* @__PURE__ */
|
|
19284
|
-
/* @__PURE__ */
|
|
19498
|
+
/* @__PURE__ */ React9.createElement("div", { style: { textAlign: "center", marginBottom: "32px" } }, /* @__PURE__ */ React9.createElement(Title2, { level: 3, style: { color: token.colorPrimary, margin: 0 } }, translate("pages.login.title", "Sign in to your account")), /* @__PURE__ */ React9.createElement(Typography3.Text, { type: "secondary", style: { fontSize: "14px", marginTop: "8px", display: "block" } }, "Choose your authentication method")),
|
|
19499
|
+
/* @__PURE__ */ React9.createElement(
|
|
19285
19500
|
Button6,
|
|
19286
19501
|
{
|
|
19287
19502
|
type: "primary",
|
|
@@ -19293,8 +19508,8 @@ var KeycloakLoginPage = () => {
|
|
|
19293
19508
|
},
|
|
19294
19509
|
"Sign in with Keycloak"
|
|
19295
19510
|
),
|
|
19296
|
-
/* @__PURE__ */
|
|
19297
|
-
/* @__PURE__ */
|
|
19511
|
+
/* @__PURE__ */ React9.createElement(Divider2, { plain: true }, "or"),
|
|
19512
|
+
/* @__PURE__ */ React9.createElement(
|
|
19298
19513
|
Button6,
|
|
19299
19514
|
{
|
|
19300
19515
|
block: true,
|
|
@@ -19308,14 +19523,14 @@ var KeycloakLoginPage = () => {
|
|
|
19308
19523
|
};
|
|
19309
19524
|
|
|
19310
19525
|
// src/pages/auth/AuthCallback.tsx
|
|
19311
|
-
import
|
|
19526
|
+
import React10, { useEffect as useEffect5, useState as useState5, useRef as useRef2 } from "react";
|
|
19312
19527
|
import { useLogin as useLogin3 } from "@refinedev/core";
|
|
19313
|
-
import { Spin, Result } from "antd";
|
|
19528
|
+
import { Spin as Spin2, Result } from "antd";
|
|
19314
19529
|
var AuthCallback = () => {
|
|
19315
19530
|
const { mutate: login } = useLogin3();
|
|
19316
|
-
const [error, setError] =
|
|
19317
|
-
const [processing, setProcessing] =
|
|
19318
|
-
const hasProcessed =
|
|
19531
|
+
const [error, setError] = useState5(null);
|
|
19532
|
+
const [processing, setProcessing] = useState5(false);
|
|
19533
|
+
const hasProcessed = useRef2(false);
|
|
19319
19534
|
useEffect5(() => {
|
|
19320
19535
|
if (hasProcessed.current || processing) {
|
|
19321
19536
|
return;
|
|
@@ -19359,13 +19574,13 @@ var AuthCallback = () => {
|
|
|
19359
19574
|
handleCallback();
|
|
19360
19575
|
}, [login, processing]);
|
|
19361
19576
|
if (error) {
|
|
19362
|
-
return /* @__PURE__ */
|
|
19577
|
+
return /* @__PURE__ */ React10.createElement(
|
|
19363
19578
|
Result,
|
|
19364
19579
|
{
|
|
19365
19580
|
status: "error",
|
|
19366
19581
|
title: "Authentication Failed",
|
|
19367
19582
|
subTitle: error,
|
|
19368
|
-
extra: /* @__PURE__ */
|
|
19583
|
+
extra: /* @__PURE__ */ React10.createElement(
|
|
19369
19584
|
"button",
|
|
19370
19585
|
{
|
|
19371
19586
|
onClick: () => window.location.href = "/login",
|
|
@@ -19383,7 +19598,7 @@ var AuthCallback = () => {
|
|
|
19383
19598
|
}
|
|
19384
19599
|
);
|
|
19385
19600
|
}
|
|
19386
|
-
return /* @__PURE__ */
|
|
19601
|
+
return /* @__PURE__ */ React10.createElement(
|
|
19387
19602
|
"div",
|
|
19388
19603
|
{
|
|
19389
19604
|
style: {
|
|
@@ -19395,13 +19610,13 @@ var AuthCallback = () => {
|
|
|
19395
19610
|
gap: "16px"
|
|
19396
19611
|
}
|
|
19397
19612
|
},
|
|
19398
|
-
/* @__PURE__ */
|
|
19399
|
-
/* @__PURE__ */
|
|
19613
|
+
/* @__PURE__ */ React10.createElement(Spin2, { size: "large" }),
|
|
19614
|
+
/* @__PURE__ */ React10.createElement("p", null, "Completing authentication...")
|
|
19400
19615
|
);
|
|
19401
19616
|
};
|
|
19402
19617
|
|
|
19403
19618
|
// src/pages/application-users/list.tsx
|
|
19404
|
-
import
|
|
19619
|
+
import React11, { useState as useState6 } from "react";
|
|
19405
19620
|
import { useNotification } from "@refinedev/core";
|
|
19406
19621
|
import { EditButton, DeleteButton } from "@refinedev/antd";
|
|
19407
19622
|
import {
|
|
@@ -19416,11 +19631,11 @@ import {
|
|
|
19416
19631
|
} from "antd/lib";
|
|
19417
19632
|
import { KeyOutlined, ThunderboltOutlined as ThunderboltOutlined2 } from "@ant-design/icons";
|
|
19418
19633
|
var ApplicationUserList = () => {
|
|
19419
|
-
const [isModalOpen, setIsModalOpen] =
|
|
19420
|
-
const [selectedUser, setSelectedUser] =
|
|
19634
|
+
const [isModalOpen, setIsModalOpen] = useState6(false);
|
|
19635
|
+
const [selectedUser, setSelectedUser] = useState6(null);
|
|
19421
19636
|
const [form] = Form5.useForm();
|
|
19422
19637
|
const { open } = useNotification();
|
|
19423
|
-
const [isLoading, setIsLoading] =
|
|
19638
|
+
const [isLoading, setIsLoading] = useState6(false);
|
|
19424
19639
|
const handleResetPasswordClick = (user) => {
|
|
19425
19640
|
setSelectedUser(user);
|
|
19426
19641
|
setIsModalOpen(true);
|
|
@@ -19450,20 +19665,20 @@ var ApplicationUserList = () => {
|
|
|
19450
19665
|
setIsLoading(false);
|
|
19451
19666
|
}
|
|
19452
19667
|
};
|
|
19453
|
-
return /* @__PURE__ */
|
|
19668
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(
|
|
19454
19669
|
SmartList,
|
|
19455
19670
|
{
|
|
19456
19671
|
searchFields: ["UserName", "DisplayName", "Email"]
|
|
19457
19672
|
},
|
|
19458
|
-
/* @__PURE__ */
|
|
19673
|
+
/* @__PURE__ */ React11.createElement(
|
|
19459
19674
|
Table4.Column,
|
|
19460
19675
|
{
|
|
19461
19676
|
dataIndex: "Photo",
|
|
19462
19677
|
title: "Photo",
|
|
19463
|
-
render: (value) => value ? /* @__PURE__ */
|
|
19678
|
+
render: (value) => value ? /* @__PURE__ */ React11.createElement("img", { src: `data:image/png;base64,${value}`, alt: "User", style: { height: 40, width: 40, objectFit: "cover", borderRadius: "50%" } }) : "-"
|
|
19464
19679
|
}
|
|
19465
19680
|
),
|
|
19466
|
-
/* @__PURE__ */
|
|
19681
|
+
/* @__PURE__ */ React11.createElement(
|
|
19467
19682
|
Table4.Column,
|
|
19468
19683
|
{
|
|
19469
19684
|
dataIndex: "DisplayName",
|
|
@@ -19473,7 +19688,7 @@ var ApplicationUserList = () => {
|
|
|
19473
19688
|
defaultVisible: true
|
|
19474
19689
|
}
|
|
19475
19690
|
),
|
|
19476
|
-
/* @__PURE__ */
|
|
19691
|
+
/* @__PURE__ */ React11.createElement(
|
|
19477
19692
|
Table4.Column,
|
|
19478
19693
|
{
|
|
19479
19694
|
dataIndex: "UserName",
|
|
@@ -19482,7 +19697,7 @@ var ApplicationUserList = () => {
|
|
|
19482
19697
|
defaultVisible: true
|
|
19483
19698
|
}
|
|
19484
19699
|
),
|
|
19485
|
-
/* @__PURE__ */
|
|
19700
|
+
/* @__PURE__ */ React11.createElement(
|
|
19486
19701
|
Table4.Column,
|
|
19487
19702
|
{
|
|
19488
19703
|
dataIndex: "Email",
|
|
@@ -19490,38 +19705,38 @@ var ApplicationUserList = () => {
|
|
|
19490
19705
|
sorter: true
|
|
19491
19706
|
}
|
|
19492
19707
|
),
|
|
19493
|
-
/* @__PURE__ */
|
|
19708
|
+
/* @__PURE__ */ React11.createElement(
|
|
19494
19709
|
Table4.Column,
|
|
19495
19710
|
{
|
|
19496
19711
|
dataIndex: "IsActive",
|
|
19497
19712
|
title: "Active",
|
|
19498
|
-
render: (value) => /* @__PURE__ */
|
|
19713
|
+
render: (value) => /* @__PURE__ */ React11.createElement(Checkbox3, { checked: value, disabled: true }),
|
|
19499
19714
|
sorter: true
|
|
19500
19715
|
}
|
|
19501
19716
|
),
|
|
19502
|
-
/* @__PURE__ */
|
|
19717
|
+
/* @__PURE__ */ React11.createElement(
|
|
19503
19718
|
Table4.Column,
|
|
19504
19719
|
{
|
|
19505
19720
|
dataIndex: "AccessFailedCount",
|
|
19506
19721
|
title: "Access Failed Count"
|
|
19507
19722
|
}
|
|
19508
19723
|
),
|
|
19509
|
-
/* @__PURE__ */
|
|
19724
|
+
/* @__PURE__ */ React11.createElement(
|
|
19510
19725
|
Table4.Column,
|
|
19511
19726
|
{
|
|
19512
19727
|
title: "Actions",
|
|
19513
19728
|
dataIndex: "actions",
|
|
19514
|
-
render: (_, record) => /* @__PURE__ */
|
|
19729
|
+
render: (_, record) => /* @__PURE__ */ React11.createElement(Space6, null, /* @__PURE__ */ React11.createElement(Tooltip, { title: "Reset Password" }, /* @__PURE__ */ React11.createElement(
|
|
19515
19730
|
Button7,
|
|
19516
19731
|
{
|
|
19517
19732
|
size: "small",
|
|
19518
|
-
icon: /* @__PURE__ */
|
|
19733
|
+
icon: /* @__PURE__ */ React11.createElement(KeyOutlined, null),
|
|
19519
19734
|
onClick: () => handleResetPasswordClick(record)
|
|
19520
19735
|
}
|
|
19521
|
-
)), /* @__PURE__ */
|
|
19736
|
+
)), /* @__PURE__ */ React11.createElement(EditButton, { hideText: true, size: "small", recordItemId: record.Oid }), /* @__PURE__ */ React11.createElement(DeleteButton, { hideText: true, size: "small", recordItemId: record.Oid }))
|
|
19522
19737
|
}
|
|
19523
19738
|
)
|
|
19524
|
-
), /* @__PURE__ */
|
|
19739
|
+
), /* @__PURE__ */ React11.createElement(
|
|
19525
19740
|
Modal3,
|
|
19526
19741
|
{
|
|
19527
19742
|
title: `Reset Password for ${selectedUser?.DisplayName || selectedUser?.UserName}`,
|
|
@@ -19530,7 +19745,7 @@ var ApplicationUserList = () => {
|
|
|
19530
19745
|
onOk: () => form.submit(),
|
|
19531
19746
|
confirmLoading: isLoading
|
|
19532
19747
|
},
|
|
19533
|
-
/* @__PURE__ */
|
|
19748
|
+
/* @__PURE__ */ React11.createElement(Form5, { form, onFinish: handleResetPasswordSubmit, layout: "vertical" }, /* @__PURE__ */ React11.createElement("div", { style: { display: "flex", gap: 8, alignItems: "flex-end" } }, /* @__PURE__ */ React11.createElement(
|
|
19534
19749
|
Form5.Item,
|
|
19535
19750
|
{
|
|
19536
19751
|
name: "password",
|
|
@@ -19538,18 +19753,18 @@ var ApplicationUserList = () => {
|
|
|
19538
19753
|
style: { flex: 1, marginBottom: 0 },
|
|
19539
19754
|
rules: [{ required: true, message: "Please input the new password!" }]
|
|
19540
19755
|
},
|
|
19541
|
-
/* @__PURE__ */
|
|
19542
|
-
), /* @__PURE__ */
|
|
19756
|
+
/* @__PURE__ */ React11.createElement(Input5.Password, { placeholder: "Enter new password" })
|
|
19757
|
+
), /* @__PURE__ */ React11.createElement(Tooltip, { title: "Generate Complex Password" }, /* @__PURE__ */ React11.createElement(Button7, { icon: /* @__PURE__ */ React11.createElement(ThunderboltOutlined2, null), onClick: handleGeneratePassword }))))
|
|
19543
19758
|
));
|
|
19544
19759
|
};
|
|
19545
19760
|
|
|
19546
19761
|
// src/pages/application-users/create.tsx
|
|
19547
|
-
import
|
|
19762
|
+
import React12 from "react";
|
|
19548
19763
|
import { Create, useForm } from "@refinedev/antd";
|
|
19549
19764
|
import { Form as Form6, Input as Input6, Checkbox as Checkbox4 } from "antd/lib";
|
|
19550
19765
|
var ApplicationUserCreate = () => {
|
|
19551
19766
|
const { formProps, saveButtonProps } = useForm();
|
|
19552
|
-
return /* @__PURE__ */
|
|
19767
|
+
return /* @__PURE__ */ React12.createElement(Create, { saveButtonProps }, /* @__PURE__ */ React12.createElement(Form6, { ...formProps, layout: "vertical" }, /* @__PURE__ */ React12.createElement(
|
|
19553
19768
|
Form6.Item,
|
|
19554
19769
|
{
|
|
19555
19770
|
label: "User Name",
|
|
@@ -19560,15 +19775,15 @@ var ApplicationUserCreate = () => {
|
|
|
19560
19775
|
}
|
|
19561
19776
|
]
|
|
19562
19777
|
},
|
|
19563
|
-
/* @__PURE__ */
|
|
19564
|
-
), /* @__PURE__ */
|
|
19778
|
+
/* @__PURE__ */ React12.createElement(Input6, null)
|
|
19779
|
+
), /* @__PURE__ */ React12.createElement(
|
|
19565
19780
|
Form6.Item,
|
|
19566
19781
|
{
|
|
19567
19782
|
label: "Display Name",
|
|
19568
19783
|
name: "DisplayName"
|
|
19569
19784
|
},
|
|
19570
|
-
/* @__PURE__ */
|
|
19571
|
-
), /* @__PURE__ */
|
|
19785
|
+
/* @__PURE__ */ React12.createElement(Input6, null)
|
|
19786
|
+
), /* @__PURE__ */ React12.createElement(
|
|
19572
19787
|
Form6.Item,
|
|
19573
19788
|
{
|
|
19574
19789
|
label: "Email",
|
|
@@ -19579,8 +19794,8 @@ var ApplicationUserCreate = () => {
|
|
|
19579
19794
|
}
|
|
19580
19795
|
]
|
|
19581
19796
|
},
|
|
19582
|
-
/* @__PURE__ */
|
|
19583
|
-
), /* @__PURE__ */
|
|
19797
|
+
/* @__PURE__ */ React12.createElement(Input6, null)
|
|
19798
|
+
), /* @__PURE__ */ React12.createElement(
|
|
19584
19799
|
Form6.Item,
|
|
19585
19800
|
{
|
|
19586
19801
|
label: "Is Active",
|
|
@@ -19588,23 +19803,23 @@ var ApplicationUserCreate = () => {
|
|
|
19588
19803
|
valuePropName: "checked",
|
|
19589
19804
|
initialValue: true
|
|
19590
19805
|
},
|
|
19591
|
-
/* @__PURE__ */
|
|
19592
|
-
), /* @__PURE__ */
|
|
19806
|
+
/* @__PURE__ */ React12.createElement(Checkbox4, null, "Active")
|
|
19807
|
+
), /* @__PURE__ */ React12.createElement(
|
|
19593
19808
|
Form6.Item,
|
|
19594
19809
|
{
|
|
19595
19810
|
label: "Photo",
|
|
19596
19811
|
name: "Photo"
|
|
19597
19812
|
},
|
|
19598
|
-
/* @__PURE__ */
|
|
19813
|
+
/* @__PURE__ */ React12.createElement(Base64Upload, null)
|
|
19599
19814
|
)));
|
|
19600
19815
|
};
|
|
19601
19816
|
|
|
19602
19817
|
// src/pages/application-users/edit.tsx
|
|
19603
|
-
import
|
|
19818
|
+
import React13 from "react";
|
|
19604
19819
|
import { Edit, useForm as useForm2, useSelect } from "@refinedev/antd";
|
|
19605
19820
|
import { Form as Form7, Input as Input7, Checkbox as Checkbox5, Select, App } from "antd/lib";
|
|
19606
19821
|
var ApplicationUserEdit = () => {
|
|
19607
|
-
const { message:
|
|
19822
|
+
const { message: message3 } = App.useApp();
|
|
19608
19823
|
const { formProps, saveButtonProps, id, form } = useForm2({
|
|
19609
19824
|
meta: {
|
|
19610
19825
|
expand: ["Roles"]
|
|
@@ -19625,12 +19840,12 @@ var ApplicationUserEdit = () => {
|
|
|
19625
19840
|
})
|
|
19626
19841
|
});
|
|
19627
19842
|
if (response.ok) {
|
|
19628
|
-
|
|
19843
|
+
message3.success("Roles updated successfully");
|
|
19629
19844
|
} else {
|
|
19630
|
-
|
|
19845
|
+
message3.error("Failed to update roles");
|
|
19631
19846
|
}
|
|
19632
19847
|
} catch (e) {
|
|
19633
|
-
|
|
19848
|
+
message3.error("Error updating roles");
|
|
19634
19849
|
}
|
|
19635
19850
|
}
|
|
19636
19851
|
});
|
|
@@ -19643,7 +19858,7 @@ var ApplicationUserEdit = () => {
|
|
|
19643
19858
|
const { Roles, ...userValues } = values;
|
|
19644
19859
|
formProps.onFinish?.(userValues);
|
|
19645
19860
|
};
|
|
19646
|
-
return /* @__PURE__ */
|
|
19861
|
+
return /* @__PURE__ */ React13.createElement(Edit, { saveButtonProps }, /* @__PURE__ */ React13.createElement(Form7, { ...formProps, layout: "vertical", onFinish: handleOnFinish }, /* @__PURE__ */ React13.createElement(
|
|
19647
19862
|
Form7.Item,
|
|
19648
19863
|
{
|
|
19649
19864
|
label: "User Name",
|
|
@@ -19654,15 +19869,15 @@ var ApplicationUserEdit = () => {
|
|
|
19654
19869
|
}
|
|
19655
19870
|
]
|
|
19656
19871
|
},
|
|
19657
|
-
/* @__PURE__ */
|
|
19658
|
-
), /* @__PURE__ */
|
|
19872
|
+
/* @__PURE__ */ React13.createElement(Input7, null)
|
|
19873
|
+
), /* @__PURE__ */ React13.createElement(
|
|
19659
19874
|
Form7.Item,
|
|
19660
19875
|
{
|
|
19661
19876
|
label: "Display Name",
|
|
19662
19877
|
name: "DisplayName"
|
|
19663
19878
|
},
|
|
19664
|
-
/* @__PURE__ */
|
|
19665
|
-
), /* @__PURE__ */
|
|
19879
|
+
/* @__PURE__ */ React13.createElement(Input7, null)
|
|
19880
|
+
), /* @__PURE__ */ React13.createElement(
|
|
19666
19881
|
Form7.Item,
|
|
19667
19882
|
{
|
|
19668
19883
|
label: "Email",
|
|
@@ -19673,16 +19888,16 @@ var ApplicationUserEdit = () => {
|
|
|
19673
19888
|
}
|
|
19674
19889
|
]
|
|
19675
19890
|
},
|
|
19676
|
-
/* @__PURE__ */
|
|
19677
|
-
), /* @__PURE__ */
|
|
19891
|
+
/* @__PURE__ */ React13.createElement(Input7, null)
|
|
19892
|
+
), /* @__PURE__ */ React13.createElement(
|
|
19678
19893
|
Form7.Item,
|
|
19679
19894
|
{
|
|
19680
19895
|
label: "Is Active",
|
|
19681
19896
|
name: "IsActive",
|
|
19682
19897
|
valuePropName: "checked"
|
|
19683
19898
|
},
|
|
19684
|
-
/* @__PURE__ */
|
|
19685
|
-
), /* @__PURE__ */
|
|
19899
|
+
/* @__PURE__ */ React13.createElement(Checkbox5, null, "Active")
|
|
19900
|
+
), /* @__PURE__ */ React13.createElement(
|
|
19686
19901
|
Form7.Item,
|
|
19687
19902
|
{
|
|
19688
19903
|
label: "Roles",
|
|
@@ -19701,49 +19916,49 @@ var ApplicationUserEdit = () => {
|
|
|
19701
19916
|
return { value: [] };
|
|
19702
19917
|
}
|
|
19703
19918
|
},
|
|
19704
|
-
/* @__PURE__ */
|
|
19705
|
-
), /* @__PURE__ */
|
|
19919
|
+
/* @__PURE__ */ React13.createElement(Select, { ...roleSelectProps, mode: "multiple" })
|
|
19920
|
+
), /* @__PURE__ */ React13.createElement(
|
|
19706
19921
|
Form7.Item,
|
|
19707
19922
|
{
|
|
19708
19923
|
label: "Photo",
|
|
19709
19924
|
name: "Photo"
|
|
19710
19925
|
},
|
|
19711
|
-
/* @__PURE__ */
|
|
19926
|
+
/* @__PURE__ */ React13.createElement(Base64Upload, null)
|
|
19712
19927
|
)));
|
|
19713
19928
|
};
|
|
19714
19929
|
|
|
19715
19930
|
// src/pages/roles/list.tsx
|
|
19716
|
-
import
|
|
19931
|
+
import React14 from "react";
|
|
19717
19932
|
import { useTable as useTable2, List as List2, EditButton as EditButton2, DeleteButton as DeleteButton2 } from "@refinedev/antd";
|
|
19718
19933
|
import { Table as Table5, Space as Space7, Checkbox as Checkbox6 } from "antd/lib";
|
|
19719
19934
|
var RoleList = () => {
|
|
19720
19935
|
const { tableProps } = useTable2({
|
|
19721
19936
|
syncWithLocation: true
|
|
19722
19937
|
});
|
|
19723
|
-
return /* @__PURE__ */
|
|
19938
|
+
return /* @__PURE__ */ React14.createElement(List2, null, /* @__PURE__ */ React14.createElement(Table5, { ...tableProps, rowKey: "Oid" }, /* @__PURE__ */ React14.createElement(Table5.Column, { dataIndex: "Name", title: "Name" }), /* @__PURE__ */ React14.createElement(
|
|
19724
19939
|
Table5.Column,
|
|
19725
19940
|
{
|
|
19726
19941
|
dataIndex: "IsAdministrative",
|
|
19727
19942
|
title: "Is Administrative",
|
|
19728
|
-
render: (value) => /* @__PURE__ */
|
|
19943
|
+
render: (value) => /* @__PURE__ */ React14.createElement(Checkbox6, { checked: value, disabled: true })
|
|
19729
19944
|
}
|
|
19730
|
-
), /* @__PURE__ */
|
|
19945
|
+
), /* @__PURE__ */ React14.createElement(Table5.Column, { dataIndex: "PermissionPolicy", title: "Permission Policy" }), /* @__PURE__ */ React14.createElement(
|
|
19731
19946
|
Table5.Column,
|
|
19732
19947
|
{
|
|
19733
19948
|
title: "Actions",
|
|
19734
19949
|
dataIndex: "actions",
|
|
19735
|
-
render: (_, record) => /* @__PURE__ */
|
|
19950
|
+
render: (_, record) => /* @__PURE__ */ React14.createElement(Space7, null, /* @__PURE__ */ React14.createElement(EditButton2, { hideText: true, size: "small", recordItemId: record.Oid }), /* @__PURE__ */ React14.createElement(DeleteButton2, { hideText: true, size: "small", recordItemId: record.Oid }))
|
|
19736
19951
|
}
|
|
19737
19952
|
)));
|
|
19738
19953
|
};
|
|
19739
19954
|
|
|
19740
19955
|
// src/pages/roles/create.tsx
|
|
19741
|
-
import
|
|
19956
|
+
import React16 from "react";
|
|
19742
19957
|
import { Create as Create2, useForm as useForm3 } from "@refinedev/antd";
|
|
19743
19958
|
import { Form as Form9, Input as Input8, Checkbox as Checkbox7, Select as Select3 } from "antd/lib";
|
|
19744
19959
|
|
|
19745
19960
|
// src/pages/roles/TypePermissionList.tsx
|
|
19746
|
-
import
|
|
19961
|
+
import React15 from "react";
|
|
19747
19962
|
import { Form as Form8, Select as Select2, Table as Table6 } from "antd/lib";
|
|
19748
19963
|
import { useTable as useTable3 } from "@refinedev/antd";
|
|
19749
19964
|
|
|
@@ -19772,7 +19987,7 @@ var useModelTypes = () => {
|
|
|
19772
19987
|
};
|
|
19773
19988
|
|
|
19774
19989
|
// src/pages/roles/TypePermissionList.tsx
|
|
19775
|
-
var PermissionSelect = (props) => /* @__PURE__ */
|
|
19990
|
+
var PermissionSelect = (props) => /* @__PURE__ */ React15.createElement(
|
|
19776
19991
|
Select2,
|
|
19777
19992
|
{
|
|
19778
19993
|
...props,
|
|
@@ -19784,14 +19999,14 @@ var PermissionSelect = (props) => /* @__PURE__ */ React14.createElement(
|
|
|
19784
19999
|
}
|
|
19785
20000
|
);
|
|
19786
20001
|
var TypePermissionFormFields = ({ typeOptions }) => {
|
|
19787
|
-
return /* @__PURE__ */
|
|
20002
|
+
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(
|
|
19788
20003
|
Form8.Item,
|
|
19789
20004
|
{
|
|
19790
20005
|
label: "Target Type",
|
|
19791
20006
|
name: "TargetTypeFullName",
|
|
19792
20007
|
rules: [{ required: true }]
|
|
19793
20008
|
},
|
|
19794
|
-
/* @__PURE__ */
|
|
20009
|
+
/* @__PURE__ */ React15.createElement(
|
|
19795
20010
|
Select2,
|
|
19796
20011
|
{
|
|
19797
20012
|
showSearch: true,
|
|
@@ -19799,7 +20014,7 @@ var TypePermissionFormFields = ({ typeOptions }) => {
|
|
|
19799
20014
|
filterOption: (input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase())
|
|
19800
20015
|
}
|
|
19801
20016
|
)
|
|
19802
|
-
), /* @__PURE__ */
|
|
20017
|
+
), /* @__PURE__ */ React15.createElement(Form8.Item, { label: "Read State", name: "ReadState" }, /* @__PURE__ */ React15.createElement(PermissionSelect, null)), /* @__PURE__ */ React15.createElement(Form8.Item, { label: "Write State", name: "WriteState" }, /* @__PURE__ */ React15.createElement(PermissionSelect, null)), /* @__PURE__ */ React15.createElement(Form8.Item, { label: "Create State", name: "CreateState" }, /* @__PURE__ */ React15.createElement(PermissionSelect, null)), /* @__PURE__ */ React15.createElement(Form8.Item, { label: "Delete State", name: "DeleteState" }, /* @__PURE__ */ React15.createElement(PermissionSelect, null)));
|
|
19803
20018
|
};
|
|
19804
20019
|
var TypePermissionList = ({ masterId }) => {
|
|
19805
20020
|
const { data: modelTypes } = useModelTypes();
|
|
@@ -19819,17 +20034,17 @@ var TypePermissionList = ({ masterId }) => {
|
|
|
19819
20034
|
mode: "off"
|
|
19820
20035
|
}
|
|
19821
20036
|
});
|
|
19822
|
-
const typeOptions =
|
|
19823
|
-
const FormFieldsWrapper =
|
|
19824
|
-
return ({ mode }) => /* @__PURE__ */
|
|
20037
|
+
const typeOptions = React15.useMemo(() => modelTypes?.filter((t) => t.IsCreatable && !t.IsDeprecated).map((t) => ({ label: t.Caption, value: t.Name })) || [], [modelTypes]);
|
|
20038
|
+
const FormFieldsWrapper = React15.useMemo(() => {
|
|
20039
|
+
return ({ mode }) => /* @__PURE__ */ React15.createElement(TypePermissionFormFields, { typeOptions });
|
|
19825
20040
|
}, [typeOptions]);
|
|
19826
|
-
const dataSource =
|
|
20041
|
+
const dataSource = React15.useMemo(() => {
|
|
19827
20042
|
return (tableProps.dataSource || []).map((p) => ({
|
|
19828
20043
|
...p,
|
|
19829
20044
|
TargetType: p.TargetType || p.TargetTypeFullName || ""
|
|
19830
20045
|
}));
|
|
19831
20046
|
}, [tableProps.dataSource]);
|
|
19832
|
-
return /* @__PURE__ */
|
|
20047
|
+
return /* @__PURE__ */ React15.createElement(
|
|
19833
20048
|
RelatedList,
|
|
19834
20049
|
{
|
|
19835
20050
|
resource: "PermissionPolicyTypePermissionObject",
|
|
@@ -19840,7 +20055,7 @@ var TypePermissionList = ({ masterId }) => {
|
|
|
19840
20055
|
modalTitle: "Type Permission",
|
|
19841
20056
|
FormFields: FormFieldsWrapper
|
|
19842
20057
|
},
|
|
19843
|
-
/* @__PURE__ */
|
|
20058
|
+
/* @__PURE__ */ React15.createElement(
|
|
19844
20059
|
Table6.Column,
|
|
19845
20060
|
{
|
|
19846
20061
|
dataIndex: "TargetType",
|
|
@@ -19848,10 +20063,10 @@ var TypePermissionList = ({ masterId }) => {
|
|
|
19848
20063
|
render: (value) => typeOptions.find((t) => t.value === value)?.label || value
|
|
19849
20064
|
}
|
|
19850
20065
|
),
|
|
19851
|
-
/* @__PURE__ */
|
|
19852
|
-
/* @__PURE__ */
|
|
19853
|
-
/* @__PURE__ */
|
|
19854
|
-
/* @__PURE__ */
|
|
20066
|
+
/* @__PURE__ */ React15.createElement(Table6.Column, { dataIndex: "ReadState", title: "Read" }),
|
|
20067
|
+
/* @__PURE__ */ React15.createElement(Table6.Column, { dataIndex: "WriteState", title: "Write" }),
|
|
20068
|
+
/* @__PURE__ */ React15.createElement(Table6.Column, { dataIndex: "CreateState", title: "Create" }),
|
|
20069
|
+
/* @__PURE__ */ React15.createElement(Table6.Column, { dataIndex: "DeleteState", title: "Delete" })
|
|
19855
20070
|
);
|
|
19856
20071
|
};
|
|
19857
20072
|
|
|
@@ -19862,7 +20077,7 @@ var RoleCreate = () => {
|
|
|
19862
20077
|
const handleSave = () => {
|
|
19863
20078
|
form.submit();
|
|
19864
20079
|
};
|
|
19865
|
-
return /* @__PURE__ */
|
|
20080
|
+
return /* @__PURE__ */ React16.createElement(Create2, { saveButtonProps: { ...saveButtonProps, onClick: handleSave } }, /* @__PURE__ */ React16.createElement(
|
|
19866
20081
|
Form9,
|
|
19867
20082
|
{
|
|
19868
20083
|
...formProps,
|
|
@@ -19872,25 +20087,25 @@ var RoleCreate = () => {
|
|
|
19872
20087
|
return formProps.onFinish && formProps.onFinish(values);
|
|
19873
20088
|
}
|
|
19874
20089
|
},
|
|
19875
|
-
/* @__PURE__ */
|
|
20090
|
+
/* @__PURE__ */ React16.createElement(
|
|
19876
20091
|
Form9.Item,
|
|
19877
20092
|
{
|
|
19878
20093
|
label: "Name",
|
|
19879
20094
|
name: "Name",
|
|
19880
20095
|
rules: [{ required: true }]
|
|
19881
20096
|
},
|
|
19882
|
-
/* @__PURE__ */
|
|
20097
|
+
/* @__PURE__ */ React16.createElement(Input8, null)
|
|
19883
20098
|
),
|
|
19884
|
-
/* @__PURE__ */
|
|
20099
|
+
/* @__PURE__ */ React16.createElement(
|
|
19885
20100
|
Form9.Item,
|
|
19886
20101
|
{
|
|
19887
20102
|
label: "Is Administrative",
|
|
19888
20103
|
name: "IsAdministrative",
|
|
19889
20104
|
valuePropName: "checked"
|
|
19890
20105
|
},
|
|
19891
|
-
/* @__PURE__ */
|
|
20106
|
+
/* @__PURE__ */ React16.createElement(Checkbox7, null, "Is Administrative")
|
|
19892
20107
|
),
|
|
19893
|
-
/* @__PURE__ */
|
|
20108
|
+
/* @__PURE__ */ React16.createElement(
|
|
19894
20109
|
Form9.Item,
|
|
19895
20110
|
{
|
|
19896
20111
|
label: "Permission Policy",
|
|
@@ -19898,7 +20113,7 @@ var RoleCreate = () => {
|
|
|
19898
20113
|
initialValue: "DenyAllByDefault" /* DenyAllByDefault */,
|
|
19899
20114
|
rules: [{ required: true }]
|
|
19900
20115
|
},
|
|
19901
|
-
/* @__PURE__ */
|
|
20116
|
+
/* @__PURE__ */ React16.createElement(
|
|
19902
20117
|
Select3,
|
|
19903
20118
|
{
|
|
19904
20119
|
options: [
|
|
@@ -19909,12 +20124,12 @@ var RoleCreate = () => {
|
|
|
19909
20124
|
}
|
|
19910
20125
|
)
|
|
19911
20126
|
),
|
|
19912
|
-
/* @__PURE__ */
|
|
20127
|
+
/* @__PURE__ */ React16.createElement(TypePermissionList, null)
|
|
19913
20128
|
));
|
|
19914
20129
|
};
|
|
19915
20130
|
|
|
19916
20131
|
// src/pages/roles/edit.tsx
|
|
19917
|
-
import
|
|
20132
|
+
import React17 from "react";
|
|
19918
20133
|
import { Edit as Edit2, useForm as useForm4 } from "@refinedev/antd";
|
|
19919
20134
|
import { Form as Form10, Input as Input9, Checkbox as Checkbox8, Select as Select4 } from "antd/lib";
|
|
19920
20135
|
var RoleEdit = () => {
|
|
@@ -19922,7 +20137,7 @@ var RoleEdit = () => {
|
|
|
19922
20137
|
const handleSave = () => {
|
|
19923
20138
|
formProps.form?.submit();
|
|
19924
20139
|
};
|
|
19925
|
-
return /* @__PURE__ */
|
|
20140
|
+
return /* @__PURE__ */ React17.createElement(Edit2, { saveButtonProps: { ...saveButtonProps, onClick: handleSave } }, /* @__PURE__ */ React17.createElement(
|
|
19926
20141
|
Form10,
|
|
19927
20142
|
{
|
|
19928
20143
|
...formProps,
|
|
@@ -19932,32 +20147,32 @@ var RoleEdit = () => {
|
|
|
19932
20147
|
return formProps.onFinish && formProps.onFinish(rest);
|
|
19933
20148
|
}
|
|
19934
20149
|
},
|
|
19935
|
-
/* @__PURE__ */
|
|
20150
|
+
/* @__PURE__ */ React17.createElement(
|
|
19936
20151
|
Form10.Item,
|
|
19937
20152
|
{
|
|
19938
20153
|
label: "Name",
|
|
19939
20154
|
name: "Name",
|
|
19940
20155
|
rules: [{ required: true }]
|
|
19941
20156
|
},
|
|
19942
|
-
/* @__PURE__ */
|
|
20157
|
+
/* @__PURE__ */ React17.createElement(Input9, null)
|
|
19943
20158
|
),
|
|
19944
|
-
/* @__PURE__ */
|
|
20159
|
+
/* @__PURE__ */ React17.createElement(
|
|
19945
20160
|
Form10.Item,
|
|
19946
20161
|
{
|
|
19947
20162
|
label: "Is Administrative",
|
|
19948
20163
|
name: "IsAdministrative",
|
|
19949
20164
|
valuePropName: "checked"
|
|
19950
20165
|
},
|
|
19951
|
-
/* @__PURE__ */
|
|
20166
|
+
/* @__PURE__ */ React17.createElement(Checkbox8, null, "Is Administrative")
|
|
19952
20167
|
),
|
|
19953
|
-
/* @__PURE__ */
|
|
20168
|
+
/* @__PURE__ */ React17.createElement(
|
|
19954
20169
|
Form10.Item,
|
|
19955
20170
|
{
|
|
19956
20171
|
label: "Permission Policy",
|
|
19957
20172
|
name: "PermissionPolicy",
|
|
19958
20173
|
rules: [{ required: true }]
|
|
19959
20174
|
},
|
|
19960
|
-
/* @__PURE__ */
|
|
20175
|
+
/* @__PURE__ */ React17.createElement(
|
|
19961
20176
|
Select4,
|
|
19962
20177
|
{
|
|
19963
20178
|
options: [
|
|
@@ -19968,7 +20183,7 @@ var RoleEdit = () => {
|
|
|
19968
20183
|
}
|
|
19969
20184
|
)
|
|
19970
20185
|
),
|
|
19971
|
-
/* @__PURE__ */
|
|
20186
|
+
/* @__PURE__ */ React17.createElement(
|
|
19972
20187
|
TypePermissionList,
|
|
19973
20188
|
{
|
|
19974
20189
|
masterId: id?.toString()
|
|
@@ -19976,14 +20191,365 @@ var RoleEdit = () => {
|
|
|
19976
20191
|
)
|
|
19977
20192
|
));
|
|
19978
20193
|
};
|
|
20194
|
+
|
|
20195
|
+
// src/pages/background-jobs/list.tsx
|
|
20196
|
+
import React18, { useState as useState7, useEffect as useEffect6, useCallback } from "react";
|
|
20197
|
+
import { useApiUrl, useTranslate as useTranslate3 } from "@refinedev/core";
|
|
20198
|
+
import { List as List3 } from "@refinedev/antd";
|
|
20199
|
+
import { Table as Table7, Button as Button8, Space as Space8, Tag, Card as Card3, Statistic, Row, Col, message as message2, Tooltip as Tooltip2, Tabs, Drawer, Descriptions, Timeline, Skeleton } from "antd";
|
|
20200
|
+
import {
|
|
20201
|
+
ReloadOutlined as ReloadOutlined2,
|
|
20202
|
+
PlayCircleOutlined,
|
|
20203
|
+
DeleteOutlined as DeleteOutlined2,
|
|
20204
|
+
CheckCircleOutlined,
|
|
20205
|
+
CloseCircleOutlined,
|
|
20206
|
+
SyncOutlined,
|
|
20207
|
+
ClockCircleOutlined
|
|
20208
|
+
} from "@ant-design/icons";
|
|
20209
|
+
var BackgroundJobList = ({
|
|
20210
|
+
title,
|
|
20211
|
+
apiUrl: customApiUrl
|
|
20212
|
+
}) => {
|
|
20213
|
+
const t = useTranslate3();
|
|
20214
|
+
const defaultApiUrl = useApiUrl();
|
|
20215
|
+
const apiUrl = customApiUrl || defaultApiUrl?.replace("/odata", "");
|
|
20216
|
+
const [refreshKey, setRefreshKey] = useState7(0);
|
|
20217
|
+
const [activeTab, setActiveTab] = useState7("recurring");
|
|
20218
|
+
const [loading, setLoading] = useState7(false);
|
|
20219
|
+
const [recurringJobs, setRecurringJobs] = useState7([]);
|
|
20220
|
+
const [succeededResult, setSucceededResult] = useState7(null);
|
|
20221
|
+
const [failedResult, setFailedResult] = useState7(null);
|
|
20222
|
+
const [processingResult, setProcessingResult] = useState7(null);
|
|
20223
|
+
const [drawerVisible, setDrawerVisible] = useState7(false);
|
|
20224
|
+
const [jobDetails, setJobDetails] = useState7(null);
|
|
20225
|
+
const [detailLoading, setDetailLoading] = useState7(false);
|
|
20226
|
+
const fetchData = useCallback(async () => {
|
|
20227
|
+
setLoading(true);
|
|
20228
|
+
const token = localStorage.getItem("refine-auth") || localStorage.getItem("access_token");
|
|
20229
|
+
const headers = token ? { "Authorization": `Bearer ${token}` } : {};
|
|
20230
|
+
try {
|
|
20231
|
+
const [recurringRes, succeededRes, failedRes, processingRes] = await Promise.all([
|
|
20232
|
+
fetch(`${apiUrl}/hangfire/recurring`, { headers }),
|
|
20233
|
+
fetch(`${apiUrl}/hangfire/jobs/succeeded`, { headers }),
|
|
20234
|
+
fetch(`${apiUrl}/hangfire/jobs/failed`, { headers }),
|
|
20235
|
+
fetch(`${apiUrl}/hangfire/jobs/processing`, { headers })
|
|
20236
|
+
]);
|
|
20237
|
+
if (recurringRes.ok) {
|
|
20238
|
+
const data = await recurringRes.json();
|
|
20239
|
+
setRecurringJobs(data.value || data || []);
|
|
20240
|
+
}
|
|
20241
|
+
if (succeededRes.ok) {
|
|
20242
|
+
setSucceededResult(await succeededRes.json());
|
|
20243
|
+
}
|
|
20244
|
+
if (failedRes.ok) {
|
|
20245
|
+
setFailedResult(await failedRes.json());
|
|
20246
|
+
}
|
|
20247
|
+
if (processingRes.ok) {
|
|
20248
|
+
setProcessingResult(await processingRes.json());
|
|
20249
|
+
}
|
|
20250
|
+
} catch (error) {
|
|
20251
|
+
console.error("Failed to fetch Hangfire data:", error);
|
|
20252
|
+
} finally {
|
|
20253
|
+
setLoading(false);
|
|
20254
|
+
}
|
|
20255
|
+
}, [apiUrl]);
|
|
20256
|
+
useEffect6(() => {
|
|
20257
|
+
fetchData();
|
|
20258
|
+
}, [fetchData, refreshKey]);
|
|
20259
|
+
const handleRefresh = () => {
|
|
20260
|
+
setRefreshKey((prev) => prev + 1);
|
|
20261
|
+
};
|
|
20262
|
+
const handleTrigger = async (jobId) => {
|
|
20263
|
+
try {
|
|
20264
|
+
const token = localStorage.getItem("refine-auth") || localStorage.getItem("access_token");
|
|
20265
|
+
const headers = token ? { "Authorization": `Bearer ${token}` } : {};
|
|
20266
|
+
const response = await fetch(`${apiUrl}/hangfire/trigger/${jobId}`, {
|
|
20267
|
+
method: "POST",
|
|
20268
|
+
headers
|
|
20269
|
+
});
|
|
20270
|
+
if (response.ok) {
|
|
20271
|
+
message2.success(t("backgroundJobs.actions.triggerSuccess"));
|
|
20272
|
+
handleRefresh();
|
|
20273
|
+
} else {
|
|
20274
|
+
message2.error(t("backgroundJobs.actions.triggerError"));
|
|
20275
|
+
}
|
|
20276
|
+
} catch {
|
|
20277
|
+
message2.error(t("backgroundJobs.actions.triggerError"));
|
|
20278
|
+
}
|
|
20279
|
+
};
|
|
20280
|
+
const handleDelete = async (jobId) => {
|
|
20281
|
+
try {
|
|
20282
|
+
const token = localStorage.getItem("refine-auth") || localStorage.getItem("access_token");
|
|
20283
|
+
const headers = token ? { "Authorization": `Bearer ${token}` } : {};
|
|
20284
|
+
const response = await fetch(`${apiUrl}/hangfire/recurring/${jobId}`, {
|
|
20285
|
+
method: "DELETE",
|
|
20286
|
+
headers
|
|
20287
|
+
});
|
|
20288
|
+
if (response.ok) {
|
|
20289
|
+
message2.success(t("backgroundJobs.actions.deleteSuccess"));
|
|
20290
|
+
handleRefresh();
|
|
20291
|
+
} else {
|
|
20292
|
+
message2.error(t("backgroundJobs.actions.deleteError"));
|
|
20293
|
+
}
|
|
20294
|
+
} catch {
|
|
20295
|
+
message2.error(t("backgroundJobs.actions.deleteError"));
|
|
20296
|
+
}
|
|
20297
|
+
};
|
|
20298
|
+
const showDetails = async (jobId) => {
|
|
20299
|
+
setDrawerVisible(true);
|
|
20300
|
+
setDetailLoading(true);
|
|
20301
|
+
setJobDetails(null);
|
|
20302
|
+
try {
|
|
20303
|
+
const token = localStorage.getItem("refine-auth") || localStorage.getItem("access_token");
|
|
20304
|
+
const headers = token ? { "Authorization": `Bearer ${token}` } : {};
|
|
20305
|
+
const res = await fetch(`${apiUrl}/hangfire/jobs/${jobId}`, { headers });
|
|
20306
|
+
if (res.ok) {
|
|
20307
|
+
const data = await res.json();
|
|
20308
|
+
setJobDetails(data);
|
|
20309
|
+
} else {
|
|
20310
|
+
message2.error("Failed to load details");
|
|
20311
|
+
}
|
|
20312
|
+
} catch {
|
|
20313
|
+
message2.error("Failed to load details");
|
|
20314
|
+
} finally {
|
|
20315
|
+
setDetailLoading(false);
|
|
20316
|
+
}
|
|
20317
|
+
};
|
|
20318
|
+
const closeDrawer = () => {
|
|
20319
|
+
setDrawerVisible(false);
|
|
20320
|
+
setJobDetails(null);
|
|
20321
|
+
};
|
|
20322
|
+
const getStateTag = (state) => {
|
|
20323
|
+
if (!state) return /* @__PURE__ */ React18.createElement(Tag, null, t("backgroundJobs.status.unknown"));
|
|
20324
|
+
switch (state.toLowerCase()) {
|
|
20325
|
+
case "succeeded":
|
|
20326
|
+
return /* @__PURE__ */ React18.createElement(Tag, { icon: /* @__PURE__ */ React18.createElement(CheckCircleOutlined, null), color: "success" }, t("backgroundJobs.status.succeeded"));
|
|
20327
|
+
case "failed":
|
|
20328
|
+
return /* @__PURE__ */ React18.createElement(Tag, { icon: /* @__PURE__ */ React18.createElement(CloseCircleOutlined, null), color: "error" }, t("backgroundJobs.status.failed"));
|
|
20329
|
+
case "processing":
|
|
20330
|
+
return /* @__PURE__ */ React18.createElement(Tag, { icon: /* @__PURE__ */ React18.createElement(SyncOutlined, { spin: true }), color: "processing" }, t("backgroundJobs.status.processing"));
|
|
20331
|
+
case "scheduled":
|
|
20332
|
+
return /* @__PURE__ */ React18.createElement(Tag, { icon: /* @__PURE__ */ React18.createElement(ClockCircleOutlined, null), color: "warning" }, t("backgroundJobs.status.scheduled"));
|
|
20333
|
+
default:
|
|
20334
|
+
return /* @__PURE__ */ React18.createElement(Tag, null, state);
|
|
20335
|
+
}
|
|
20336
|
+
};
|
|
20337
|
+
const recurringColumns = [
|
|
20338
|
+
{ title: t("backgroundJobs.columns.id"), dataIndex: "Id", key: "Id" },
|
|
20339
|
+
{
|
|
20340
|
+
title: t("backgroundJobs.columns.cron"),
|
|
20341
|
+
dataIndex: "Cron",
|
|
20342
|
+
key: "Cron",
|
|
20343
|
+
render: (cron) => /* @__PURE__ */ React18.createElement(Tag, { color: "blue" }, cron)
|
|
20344
|
+
},
|
|
20345
|
+
{ title: t("backgroundJobs.columns.queue"), dataIndex: "Queue", key: "Queue" },
|
|
20346
|
+
{
|
|
20347
|
+
title: t("backgroundJobs.columns.nextExecution"),
|
|
20348
|
+
dataIndex: "NextExecution",
|
|
20349
|
+
key: "NextExecution",
|
|
20350
|
+
render: (date) => date ? new Date(date).toLocaleString() : "-"
|
|
20351
|
+
},
|
|
20352
|
+
{
|
|
20353
|
+
title: t("backgroundJobs.columns.lastState"),
|
|
20354
|
+
dataIndex: "LastJobState",
|
|
20355
|
+
key: "LastJobState",
|
|
20356
|
+
render: (state) => getStateTag(state)
|
|
20357
|
+
},
|
|
20358
|
+
{
|
|
20359
|
+
title: t("backgroundJobs.columns.actions"),
|
|
20360
|
+
key: "actions",
|
|
20361
|
+
render: (_, record) => /* @__PURE__ */ React18.createElement(Space8, null, /* @__PURE__ */ React18.createElement(Tooltip2, { title: t("backgroundJobs.actions.trigger") }, /* @__PURE__ */ React18.createElement(
|
|
20362
|
+
Button8,
|
|
20363
|
+
{
|
|
20364
|
+
type: "primary",
|
|
20365
|
+
icon: /* @__PURE__ */ React18.createElement(PlayCircleOutlined, null),
|
|
20366
|
+
size: "small",
|
|
20367
|
+
onClick: () => handleTrigger(record.Id)
|
|
20368
|
+
}
|
|
20369
|
+
)), /* @__PURE__ */ React18.createElement(Tooltip2, { title: t("backgroundJobs.actions.delete") }, /* @__PURE__ */ React18.createElement(
|
|
20370
|
+
Button8,
|
|
20371
|
+
{
|
|
20372
|
+
danger: true,
|
|
20373
|
+
icon: /* @__PURE__ */ React18.createElement(DeleteOutlined2, null),
|
|
20374
|
+
size: "small",
|
|
20375
|
+
onClick: () => handleDelete(record.Id)
|
|
20376
|
+
}
|
|
20377
|
+
)))
|
|
20378
|
+
}
|
|
20379
|
+
];
|
|
20380
|
+
const succeededColumns = [
|
|
20381
|
+
{
|
|
20382
|
+
title: t("backgroundJobs.columns.jobId"),
|
|
20383
|
+
dataIndex: "JobId",
|
|
20384
|
+
key: "JobId",
|
|
20385
|
+
render: (text) => /* @__PURE__ */ React18.createElement("a", { onClick: () => showDetails(text) }, text)
|
|
20386
|
+
},
|
|
20387
|
+
{ title: t("backgroundJobs.columns.jobName"), dataIndex: "JobName", key: "JobName" },
|
|
20388
|
+
{
|
|
20389
|
+
title: t("backgroundJobs.columns.succeededAt"),
|
|
20390
|
+
dataIndex: "SucceededAt",
|
|
20391
|
+
key: "SucceededAt",
|
|
20392
|
+
render: (date) => date ? new Date(date).toLocaleString() : "-"
|
|
20393
|
+
},
|
|
20394
|
+
{ title: t("backgroundJobs.columns.duration"), dataIndex: "TotalDuration", key: "TotalDuration" }
|
|
20395
|
+
];
|
|
20396
|
+
const failedColumns = [
|
|
20397
|
+
{
|
|
20398
|
+
title: t("backgroundJobs.columns.jobId"),
|
|
20399
|
+
dataIndex: "JobId",
|
|
20400
|
+
key: "JobId",
|
|
20401
|
+
render: (text) => /* @__PURE__ */ React18.createElement("a", { onClick: () => showDetails(text) }, text)
|
|
20402
|
+
},
|
|
20403
|
+
{ title: t("backgroundJobs.columns.jobName"), dataIndex: "JobName", key: "JobName" },
|
|
20404
|
+
{
|
|
20405
|
+
title: t("backgroundJobs.columns.failedAt"),
|
|
20406
|
+
dataIndex: "FailedAt",
|
|
20407
|
+
key: "FailedAt",
|
|
20408
|
+
render: (date) => date ? new Date(date).toLocaleString() : "-"
|
|
20409
|
+
},
|
|
20410
|
+
{
|
|
20411
|
+
title: t("backgroundJobs.columns.exception"),
|
|
20412
|
+
dataIndex: "ExceptionMessage",
|
|
20413
|
+
key: "ExceptionMessage",
|
|
20414
|
+
render: (msg) => /* @__PURE__ */ React18.createElement(Tooltip2, { title: msg }, /* @__PURE__ */ React18.createElement("span", null, msg?.substring(0, 50), msg && msg.length > 50 ? "..." : ""))
|
|
20415
|
+
}
|
|
20416
|
+
];
|
|
20417
|
+
const processingColumns = [
|
|
20418
|
+
{
|
|
20419
|
+
title: t("backgroundJobs.columns.jobId"),
|
|
20420
|
+
dataIndex: "JobId",
|
|
20421
|
+
key: "JobId",
|
|
20422
|
+
render: (text) => /* @__PURE__ */ React18.createElement("a", { onClick: () => showDetails(text) }, text)
|
|
20423
|
+
},
|
|
20424
|
+
{ title: t("backgroundJobs.columns.jobName"), dataIndex: "JobName", key: "JobName" },
|
|
20425
|
+
{
|
|
20426
|
+
title: t("backgroundJobs.columns.startedAt"),
|
|
20427
|
+
dataIndex: "StartedAt",
|
|
20428
|
+
key: "StartedAt",
|
|
20429
|
+
render: (date) => date ? new Date(date).toLocaleString() : "-"
|
|
20430
|
+
},
|
|
20431
|
+
{ title: t("backgroundJobs.columns.serverId"), dataIndex: "ServerId", key: "ServerId" }
|
|
20432
|
+
];
|
|
20433
|
+
const items = [
|
|
20434
|
+
{
|
|
20435
|
+
key: "recurring",
|
|
20436
|
+
label: `${t("backgroundJobs.tabs.recurring")} (${recurringJobs.length})`,
|
|
20437
|
+
children: /* @__PURE__ */ React18.createElement(
|
|
20438
|
+
Table7,
|
|
20439
|
+
{
|
|
20440
|
+
dataSource: recurringJobs,
|
|
20441
|
+
columns: recurringColumns,
|
|
20442
|
+
rowKey: "Id",
|
|
20443
|
+
loading,
|
|
20444
|
+
pagination: false
|
|
20445
|
+
}
|
|
20446
|
+
)
|
|
20447
|
+
},
|
|
20448
|
+
{
|
|
20449
|
+
key: "succeeded",
|
|
20450
|
+
label: /* @__PURE__ */ React18.createElement("span", null, /* @__PURE__ */ React18.createElement(CheckCircleOutlined, { style: { color: "#52c41a" } }), " ", t("backgroundJobs.tabs.succeeded"), " (", succeededResult?.Total || 0, ")"),
|
|
20451
|
+
children: /* @__PURE__ */ React18.createElement(
|
|
20452
|
+
Table7,
|
|
20453
|
+
{
|
|
20454
|
+
dataSource: succeededResult?.Jobs || [],
|
|
20455
|
+
columns: succeededColumns,
|
|
20456
|
+
rowKey: "JobId",
|
|
20457
|
+
loading,
|
|
20458
|
+
pagination: { pageSize: 10 }
|
|
20459
|
+
}
|
|
20460
|
+
)
|
|
20461
|
+
},
|
|
20462
|
+
{
|
|
20463
|
+
key: "failed",
|
|
20464
|
+
label: /* @__PURE__ */ React18.createElement("span", null, /* @__PURE__ */ React18.createElement(CloseCircleOutlined, { style: { color: "#ff4d4f" } }), " ", t("backgroundJobs.tabs.failed"), " (", failedResult?.Total || 0, ")"),
|
|
20465
|
+
children: /* @__PURE__ */ React18.createElement(
|
|
20466
|
+
Table7,
|
|
20467
|
+
{
|
|
20468
|
+
dataSource: failedResult?.Jobs || [],
|
|
20469
|
+
columns: failedColumns,
|
|
20470
|
+
rowKey: "JobId",
|
|
20471
|
+
loading,
|
|
20472
|
+
pagination: { pageSize: 10 }
|
|
20473
|
+
}
|
|
20474
|
+
)
|
|
20475
|
+
},
|
|
20476
|
+
{
|
|
20477
|
+
key: "processing",
|
|
20478
|
+
label: /* @__PURE__ */ React18.createElement("span", null, /* @__PURE__ */ React18.createElement(SyncOutlined, { spin: true, style: { color: "#1890ff" } }), " ", t("backgroundJobs.tabs.processing"), " (", processingResult?.Total || 0, ")"),
|
|
20479
|
+
children: /* @__PURE__ */ React18.createElement(
|
|
20480
|
+
Table7,
|
|
20481
|
+
{
|
|
20482
|
+
dataSource: processingResult?.Jobs || [],
|
|
20483
|
+
columns: processingColumns,
|
|
20484
|
+
rowKey: "JobId",
|
|
20485
|
+
loading,
|
|
20486
|
+
pagination: false
|
|
20487
|
+
}
|
|
20488
|
+
)
|
|
20489
|
+
}
|
|
20490
|
+
];
|
|
20491
|
+
return /* @__PURE__ */ React18.createElement(
|
|
20492
|
+
List3,
|
|
20493
|
+
{
|
|
20494
|
+
title: title || t("backgroundJobs.title"),
|
|
20495
|
+
headerButtons: /* @__PURE__ */ React18.createElement(Button8, { icon: /* @__PURE__ */ React18.createElement(ReloadOutlined2, null), onClick: handleRefresh, loading }, t("buttons.refresh"))
|
|
20496
|
+
},
|
|
20497
|
+
/* @__PURE__ */ React18.createElement(Row, { gutter: 16, style: { marginBottom: 16 } }, /* @__PURE__ */ React18.createElement(Col, { span: 6 }, /* @__PURE__ */ React18.createElement(Card3, null, /* @__PURE__ */ React18.createElement(
|
|
20498
|
+
Statistic,
|
|
20499
|
+
{
|
|
20500
|
+
title: t("backgroundJobs.tabs.recurring"),
|
|
20501
|
+
value: recurringJobs.length,
|
|
20502
|
+
prefix: /* @__PURE__ */ React18.createElement(ClockCircleOutlined, null)
|
|
20503
|
+
}
|
|
20504
|
+
))), /* @__PURE__ */ React18.createElement(Col, { span: 6 }, /* @__PURE__ */ React18.createElement(Card3, null, /* @__PURE__ */ React18.createElement(
|
|
20505
|
+
Statistic,
|
|
20506
|
+
{
|
|
20507
|
+
title: t("backgroundJobs.tabs.succeeded"),
|
|
20508
|
+
value: succeededResult?.Total || 0,
|
|
20509
|
+
valueStyle: { color: "#3f8600" },
|
|
20510
|
+
prefix: /* @__PURE__ */ React18.createElement(CheckCircleOutlined, null)
|
|
20511
|
+
}
|
|
20512
|
+
))), /* @__PURE__ */ React18.createElement(Col, { span: 6 }, /* @__PURE__ */ React18.createElement(Card3, null, /* @__PURE__ */ React18.createElement(
|
|
20513
|
+
Statistic,
|
|
20514
|
+
{
|
|
20515
|
+
title: t("backgroundJobs.tabs.failed"),
|
|
20516
|
+
value: failedResult?.Total || 0,
|
|
20517
|
+
valueStyle: { color: "#cf1322" },
|
|
20518
|
+
prefix: /* @__PURE__ */ React18.createElement(CloseCircleOutlined, null)
|
|
20519
|
+
}
|
|
20520
|
+
))), /* @__PURE__ */ React18.createElement(Col, { span: 6 }, /* @__PURE__ */ React18.createElement(Card3, null, /* @__PURE__ */ React18.createElement(
|
|
20521
|
+
Statistic,
|
|
20522
|
+
{
|
|
20523
|
+
title: t("backgroundJobs.tabs.processing"),
|
|
20524
|
+
value: processingResult?.Total || 0,
|
|
20525
|
+
valueStyle: { color: "#1890ff" },
|
|
20526
|
+
prefix: /* @__PURE__ */ React18.createElement(SyncOutlined, null)
|
|
20527
|
+
}
|
|
20528
|
+
)))),
|
|
20529
|
+
/* @__PURE__ */ React18.createElement(Tabs, { activeKey: activeTab, onChange: setActiveTab, items }),
|
|
20530
|
+
/* @__PURE__ */ React18.createElement(
|
|
20531
|
+
Drawer,
|
|
20532
|
+
{
|
|
20533
|
+
title: t("backgroundJobs.drawer.title"),
|
|
20534
|
+
placement: "right",
|
|
20535
|
+
onClose: closeDrawer,
|
|
20536
|
+
open: drawerVisible,
|
|
20537
|
+
width: 600
|
|
20538
|
+
},
|
|
20539
|
+
detailLoading ? /* @__PURE__ */ React18.createElement(Skeleton, { active: true }) : jobDetails ? /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(Descriptions, { column: 1, bordered: true, size: "small" }, /* @__PURE__ */ React18.createElement(Descriptions.Item, { label: t("backgroundJobs.drawer.jobName") }, jobDetails.JobName), /* @__PURE__ */ React18.createElement(Descriptions.Item, { label: t("backgroundJobs.drawer.createdAt") }, jobDetails.CreatedAt ? new Date(jobDetails.CreatedAt).toLocaleString() : "-")), /* @__PURE__ */ React18.createElement("div", { style: { marginTop: 24 } }, /* @__PURE__ */ React18.createElement("h3", null, t("backgroundJobs.drawer.history")), /* @__PURE__ */ React18.createElement(Timeline, { mode: "left" }, jobDetails.History.map((h, i) => /* @__PURE__ */ React18.createElement(Timeline.Item, { key: i, color: h.StateName === "Succeeded" ? "green" : h.StateName === "Failed" ? "red" : "blue" }, /* @__PURE__ */ React18.createElement("p", null, /* @__PURE__ */ React18.createElement("strong", null, h.StateName), " - ", new Date(h.CreatedAt).toLocaleString()), h.Reason && /* @__PURE__ */ React18.createElement("p", null, t("backgroundJobs.drawer.reason"), ": ", h.Reason), h.Data && Object.keys(h.Data).length > 0 && /* @__PURE__ */ React18.createElement("div", { style: { background: "#f5f5f5", padding: 8, borderRadius: 4, overflowX: "auto", marginTop: 8 } }, /* @__PURE__ */ React18.createElement("pre", { style: { margin: 0, fontSize: 12 } }, JSON.stringify(h.Data, null, 2)))))))) : /* @__PURE__ */ React18.createElement("div", null, t("backgroundJobs.drawer.noData"))
|
|
20540
|
+
)
|
|
20541
|
+
);
|
|
20542
|
+
};
|
|
19979
20543
|
export {
|
|
19980
20544
|
ApplicationUserCreate,
|
|
19981
20545
|
ApplicationUserEdit,
|
|
19982
20546
|
ApplicationUserList,
|
|
19983
20547
|
AuthCallback,
|
|
20548
|
+
BackgroundJobList,
|
|
19984
20549
|
Base64Upload,
|
|
19985
20550
|
ColorModeContext,
|
|
19986
20551
|
ColorModeContextProvider,
|
|
20552
|
+
DrawioEditor,
|
|
19987
20553
|
Header,
|
|
19988
20554
|
HttpError,
|
|
19989
20555
|
KeycloakLoginPage,
|