strapi-plugin-magic-sessionmanager 4.19.0 → 4.19.1
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 +14 -0
- package/dist/admin/{Analytics-AzG-hPvn.js → Analytics-BElmzyNJ.js} +1 -1
- package/dist/admin/{Analytics-DSXe9BPn.mjs → Analytics-BqFlgLnN.mjs} +1 -1
- package/dist/admin/{App-7UDfLwMK.mjs → App-0thsC_P9.mjs} +107 -58
- package/dist/admin/{App-D08oGxy4.js → App-D_J2eeEG.js} +140 -91
- package/dist/admin/{OnlineUsersWidget-DIhJZ77w.mjs → OnlineUsersWidget-BgJ1ws-5.mjs} +1 -1
- package/dist/admin/{OnlineUsersWidget-CK0_o7Jk.js → OnlineUsersWidget-DMZBwqdY.js} +1 -1
- package/dist/admin/{Settings-DnNBDP1I.js → Settings-FOkui_ke.js} +40 -270
- package/dist/admin/{Settings-CneNJppG.mjs → Settings-QN3Mu4AQ.mjs} +2 -232
- package/dist/admin/{de-CJZtJdhC.js → de-CEyi4lpp.js} +2 -1
- package/dist/admin/{de-DvYUwhjB.mjs → de-uGKSKVYD.mjs} +2 -1
- package/dist/admin/{en-BZ2YkNIU.js → en-CSXeJYKy.js} +2 -1
- package/dist/admin/{en-B8m9k-qd.mjs → en-Yu7tfwqx.mjs} +2 -1
- package/dist/admin/{es-BBsMtof1.js → es-BrKqXhAU.js} +2 -1
- package/dist/admin/{es-DBH36rrX.mjs → es-iNG9Amf9.mjs} +2 -1
- package/dist/admin/{fr-CLvB1rGe.mjs → fr-CaFICHlf.mjs} +2 -1
- package/dist/admin/{fr-Cw6nc38j.js → fr-DKZNfdlH.js} +2 -1
- package/dist/admin/{index-BSUrdxxt.js → index-DEYtqPc3.js} +9 -9
- package/dist/admin/{index-5Zb3GVml.mjs → index-h-ksmM8A.mjs} +9 -9
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/{pt-CVht14if.mjs → pt-Bz2hWVrq.mjs} +2 -1
- package/dist/admin/{pt-CjnMe7Z-.js → pt-IEagyVDL.js} +2 -1
- package/dist/admin/settingsTabs-D02CuEvs.mjs +433 -0
- package/dist/admin/settingsTabs-N4TFn-mw.js +432 -0
- package/package.json +1 -1
- package/dist/admin/dashboardModel-CjU0V7Sx.js +0 -188
- package/dist/admin/dashboardModel-OyQ_39aF.mjs +0 -189
|
@@ -9,8 +9,8 @@ const designSystem = require("@strapi/design-system");
|
|
|
9
9
|
const icons = require("@strapi/icons");
|
|
10
10
|
const symbols = require("@strapi/icons/symbols");
|
|
11
11
|
const styled = require("styled-components");
|
|
12
|
-
const index = require("./index-
|
|
13
|
-
const
|
|
12
|
+
const index = require("./index-DEYtqPc3.js");
|
|
13
|
+
const settingsTabs = require("./settingsTabs-N4TFn-mw.js");
|
|
14
14
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
15
15
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
16
16
|
const EndReason = ({ session, reason, variant = "omega", textColor = "neutral800" }) => {
|
|
@@ -288,7 +288,7 @@ function normalizeGeoData(geo, fallback = {}) {
|
|
|
288
288
|
const city = index.presentText(geo.city);
|
|
289
289
|
const timezone = index.presentText(geo.timezone);
|
|
290
290
|
if (!country && !city && !timezone) return null;
|
|
291
|
-
const riskSource =
|
|
291
|
+
const riskSource = settingsTabs.isRiskSource(geo.riskSource) ? geo.riskSource : null;
|
|
292
292
|
const rawScore = typeof geo.securityScore === "number" ? geo.securityScore : fallback?.securityScore;
|
|
293
293
|
const securityScore = riskSource && typeof rawScore === "number" && Number.isFinite(rawScore) ? rawScore : null;
|
|
294
294
|
return {
|
|
@@ -379,8 +379,8 @@ const SessionDetailModal = ({ session, now, onClose, onCloseAutoFocus, onEndSess
|
|
|
379
379
|
const userAgent = index.presentText(session.userAgent);
|
|
380
380
|
const sessionId = index.presentText(session.id);
|
|
381
381
|
const ipAddress = index.presentText(session.ipAddress);
|
|
382
|
-
const user =
|
|
383
|
-
const userEditPath =
|
|
382
|
+
const user = settingsTabs.getSessionUserLabels(session);
|
|
383
|
+
const userEditPath = settingsTabs.getUserEditPath(session);
|
|
384
384
|
const storedGeo = getStoredGeoData(session);
|
|
385
385
|
const liveGeo = lookup.status === "ok" ? lookup.geo : null;
|
|
386
386
|
const geo = liveGeo || storedGeo;
|
|
@@ -612,7 +612,7 @@ const SessionDetailModal = ({ session, now, onClose, onCloseAutoFocus, onEndSess
|
|
|
612
612
|
"modal.security.riskUnavailableNote",
|
|
613
613
|
"Needs a risk data source. Location data alone cannot tell VPNs, proxies or Tor apart, so no score was calculated."
|
|
614
614
|
) }),
|
|
615
|
-
/* @__PURE__ */ jsxRuntime.jsx(TargetLink, { tag: reactRouterDom.NavLink, to:
|
|
615
|
+
/* @__PURE__ */ jsxRuntime.jsx(TargetLink, { tag: reactRouterDom.NavLink, to: settingsTabs.RISK_SETTINGS_PATH, children: t("modal.security.riskSetup", "Set up risk data") })
|
|
616
616
|
] }) : null,
|
|
617
617
|
lookupControls
|
|
618
618
|
] }),
|
|
@@ -755,9 +755,9 @@ const isolateActionKeys = (event) => {
|
|
|
755
755
|
/** @type {Node} */
|
|
756
756
|
event.target
|
|
757
757
|
);
|
|
758
|
-
if (!
|
|
758
|
+
if (!settingsTabs.shouldIsolateActionKey(event.key, fromInsideGroup)) return;
|
|
759
759
|
event.stopPropagation();
|
|
760
|
-
if (
|
|
760
|
+
if (settingsTabs.shouldRedispatchEscape(event.key, fromInsideGroup)) {
|
|
761
761
|
const { ownerDocument } = event.currentTarget;
|
|
762
762
|
ownerDocument.dispatchEvent(
|
|
763
763
|
new KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true })
|
|
@@ -805,7 +805,7 @@ const SessionActions = ({
|
|
|
805
805
|
const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
|
|
806
806
|
const [deleteOpen, setDeleteOpen] = react.useState(false);
|
|
807
807
|
const moreRef = react.useRef(null);
|
|
808
|
-
const user =
|
|
808
|
+
const user = settingsTabs.getSessionUserLabels(session).accessible;
|
|
809
809
|
const canEnd = session.isActive === true;
|
|
810
810
|
const device = deviceSummary(session) || deviceTypeLabel(session);
|
|
811
811
|
const copy = getConfirmationCopy(t, { user, device, isOpen: canEnd });
|
|
@@ -832,7 +832,7 @@ const SessionActions = ({
|
|
|
832
832
|
);
|
|
833
833
|
const endKey = `end-${session.id}-${canEnd ? "open" : "ended"}`;
|
|
834
834
|
if (layout === "table") {
|
|
835
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
835
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(settingsTabs.RowActions, { onKeyDown: isolateActionKeys, onClick: (event) => event.stopPropagation(), children: [
|
|
836
836
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
837
837
|
designSystem.IconButton,
|
|
838
838
|
{
|
|
@@ -973,7 +973,7 @@ const SessionTable = ({
|
|
|
973
973
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
974
974
|
designSystem.Table,
|
|
975
975
|
{
|
|
976
|
-
colCount: compact ?
|
|
976
|
+
colCount: compact ? settingsTabs.DASHBOARD_COMPACT_TABLE_COLUMNS : settingsTabs.DASHBOARD_TABLE_COLUMNS,
|
|
977
977
|
rowCount: sessions.length + 1,
|
|
978
978
|
"aria-labelledby": labelledBy,
|
|
979
979
|
"aria-busy": busy,
|
|
@@ -988,7 +988,7 @@ const SessionTable = ({
|
|
|
988
988
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Th, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: t("homepage.table.actions", "Actions") }) })
|
|
989
989
|
] }) }),
|
|
990
990
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tbody, { children: sessions.map((session) => {
|
|
991
|
-
const user =
|
|
991
|
+
const user = settingsTabs.getSessionUserLabels(session);
|
|
992
992
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
993
993
|
designSystem.Tr,
|
|
994
994
|
{
|
|
@@ -1064,7 +1064,7 @@ const SessionCardList = ({
|
|
|
1064
1064
|
mutationPending,
|
|
1065
1065
|
getFocusFallback
|
|
1066
1066
|
}) => /* @__PURE__ */ jsxRuntime.jsx(CardList, { "aria-labelledby": labelledBy, "aria-busy": busy, children: sessions.map((session) => {
|
|
1067
|
-
const user =
|
|
1067
|
+
const user = settingsTabs.getSessionUserLabels(session);
|
|
1068
1068
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1069
1069
|
designSystem.Box,
|
|
1070
1070
|
{
|
|
@@ -1200,12 +1200,12 @@ const Legend = styled__default.default.ul`
|
|
|
1200
1200
|
const HowSessionsWork = () => {
|
|
1201
1201
|
const { formatMessage } = reactIntl.useIntl();
|
|
1202
1202
|
const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
|
|
1203
|
-
const [open, setOpen] = react.useState(() =>
|
|
1203
|
+
const [open, setOpen] = react.useState(() => settingsTabs.readDisclosureOpen(settingsTabs.getBrowserStorage()));
|
|
1204
1204
|
const contentId = `how-sessions-work-${react.useId().replace(/:/g, "")}`;
|
|
1205
1205
|
const toggle = () => {
|
|
1206
1206
|
setOpen((previous) => {
|
|
1207
1207
|
const next = !previous;
|
|
1208
|
-
|
|
1208
|
+
settingsTabs.writeDisclosureOpen(settingsTabs.getBrowserStorage(), next);
|
|
1209
1209
|
return next;
|
|
1210
1210
|
});
|
|
1211
1211
|
};
|
|
@@ -1706,10 +1706,10 @@ const HomePage = () => {
|
|
|
1706
1706
|
const { toggleNotification } = StrapiAdmin.useNotification();
|
|
1707
1707
|
const formatters = index.useSessionFormatters();
|
|
1708
1708
|
const { isBelowSmall, isBelowMedium, isBelowLarge } = useBreakpoint();
|
|
1709
|
-
const [listWidthRef, listWidth] =
|
|
1709
|
+
const [listWidthRef, listWidth] = settingsTabs.useElementWidth();
|
|
1710
1710
|
const [{ query }, setQuery] = StrapiAdmin.useQueryParams();
|
|
1711
1711
|
const t = (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
|
|
1712
|
-
const dashboard =
|
|
1712
|
+
const dashboard = settingsTabs.parseDashboardQuery(query);
|
|
1713
1713
|
const [sessions, setSessions] = react.useState([]);
|
|
1714
1714
|
const [pagination, setPagination] = react.useState({ total: 0, pageCount: 1 });
|
|
1715
1715
|
const [stats, setStats] = react.useState(EMPTY_SESSION_STATS);
|
|
@@ -1786,7 +1786,7 @@ const HomePage = () => {
|
|
|
1786
1786
|
if (showDetailModal || mutationPending) return void 0;
|
|
1787
1787
|
const interval = setInterval(() => {
|
|
1788
1788
|
fetchSessions();
|
|
1789
|
-
},
|
|
1789
|
+
}, settingsTabs.AUTO_REFRESH_INTERVAL_MS);
|
|
1790
1790
|
return () => clearInterval(interval);
|
|
1791
1791
|
}, [showDetailModal, mutationPending, fetchSessions]);
|
|
1792
1792
|
const handleTerminateSession = async (session) => {
|
|
@@ -1803,7 +1803,7 @@ const HomePage = () => {
|
|
|
1803
1803
|
});
|
|
1804
1804
|
} catch (err) {
|
|
1805
1805
|
index.logSafeAdminError("dashboard.terminateSession", err);
|
|
1806
|
-
if (
|
|
1806
|
+
if (settingsTabs.getErrorStatus(err) === 404) {
|
|
1807
1807
|
await fetchSessions();
|
|
1808
1808
|
toggleNotification({
|
|
1809
1809
|
type: "warning",
|
|
@@ -1843,7 +1843,7 @@ const HomePage = () => {
|
|
|
1843
1843
|
});
|
|
1844
1844
|
} catch (err) {
|
|
1845
1845
|
index.logSafeAdminError("dashboard.deleteSession", err);
|
|
1846
|
-
if (
|
|
1846
|
+
if (settingsTabs.getErrorStatus(err) === 404) {
|
|
1847
1847
|
await fetchSessions();
|
|
1848
1848
|
toggleNotification({
|
|
1849
1849
|
type: "warning",
|
|
@@ -1899,7 +1899,7 @@ const HomePage = () => {
|
|
|
1899
1899
|
if (format === "csv") {
|
|
1900
1900
|
const csvContent = buildSessionCsv(rows, {
|
|
1901
1901
|
unavailableValue: "",
|
|
1902
|
-
getDeviceInfo:
|
|
1902
|
+
getDeviceInfo: settingsTabs.getExportDeviceInfo,
|
|
1903
1903
|
getSessionStatus: index.getSessionStatus
|
|
1904
1904
|
});
|
|
1905
1905
|
downloadFile(csvContent, "text/csv;charset=utf-8;", "csv");
|
|
@@ -1909,7 +1909,7 @@ const HomePage = () => {
|
|
|
1909
1909
|
totalSessions: stats.total,
|
|
1910
1910
|
exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1911
1911
|
unavailableValue: "",
|
|
1912
|
-
getDeviceInfo:
|
|
1912
|
+
getDeviceInfo: settingsTabs.getExportDeviceInfo,
|
|
1913
1913
|
getSessionStatus: index.getSessionStatus,
|
|
1914
1914
|
truncated: capped
|
|
1915
1915
|
});
|
|
@@ -1951,7 +1951,7 @@ const HomePage = () => {
|
|
|
1951
1951
|
const getFocusFallback = react.useCallback(
|
|
1952
1952
|
(sessionId) => ({
|
|
1953
1953
|
get current() {
|
|
1954
|
-
const targetId =
|
|
1954
|
+
const targetId = settingsTabs.pickFocusSessionId(
|
|
1955
1955
|
mutationSnapshotRef.current,
|
|
1956
1956
|
visibleIdsRef.current,
|
|
1957
1957
|
sessionId
|
|
@@ -1982,7 +1982,7 @@ const HomePage = () => {
|
|
|
1982
1982
|
};
|
|
1983
1983
|
const handleSearch = react.useCallback(
|
|
1984
1984
|
(value) => {
|
|
1985
|
-
setQuery({ search:
|
|
1985
|
+
setQuery({ search: settingsTabs.encodeSearchQuery(value), _q: void 0, page: "1" }, "push", true);
|
|
1986
1986
|
},
|
|
1987
1987
|
[setQuery]
|
|
1988
1988
|
);
|
|
@@ -1993,7 +1993,7 @@ const HomePage = () => {
|
|
|
1993
1993
|
const showSessionData = !loading && hasData;
|
|
1994
1994
|
const showToolbar = showSessionData && stats.total > 0;
|
|
1995
1995
|
const canExport = showSessionData && pageResult.total > 0 && !exporting;
|
|
1996
|
-
const filtersActive =
|
|
1996
|
+
const filtersActive = settingsTabs.hasActiveFilters(dashboard);
|
|
1997
1997
|
const exportValues = { count: Math.min(pageResult.total, MAX_EXPORT_ROWS) };
|
|
1998
1998
|
const exportMenu = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1999
1999
|
designSystem.SimpleMenu,
|
|
@@ -2244,7 +2244,7 @@ const HomePage = () => {
|
|
|
2244
2244
|
SessionTable,
|
|
2245
2245
|
{
|
|
2246
2246
|
...listProps,
|
|
2247
|
-
compact:
|
|
2247
|
+
compact: settingsTabs.shouldUseCompactTable(listWidth, isBelowLarge)
|
|
2248
2248
|
}
|
|
2249
2249
|
),
|
|
2250
2250
|
/* @__PURE__ */ jsxRuntime.jsx(PaginationTargets$2, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2252,9 +2252,9 @@ const HomePage = () => {
|
|
|
2252
2252
|
{
|
|
2253
2253
|
pageCount: pageResult.pageCount,
|
|
2254
2254
|
total: pageResult.total,
|
|
2255
|
-
defaultPageSize: Number(
|
|
2255
|
+
defaultPageSize: Number(settingsTabs.DEFAULT_PAGE_SIZE),
|
|
2256
2256
|
children: [
|
|
2257
|
-
/* @__PURE__ */ jsxRuntime.jsx(StrapiAdmin.Pagination.PageSize, { options: [...
|
|
2257
|
+
/* @__PURE__ */ jsxRuntime.jsx(StrapiAdmin.Pagination.PageSize, { options: [...settingsTabs.PAGE_SIZE_OPTIONS] }),
|
|
2258
2258
|
/* @__PURE__ */ jsxRuntime.jsx(StrapiAdmin.Pagination.Links, {})
|
|
2259
2259
|
]
|
|
2260
2260
|
}
|
|
@@ -2444,7 +2444,7 @@ function withEventAdminNames(row, placeholderName) {
|
|
|
2444
2444
|
}
|
|
2445
2445
|
const HIGHLIGHT_BADGE = { backgroundColor: "primary100", textColor: "neutral800" };
|
|
2446
2446
|
const keepActionKeys = (event) => {
|
|
2447
|
-
if (
|
|
2447
|
+
if (settingsTabs.shouldIsolateActionKey(event.key, true)) event.stopPropagation();
|
|
2448
2448
|
};
|
|
2449
2449
|
const SHRINKING_ADMIN_CELL = { maxWidth: 0, width: "34%" };
|
|
2450
2450
|
const SHRINKING_ROLES_CELL = { maxWidth: 0, width: "22%" };
|
|
@@ -2515,7 +2515,7 @@ const AdminTable = ({
|
|
|
2515
2515
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { style: SHRINKING_ROLES_CELL, children: /* @__PURE__ */ jsxRuntime.jsx(AdminRoles, { admin }) }),
|
|
2516
2516
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(AdminStatus, { admin }) }),
|
|
2517
2517
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(LastActive, { value: admin.lastActiveAt }) }),
|
|
2518
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2518
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsxs(settingsTabs.RowActions, { onKeyDown: keepActionKeys, children: [
|
|
2519
2519
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2520
2520
|
designSystem.IconButton,
|
|
2521
2521
|
{
|
|
@@ -2916,6 +2916,32 @@ function parseActivityPageQuery(query) {
|
|
|
2916
2916
|
function hasActivityPageFilters(view) {
|
|
2917
2917
|
return view.event !== "all" || view.period !== "30" || view.adminId !== null;
|
|
2918
2918
|
}
|
|
2919
|
+
function groupChangedSettings(keys) {
|
|
2920
|
+
const list = Array.isArray(keys) ? keys.filter((key) => typeof key === "string" && key) : [];
|
|
2921
|
+
const byTab = /* @__PURE__ */ new Map();
|
|
2922
|
+
const unknown = [];
|
|
2923
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2924
|
+
for (const key of list) {
|
|
2925
|
+
const tab = settingsTabs.SETTINGS_TAB_IDS.find((id) => settingsTabs.SETTINGS_TAB_FIELDS[id]?.includes(key));
|
|
2926
|
+
const entry = settingsTabs.SETTINGS_FIELD_LABELS[key];
|
|
2927
|
+
if (!tab || !entry) {
|
|
2928
|
+
if (!seen.has(`raw:${key}`)) unknown.push({ key, label: null });
|
|
2929
|
+
seen.add(`raw:${key}`);
|
|
2930
|
+
continue;
|
|
2931
|
+
}
|
|
2932
|
+
if (seen.has(`label:${entry[0]}`)) continue;
|
|
2933
|
+
seen.add(`label:${entry[0]}`);
|
|
2934
|
+
if (!byTab.has(tab)) byTab.set(tab, []);
|
|
2935
|
+
byTab.get(tab).push({ key, label: message(entry[0], entry[1]) });
|
|
2936
|
+
}
|
|
2937
|
+
const groups = settingsTabs.SETTINGS_TAB_IDS.filter((tab) => byTab.has(tab)).map((tab) => ({
|
|
2938
|
+
tab,
|
|
2939
|
+
label: message(settingsTabs.SETTINGS_TAB_LABELS[tab][0], settingsTabs.SETTINGS_TAB_LABELS[tab][1]),
|
|
2940
|
+
fields: byTab.get(tab)
|
|
2941
|
+
}));
|
|
2942
|
+
if (unknown.length) groups.push({ tab: null, label: null, fields: unknown });
|
|
2943
|
+
return groups;
|
|
2944
|
+
}
|
|
2919
2945
|
const ACTIVITY_ACTION_LABELS = Object.freeze({
|
|
2920
2946
|
all: message("adminPanel.activity.action.all", "All actions"),
|
|
2921
2947
|
view: message("adminPanel.activity.action.view", "Opened"),
|
|
@@ -3008,6 +3034,81 @@ function buildActivityCsv(rows) {
|
|
|
3008
3034
|
])
|
|
3009
3035
|
);
|
|
3010
3036
|
}
|
|
3037
|
+
const settingsGroupText = (t, group) => {
|
|
3038
|
+
const fields = group.fields.map(
|
|
3039
|
+
(field) => field.label ? t(field.label.messageId, field.label.defaultMessage) : field.key
|
|
3040
|
+
).join(", ");
|
|
3041
|
+
return group.label ? t("adminPanel.activity.settingsGroup", "{tab}: {fields}", {
|
|
3042
|
+
tab: t(group.label.messageId, group.label.defaultMessage),
|
|
3043
|
+
fields
|
|
3044
|
+
}) : fields;
|
|
3045
|
+
};
|
|
3046
|
+
const changedSettingsText = (t, keys, { limit } = {}) => {
|
|
3047
|
+
const groups = groupChangedSettings(keys);
|
|
3048
|
+
const total = groups.reduce((sum, group) => sum + group.fields.length, 0);
|
|
3049
|
+
if (!total) return "";
|
|
3050
|
+
let budget = limit && limit > 0 ? limit : total;
|
|
3051
|
+
const shown = [];
|
|
3052
|
+
for (const group of groups) {
|
|
3053
|
+
if (budget <= 0) break;
|
|
3054
|
+
shown.push({ ...group, fields: group.fields.slice(0, budget) });
|
|
3055
|
+
budget -= Math.min(budget, group.fields.length);
|
|
3056
|
+
}
|
|
3057
|
+
const named = shown.reduce((sum, group) => sum + group.fields.length, 0);
|
|
3058
|
+
const text = shown.map((group) => settingsGroupText(t, group)).join(" · ");
|
|
3059
|
+
return named < total ? t("adminPanel.activity.settingsMore", "{names} and {count, number} more", {
|
|
3060
|
+
names: text,
|
|
3061
|
+
count: total - named
|
|
3062
|
+
}) : text;
|
|
3063
|
+
};
|
|
3064
|
+
const changedSettingsLines = (t, keys) => groupChangedSettings(keys).map((group) => settingsGroupText(t, group));
|
|
3065
|
+
const noAdminText = (t, row) => row?.event === "security-log.retention.purged" ? t("adminPanel.activity.system", "System") : t("adminPanel.activity.unknownAccount", "Unknown account");
|
|
3066
|
+
const deviceText = (t, row) => {
|
|
3067
|
+
if (row.browser && row.os) {
|
|
3068
|
+
return t("adminPanel.activity.browserOnOs", "{browser} on {os}", {
|
|
3069
|
+
browser: row.browser,
|
|
3070
|
+
os: row.os
|
|
3071
|
+
});
|
|
3072
|
+
}
|
|
3073
|
+
return row.browser || row.os || "";
|
|
3074
|
+
};
|
|
3075
|
+
const ipText = (t, row) => {
|
|
3076
|
+
if (!row.ipAddress) return "";
|
|
3077
|
+
return row.ipAnonymized ? t("adminPanel.activity.ipAnonymized", "{ip} (anonymised)", { ip: row.ipAddress }) : row.ipAddress;
|
|
3078
|
+
};
|
|
3079
|
+
const eventDetailText = (t, row, presentation, withActor) => {
|
|
3080
|
+
const parts = [];
|
|
3081
|
+
if (presentation.detail) {
|
|
3082
|
+
parts.push(t(presentation.detail.messageId, presentation.detail.defaultMessage));
|
|
3083
|
+
}
|
|
3084
|
+
if (Number.isInteger(row.attempts) && row.attempts > 1) {
|
|
3085
|
+
parts.push(
|
|
3086
|
+
t(
|
|
3087
|
+
"adminPanel.activity.attempts",
|
|
3088
|
+
"{count, plural, one {# attempt} other {# attempts}} within 5 minutes",
|
|
3089
|
+
{ count: row.attempts }
|
|
3090
|
+
)
|
|
3091
|
+
);
|
|
3092
|
+
}
|
|
3093
|
+
const changed = changedSettingsText(t, row.change?.keys, { limit: 3 });
|
|
3094
|
+
if (changed) parts.push(changed);
|
|
3095
|
+
if (Number.isInteger(row.purge?.count)) {
|
|
3096
|
+
parts.push(
|
|
3097
|
+
Number.isInteger(row.purge?.retentionDays) ? t(
|
|
3098
|
+
"adminPanel.activity.purgedDetail",
|
|
3099
|
+
"{count, plural, one {# event} other {# events}}, older than {days, plural, one {# day} other {# days}}",
|
|
3100
|
+
{ count: row.purge.count, days: row.purge.retentionDays }
|
|
3101
|
+
) : t("adminPanel.activity.purgedCount", "{count, plural, one {# event} other {# events}}", {
|
|
3102
|
+
count: row.purge.count
|
|
3103
|
+
})
|
|
3104
|
+
);
|
|
3105
|
+
}
|
|
3106
|
+
if (withActor && row.actor?.name) {
|
|
3107
|
+
parts.push(t("adminPanel.activity.byAdmin", "by {name}", { name: row.actor.name }));
|
|
3108
|
+
}
|
|
3109
|
+
return parts.join(" · ");
|
|
3110
|
+
};
|
|
3111
|
+
const contentTypeText = (row) => [row.contentType?.name, row.entry?.locale].filter(Boolean).join(" · ");
|
|
3011
3112
|
const useT$3 = () => {
|
|
3012
3113
|
const { formatMessage } = reactIntl.useIntl();
|
|
3013
3114
|
return (id, defaultMessage, values) => formatMessage({ id: index.getTranslation(id), defaultMessage }, values);
|
|
@@ -3116,7 +3217,6 @@ const EventTime = ({ value, compact = false }) => {
|
|
|
3116
3217
|
compact ? null : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: /* @__PURE__ */ jsxRuntime.jsx(NoWrap, { children: formatDate(date, SHORT_DATE) }) })
|
|
3117
3218
|
] });
|
|
3118
3219
|
};
|
|
3119
|
-
const noAdminText = (t, row) => row?.event === "security-log.retention.purged" ? t("adminPanel.activity.system", "System") : t("adminPanel.activity.unknownAccount", "Unknown account");
|
|
3120
3220
|
const AdminName = ({ admin, row, onOpenAdmin }) => {
|
|
3121
3221
|
const t = useT$3();
|
|
3122
3222
|
if (!admin) {
|
|
@@ -3140,58 +3240,6 @@ const AdminName = ({ admin, row, onOpenAdmin }) => {
|
|
|
3140
3240
|
}
|
|
3141
3241
|
);
|
|
3142
3242
|
};
|
|
3143
|
-
const deviceText = (t, row) => {
|
|
3144
|
-
if (row.browser && row.os) {
|
|
3145
|
-
return t("adminPanel.activity.browserOnOs", "{browser} on {os}", {
|
|
3146
|
-
browser: row.browser,
|
|
3147
|
-
os: row.os
|
|
3148
|
-
});
|
|
3149
|
-
}
|
|
3150
|
-
return row.browser || row.os || "";
|
|
3151
|
-
};
|
|
3152
|
-
const ipText = (t, row) => {
|
|
3153
|
-
if (!row.ipAddress) return "";
|
|
3154
|
-
return row.ipAnonymized ? t("adminPanel.activity.ipAnonymized", "{ip} (anonymised)", { ip: row.ipAddress }) : row.ipAddress;
|
|
3155
|
-
};
|
|
3156
|
-
const eventDetailText = (t, row, presentation, withActor) => {
|
|
3157
|
-
const parts = [];
|
|
3158
|
-
if (presentation.detail) {
|
|
3159
|
-
parts.push(t(presentation.detail.messageId, presentation.detail.defaultMessage));
|
|
3160
|
-
}
|
|
3161
|
-
if (Number.isInteger(row.attempts) && row.attempts > 1) {
|
|
3162
|
-
parts.push(
|
|
3163
|
-
t(
|
|
3164
|
-
"adminPanel.activity.attempts",
|
|
3165
|
-
"{count, plural, one {# attempt} other {# attempts}} within 5 minutes",
|
|
3166
|
-
{ count: row.attempts }
|
|
3167
|
-
)
|
|
3168
|
-
);
|
|
3169
|
-
}
|
|
3170
|
-
const keys = Array.isArray(row.change?.keys) ? row.change.keys : [];
|
|
3171
|
-
if (keys.length) {
|
|
3172
|
-
parts.push(
|
|
3173
|
-
keys.length > 3 ? t("adminPanel.activity.settingsMore", "{names} and {count, number} more", {
|
|
3174
|
-
names: keys.slice(0, 3).join(", "),
|
|
3175
|
-
count: keys.length - 3
|
|
3176
|
-
}) : keys.join(", ")
|
|
3177
|
-
);
|
|
3178
|
-
}
|
|
3179
|
-
if (Number.isInteger(row.purge?.count)) {
|
|
3180
|
-
parts.push(
|
|
3181
|
-
Number.isInteger(row.purge?.retentionDays) ? t(
|
|
3182
|
-
"adminPanel.activity.purgedDetail",
|
|
3183
|
-
"{count, plural, one {# event} other {# events}}, older than {days, plural, one {# day} other {# days}}",
|
|
3184
|
-
{ count: row.purge.count, days: row.purge.retentionDays }
|
|
3185
|
-
) : t("adminPanel.activity.purgedCount", "{count, plural, one {# event} other {# events}}", {
|
|
3186
|
-
count: row.purge.count
|
|
3187
|
-
})
|
|
3188
|
-
);
|
|
3189
|
-
}
|
|
3190
|
-
if (withActor && row.actor?.name) {
|
|
3191
|
-
parts.push(t("adminPanel.activity.byAdmin", "by {name}", { name: row.actor.name }));
|
|
3192
|
-
}
|
|
3193
|
-
return parts.join(" · ");
|
|
3194
|
-
};
|
|
3195
3243
|
const SignInDetails = ({ row }) => {
|
|
3196
3244
|
const t = useT$3();
|
|
3197
3245
|
const ip = ipText(t, row);
|
|
@@ -3266,7 +3314,6 @@ const ActivityEntry = ({ row }) => {
|
|
|
3266
3314
|
}
|
|
3267
3315
|
);
|
|
3268
3316
|
};
|
|
3269
|
-
const contentTypeText = (row) => [row.contentType?.name, row.entry?.locale].filter(Boolean).join(" · ");
|
|
3270
3317
|
const EventDetailsModal = ({ title, items, footerAction, onClose, onCloseAutoFocus }) => {
|
|
3271
3318
|
const t = useT$3();
|
|
3272
3319
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open: true, onOpenChange: (open) => open ? null : onClose(), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { onCloseAutoFocus, "aria-describedby": void 0, children: [
|
|
@@ -3350,11 +3397,13 @@ const signInDetails = (t, formatDate, row) => {
|
|
|
3350
3397
|
});
|
|
3351
3398
|
}
|
|
3352
3399
|
if (row.change) {
|
|
3400
|
+
const lines = changedSettingsLines(t, row.change.keys);
|
|
3353
3401
|
items.push({
|
|
3354
3402
|
id: "settings",
|
|
3355
3403
|
label: t("adminPanel.activity.details.changedSettings", "Changed settings"),
|
|
3356
|
-
|
|
3357
|
-
|
|
3404
|
+
...lines.length ? {
|
|
3405
|
+
render: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, "data-changed-settings": "", children: lines.map((line) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "neutral800", children: line }, line)) })
|
|
3406
|
+
} : { value: null },
|
|
3358
3407
|
fullWidth: true
|
|
3359
3408
|
});
|
|
3360
3409
|
}
|
|
@@ -3497,7 +3546,7 @@ const SignInEventTable = ({
|
|
|
3497
3546
|
}) => {
|
|
3498
3547
|
const t = useT$3();
|
|
3499
3548
|
const { formatDate, formatRelativeTime } = index.useSessionFormatters();
|
|
3500
|
-
const [measureRef, width] =
|
|
3549
|
+
const [measureRef, width] = settingsTabs.useElementWidth();
|
|
3501
3550
|
const {
|
|
3502
3551
|
selected,
|
|
3503
3552
|
open: openDetails,
|
|
@@ -3613,7 +3662,7 @@ const SignInEventTable = ({
|
|
|
3613
3662
|
const ActivityEventTable = ({ rows, label, showAdmin = false, busy = false }) => {
|
|
3614
3663
|
const t = useT$3();
|
|
3615
3664
|
const { formatDate, formatRelativeTime } = index.useSessionFormatters();
|
|
3616
|
-
const [measureRef, width] =
|
|
3665
|
+
const [measureRef, width] = settingsTabs.useElementWidth();
|
|
3617
3666
|
const {
|
|
3618
3667
|
selected,
|
|
3619
3668
|
open: openDetails,
|
|
@@ -4509,7 +4558,7 @@ const AdminPanelPage = () => {
|
|
|
4509
4558
|
setQuery({ filter: filter === "all" ? void 0 : filter, page: "1" });
|
|
4510
4559
|
};
|
|
4511
4560
|
const handleSearch = react.useCallback(
|
|
4512
|
-
(value) => setQuery({ search:
|
|
4561
|
+
(value) => setQuery({ search: settingsTabs.encodeSearchQuery(value), page: "1" }, "push", true),
|
|
4513
4562
|
[setQuery]
|
|
4514
4563
|
);
|
|
4515
4564
|
const handleClearFilters = () => {
|
|
@@ -4552,10 +4601,10 @@ const AdminPanelPage = () => {
|
|
|
4552
4601
|
index.logSafeAdminError("adminPanel.signOut", err);
|
|
4553
4602
|
const message2 = getSignOutErrorMessage(err);
|
|
4554
4603
|
toggleNotification({
|
|
4555
|
-
type:
|
|
4604
|
+
type: settingsTabs.getErrorStatus(err) === 404 ? "warning" : "danger",
|
|
4556
4605
|
message: t(message2.messageId, message2.defaultMessage)
|
|
4557
4606
|
});
|
|
4558
|
-
if (
|
|
4607
|
+
if (settingsTabs.getErrorStatus(err) === 404) {
|
|
4559
4608
|
await Promise.all([fetchAdmins(), selected ? fetchDialogSessions(selected) : null]);
|
|
4560
4609
|
return;
|
|
4561
4610
|
}
|
|
@@ -6,7 +6,7 @@ import { Flex, Loader, Button, Box, Typography } from "@strapi/design-system";
|
|
|
6
6
|
import { User, Lightning, Clock, Lock, WarningCircle } from "@strapi/icons";
|
|
7
7
|
import * as StrapiAdmin from "@strapi/strapi/admin";
|
|
8
8
|
import { useFetchClient } from "@strapi/strapi/admin";
|
|
9
|
-
import { l as logSafeAdminError, n as isCancelledRequest, b as getTranslation, R as ReadableText, M as MissingValue } from "./index-
|
|
9
|
+
import { l as logSafeAdminError, n as isCancelledRequest, b as getTranslation, R as ReadableText, M as MissingValue } from "./index-h-ksmM8A.mjs";
|
|
10
10
|
function normalizeUserCounts(response) {
|
|
11
11
|
const totalUsers = response?.data?.totalUsers;
|
|
12
12
|
const blockedUsers = response?.data?.blockedUsers;
|
|
@@ -7,7 +7,7 @@ const styled = require("styled-components");
|
|
|
7
7
|
const designSystem = require("@strapi/design-system");
|
|
8
8
|
const icons = require("@strapi/icons");
|
|
9
9
|
const StrapiAdmin = require("@strapi/strapi/admin");
|
|
10
|
-
const index = require("./index-
|
|
10
|
+
const index = require("./index-DEYtqPc3.js");
|
|
11
11
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
12
12
|
function _interopNamespace(e) {
|
|
13
13
|
if (e && e.__esModule) return e;
|