strapi-plugin-magic-sessionmanager 3.7.0 → 4.0.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/README.md +90 -0
- package/admin/src/components/LicenseGuard.jsx +6 -6
- package/admin/src/components/SessionDetailModal.jsx +12 -12
- package/admin/src/components/SessionInfoCard.jsx +3 -3
- package/admin/src/components/SessionInfoPanel.jsx +3 -2
- package/admin/src/hooks/useLicense.js +1 -1
- package/admin/src/index.js +2 -2
- package/admin/src/pages/Analytics.jsx +2 -2
- package/admin/src/pages/HomePage.jsx +11 -14
- package/admin/src/pages/License.jsx +2 -2
- package/admin/src/pages/Settings.jsx +24 -25
- package/admin/src/pages/SettingsNew.jsx +21 -21
- package/admin/src/utils/parseUserAgent.js +7 -7
- package/dist/_chunks/{Analytics-Bi-vcT63.js → Analytics-BBdv1I5y.js} +4 -4
- package/dist/_chunks/{Analytics-BM9i88xu.mjs → Analytics-Dv9f_0eZ.mjs} +4 -4
- package/dist/_chunks/{App-DcnJOCL9.mjs → App-CIQ-7sa7.mjs} +26 -31
- package/dist/_chunks/{App-BbiNy_cT.js → App-CJaZPNjt.js} +26 -31
- package/dist/_chunks/{License-kYo8j2yl.js → License-D24rgaZQ.js} +3 -3
- package/dist/_chunks/{License-DsxP-MAL.mjs → License-nrmFxoBm.mjs} +3 -3
- package/dist/_chunks/{Settings-jW0TOE_d.js → Settings-CqxgjU0y.js} +26 -26
- package/dist/_chunks/{Settings-C3sW9eBD.mjs → Settings-D5dLEGc_.mjs} +26 -26
- package/dist/_chunks/{index-DG9XeVSg.mjs → index-Duk1_Wrz.mjs} +15 -15
- package/dist/_chunks/{index-Dr2HT-Dd.js → index-WH04CS1c.js} +15 -15
- package/dist/_chunks/{useLicense-BL_3bX9O.js → useLicense-BwOlCyhc.js} +2 -2
- package/dist/_chunks/{useLicense-DOkJX-tk.mjs → useLicense-Ce8GaxB0.mjs} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +250 -119
- package/dist/server/index.mjs +250 -119
- package/package.json +1 -1
- package/server/src/bootstrap.js +106 -28
- package/server/src/controllers/license.js +4 -4
- package/server/src/controllers/session.js +67 -13
- package/server/src/destroy.js +1 -1
- package/server/src/middlewares/last-seen.js +13 -7
- package/server/src/register.js +4 -4
- package/server/src/routes/content-api.js +11 -2
- package/server/src/services/geolocation.js +4 -2
- package/server/src/services/license-guard.js +13 -10
- package/server/src/services/notifications.js +20 -20
- package/server/src/services/service.js +1 -1
- package/server/src/services/session.js +63 -33
- package/server/src/utils/encryption.js +1 -1
|
@@ -4,8 +4,8 @@ import { Flex, Loader, Typography, Button, Box, Badge, Accordion, Grid, SingleSe
|
|
|
4
4
|
import { useFetchClient, useNotification } from "@strapi/strapi/admin";
|
|
5
5
|
import { Check, Information, Cog, Trash, Shield, Code, Duplicate, Mail } from "@strapi/icons";
|
|
6
6
|
import styled, { css, keyframes } from "styled-components";
|
|
7
|
-
import { a as pluginId } from "./index-
|
|
8
|
-
import { u as useLicense } from "./useLicense-
|
|
7
|
+
import { a as pluginId } from "./index-Duk1_Wrz.mjs";
|
|
8
|
+
import { u as useLicense } from "./useLicense-Ce8GaxB0.mjs";
|
|
9
9
|
const theme = {
|
|
10
10
|
colors: {
|
|
11
11
|
primary: { 600: "#0284C7", 700: "#075985", 100: "#E0F2FE", 50: "#F0F9FF" },
|
|
@@ -181,12 +181,12 @@ const validateTemplate = (template, templateType) => {
|
|
|
181
181
|
};
|
|
182
182
|
const getDefaultTemplates = () => ({
|
|
183
183
|
suspiciousLogin: {
|
|
184
|
-
subject: "
|
|
184
|
+
subject: "[ALERT] Suspicious Login Alert - Session Manager",
|
|
185
185
|
html: `
|
|
186
186
|
<html>
|
|
187
187
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
|
188
188
|
<div style="max-width: 600px; margin: 0 auto; padding: 20px; background-color: #f9fafb; border-radius: 10px;">
|
|
189
|
-
<h2 style="color: #dc2626;"
|
|
189
|
+
<h2 style="color: #dc2626;">[ALERT] Suspicious Login Detected</h2>
|
|
190
190
|
<p>A potentially suspicious login was detected for your account.</p>
|
|
191
191
|
|
|
192
192
|
<div style="background: white; padding: 15px; border-radius: 8px; margin: 20px 0;">
|
|
@@ -221,7 +221,7 @@ const getDefaultTemplates = () => ({
|
|
|
221
221
|
</div>
|
|
222
222
|
</body>
|
|
223
223
|
</html>`,
|
|
224
|
-
text:
|
|
224
|
+
text: `[ALERT] Suspicious Login Detected
|
|
225
225
|
|
|
226
226
|
A potentially suspicious login was detected for your account.
|
|
227
227
|
|
|
@@ -236,12 +236,12 @@ Login Details:
|
|
|
236
236
|
Security: VPN={{reason.isVpn}}, Proxy={{reason.isProxy}}, Threat={{reason.isThreat}}, Score={{reason.securityScore}}/100`
|
|
237
237
|
},
|
|
238
238
|
newLocation: {
|
|
239
|
-
subject: "
|
|
239
|
+
subject: "[LOCATION] New Location Login Detected",
|
|
240
240
|
html: `
|
|
241
241
|
<html>
|
|
242
242
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
|
243
243
|
<div style="max-width: 600px; margin: 0 auto; padding: 20px; background-color: #f0f9ff; border-radius: 10px;">
|
|
244
|
-
<h2 style="color: #0284c7;"
|
|
244
|
+
<h2 style="color: #0284c7;">[LOCATION] Login from New Location</h2>
|
|
245
245
|
<p>Your account was accessed from a new location.</p>
|
|
246
246
|
|
|
247
247
|
<div style="background: white; padding: 15px; border-radius: 8px; margin: 20px 0;">
|
|
@@ -264,7 +264,7 @@ Security: VPN={{reason.isVpn}}, Proxy={{reason.isProxy}}, Threat={{reason.isThre
|
|
|
264
264
|
</div>
|
|
265
265
|
</body>
|
|
266
266
|
</html>`,
|
|
267
|
-
text:
|
|
267
|
+
text: `[LOCATION] Login from New Location
|
|
268
268
|
|
|
269
269
|
Your account was accessed from a new location.
|
|
270
270
|
|
|
@@ -279,12 +279,12 @@ New Location Details:
|
|
|
279
279
|
If this was you, no action is needed.`
|
|
280
280
|
},
|
|
281
281
|
vpnProxy: {
|
|
282
|
-
subject: "
|
|
282
|
+
subject: "[WARNING] VPN/Proxy Login Detected",
|
|
283
283
|
html: `
|
|
284
284
|
<html>
|
|
285
285
|
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333;">
|
|
286
286
|
<div style="max-width: 600px; margin: 0 auto; padding: 20px; background-color: #fffbeb; border-radius: 10px;">
|
|
287
|
-
<h2 style="color: #d97706;"
|
|
287
|
+
<h2 style="color: #d97706;">[WARNING] VPN/Proxy Detected</h2>
|
|
288
288
|
<p>A login from a VPN or proxy service was detected on your account.</p>
|
|
289
289
|
|
|
290
290
|
<div style="background: white; padding: 15px; border-radius: 8px; margin: 20px 0;">
|
|
@@ -309,7 +309,7 @@ If this was you, no action is needed.`
|
|
|
309
309
|
</div>
|
|
310
310
|
</body>
|
|
311
311
|
</html>`,
|
|
312
|
-
text:
|
|
312
|
+
text: `[WARNING] VPN/Proxy Detected
|
|
313
313
|
|
|
314
314
|
A login from a VPN or proxy service was detected on your account.
|
|
315
315
|
|
|
@@ -445,7 +445,7 @@ const SettingsPage = () => {
|
|
|
445
445
|
setHasChanges(false);
|
|
446
446
|
};
|
|
447
447
|
const handleCleanInactive = async () => {
|
|
448
|
-
if (!confirm("
|
|
448
|
+
if (!confirm("[WARNING] This will permanently delete ALL inactive sessions.\n\nContinue?")) {
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
451
|
setCleaning(true);
|
|
@@ -539,7 +539,7 @@ const SettingsPage = () => {
|
|
|
539
539
|
}
|
|
540
540
|
) }),
|
|
541
541
|
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsxs(Box, { padding: 6, children: [
|
|
542
|
-
/* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: theme.colors.neutral[700] }, children: "
|
|
542
|
+
/* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: theme.colors.neutral[700] }, children: "SESSION TIMEOUT" }),
|
|
543
543
|
/* @__PURE__ */ jsxs(Grid.Root, { gap: 6, style: { marginBottom: "32px" }, children: [
|
|
544
544
|
/* @__PURE__ */ jsx(Grid.Item, { col: 6, s: 12, children: /* @__PURE__ */ jsxs(Box, { children: [
|
|
545
545
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Inactivity Timeout" }),
|
|
@@ -669,7 +669,7 @@ const SettingsPage = () => {
|
|
|
669
669
|
}
|
|
670
670
|
) }),
|
|
671
671
|
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsxs(Box, { padding: 6, children: [
|
|
672
|
-
/* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: theme.colors.neutral[700] }, children: "
|
|
672
|
+
/* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "16px", display: "block", color: theme.colors.neutral[700] }, children: "SECURITY OPTIONS" }),
|
|
673
673
|
/* @__PURE__ */ jsx(
|
|
674
674
|
Box,
|
|
675
675
|
{
|
|
@@ -979,7 +979,7 @@ const SettingsPage = () => {
|
|
|
979
979
|
{
|
|
980
980
|
checked: settings.alertOnSuspiciousLogin,
|
|
981
981
|
onChange: () => handleChange("alertOnSuspiciousLogin", !settings.alertOnSuspiciousLogin),
|
|
982
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "14px" }, children: "
|
|
982
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "14px" }, children: "Suspicious Login" })
|
|
983
983
|
}
|
|
984
984
|
)
|
|
985
985
|
}
|
|
@@ -1001,7 +1001,7 @@ const SettingsPage = () => {
|
|
|
1001
1001
|
{
|
|
1002
1002
|
checked: settings.alertOnNewLocation,
|
|
1003
1003
|
onChange: () => handleChange("alertOnNewLocation", !settings.alertOnNewLocation),
|
|
1004
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "14px" }, children: "
|
|
1004
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "14px" }, children: "New Location" })
|
|
1005
1005
|
}
|
|
1006
1006
|
)
|
|
1007
1007
|
}
|
|
@@ -1023,24 +1023,24 @@ const SettingsPage = () => {
|
|
|
1023
1023
|
{
|
|
1024
1024
|
checked: settings.alertOnVpnProxy,
|
|
1025
1025
|
onChange: () => handleChange("alertOnVpnProxy", !settings.alertOnVpnProxy),
|
|
1026
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "14px" }, children: "
|
|
1026
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", style: { fontSize: "14px" }, children: "VPN/Proxy" })
|
|
1027
1027
|
}
|
|
1028
1028
|
)
|
|
1029
1029
|
}
|
|
1030
1030
|
) })
|
|
1031
1031
|
] }),
|
|
1032
1032
|
/* @__PURE__ */ jsx(Divider, { style: { marginBottom: "24px" } }),
|
|
1033
|
-
/* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: theme.colors.neutral[700] }, children: "
|
|
1033
|
+
/* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: theme.colors.neutral[700] }, children: "EMAIL TEMPLATES" }),
|
|
1034
1034
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { marginBottom: "20px", display: "block", fontSize: "12px" }, children: "Customize email notification templates with dynamic variables" }),
|
|
1035
1035
|
/* @__PURE__ */ jsxs(Tabs.Root, { value: activeTemplateTab, onValueChange: setActiveTemplateTab, children: [
|
|
1036
1036
|
/* @__PURE__ */ jsxs(Tabs.List, { "aria-label": "Email Templates", children: [
|
|
1037
|
-
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "suspiciousLogin", children: "
|
|
1038
|
-
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "newLocation", children: "
|
|
1039
|
-
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "vpnProxy", children: "
|
|
1037
|
+
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "suspiciousLogin", children: "Suspicious Login" }),
|
|
1038
|
+
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "newLocation", children: "New Location" }),
|
|
1039
|
+
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "vpnProxy", children: "VPN/Proxy" })
|
|
1040
1040
|
] }),
|
|
1041
1041
|
Object.keys(settings.emailTemplates).map((templateKey) => /* @__PURE__ */ jsx(Tabs.Content, { value: templateKey, children: /* @__PURE__ */ jsxs(Box, { paddingTop: 4, children: [
|
|
1042
1042
|
/* @__PURE__ */ jsxs(Box, { style: { marginBottom: "24px" }, children: [
|
|
1043
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "
|
|
1043
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", style: { marginBottom: "8px", display: "block" }, children: "Email Subject" }),
|
|
1044
1044
|
/* @__PURE__ */ jsx(
|
|
1045
1045
|
TextInput,
|
|
1046
1046
|
{
|
|
@@ -1196,7 +1196,7 @@ const SettingsPage = () => {
|
|
|
1196
1196
|
const validation = validateTemplate(settings.emailTemplates[templateKey].html, templateKey);
|
|
1197
1197
|
toggleNotification({
|
|
1198
1198
|
type: validation.isValid ? "success" : "warning",
|
|
1199
|
-
message: validation.isValid ? `✓ Template valid! Found ${validation.foundVars.length}/${validation.totalAvailable} variables.` : "
|
|
1199
|
+
message: validation.isValid ? `✓ Template valid! Found ${validation.foundVars.length}/${validation.totalAvailable} variables.` : "[WARNING] No variables found. Add at least one variable."
|
|
1200
1200
|
});
|
|
1201
1201
|
},
|
|
1202
1202
|
children: "✓ Validate"
|
|
@@ -1401,7 +1401,7 @@ const SettingsPage = () => {
|
|
|
1401
1401
|
}
|
|
1402
1402
|
),
|
|
1403
1403
|
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", style: { marginTop: "10px" }, children: [
|
|
1404
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px" }, children: "
|
|
1404
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px" }, children: "Optional: Post session alerts to your Discord channel" }),
|
|
1405
1405
|
settings.discordWebhookUrl && /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "primary600", style: { fontSize: "11px", fontFamily: "monospace" }, children: [
|
|
1406
1406
|
settings.discordWebhookUrl.length,
|
|
1407
1407
|
" characters"
|
|
@@ -1444,7 +1444,7 @@ const SettingsPage = () => {
|
|
|
1444
1444
|
}
|
|
1445
1445
|
),
|
|
1446
1446
|
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", alignItems: "center", style: { marginTop: "10px" }, children: [
|
|
1447
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px" }, children: "
|
|
1447
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", style: { fontSize: "12px" }, children: "Optional: Post session alerts to your Slack workspace" }),
|
|
1448
1448
|
settings.slackWebhookUrl && /* @__PURE__ */ jsxs(Typography, { variant: "pi", textColor: "primary600", style: { fontSize: "11px", fontFamily: "monospace" }, children: [
|
|
1449
1449
|
settings.slackWebhookUrl.length,
|
|
1450
1450
|
" characters"
|
|
@@ -1458,7 +1458,7 @@ const SettingsPage = () => {
|
|
|
1458
1458
|
/* @__PURE__ */ jsx(Box, { padding: 5, background: "primary100", style: { borderRadius: theme.borderRadius.md, marginTop: "32px", border: "2px solid #BAE6FD" }, children: /* @__PURE__ */ jsxs(Flex, { gap: 3, alignItems: "flex-start", children: [
|
|
1459
1459
|
/* @__PURE__ */ jsx(Check, { style: { width: "20px", height: "20px", color: theme.colors.success[600], flexShrink: 0, marginTop: "2px" } }),
|
|
1460
1460
|
/* @__PURE__ */ jsxs(Box, { style: { flex: 1 }, children: [
|
|
1461
|
-
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: theme.colors.primary[700] }, children: "
|
|
1461
|
+
/* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", style: { marginBottom: "8px", display: "block", color: theme.colors.primary[700] }, children: "Database-Backed Settings" }),
|
|
1462
1462
|
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "primary700", style: { fontSize: "13px", lineHeight: "1.8" }, children: "All settings are stored in your Strapi database and shared across all admin users. Changes take effect immediately - no server restart required! Email templates, webhooks, and security options are all managed from this interface." })
|
|
1463
1463
|
] })
|
|
1464
1464
|
] }) })
|
|
@@ -22,20 +22,20 @@ const parseUserAgent = (userAgent) => {
|
|
|
22
22
|
if (!userAgent) {
|
|
23
23
|
return {
|
|
24
24
|
device: "Unknown",
|
|
25
|
-
deviceIcon: "
|
|
25
|
+
deviceIcon: "question",
|
|
26
26
|
browser: "Unknown",
|
|
27
27
|
os: "Unknown"
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
const ua = userAgent.toLowerCase();
|
|
31
31
|
let device = "Desktop";
|
|
32
|
-
let deviceIcon = "
|
|
32
|
+
let deviceIcon = "desktop";
|
|
33
33
|
if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(userAgent)) {
|
|
34
34
|
device = "Tablet";
|
|
35
|
-
deviceIcon = "
|
|
35
|
+
deviceIcon = "tablet";
|
|
36
36
|
} else if (/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(userAgent)) {
|
|
37
37
|
device = "Mobile";
|
|
38
|
-
deviceIcon = "
|
|
38
|
+
deviceIcon = "mobile";
|
|
39
39
|
}
|
|
40
40
|
let browser = "Unknown";
|
|
41
41
|
if (ua.includes("edg/")) {
|
|
@@ -50,15 +50,15 @@ const parseUserAgent = (userAgent) => {
|
|
|
50
50
|
browser = "Opera";
|
|
51
51
|
} else if (ua.includes("curl/")) {
|
|
52
52
|
browser = "cURL";
|
|
53
|
-
deviceIcon = "
|
|
53
|
+
deviceIcon = "gear";
|
|
54
54
|
device = "API Client";
|
|
55
55
|
} else if (ua.includes("postman")) {
|
|
56
56
|
browser = "Postman";
|
|
57
|
-
deviceIcon = "
|
|
57
|
+
deviceIcon = "code";
|
|
58
58
|
device = "API Client";
|
|
59
59
|
} else if (ua.includes("insomnia")) {
|
|
60
60
|
browser = "Insomnia";
|
|
61
|
-
deviceIcon = "
|
|
61
|
+
deviceIcon = "code";
|
|
62
62
|
device = "API Client";
|
|
63
63
|
}
|
|
64
64
|
let os = "Unknown";
|
|
@@ -87,7 +87,7 @@ const SessionInfoPanel = ({ documentId, model, document }) => {
|
|
|
87
87
|
const [actionLoading, setActionLoading] = useState(false);
|
|
88
88
|
const { get, post: postRequest } = useFetchClient();
|
|
89
89
|
const { toggleNotification } = useNotification();
|
|
90
|
-
const userId = document?.
|
|
90
|
+
const userId = document?.documentId || documentId;
|
|
91
91
|
useEffect(() => {
|
|
92
92
|
if (model !== "plugin::users-permissions.user" || !userId) {
|
|
93
93
|
setLoading(false);
|
|
@@ -191,7 +191,7 @@ const SessionInfoPanel = ({ documentId, model, document }) => {
|
|
|
191
191
|
textColor: "neutral0",
|
|
192
192
|
size: "M",
|
|
193
193
|
style: { fontSize: "14px", padding: "6px 12px" },
|
|
194
|
-
children: isOnline ? "
|
|
194
|
+
children: isOnline ? "ACTIVE" : "OFFLINE"
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
197
|
/* @__PURE__ */ jsxs(Typography, { variant: "omega", fontWeight: "semiBold", textColor: isOnline ? "success700" : "neutral700", children: [
|
|
@@ -403,7 +403,7 @@ const index = {
|
|
|
403
403
|
id: `${pluginId}.plugin.name`,
|
|
404
404
|
defaultMessage: pluginPkg.strapi.displayName
|
|
405
405
|
},
|
|
406
|
-
Component: () => import("./App-
|
|
406
|
+
Component: () => import("./App-CIQ-7sa7.mjs")
|
|
407
407
|
});
|
|
408
408
|
app.createSettingSection(
|
|
409
409
|
{
|
|
@@ -419,7 +419,7 @@ const index = {
|
|
|
419
419
|
},
|
|
420
420
|
id: "general",
|
|
421
421
|
to: `/settings/${pluginId}/general`,
|
|
422
|
-
Component: () => import("./Settings-
|
|
422
|
+
Component: () => import("./Settings-D5dLEGc_.mjs")
|
|
423
423
|
},
|
|
424
424
|
{
|
|
425
425
|
intlLabel: {
|
|
@@ -428,7 +428,7 @@ const index = {
|
|
|
428
428
|
},
|
|
429
429
|
id: "analytics",
|
|
430
430
|
to: `/settings/${pluginId}/analytics`,
|
|
431
|
-
Component: () => import("./Analytics-
|
|
431
|
+
Component: () => import("./Analytics-Dv9f_0eZ.mjs")
|
|
432
432
|
},
|
|
433
433
|
{
|
|
434
434
|
intlLabel: {
|
|
@@ -437,7 +437,7 @@ const index = {
|
|
|
437
437
|
},
|
|
438
438
|
id: "license",
|
|
439
439
|
to: `/settings/${pluginId}/license`,
|
|
440
|
-
Component: () => import("./License-
|
|
440
|
+
Component: () => import("./License-nrmFxoBm.mjs")
|
|
441
441
|
}
|
|
442
442
|
]
|
|
443
443
|
);
|
|
@@ -461,7 +461,7 @@ const index = {
|
|
|
461
461
|
id: "online-users-widget",
|
|
462
462
|
pluginId
|
|
463
463
|
});
|
|
464
|
-
console.log(`[${pluginId}]
|
|
464
|
+
console.log(`[${pluginId}] [SUCCESS] Online Users Widget registered`);
|
|
465
465
|
}
|
|
466
466
|
},
|
|
467
467
|
bootstrap(app) {
|
|
@@ -471,7 +471,7 @@ const index = {
|
|
|
471
471
|
if (contentManagerPlugin && contentManagerPlugin.apis) {
|
|
472
472
|
console.log(`[${pluginId}] Injecting SessionInfoPanel into edit view sidebar...`);
|
|
473
473
|
contentManagerPlugin.apis.addEditViewSidePanel([SessionInfoPanel]);
|
|
474
|
-
console.log(`[${pluginId}]
|
|
474
|
+
console.log(`[${pluginId}] [SUCCESS] SessionInfoPanel injected successfully`);
|
|
475
475
|
} else {
|
|
476
476
|
console.warn(`[${pluginId}] Content Manager plugin or APIs not available`);
|
|
477
477
|
}
|
|
@@ -23,20 +23,20 @@ const parseUserAgent = (userAgent) => {
|
|
|
23
23
|
if (!userAgent) {
|
|
24
24
|
return {
|
|
25
25
|
device: "Unknown",
|
|
26
|
-
deviceIcon: "
|
|
26
|
+
deviceIcon: "question",
|
|
27
27
|
browser: "Unknown",
|
|
28
28
|
os: "Unknown"
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
const ua = userAgent.toLowerCase();
|
|
32
32
|
let device = "Desktop";
|
|
33
|
-
let deviceIcon = "
|
|
33
|
+
let deviceIcon = "desktop";
|
|
34
34
|
if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(userAgent)) {
|
|
35
35
|
device = "Tablet";
|
|
36
|
-
deviceIcon = "
|
|
36
|
+
deviceIcon = "tablet";
|
|
37
37
|
} else if (/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(userAgent)) {
|
|
38
38
|
device = "Mobile";
|
|
39
|
-
deviceIcon = "
|
|
39
|
+
deviceIcon = "mobile";
|
|
40
40
|
}
|
|
41
41
|
let browser = "Unknown";
|
|
42
42
|
if (ua.includes("edg/")) {
|
|
@@ -51,15 +51,15 @@ const parseUserAgent = (userAgent) => {
|
|
|
51
51
|
browser = "Opera";
|
|
52
52
|
} else if (ua.includes("curl/")) {
|
|
53
53
|
browser = "cURL";
|
|
54
|
-
deviceIcon = "
|
|
54
|
+
deviceIcon = "gear";
|
|
55
55
|
device = "API Client";
|
|
56
56
|
} else if (ua.includes("postman")) {
|
|
57
57
|
browser = "Postman";
|
|
58
|
-
deviceIcon = "
|
|
58
|
+
deviceIcon = "code";
|
|
59
59
|
device = "API Client";
|
|
60
60
|
} else if (ua.includes("insomnia")) {
|
|
61
61
|
browser = "Insomnia";
|
|
62
|
-
deviceIcon = "
|
|
62
|
+
deviceIcon = "code";
|
|
63
63
|
device = "API Client";
|
|
64
64
|
}
|
|
65
65
|
let os = "Unknown";
|
|
@@ -88,7 +88,7 @@ const SessionInfoPanel = ({ documentId, model, document }) => {
|
|
|
88
88
|
const [actionLoading, setActionLoading] = react.useState(false);
|
|
89
89
|
const { get, post: postRequest } = admin.useFetchClient();
|
|
90
90
|
const { toggleNotification } = admin.useNotification();
|
|
91
|
-
const userId = document?.
|
|
91
|
+
const userId = document?.documentId || documentId;
|
|
92
92
|
react.useEffect(() => {
|
|
93
93
|
if (model !== "plugin::users-permissions.user" || !userId) {
|
|
94
94
|
setLoading(false);
|
|
@@ -192,7 +192,7 @@ const SessionInfoPanel = ({ documentId, model, document }) => {
|
|
|
192
192
|
textColor: "neutral0",
|
|
193
193
|
size: "M",
|
|
194
194
|
style: { fontSize: "14px", padding: "6px 12px" },
|
|
195
|
-
children: isOnline ? "
|
|
195
|
+
children: isOnline ? "ACTIVE" : "OFFLINE"
|
|
196
196
|
}
|
|
197
197
|
),
|
|
198
198
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "omega", fontWeight: "semiBold", textColor: isOnline ? "success700" : "neutral700", children: [
|
|
@@ -404,7 +404,7 @@ const index = {
|
|
|
404
404
|
id: `${pluginId}.plugin.name`,
|
|
405
405
|
defaultMessage: pluginPkg.strapi.displayName
|
|
406
406
|
},
|
|
407
|
-
Component: () => Promise.resolve().then(() => require("./App-
|
|
407
|
+
Component: () => Promise.resolve().then(() => require("./App-CJaZPNjt.js"))
|
|
408
408
|
});
|
|
409
409
|
app.createSettingSection(
|
|
410
410
|
{
|
|
@@ -420,7 +420,7 @@ const index = {
|
|
|
420
420
|
},
|
|
421
421
|
id: "general",
|
|
422
422
|
to: `/settings/${pluginId}/general`,
|
|
423
|
-
Component: () => Promise.resolve().then(() => require("./Settings-
|
|
423
|
+
Component: () => Promise.resolve().then(() => require("./Settings-CqxgjU0y.js"))
|
|
424
424
|
},
|
|
425
425
|
{
|
|
426
426
|
intlLabel: {
|
|
@@ -429,7 +429,7 @@ const index = {
|
|
|
429
429
|
},
|
|
430
430
|
id: "analytics",
|
|
431
431
|
to: `/settings/${pluginId}/analytics`,
|
|
432
|
-
Component: () => Promise.resolve().then(() => require("./Analytics-
|
|
432
|
+
Component: () => Promise.resolve().then(() => require("./Analytics-BBdv1I5y.js"))
|
|
433
433
|
},
|
|
434
434
|
{
|
|
435
435
|
intlLabel: {
|
|
@@ -438,7 +438,7 @@ const index = {
|
|
|
438
438
|
},
|
|
439
439
|
id: "license",
|
|
440
440
|
to: `/settings/${pluginId}/license`,
|
|
441
|
-
Component: () => Promise.resolve().then(() => require("./License-
|
|
441
|
+
Component: () => Promise.resolve().then(() => require("./License-D24rgaZQ.js"))
|
|
442
442
|
}
|
|
443
443
|
]
|
|
444
444
|
);
|
|
@@ -462,7 +462,7 @@ const index = {
|
|
|
462
462
|
id: "online-users-widget",
|
|
463
463
|
pluginId
|
|
464
464
|
});
|
|
465
|
-
console.log(`[${pluginId}]
|
|
465
|
+
console.log(`[${pluginId}] [SUCCESS] Online Users Widget registered`);
|
|
466
466
|
}
|
|
467
467
|
},
|
|
468
468
|
bootstrap(app) {
|
|
@@ -472,7 +472,7 @@ const index = {
|
|
|
472
472
|
if (contentManagerPlugin && contentManagerPlugin.apis) {
|
|
473
473
|
console.log(`[${pluginId}] Injecting SessionInfoPanel into edit view sidebar...`);
|
|
474
474
|
contentManagerPlugin.apis.addEditViewSidePanel([SessionInfoPanel]);
|
|
475
|
-
console.log(`[${pluginId}]
|
|
475
|
+
console.log(`[${pluginId}] [SUCCESS] SessionInfoPanel injected successfully`);
|
|
476
476
|
} else {
|
|
477
477
|
console.warn(`[${pluginId}] Content Manager plugin or APIs not available`);
|
|
478
478
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const react = require("react");
|
|
3
3
|
const admin = require("@strapi/strapi/admin");
|
|
4
|
-
const index = require("./index-
|
|
4
|
+
const index = require("./index-WH04CS1c.js");
|
|
5
5
|
const useLicense = () => {
|
|
6
6
|
const { get } = admin.useFetchClient();
|
|
7
7
|
const [isPremium, setIsPremium] = react.useState(false);
|
|
@@ -44,7 +44,7 @@ const useLicense = () => {
|
|
|
44
44
|
if ((newIsPremium !== isPremium || !silent) && !silent) {
|
|
45
45
|
console.log(`[magic-sessionmanager/useLicense] Premium Status: ${newIsPremium} (valid: ${isValid}, featurePremium: ${hasPremiumFeature})`);
|
|
46
46
|
if (!newIsPremium && isValid) {
|
|
47
|
-
console.warn("[magic-sessionmanager/useLicense]
|
|
47
|
+
console.warn("[magic-sessionmanager/useLicense] [WARN] License is valid but Premium feature is not enabled!");
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
setIsPremium(newIsPremium);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
import { useFetchClient } from "@strapi/strapi/admin";
|
|
3
|
-
import { a as pluginId } from "./index-
|
|
3
|
+
import { a as pluginId } from "./index-Duk1_Wrz.mjs";
|
|
4
4
|
const useLicense = () => {
|
|
5
5
|
const { get } = useFetchClient();
|
|
6
6
|
const [isPremium, setIsPremium] = useState(false);
|
|
@@ -43,7 +43,7 @@ const useLicense = () => {
|
|
|
43
43
|
if ((newIsPremium !== isPremium || !silent) && !silent) {
|
|
44
44
|
console.log(`[magic-sessionmanager/useLicense] Premium Status: ${newIsPremium} (valid: ${isValid}, featurePremium: ${hasPremiumFeature})`);
|
|
45
45
|
if (!newIsPremium && isValid) {
|
|
46
|
-
console.warn("[magic-sessionmanager/useLicense]
|
|
46
|
+
console.warn("[magic-sessionmanager/useLicense] [WARN] License is valid but Premium feature is not enabled!");
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
setIsPremium(newIsPremium);
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED