@nice2dev/licensing 1.2.0 → 1.2.2
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 +142 -0
- package/dist/index.cjs +364 -273
- package/dist/index.mjs +365 -274
- package/dist/marks-BxZztzfi.cjs +1466 -0
- package/dist/marks-CDyo3kiN.cjs +1462 -0
- package/dist/marks-CTwbg2ls.js +1463 -0
- package/dist/marks-C_PSZQ9M.js +1467 -0
- package/dist/react.cjs +110 -91
- package/dist/react.mjs +111 -92
- package/package.json +7 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const marks = require("./marks-
|
|
3
|
+
const marks = require("./marks-BxZztzfi.cjs");
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
|
+
const uiCore = require("@nice2dev/ui-core");
|
|
5
6
|
const React = require("react");
|
|
7
|
+
const icons = require("@nice2dev/icons");
|
|
6
8
|
const HEARTBEAT_INTERVAL_MS = 5 * 60 * 1e3;
|
|
7
9
|
class SeatManager {
|
|
8
10
|
constructor(serverUrl, apiKey) {
|
|
@@ -42,7 +44,7 @@ class SeatManager {
|
|
|
42
44
|
success: true,
|
|
43
45
|
seat: data.seat
|
|
44
46
|
};
|
|
45
|
-
} catch
|
|
47
|
+
} catch {
|
|
46
48
|
return {
|
|
47
49
|
success: false,
|
|
48
50
|
error: "Network error"
|
|
@@ -215,7 +217,7 @@ class FloatingLicenseManager {
|
|
|
215
217
|
leaseId: data.leaseId,
|
|
216
218
|
expiresAt: data.expiresAt
|
|
217
219
|
};
|
|
218
|
-
} catch
|
|
220
|
+
} catch {
|
|
219
221
|
return {
|
|
220
222
|
success: false,
|
|
221
223
|
error: "Network error"
|
|
@@ -1263,9 +1265,10 @@ function useLicensePortal(config) {
|
|
|
1263
1265
|
invoices: [],
|
|
1264
1266
|
activeTab: "overview"
|
|
1265
1267
|
});
|
|
1268
|
+
const { apiBaseUrl, authToken, customerId } = config;
|
|
1266
1269
|
const service = React.useMemo(
|
|
1267
|
-
() => new LicensePortalService(
|
|
1268
|
-
[
|
|
1270
|
+
() => new LicensePortalService({ apiBaseUrl, authToken, customerId }),
|
|
1271
|
+
[apiBaseUrl, authToken, customerId]
|
|
1269
1272
|
);
|
|
1270
1273
|
const loadData = React.useCallback(async () => {
|
|
1271
1274
|
var _a;
|
|
@@ -1355,6 +1358,7 @@ function useLicensePortal(config) {
|
|
|
1355
1358
|
};
|
|
1356
1359
|
}
|
|
1357
1360
|
const LicenseStatusBadge = ({ status, size = "md" }) => {
|
|
1361
|
+
const { t } = uiCore.useNiceTranslation();
|
|
1358
1362
|
const sizeClasses = {
|
|
1359
1363
|
sm: "px-2 py-0.5 text-xs",
|
|
1360
1364
|
md: "px-2.5 py-1 text-sm",
|
|
@@ -1376,12 +1380,13 @@ const LicenseStatusBadge = ({ status, size = "md" }) => {
|
|
|
1376
1380
|
style: { backgroundColor: getStatusColor(status) }
|
|
1377
1381
|
}
|
|
1378
1382
|
),
|
|
1379
|
-
status.charAt(0).toUpperCase() + status.slice(1)
|
|
1383
|
+
t(`licensePortal.status.${status}`, status.charAt(0).toUpperCase() + status.slice(1))
|
|
1380
1384
|
]
|
|
1381
1385
|
}
|
|
1382
1386
|
);
|
|
1383
1387
|
};
|
|
1384
1388
|
const LicenseTierBadge = ({ tier, size = "md" }) => {
|
|
1389
|
+
const { t } = uiCore.useNiceTranslation();
|
|
1385
1390
|
const tierColors = {
|
|
1386
1391
|
trial: "#6b7280",
|
|
1387
1392
|
personal: "#3b82f6",
|
|
@@ -1404,11 +1409,12 @@ const LicenseTierBadge = ({ tier, size = "md" }) => {
|
|
|
1404
1409
|
color: tierColors[tier],
|
|
1405
1410
|
border: `1px solid ${tierColors[tier]}40`
|
|
1406
1411
|
},
|
|
1407
|
-
children: getTierLabel(tier)
|
|
1412
|
+
children: t(`licensing.tier.${tier}`, getTierLabel(tier))
|
|
1408
1413
|
}
|
|
1409
1414
|
);
|
|
1410
1415
|
};
|
|
1411
1416
|
const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected }) => {
|
|
1417
|
+
const { t } = uiCore.useNiceTranslation();
|
|
1412
1418
|
const daysRemaining = getDaysUntilExpiration(license.expiresAt);
|
|
1413
1419
|
const isExpiringSoon = daysRemaining !== null && daysRemaining <= 30 && daysRemaining > 0;
|
|
1414
1420
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1426,7 +1432,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
|
|
|
1426
1432
|
] })
|
|
1427
1433
|
] }),
|
|
1428
1434
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-right text-sm", children: [
|
|
1429
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Seats" }),
|
|
1435
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licensePortal.seats", "Seats") }),
|
|
1430
1436
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-semibold", children: [
|
|
1431
1437
|
license.activeSeats,
|
|
1432
1438
|
"/",
|
|
@@ -1435,25 +1441,16 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
|
|
|
1435
1441
|
] })
|
|
1436
1442
|
] }),
|
|
1437
1443
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm text-gray-600 mb-3", children: [
|
|
1438
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1439
|
-
"
|
|
1440
|
-
license.licensee
|
|
1441
|
-
|
|
1442
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1443
|
-
"Email: ",
|
|
1444
|
-
license.email
|
|
1445
|
-
] })
|
|
1444
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: t("licensePortal.licensee", "Licensee: {licensee}").replace(
|
|
1445
|
+
"{licensee}",
|
|
1446
|
+
String(license.licensee)
|
|
1447
|
+
) }),
|
|
1448
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: t("licensePortal.email", "Email: {email}").replace("{email}", String(license.email)) })
|
|
1446
1449
|
] }),
|
|
1447
|
-
license.expiresAt && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `text-sm ${isExpiringSoon ? "text-orange-600" : "text-gray-500"}`, children: daysRemaining !== null && daysRemaining > 0 ? /* @__PURE__ */ jsxRuntime.
|
|
1448
|
-
"
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
formatDate(license.expiresAt),
|
|
1452
|
-
")"
|
|
1453
|
-
] }) : daysRemaining === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-600", children: "Expires today" }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-red-600", children: [
|
|
1454
|
-
"Expired ",
|
|
1455
|
-
formatDate(license.expiresAt)
|
|
1456
|
-
] }) }),
|
|
1450
|
+
license.expiresAt && /* @__PURE__ */ jsxRuntime.jsx("div", { className: `text-sm ${isExpiringSoon ? "text-orange-600" : "text-gray-500"}`, children: daysRemaining !== null && daysRemaining > 0 ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: t("licensePortal.expiresInDays", "Expires in {daysRemaining} days ({expiresAt})").replace("{daysRemaining}", String(daysRemaining)).replace("{expiresAt}", String(formatDate(license.expiresAt))) }) : daysRemaining === 0 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-600", children: t("licensePortal.expiresToday", "Expires today") }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-red-600", children: t("licensePortal.expired", "Expired {expiresAt}").replace(
|
|
1451
|
+
"{expiresAt}",
|
|
1452
|
+
String(formatDate(license.expiresAt))
|
|
1453
|
+
) }) }),
|
|
1457
1454
|
(onActivate || onDeactivate) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t", children: [
|
|
1458
1455
|
onActivate && license.status === "valid" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1459
1456
|
"button",
|
|
@@ -1463,7 +1460,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
|
|
|
1463
1460
|
e.stopPropagation();
|
|
1464
1461
|
onActivate();
|
|
1465
1462
|
},
|
|
1466
|
-
children: "Activate"
|
|
1463
|
+
children: t("licensePortal.activate", "Activate")
|
|
1467
1464
|
}
|
|
1468
1465
|
),
|
|
1469
1466
|
onDeactivate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1474,7 +1471,7 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
|
|
|
1474
1471
|
e.stopPropagation();
|
|
1475
1472
|
onDeactivate();
|
|
1476
1473
|
},
|
|
1477
|
-
children: "Deactivate"
|
|
1474
|
+
children: t("licensePortal.deactivate", "Deactivate")
|
|
1478
1475
|
}
|
|
1479
1476
|
)
|
|
1480
1477
|
] })
|
|
@@ -1483,24 +1480,25 @@ const LicenseCard = ({ license, onSelect, onActivate, onDeactivate, selected })
|
|
|
1483
1480
|
);
|
|
1484
1481
|
};
|
|
1485
1482
|
const LicensePortal = (props) => {
|
|
1483
|
+
const { t } = uiCore.useNiceTranslation();
|
|
1486
1484
|
const { className, style, ...config } = props;
|
|
1487
1485
|
const { state, activateLicense, deactivateLicense, selectLicense, setActiveTab, loadData } = useLicensePortal(config);
|
|
1488
1486
|
if (state.loading) {
|
|
1489
1487
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-license-portal ${className || ""}`, style, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-center p-8", children: [
|
|
1490
1488
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500" }),
|
|
1491
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 text-gray-600", children: "Loading licenses..." })
|
|
1489
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 text-gray-600", children: t("licensePortal.loadingLicenses", "Loading licenses...") })
|
|
1492
1490
|
] }) });
|
|
1493
1491
|
}
|
|
1494
1492
|
if (state.error) {
|
|
1495
1493
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `nice-license-portal ${className || ""}`, style, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
1496
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-red-800 font-semibold", children: "Error loading licenses" }),
|
|
1494
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-red-800 font-semibold", children: t("licensePortal.errorLoadingLicenses", "Error loading licenses") }),
|
|
1497
1495
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-600 text-sm mt-1", children: state.error.message }),
|
|
1498
1496
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1499
1497
|
"button",
|
|
1500
1498
|
{
|
|
1501
1499
|
className: "mt-3 px-4 py-2 bg-red-100 text-red-700 rounded hover:bg-red-200",
|
|
1502
1500
|
onClick: loadData,
|
|
1503
|
-
children: "Retry"
|
|
1501
|
+
children: t("licensePortal.retry", "Retry")
|
|
1504
1502
|
}
|
|
1505
1503
|
)
|
|
1506
1504
|
] }) });
|
|
@@ -1510,17 +1508,20 @@ const LicensePortal = (props) => {
|
|
|
1510
1508
|
return null;
|
|
1511
1509
|
}
|
|
1512
1510
|
const tabs = [
|
|
1513
|
-
{ id: "overview", label: "Overview" },
|
|
1514
|
-
{ id: "licenses", label: "Licenses" },
|
|
1515
|
-
{ id: "seats", label: "Seat Management" },
|
|
1516
|
-
...config.showBilling ? [{ id: "billing", label: "Billing" }] : [],
|
|
1517
|
-
...config.showAnalytics ? [{ id: "analytics", label: "Analytics" }] : [],
|
|
1518
|
-
{ id: "settings", label: "Settings" }
|
|
1511
|
+
{ id: "overview", label: t("licensePortal.overview", "Overview") },
|
|
1512
|
+
{ id: "licenses", label: t("licensePortal.licenses", "Licenses") },
|
|
1513
|
+
{ id: "seats", label: t("licensePortal.seatManagement", "Seat Management") },
|
|
1514
|
+
...config.showBilling ? [{ id: "billing", label: t("licensePortal.billing", "Billing") }] : [],
|
|
1515
|
+
...config.showAnalytics ? [{ id: "analytics", label: t("licensePortal.analytics", "Analytics") }] : [],
|
|
1516
|
+
{ id: "settings", label: t("licensePortal.settings", "Settings") }
|
|
1519
1517
|
];
|
|
1520
1518
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-license-portal ${className || ""}`, style, children: [
|
|
1521
1519
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6", children: [
|
|
1522
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "License Portal" }),
|
|
1523
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children:
|
|
1520
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("licensePortal.licensePortal", "License Portal") }),
|
|
1521
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: t(
|
|
1522
|
+
"licensePortal.manageYourNice2devLicensesAnd",
|
|
1523
|
+
"Manage your Nice2Dev licenses and subscriptions"
|
|
1524
|
+
) })
|
|
1524
1525
|
] }),
|
|
1525
1526
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-b border-gray-200 mb-6", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { className: "flex gap-6", children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1526
1527
|
"button",
|
|
@@ -1534,15 +1535,15 @@ const LicensePortal = (props) => {
|
|
|
1534
1535
|
state.activeTab === "overview" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1535
1536
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-4 gap-4", children: [
|
|
1536
1537
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
|
|
1537
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Total Licenses" }),
|
|
1538
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.totalLicenses", "Total Licenses") }),
|
|
1538
1539
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold", children: overview.totalLicenses })
|
|
1539
1540
|
] }),
|
|
1540
1541
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
|
|
1541
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Active" }),
|
|
1542
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.active", "Active") }),
|
|
1542
1543
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold text-green-600", children: overview.activeLicenses })
|
|
1543
1544
|
] }),
|
|
1544
1545
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
|
|
1545
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Seats Used" }),
|
|
1546
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.seatsUsed", "Seats Used") }),
|
|
1546
1547
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-2xl font-bold", children: [
|
|
1547
1548
|
overview.usedSeats,
|
|
1548
1549
|
"/",
|
|
@@ -1550,22 +1551,22 @@ const LicensePortal = (props) => {
|
|
|
1550
1551
|
] })
|
|
1551
1552
|
] }),
|
|
1552
1553
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white p-4 rounded-lg border border-gray-200", children: [
|
|
1553
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Expiring Soon" }),
|
|
1554
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.expiringSoon", "Expiring Soon") }),
|
|
1554
1555
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl font-bold text-orange-600", children: overview.expiringSoon.length })
|
|
1555
1556
|
] })
|
|
1556
1557
|
] }),
|
|
1557
1558
|
overview.expiringSoon.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-lg p-4", children: [
|
|
1558
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: "Licenses Expiring Soon" }),
|
|
1559
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: t("licensePortal.licensesExpiringSoon", "Licenses Expiring Soon") }),
|
|
1559
1560
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: overview.expiringSoon.map((license) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between text-sm", children: [
|
|
1560
1561
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-orange-700", children: license.key }),
|
|
1561
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1562
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-orange-600", children: t("licensePortal.daysRemainingCount", "{days} days remaining").replace(
|
|
1563
|
+
"{days}",
|
|
1564
|
+
String(getDaysUntilExpiration(license.expiresAt))
|
|
1565
|
+
) })
|
|
1565
1566
|
] }, license.key)) })
|
|
1566
1567
|
] }),
|
|
1567
1568
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
|
|
1568
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Recent Activity" }) }),
|
|
1569
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("licensePortal.recentActivity", "Recent Activity") }) }),
|
|
1569
1570
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-gray-100", children: [
|
|
1570
1571
|
state.actionHistory.slice(0, 5).map((action) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex items-center justify-between", children: [
|
|
1571
1572
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -1574,7 +1575,7 @@ const LicensePortal = (props) => {
|
|
|
1574
1575
|
] }),
|
|
1575
1576
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: formatDate(action.timestamp) })
|
|
1576
1577
|
] }, action.id)),
|
|
1577
|
-
state.actionHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: "No recent activity" })
|
|
1578
|
+
state.actionHistory.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: t("licensePortal.noRecentActivity", "No recent activity") })
|
|
1578
1579
|
] })
|
|
1579
1580
|
] })
|
|
1580
1581
|
] }),
|
|
@@ -1597,18 +1598,21 @@ const LicensePortal = (props) => {
|
|
|
1597
1598
|
license.key
|
|
1598
1599
|
);
|
|
1599
1600
|
}),
|
|
1600
|
-
overview.licenses.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full text-center py-8 text-gray-500", children:
|
|
1601
|
+
overview.licenses.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full text-center py-8 text-gray-500", children: t(
|
|
1602
|
+
"licensePortal.noLicensesFoundContactSupport",
|
|
1603
|
+
"No licenses found. Contact support to purchase a license."
|
|
1604
|
+
) })
|
|
1601
1605
|
] }),
|
|
1602
1606
|
state.activeTab === "billing" && config.showBilling && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1603
1607
|
state.subscription && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: [
|
|
1604
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Current Subscription" }),
|
|
1608
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.currentSubscription", "Current Subscription") }),
|
|
1605
1609
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
1606
1610
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1607
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Plan" }),
|
|
1611
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.plan", "Plan") }),
|
|
1608
1612
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.subscription.plan })
|
|
1609
1613
|
] }),
|
|
1610
1614
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1611
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Status" }),
|
|
1615
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.status", "Status") }),
|
|
1612
1616
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1613
1617
|
"div",
|
|
1614
1618
|
{
|
|
@@ -1618,7 +1622,7 @@ const LicensePortal = (props) => {
|
|
|
1618
1622
|
)
|
|
1619
1623
|
] }),
|
|
1620
1624
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1621
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Current Period" }),
|
|
1625
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.currentPeriod", "Current Period") }),
|
|
1622
1626
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "font-medium", children: [
|
|
1623
1627
|
formatDate(state.subscription.currentPeriodStart),
|
|
1624
1628
|
" -",
|
|
@@ -1627,13 +1631,13 @@ const LicensePortal = (props) => {
|
|
|
1627
1631
|
] })
|
|
1628
1632
|
] }),
|
|
1629
1633
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1630
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Seats" }),
|
|
1634
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licensePortal.seats", "Seats") }),
|
|
1631
1635
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.subscription.seats })
|
|
1632
1636
|
] })
|
|
1633
1637
|
] })
|
|
1634
1638
|
] }),
|
|
1635
1639
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
|
|
1636
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Invoices" }) }),
|
|
1640
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("licensePortal.invoices", "Invoices") }) }),
|
|
1637
1641
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-gray-100", children: [
|
|
1638
1642
|
state.invoices.map((invoice) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 flex items-center justify-between", children: [
|
|
1639
1643
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -1660,20 +1664,23 @@ const LicensePortal = (props) => {
|
|
|
1660
1664
|
className: "text-blue-500 hover:text-blue-600",
|
|
1661
1665
|
target: "_blank",
|
|
1662
1666
|
rel: "noopener noreferrer",
|
|
1663
|
-
children: "Download"
|
|
1667
|
+
children: t("licensePortal.download", "Download")
|
|
1664
1668
|
}
|
|
1665
1669
|
)
|
|
1666
1670
|
] })
|
|
1667
1671
|
] }, invoice.id)),
|
|
1668
|
-
state.invoices.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: "No invoices" })
|
|
1672
|
+
state.invoices.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 text-gray-500 text-center", children: t("licensePortal.noInvoices", "No invoices") })
|
|
1669
1673
|
] })
|
|
1670
1674
|
] })
|
|
1671
1675
|
] }),
|
|
1672
1676
|
state.activeTab === "seats" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: [
|
|
1673
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Seat Management" }),
|
|
1674
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mb-4", children:
|
|
1677
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.seatManagement", "Seat Management") }),
|
|
1678
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mb-4", children: t(
|
|
1679
|
+
"licensePortal.selectALicenseToManage",
|
|
1680
|
+
"Select a license to manage seat assignments."
|
|
1681
|
+
) })
|
|
1675
1682
|
] }),
|
|
1676
|
-
state.activeTab === "settings" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Portal Settings" }) })
|
|
1683
|
+
state.activeTab === "settings" && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-white rounded-lg border border-gray-200 p-6", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("licensePortal.portalSettings", "Portal Settings") }) })
|
|
1677
1684
|
] });
|
|
1678
1685
|
};
|
|
1679
1686
|
class ActivationService {
|
|
@@ -1691,6 +1698,7 @@ class ActivationService {
|
|
|
1691
1698
|
const error = await response.json().catch(() => ({}));
|
|
1692
1699
|
throw {
|
|
1693
1700
|
code: `HTTP_${response.status}`,
|
|
1701
|
+
// audit-allow: i18n — the service's fallback in the thrown ActivationError (API contract)
|
|
1694
1702
|
message: error.message || "Request failed",
|
|
1695
1703
|
retryable: response.status >= 500,
|
|
1696
1704
|
supportRequired: response.status === 403
|
|
@@ -1764,6 +1772,7 @@ async function getDefaultMachineName() {
|
|
|
1764
1772
|
return "Unknown Device";
|
|
1765
1773
|
}
|
|
1766
1774
|
function useActivationWizard(config) {
|
|
1775
|
+
const { t } = uiCore.useNiceTranslation();
|
|
1767
1776
|
const [state, setState] = React.useState({
|
|
1768
1777
|
step: "enter-key",
|
|
1769
1778
|
licenseKey: "",
|
|
@@ -1793,7 +1802,10 @@ function useActivationWizard(config) {
|
|
|
1793
1802
|
...s,
|
|
1794
1803
|
error: {
|
|
1795
1804
|
code: "INVALID_FORMAT",
|
|
1796
|
-
message:
|
|
1805
|
+
message: t(
|
|
1806
|
+
"activationWizard.licenseKeyFormatIsInvalid",
|
|
1807
|
+
"License key format is invalid. Expected format: XXXX-XXXX-XXXX-XXXX-XXXX"
|
|
1808
|
+
),
|
|
1797
1809
|
retryable: true
|
|
1798
1810
|
}
|
|
1799
1811
|
}));
|
|
@@ -1808,7 +1820,7 @@ function useActivationWizard(config) {
|
|
|
1808
1820
|
step: "error",
|
|
1809
1821
|
error: {
|
|
1810
1822
|
code: validation.errorCode || "VALIDATION_FAILED",
|
|
1811
|
-
message: validation.errorMessage || "License key validation failed",
|
|
1823
|
+
message: validation.errorMessage || t("activationWizard.licenseKeyValidationFailed", "License key validation failed"),
|
|
1812
1824
|
retryable: true
|
|
1813
1825
|
}
|
|
1814
1826
|
}));
|
|
@@ -1832,7 +1844,10 @@ function useActivationWizard(config) {
|
|
|
1832
1844
|
step: "error",
|
|
1833
1845
|
error: {
|
|
1834
1846
|
code: "HARDWARE_LIMIT",
|
|
1835
|
-
message: hwCheck.reason ||
|
|
1847
|
+
message: hwCheck.reason || t(
|
|
1848
|
+
"activationWizard.maximumHardwareActivationsReached",
|
|
1849
|
+
"Maximum hardware activations reached"
|
|
1850
|
+
),
|
|
1836
1851
|
retryable: false,
|
|
1837
1852
|
supportRequired: true
|
|
1838
1853
|
}
|
|
@@ -1847,7 +1862,7 @@ function useActivationWizard(config) {
|
|
|
1847
1862
|
error
|
|
1848
1863
|
}));
|
|
1849
1864
|
}
|
|
1850
|
-
}, [state.licenseKey, state.machineName, service]);
|
|
1865
|
+
}, [state.licenseKey, state.machineName, service, t]);
|
|
1851
1866
|
const acceptTermsAndActivate = React.useCallback(async () => {
|
|
1852
1867
|
var _a, _b;
|
|
1853
1868
|
if (!state.termsAccepted) {
|
|
@@ -1855,7 +1870,10 @@ function useActivationWizard(config) {
|
|
|
1855
1870
|
...s,
|
|
1856
1871
|
error: {
|
|
1857
1872
|
code: "TERMS_NOT_ACCEPTED",
|
|
1858
|
-
message:
|
|
1873
|
+
message: t(
|
|
1874
|
+
"activationWizard.pleaseAcceptTheTermsOf",
|
|
1875
|
+
"Please accept the terms of service to continue"
|
|
1876
|
+
),
|
|
1859
1877
|
retryable: true
|
|
1860
1878
|
}
|
|
1861
1879
|
}));
|
|
@@ -1884,7 +1902,7 @@ function useActivationWizard(config) {
|
|
|
1884
1902
|
}));
|
|
1885
1903
|
(_b = config.onActivationError) == null ? void 0 : _b.call(config, activationError);
|
|
1886
1904
|
}
|
|
1887
|
-
}, [state, service, config]);
|
|
1905
|
+
}, [state, service, config, t]);
|
|
1888
1906
|
const startOfflineActivation = React.useCallback(async () => {
|
|
1889
1907
|
if (!config.allowOfflineActivation) {
|
|
1890
1908
|
return;
|
|
@@ -1973,13 +1991,14 @@ function useActivationWizard(config) {
|
|
|
1973
1991
|
};
|
|
1974
1992
|
}
|
|
1975
1993
|
const StepIndicator = ({ currentStep }) => {
|
|
1994
|
+
const { t } = uiCore.useNiceTranslation();
|
|
1976
1995
|
const steps = [
|
|
1977
|
-
{ id: "enter-key", label: "Enter Key" },
|
|
1978
|
-
{ id: "validate", label: "Validate" },
|
|
1979
|
-
{ id: "hardware-check", label: "Hardware" },
|
|
1980
|
-
{ id: "terms", label: "Terms" },
|
|
1981
|
-
{ id: "activating", label: "Activate" },
|
|
1982
|
-
{ id: "success", label: "Done" }
|
|
1996
|
+
{ id: "enter-key", label: t("activationWizard.enterKey", "Enter Key") },
|
|
1997
|
+
{ id: "validate", label: t("activationWizard.validate", "Validate") },
|
|
1998
|
+
{ id: "hardware-check", label: t("activationWizard.hardware", "Hardware") },
|
|
1999
|
+
{ id: "terms", label: t("activationWizard.terms", "Terms") },
|
|
2000
|
+
{ id: "activating", label: t("activationWizard.activate", "Activate") },
|
|
2001
|
+
{ id: "success", label: t("activationWizard.done", "Done") }
|
|
1983
2002
|
];
|
|
1984
2003
|
const stepOrder = [
|
|
1985
2004
|
"enter-key",
|
|
@@ -2011,6 +2030,7 @@ const StepIndicator = ({ currentStep }) => {
|
|
|
2011
2030
|
};
|
|
2012
2031
|
const ActivationWizard = (props) => {
|
|
2013
2032
|
var _a;
|
|
2033
|
+
const { t } = uiCore.useNiceTranslation();
|
|
2014
2034
|
const { className, style, ...config } = props;
|
|
2015
2035
|
const {
|
|
2016
2036
|
state,
|
|
@@ -2031,17 +2051,20 @@ const ActivationWizard = (props) => {
|
|
|
2031
2051
|
style,
|
|
2032
2052
|
children: [
|
|
2033
2053
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-6", children: [
|
|
2034
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "Activate License" }),
|
|
2035
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-1", children:
|
|
2054
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("activationWizard.activateLicense", "Activate License") }),
|
|
2055
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-1", children: t(
|
|
2056
|
+
"activationWizard.followTheStepsToActivate",
|
|
2057
|
+
"Follow the steps to activate your Nice2Dev license"
|
|
2058
|
+
) })
|
|
2036
2059
|
] }),
|
|
2037
2060
|
state.step !== "error" && /* @__PURE__ */ jsxRuntime.jsx(StepIndicator, { currentStep: state.step }),
|
|
2038
2061
|
state.step === "error" && state.error && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2039
2062
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-6 text-center", children: [
|
|
2040
2063
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-red-500 text-4xl mb-3 font-bold", "aria-hidden": "true", children: "!" }),
|
|
2041
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-red-800", children: "Activation Failed" }),
|
|
2064
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-red-800", children: t("activationWizard.activationFailed", "Activation Failed") }),
|
|
2042
2065
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-600 mt-2", children: state.error.message }),
|
|
2043
2066
|
state.error.supportRequired && config.supportEmail && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-sm text-gray-600 mt-4", children: [
|
|
2044
|
-
"Please contact support at",
|
|
2067
|
+
t("activationWizard.pleaseContactSupportAt", "Please contact support at"),
|
|
2045
2068
|
" ",
|
|
2046
2069
|
/* @__PURE__ */ jsxRuntime.jsx("a", { href: `mailto:${config.supportEmail}`, className: "text-blue-500 hover:underline", children: config.supportEmail })
|
|
2047
2070
|
] })
|
|
@@ -2052,7 +2075,7 @@ const ActivationWizard = (props) => {
|
|
|
2052
2075
|
{
|
|
2053
2076
|
onClick: () => goBack(),
|
|
2054
2077
|
className: "px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
|
|
2055
|
-
children: "Try Again"
|
|
2078
|
+
children: t("activationWizard.tryAgain", "Try Again")
|
|
2056
2079
|
}
|
|
2057
2080
|
),
|
|
2058
2081
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2060,14 +2083,14 @@ const ActivationWizard = (props) => {
|
|
|
2060
2083
|
{
|
|
2061
2084
|
onClick: reset,
|
|
2062
2085
|
className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
|
|
2063
|
-
children: "Start Over"
|
|
2086
|
+
children: t("activationWizard.startOver", "Start Over")
|
|
2064
2087
|
}
|
|
2065
2088
|
)
|
|
2066
2089
|
] })
|
|
2067
2090
|
] }),
|
|
2068
2091
|
state.step === "enter-key" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
2069
2092
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2070
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "License Key" }),
|
|
2093
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("activationWizard.licenseKey", "License Key") }),
|
|
2071
2094
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2072
2095
|
"input",
|
|
2073
2096
|
{
|
|
@@ -2079,17 +2102,20 @@ const ActivationWizard = (props) => {
|
|
|
2079
2102
|
maxLength: 29
|
|
2080
2103
|
}
|
|
2081
2104
|
),
|
|
2082
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 mt-2", children:
|
|
2105
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-500 mt-2", children: t(
|
|
2106
|
+
"activationWizard.enterTheLicenseKeyYou",
|
|
2107
|
+
"Enter the license key you received upon purchase"
|
|
2108
|
+
) })
|
|
2083
2109
|
] }),
|
|
2084
2110
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2085
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Machine Name (optional)" }),
|
|
2111
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("activationWizard.machineNameOptional", "Machine Name (optional)") }),
|
|
2086
2112
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2087
2113
|
"input",
|
|
2088
2114
|
{
|
|
2089
2115
|
type: "text",
|
|
2090
2116
|
value: state.machineName,
|
|
2091
2117
|
onChange: (e) => setMachineName(e.target.value),
|
|
2092
|
-
placeholder: "My Work PC",
|
|
2118
|
+
placeholder: t("activationWizard.myWorkPc", "My Work PC"),
|
|
2093
2119
|
className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
|
2094
2120
|
}
|
|
2095
2121
|
)
|
|
@@ -2102,7 +2128,7 @@ const ActivationWizard = (props) => {
|
|
|
2102
2128
|
onClick: validateKey,
|
|
2103
2129
|
disabled: !state.licenseKey,
|
|
2104
2130
|
className: "flex-1 px-6 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300 disabled:cursor-not-allowed",
|
|
2105
|
-
children: "Continue"
|
|
2131
|
+
children: t("activationWizard.continue", "Continue")
|
|
2106
2132
|
}
|
|
2107
2133
|
),
|
|
2108
2134
|
config.onCancel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2110,41 +2136,54 @@ const ActivationWizard = (props) => {
|
|
|
2110
2136
|
{
|
|
2111
2137
|
onClick: config.onCancel,
|
|
2112
2138
|
className: "px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
|
|
2113
|
-
children: "Cancel"
|
|
2139
|
+
children: t("activationWizard.cancel", "Cancel")
|
|
2114
2140
|
}
|
|
2115
2141
|
)
|
|
2116
2142
|
] }),
|
|
2117
|
-
config.allowOfflineActivation && /* @__PURE__ */ jsxRuntime.
|
|
2143
|
+
config.allowOfflineActivation && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2118
2144
|
"button",
|
|
2119
2145
|
{
|
|
2120
2146
|
onClick: startOfflineActivation,
|
|
2121
2147
|
className: "w-full text-sm text-blue-500 hover:underline",
|
|
2122
|
-
children:
|
|
2148
|
+
children: [
|
|
2149
|
+
t("activationWizard.activateOffline", "Activate offline"),
|
|
2150
|
+
" ",
|
|
2151
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.NtdArrowRight, { size: 14, style: { verticalAlign: "-2px" } })
|
|
2152
|
+
]
|
|
2123
2153
|
}
|
|
2124
2154
|
)
|
|
2125
2155
|
] }),
|
|
2126
2156
|
(state.step === "validate" || state.step === "hardware-check") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", children: [
|
|
2127
2157
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto" }),
|
|
2128
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: state.step === "validate" ? "Validating License..." : "Checking Hardware..." }),
|
|
2129
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: state.step === "validate" ?
|
|
2158
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: state.step === "validate" ? t("activationWizard.validatingLicense", "Validating License...") : t("activationWizard.checkingHardware", "Checking Hardware...") }),
|
|
2159
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: state.step === "validate" ? t(
|
|
2160
|
+
"activationWizard.verifyingYourLicenseKeyWith",
|
|
2161
|
+
"Verifying your license key with the server"
|
|
2162
|
+
) : t(
|
|
2163
|
+
"activationWizard.collectingHardwareInformationForActivati",
|
|
2164
|
+
"Collecting hardware information for activation"
|
|
2165
|
+
) })
|
|
2130
2166
|
] }),
|
|
2131
2167
|
state.step === "terms" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
2132
2168
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-gray-50 rounded-lg p-4", children: [
|
|
2133
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-3", children: "License Details" }),
|
|
2169
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-3", children: t("activationWizard.licenseDetails", "License Details") }),
|
|
2134
2170
|
((_a = state.validation) == null ? void 0 : _a.license) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
|
|
2135
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
|
|
2171
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.tier", "Tier:") }),
|
|
2136
2172
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium capitalize", children: state.validation.license.tier }),
|
|
2137
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Licensee:" }),
|
|
2173
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.licensee", "Licensee:") }),
|
|
2138
2174
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.validation.license.licensee }),
|
|
2139
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Max Machines:" }),
|
|
2175
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.maxMachines", "Max Machines:") }),
|
|
2140
2176
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.validation.license.maxMachines }),
|
|
2141
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "This Machine:" }),
|
|
2177
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.thisMachine", "This Machine:") }),
|
|
2142
2178
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: state.machineName })
|
|
2143
2179
|
] })
|
|
2144
2180
|
] }),
|
|
2145
2181
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border border-gray-200 rounded-lg p-4 max-h-48 overflow-y-auto text-sm text-gray-600", children: [
|
|
2146
|
-
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-gray-800 mb-2", children: "Terms of Service" }),
|
|
2147
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { children:
|
|
2182
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold text-gray-800 mb-2", children: t("activationWizard.termsOfService", "Terms of Service") }),
|
|
2183
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: t(
|
|
2184
|
+
"activationWizard.byActivatingThisLicenseYou",
|
|
2185
|
+
"By activating this license, you agree to the Nice2Dev Software License Agreement. This license grants you the right to use the software on the specified number of machines according to your license tier. Unauthorized redistribution, reverse engineering, or violation of these terms may result in license revocation."
|
|
2186
|
+
) })
|
|
2148
2187
|
] }),
|
|
2149
2188
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [
|
|
2150
2189
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2157,7 +2196,7 @@ const ActivationWizard = (props) => {
|
|
|
2157
2196
|
}
|
|
2158
2197
|
),
|
|
2159
2198
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-gray-700", children: [
|
|
2160
|
-
"I accept the",
|
|
2199
|
+
t("activationWizard.iAcceptThe", "I accept the"),
|
|
2161
2200
|
" ",
|
|
2162
2201
|
config.termsUrl ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2163
2202
|
"a",
|
|
@@ -2166,12 +2205,12 @@ const ActivationWizard = (props) => {
|
|
|
2166
2205
|
className: "text-blue-500 hover:underline",
|
|
2167
2206
|
target: "_blank",
|
|
2168
2207
|
rel: "noopener noreferrer",
|
|
2169
|
-
children: "Terms of Service"
|
|
2208
|
+
children: t("activationWizard.termsOfService", "Terms of Service")
|
|
2170
2209
|
}
|
|
2171
|
-
) : "Terms of Service",
|
|
2210
|
+
) : t("activationWizard.termsOfService", "Terms of Service"),
|
|
2172
2211
|
config.privacyUrl && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2173
2212
|
" ",
|
|
2174
|
-
"and",
|
|
2213
|
+
t("activationWizard.and", "and"),
|
|
2175
2214
|
" ",
|
|
2176
2215
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2177
2216
|
"a",
|
|
@@ -2180,7 +2219,7 @@ const ActivationWizard = (props) => {
|
|
|
2180
2219
|
className: "text-blue-500 hover:underline",
|
|
2181
2220
|
target: "_blank",
|
|
2182
2221
|
rel: "noopener noreferrer",
|
|
2183
|
-
children: "Privacy Policy"
|
|
2222
|
+
children: t("activationWizard.privacyPolicy", "Privacy Policy")
|
|
2184
2223
|
}
|
|
2185
2224
|
)
|
|
2186
2225
|
] })
|
|
@@ -2193,7 +2232,7 @@ const ActivationWizard = (props) => {
|
|
|
2193
2232
|
{
|
|
2194
2233
|
onClick: goBack,
|
|
2195
2234
|
className: "px-6 py-3 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
|
|
2196
|
-
children: "Back"
|
|
2235
|
+
children: t("activationWizard.back", "Back")
|
|
2197
2236
|
}
|
|
2198
2237
|
),
|
|
2199
2238
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2202,31 +2241,37 @@ const ActivationWizard = (props) => {
|
|
|
2202
2241
|
onClick: acceptTermsAndActivate,
|
|
2203
2242
|
disabled: !state.termsAccepted,
|
|
2204
2243
|
className: "flex-1 px-6 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300 disabled:cursor-not-allowed",
|
|
2205
|
-
children: "Activate License"
|
|
2244
|
+
children: t("activationWizard.activateLicense", "Activate License")
|
|
2206
2245
|
}
|
|
2207
2246
|
)
|
|
2208
2247
|
] })
|
|
2209
2248
|
] }),
|
|
2210
2249
|
state.step === "activating" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8", children: [
|
|
2211
2250
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-12 w-12 border-b-2 border-blue-500 mx-auto" }),
|
|
2212
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: "Activating License..." }),
|
|
2213
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children:
|
|
2251
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: t("activationWizard.activatingLicense", "Activating License...") }),
|
|
2252
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500 mt-2", children: t(
|
|
2253
|
+
"activationWizard.pleaseWaitWhileWeActivate",
|
|
2254
|
+
"Please wait while we activate your license"
|
|
2255
|
+
) })
|
|
2214
2256
|
] }),
|
|
2215
2257
|
state.step === "success" && state.activatedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-6", children: [
|
|
2216
2258
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-green-500 text-6xl", children: /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}) }),
|
|
2217
2259
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2218
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold text-gray-900", children: "License Activated!" }),
|
|
2219
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children:
|
|
2260
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold text-gray-900", children: t("activationWizard.licenseActivated", "License Activated!") }),
|
|
2261
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: t(
|
|
2262
|
+
"activationWizard.yourLicenseHasBeenSuccessfully",
|
|
2263
|
+
"Your license has been successfully activated on this machine."
|
|
2264
|
+
) })
|
|
2220
2265
|
] }),
|
|
2221
2266
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-green-50 rounded-lg p-4 text-left", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
|
|
2222
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "License Key:" }),
|
|
2267
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.licenseKey2", "License Key:") }),
|
|
2223
2268
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: state.activatedLicense.key }),
|
|
2224
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
|
|
2269
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.tier", "Tier:") }),
|
|
2225
2270
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "capitalize", children: state.activatedLicense.tier }),
|
|
2226
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Machine:" }),
|
|
2271
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.machine", "Machine:") }),
|
|
2227
2272
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: state.machineName }),
|
|
2228
2273
|
state.activatedLicense.expiresAt && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2229
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Expires:" }),
|
|
2274
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("activationWizard.expires", "Expires:") }),
|
|
2230
2275
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: new Date(state.activatedLicense.expiresAt).toLocaleDateString() })
|
|
2231
2276
|
] })
|
|
2232
2277
|
] }) }),
|
|
@@ -2239,15 +2284,18 @@ const ActivationWizard = (props) => {
|
|
|
2239
2284
|
(_a2 = config.onCancel) == null ? void 0 : _a2.call(config);
|
|
2240
2285
|
},
|
|
2241
2286
|
className: "px-8 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
|
|
2242
|
-
children: "Done"
|
|
2287
|
+
children: t("activationWizard.done", "Done")
|
|
2243
2288
|
}
|
|
2244
2289
|
)
|
|
2245
2290
|
] }),
|
|
2246
2291
|
state.offlineChallenge && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg p-6 max-w-md w-full", children: [
|
|
2247
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold mb-4", children: "Offline Activation" }),
|
|
2292
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold mb-4", children: t("activationWizard.offlineActivation", "Offline Activation") }),
|
|
2248
2293
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2249
2294
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2250
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children:
|
|
2295
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t(
|
|
2296
|
+
"activationWizard.challengeCodeSendThisTo",
|
|
2297
|
+
"Challenge Code (send this to support):"
|
|
2298
|
+
) }),
|
|
2251
2299
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2252
2300
|
"textarea",
|
|
2253
2301
|
{
|
|
@@ -2258,13 +2306,16 @@ const ActivationWizard = (props) => {
|
|
|
2258
2306
|
)
|
|
2259
2307
|
] }),
|
|
2260
2308
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2261
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Response Code (from support):" }),
|
|
2309
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t("activationWizard.responseCodeFromSupport", "Response Code (from support):") }),
|
|
2262
2310
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2263
2311
|
"textarea",
|
|
2264
2312
|
{
|
|
2265
2313
|
value: offlineResponse,
|
|
2266
2314
|
onChange: (e) => setOfflineResponse(e.target.value),
|
|
2267
|
-
placeholder:
|
|
2315
|
+
placeholder: t(
|
|
2316
|
+
"activationWizard.pasteTheResponseCodeHere",
|
|
2317
|
+
"Paste the response code here..."
|
|
2318
|
+
),
|
|
2268
2319
|
className: "w-full px-3 py-2 border border-gray-300 rounded font-mono text-xs h-20"
|
|
2269
2320
|
}
|
|
2270
2321
|
)
|
|
@@ -2277,7 +2328,7 @@ const ActivationWizard = (props) => {
|
|
|
2277
2328
|
},
|
|
2278
2329
|
disabled: !offlineResponse,
|
|
2279
2330
|
className: "flex-1 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 disabled:bg-gray-300",
|
|
2280
|
-
children: "Activate"
|
|
2331
|
+
children: t("activationWizard.activate", "Activate")
|
|
2281
2332
|
}
|
|
2282
2333
|
),
|
|
2283
2334
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2287,7 +2338,7 @@ const ActivationWizard = (props) => {
|
|
|
2287
2338
|
setOfflineResponse("");
|
|
2288
2339
|
},
|
|
2289
2340
|
className: "px-4 py-2 bg-gray-200 text-gray-700 rounded hover:bg-gray-300",
|
|
2290
|
-
children: "Cancel"
|
|
2341
|
+
children: t("activationWizard.cancel", "Cancel")
|
|
2291
2342
|
}
|
|
2292
2343
|
)
|
|
2293
2344
|
] })
|
|
@@ -2312,6 +2363,7 @@ class LicenseTransferService {
|
|
|
2312
2363
|
const error = await response.json().catch(() => ({}));
|
|
2313
2364
|
throw {
|
|
2314
2365
|
code: `HTTP_${response.status}`,
|
|
2366
|
+
// audit-allow: i18n — the service's fallback in the thrown TransferError (API contract)
|
|
2315
2367
|
message: error.message || "Request failed"
|
|
2316
2368
|
};
|
|
2317
2369
|
}
|
|
@@ -2407,6 +2459,7 @@ const TRANSFER_REASONS = [
|
|
|
2407
2459
|
{ value: "other", label: "Other" }
|
|
2408
2460
|
];
|
|
2409
2461
|
function useLicenseTransfer(config) {
|
|
2462
|
+
const { t } = uiCore.useNiceTranslation();
|
|
2410
2463
|
const [step, setStep] = React.useState("select-license");
|
|
2411
2464
|
const [licenses, setLicenses] = React.useState([]);
|
|
2412
2465
|
const [formData, setFormData] = React.useState({
|
|
@@ -2477,7 +2530,13 @@ function useLicenseTransfer(config) {
|
|
|
2477
2530
|
const initiateTransfer = React.useCallback(async () => {
|
|
2478
2531
|
var _a, _b;
|
|
2479
2532
|
if (!formData.confirmDeactivation) {
|
|
2480
|
-
setError({
|
|
2533
|
+
setError({
|
|
2534
|
+
code: "CONFIRMATION_REQUIRED",
|
|
2535
|
+
message: t(
|
|
2536
|
+
"licenseTransfer.pleaseConfirmLicenseDeactivation",
|
|
2537
|
+
"Please confirm license deactivation"
|
|
2538
|
+
)
|
|
2539
|
+
});
|
|
2481
2540
|
return;
|
|
2482
2541
|
}
|
|
2483
2542
|
setStep("processing");
|
|
@@ -2501,7 +2560,7 @@ function useLicenseTransfer(config) {
|
|
|
2501
2560
|
} finally {
|
|
2502
2561
|
setLoading(false);
|
|
2503
2562
|
}
|
|
2504
|
-
}, [formData, service, config]);
|
|
2563
|
+
}, [formData, service, config, t]);
|
|
2505
2564
|
const reset = React.useCallback(() => {
|
|
2506
2565
|
setStep("select-license");
|
|
2507
2566
|
setFormData({
|
|
@@ -2536,19 +2595,23 @@ function useLicenseTransfer(config) {
|
|
|
2536
2595
|
reset
|
|
2537
2596
|
};
|
|
2538
2597
|
}
|
|
2539
|
-
const TransferStatusBadge = ({ status }) =>
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
)
|
|
2598
|
+
const TransferStatusBadge = ({ status }) => {
|
|
2599
|
+
const { t } = uiCore.useNiceTranslation();
|
|
2600
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2601
|
+
"span",
|
|
2602
|
+
{
|
|
2603
|
+
className: "inline-flex items-center px-2.5 py-1 rounded-full text-sm font-medium",
|
|
2604
|
+
style: {
|
|
2605
|
+
backgroundColor: `${getTransferStatusColor(status)}20`,
|
|
2606
|
+
color: getTransferStatusColor(status)
|
|
2607
|
+
},
|
|
2608
|
+
children: t(`licenseTransfer.status.${status}`, getTransferStatusLabel(status))
|
|
2609
|
+
}
|
|
2610
|
+
);
|
|
2611
|
+
};
|
|
2550
2612
|
const LicenseTransfer = (props) => {
|
|
2551
2613
|
var _a, _b;
|
|
2614
|
+
const { t } = uiCore.useNiceTranslation();
|
|
2552
2615
|
const { className, style, ...config } = props;
|
|
2553
2616
|
const {
|
|
2554
2617
|
step,
|
|
@@ -2577,12 +2640,15 @@ const LicenseTransfer = (props) => {
|
|
|
2577
2640
|
className: `nice-license-transfer bg-white rounded-lg shadow-lg p-8 max-w-2xl mx-auto ${className || ""}`,
|
|
2578
2641
|
style,
|
|
2579
2642
|
children: [
|
|
2580
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-2", children: "Transfer License" }),
|
|
2581
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mb-6", children:
|
|
2643
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-2", children: t("licenseTransfer.transferLicense", "Transfer License") }),
|
|
2644
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mb-6", children: t(
|
|
2645
|
+
"licenseTransfer.transferALicenseToAnother",
|
|
2646
|
+
"Transfer a license to another user or organization"
|
|
2647
|
+
) }),
|
|
2582
2648
|
error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-red-700", children: error.message }) }),
|
|
2583
2649
|
step === "select-license" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2584
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: "Select a license to transfer" }),
|
|
2585
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin h-8 w-8 border-b-2 border-blue-500 rounded-full mx-auto" }) }) : licenses.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-gray-500", children: "No transferable licenses found" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4", children: licenses.map((license) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2650
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: t("licenseTransfer.selectALicenseToTransfer", "Select a license to transfer") }),
|
|
2651
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin h-8 w-8 border-b-2 border-blue-500 rounded-full mx-auto" }) }) : licenses.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-gray-500", children: t("licenseTransfer.noTransferableLicensesFound", "No transferable licenses found") }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-4", children: licenses.map((license) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2586
2652
|
"div",
|
|
2587
2653
|
{
|
|
2588
2654
|
className: "p-4 border border-gray-200 rounded-lg hover:border-blue-500 cursor-pointer transition-colors",
|
|
@@ -2595,12 +2661,7 @@ const LicenseTransfer = (props) => {
|
|
|
2595
2661
|
] }),
|
|
2596
2662
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 py-1 bg-blue-100 text-blue-700 rounded text-sm capitalize", children: license.tier })
|
|
2597
2663
|
] }),
|
|
2598
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2599
|
-
license.activeSeats,
|
|
2600
|
-
"/",
|
|
2601
|
-
license.maxSeats ?? "∞",
|
|
2602
|
-
" seats used"
|
|
2603
|
-
] })
|
|
2664
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 text-sm text-gray-500", children: t("licenseTransfer.seatsUsed", "{activeSeats}/{maxSeats} seats used").replace("{activeSeats}", String(license.activeSeats)).replace("{maxSeats}", String(license.maxSeats ?? "∞")) })
|
|
2604
2665
|
]
|
|
2605
2666
|
},
|
|
2606
2667
|
license.key
|
|
@@ -2608,11 +2669,11 @@ const LicenseTransfer = (props) => {
|
|
|
2608
2669
|
] }),
|
|
2609
2670
|
step === "enter-recipient" && selectedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
2610
2671
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 bg-gray-50 rounded-lg", children: [
|
|
2611
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: "Transferring license:" }),
|
|
2672
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500", children: t("licenseTransfer.transferringLicense", "Transferring license:") }),
|
|
2612
2673
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: selectedLicense.key })
|
|
2613
2674
|
] }),
|
|
2614
2675
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2615
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Recipient Email" }),
|
|
2676
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.recipientEmail", "Recipient Email") }),
|
|
2616
2677
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
2617
2678
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2618
2679
|
"input",
|
|
@@ -2621,7 +2682,7 @@ const LicenseTransfer = (props) => {
|
|
|
2621
2682
|
value: formData.recipientEmail,
|
|
2622
2683
|
onChange: (e) => setFormData((f) => ({ ...f, recipientEmail: e.target.value })),
|
|
2623
2684
|
onBlur: validateRecipient,
|
|
2624
|
-
placeholder: "recipient@company.com",
|
|
2685
|
+
placeholder: t("licenseTransfer.recipientCompanyCom", "recipient@company.com"),
|
|
2625
2686
|
className: "flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
|
|
2626
2687
|
}
|
|
2627
2688
|
),
|
|
@@ -2631,7 +2692,7 @@ const LicenseTransfer = (props) => {
|
|
|
2631
2692
|
onClick: validateRecipient,
|
|
2632
2693
|
disabled: !formData.recipientEmail || loading,
|
|
2633
2694
|
className: "px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300 disabled:opacity-50",
|
|
2634
|
-
children: "Validate"
|
|
2695
|
+
children: t("licenseTransfer.validate", "Validate")
|
|
2635
2696
|
}
|
|
2636
2697
|
)
|
|
2637
2698
|
] }),
|
|
@@ -2640,28 +2701,28 @@ const LicenseTransfer = (props) => {
|
|
|
2640
2701
|
{
|
|
2641
2702
|
className: `mt-2 text-sm ${recipientValidation.valid ? "text-green-600" : "text-red-600"}`,
|
|
2642
2703
|
children: [
|
|
2643
|
-
recipientValidation.valid ? "Valid recipient" : "Invalid recipient",
|
|
2644
|
-
recipientValidation.isExternal && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-orange-600", children: "(External organization)" })
|
|
2704
|
+
recipientValidation.valid ? t("licenseTransfer.validRecipient", "Valid recipient") : t("licenseTransfer.invalidRecipient", "Invalid recipient"),
|
|
2705
|
+
recipientValidation.isExternal && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-orange-600", children: t("licenseTransfer.externalOrganization", "(External organization)") })
|
|
2645
2706
|
]
|
|
2646
2707
|
}
|
|
2647
2708
|
),
|
|
2648
2709
|
(_a = recipientValidation == null ? void 0 : recipientValidation.warnings) == null ? void 0 : _a.map((warning, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-sm text-orange-600", children: warning }, i))
|
|
2649
2710
|
] }),
|
|
2650
2711
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2651
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Recipient Name" }),
|
|
2712
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.recipientName", "Recipient Name") }),
|
|
2652
2713
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2653
2714
|
"input",
|
|
2654
2715
|
{
|
|
2655
2716
|
type: "text",
|
|
2656
2717
|
value: formData.recipientName,
|
|
2657
2718
|
onChange: (e) => setFormData((f) => ({ ...f, recipientName: e.target.value })),
|
|
2658
|
-
placeholder: "John Doe",
|
|
2719
|
+
placeholder: t("licenseTransfer.johnDoe", "John Doe"),
|
|
2659
2720
|
className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
|
|
2660
2721
|
}
|
|
2661
2722
|
)
|
|
2662
2723
|
] }),
|
|
2663
2724
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2664
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Transfer Reason" }),
|
|
2725
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.transferReason", "Transfer Reason") }),
|
|
2665
2726
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2666
2727
|
"select",
|
|
2667
2728
|
{
|
|
@@ -2671,18 +2732,21 @@ const LicenseTransfer = (props) => {
|
|
|
2671
2732
|
transferReason: e.target.value
|
|
2672
2733
|
})),
|
|
2673
2734
|
className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500",
|
|
2674
|
-
children: TRANSFER_REASONS.map((reason) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: reason.value, children: reason.label }, reason.value))
|
|
2735
|
+
children: TRANSFER_REASONS.map((reason) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: reason.value, children: t(`licenseTransfer.reason.${reason.value}`, reason.label) }, reason.value))
|
|
2675
2736
|
}
|
|
2676
2737
|
)
|
|
2677
2738
|
] }),
|
|
2678
2739
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2679
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Notes (optional)" }),
|
|
2740
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t("licenseTransfer.notesOptional", "Notes (optional)") }),
|
|
2680
2741
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2681
2742
|
"textarea",
|
|
2682
2743
|
{
|
|
2683
2744
|
value: formData.notes,
|
|
2684
2745
|
onChange: (e) => setFormData((f) => ({ ...f, notes: e.target.value })),
|
|
2685
|
-
placeholder:
|
|
2746
|
+
placeholder: t(
|
|
2747
|
+
"licenseTransfer.anyAdditionalInformation",
|
|
2748
|
+
"Any additional information..."
|
|
2749
|
+
),
|
|
2686
2750
|
rows: 3,
|
|
2687
2751
|
className: "w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500"
|
|
2688
2752
|
}
|
|
@@ -2694,7 +2758,7 @@ const LicenseTransfer = (props) => {
|
|
|
2694
2758
|
{
|
|
2695
2759
|
onClick: () => setStep("select-license"),
|
|
2696
2760
|
className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
|
|
2697
|
-
children: "Back"
|
|
2761
|
+
children: t("licenseTransfer.back", "Back")
|
|
2698
2762
|
}
|
|
2699
2763
|
),
|
|
2700
2764
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2703,36 +2767,42 @@ const LicenseTransfer = (props) => {
|
|
|
2703
2767
|
onClick: proceedToReview,
|
|
2704
2768
|
disabled: !(recipientValidation == null ? void 0 : recipientValidation.valid) || !formData.recipientName,
|
|
2705
2769
|
className: "flex-1 px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300",
|
|
2706
|
-
children: "Review Transfer"
|
|
2770
|
+
children: t("licenseTransfer.reviewTransfer", "Review Transfer")
|
|
2707
2771
|
}
|
|
2708
2772
|
)
|
|
2709
2773
|
] })
|
|
2710
2774
|
] }),
|
|
2711
2775
|
step === "review" && selectedLicense && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
2712
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: "Review Transfer Details" }),
|
|
2776
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold", children: t("licenseTransfer.reviewTransferDetails", "Review Transfer Details") }),
|
|
2713
2777
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-gray-50 rounded-lg p-4 space-y-3", children: [
|
|
2714
2778
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-2 text-sm", children: [
|
|
2715
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "License Key:" }),
|
|
2779
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.licenseKey", "License Key:") }),
|
|
2716
2780
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: selectedLicense.key }),
|
|
2717
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Current Licensee:" }),
|
|
2781
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.currentLicensee", "Current Licensee:") }),
|
|
2718
2782
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: selectedLicense.licensee }),
|
|
2719
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Tier:" }),
|
|
2783
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.tier", "Tier:") }),
|
|
2720
2784
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "capitalize", children: selectedLicense.tier }),
|
|
2721
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Transfer To:" }),
|
|
2785
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.transferTo", "Transfer To:") }),
|
|
2722
2786
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: formData.recipientName }),
|
|
2723
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Recipient Email:" }),
|
|
2787
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.recipientEmail2", "Recipient Email:") }),
|
|
2724
2788
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: formData.recipientEmail }),
|
|
2725
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Reason:" }),
|
|
2726
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: (
|
|
2789
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.reason", "Reason:") }),
|
|
2790
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: t(
|
|
2791
|
+
`licenseTransfer.reason.${formData.transferReason}`,
|
|
2792
|
+
((_b = TRANSFER_REASONS.find((r) => r.value === formData.transferReason)) == null ? void 0 : _b.label) ?? formData.transferReason
|
|
2793
|
+
) })
|
|
2727
2794
|
] }),
|
|
2728
2795
|
formData.notes && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "pt-3 border-t border-gray-200", children: [
|
|
2729
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500 mb-1", children: "Notes:" }),
|
|
2796
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-gray-500 mb-1", children: t("licenseTransfer.notes", "Notes:") }),
|
|
2730
2797
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm", children: formData.notes })
|
|
2731
2798
|
] })
|
|
2732
2799
|
] }),
|
|
2733
2800
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-4 bg-orange-50 border border-orange-200 rounded-lg", children: [
|
|
2734
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: "Important" }),
|
|
2735
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-orange-700", children:
|
|
2801
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-orange-800 mb-2", children: t("licenseTransfer.important", "Important") }),
|
|
2802
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-orange-700", children: t(
|
|
2803
|
+
"licenseTransfer.onceTheTransferIsCompleted",
|
|
2804
|
+
"Once the transfer is completed, this license will be deactivated from all your machines and the new owner will need to activate it."
|
|
2805
|
+
) })
|
|
2736
2806
|
] }),
|
|
2737
2807
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-start gap-3 cursor-pointer", children: [
|
|
2738
2808
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2744,7 +2814,10 @@ const LicenseTransfer = (props) => {
|
|
|
2744
2814
|
className: "mt-1 w-4 h-4 rounded border-gray-300 text-blue-500 focus:ring-blue-500"
|
|
2745
2815
|
}
|
|
2746
2816
|
),
|
|
2747
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700", children:
|
|
2817
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-700", children: t(
|
|
2818
|
+
"licenseTransfer.iUnderstandThatThisLicense",
|
|
2819
|
+
"I understand that this license will be deactivated and transferred to the recipient. This action cannot be undone without admin intervention."
|
|
2820
|
+
) })
|
|
2748
2821
|
] }),
|
|
2749
2822
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-3", children: [
|
|
2750
2823
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2752,7 +2825,7 @@ const LicenseTransfer = (props) => {
|
|
|
2752
2825
|
{
|
|
2753
2826
|
onClick: () => setStep("enter-recipient"),
|
|
2754
2827
|
className: "px-6 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
|
|
2755
|
-
children: "Back"
|
|
2828
|
+
children: t("licenseTransfer.back", "Back")
|
|
2756
2829
|
}
|
|
2757
2830
|
),
|
|
2758
2831
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2761,28 +2834,37 @@ const LicenseTransfer = (props) => {
|
|
|
2761
2834
|
onClick: initiateTransfer,
|
|
2762
2835
|
disabled: !formData.confirmDeactivation || loading,
|
|
2763
2836
|
className: "flex-1 px-6 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 disabled:bg-gray-300",
|
|
2764
|
-
children: loading ? "Processing..." : "Initiate Transfer"
|
|
2837
|
+
children: loading ? t("licenseTransfer.processing", "Processing...") : t("licenseTransfer.initiateTransfer", "Initiate Transfer")
|
|
2765
2838
|
}
|
|
2766
2839
|
)
|
|
2767
2840
|
] })
|
|
2768
2841
|
] }),
|
|
2769
2842
|
step === "processing" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-12", children: [
|
|
2770
2843
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin h-12 w-12 border-b-2 border-blue-500 rounded-full mx-auto" }),
|
|
2771
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: "Processing Transfer..." }),
|
|
2772
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500", children:
|
|
2844
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold mt-4", children: t("licenseTransfer.processingTransfer", "Processing Transfer...") }),
|
|
2845
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-500", children: t(
|
|
2846
|
+
"licenseTransfer.pleaseWaitWhileWeProcess",
|
|
2847
|
+
"Please wait while we process your transfer request"
|
|
2848
|
+
) })
|
|
2773
2849
|
] }),
|
|
2774
2850
|
step === "complete" && transfer && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-6", children: [
|
|
2775
2851
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-green-500 text-6xl", children: /* @__PURE__ */ jsxRuntime.jsx(marks.CheckMark, {}) }),
|
|
2776
2852
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2777
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold", children: "Transfer Initiated" }),
|
|
2778
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: transfer.approvalRequired ?
|
|
2853
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-xl font-bold", children: t("licenseTransfer.transferInitiated", "Transfer Initiated") }),
|
|
2854
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600 mt-2", children: transfer.approvalRequired ? t(
|
|
2855
|
+
"licenseTransfer.yourTransferRequestHasBeen",
|
|
2856
|
+
"Your transfer request has been submitted for approval."
|
|
2857
|
+
) : t(
|
|
2858
|
+
"licenseTransfer.anEmailHasBeenSent",
|
|
2859
|
+
"An email has been sent to the recipient with instructions to accept the transfer."
|
|
2860
|
+
) })
|
|
2779
2861
|
] }),
|
|
2780
2862
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-gray-50 rounded-lg p-4 text-left", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-sm grid grid-cols-2 gap-2", children: [
|
|
2781
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Transfer ID:" }),
|
|
2863
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.transferId", "Transfer ID:") }),
|
|
2782
2864
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-mono", children: transfer.id }),
|
|
2783
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Status:" }),
|
|
2865
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.status", "Status:") }),
|
|
2784
2866
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(TransferStatusBadge, { status: transfer.status }) }),
|
|
2785
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: "Expires:" }),
|
|
2867
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500", children: t("licenseTransfer.expires", "Expires:") }),
|
|
2786
2868
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: new Date(transfer.expiresAt).toLocaleDateString() })
|
|
2787
2869
|
] }) }),
|
|
2788
2870
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2790,7 +2872,7 @@ const LicenseTransfer = (props) => {
|
|
|
2790
2872
|
{
|
|
2791
2873
|
onClick: reset,
|
|
2792
2874
|
className: "px-8 py-3 bg-blue-500 text-white rounded-lg hover:bg-blue-600",
|
|
2793
|
-
children: "Done"
|
|
2875
|
+
children: t("licenseTransfer.done", "Done")
|
|
2794
2876
|
}
|
|
2795
2877
|
)
|
|
2796
2878
|
] })
|
|
@@ -3206,7 +3288,7 @@ const MetricCard = ({ title, value, change, suffix, loading }) => /* @__PURE__ *
|
|
|
3206
3288
|
suffix && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-normal text-gray-500 ml-1", children: suffix })
|
|
3207
3289
|
] }),
|
|
3208
3290
|
change !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `text-sm mt-1 ${change >= 0 ? "text-green-600" : "text-red-600"}`, children: [
|
|
3209
|
-
change >= 0 ? "
|
|
3291
|
+
change >= 0 ? /* @__PURE__ */ jsxRuntime.jsx(icons.NtdArrowUp, { size: 12, style: { verticalAlign: "-1px" } }) : /* @__PURE__ */ jsxRuntime.jsx(icons.NtdArrowDown, { size: 12, style: { verticalAlign: "-1px" } }),
|
|
3210
3292
|
" ",
|
|
3211
3293
|
Math.abs(change).toFixed(1),
|
|
3212
3294
|
"%"
|
|
@@ -3214,13 +3296,14 @@ const MetricCard = ({ title, value, change, suffix, loading }) => /* @__PURE__ *
|
|
|
3214
3296
|
] })
|
|
3215
3297
|
] });
|
|
3216
3298
|
const TimeRangeSelector = ({ value, onChange }) => {
|
|
3299
|
+
const { t } = uiCore.useNiceTranslation();
|
|
3217
3300
|
const options = [
|
|
3218
|
-
{ value: "24h", label: "24 Hours" },
|
|
3219
|
-
{ value: "7d", label: "7 Days" },
|
|
3220
|
-
{ value: "30d", label: "30 Days" },
|
|
3221
|
-
{ value: "90d", label: "90 Days" },
|
|
3222
|
-
{ value: "1y", label: "1 Year" },
|
|
3223
|
-
{ value: "all", label: "All Time" }
|
|
3301
|
+
{ value: "24h", label: t("usageAnalyticsDashboard.n24Hours", "24 Hours") },
|
|
3302
|
+
{ value: "7d", label: t("usageAnalyticsDashboard.n7Days", "7 Days") },
|
|
3303
|
+
{ value: "30d", label: t("usageAnalyticsDashboard.n30Days", "30 Days") },
|
|
3304
|
+
{ value: "90d", label: t("usageAnalyticsDashboard.n90Days", "90 Days") },
|
|
3305
|
+
{ value: "1y", label: t("usageAnalyticsDashboard.n1Year", "1 Year") },
|
|
3306
|
+
{ value: "all", label: t("usageAnalyticsDashboard.allTime", "All Time") }
|
|
3224
3307
|
];
|
|
3225
3308
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1 bg-gray-100 rounded-lg p-1", children: options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3226
3309
|
"button",
|
|
@@ -3232,93 +3315,101 @@ const TimeRangeSelector = ({ value, onChange }) => {
|
|
|
3232
3315
|
opt.value
|
|
3233
3316
|
)) });
|
|
3234
3317
|
};
|
|
3235
|
-
const FeatureUsageTable = ({ data, loading }) =>
|
|
3236
|
-
|
|
3237
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3238
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
3239
|
-
|
|
3240
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3318
|
+
const FeatureUsageTable = ({ data, loading }) => {
|
|
3319
|
+
const { t } = uiCore.useNiceTranslation();
|
|
3320
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
|
|
3321
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("usageAnalyticsDashboard.featureUsage", "Feature Usage") }) }),
|
|
3322
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
|
|
3323
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
3324
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.feature", "Feature") }),
|
|
3325
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.totalUses", "Total Uses") }),
|
|
3326
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.users2", "Users") }),
|
|
3327
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.avgUser", "Avg/User") }),
|
|
3328
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.trend", "Trend") })
|
|
3329
|
+
] }) }),
|
|
3330
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: t("usageAnalyticsDashboard.loading", "Loading...") }) }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: t("usageAnalyticsDashboard.noDataAvailable", "No data available") }) }) : data.map((feature) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
|
|
3331
|
+
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
|
|
3332
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: feature.featureName }),
|
|
3333
|
+
feature.category && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: feature.category })
|
|
3334
|
+
] }),
|
|
3335
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.totalUses.toLocaleString() }),
|
|
3336
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.uniqueUsers.toLocaleString() }),
|
|
3337
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.avgUsesPerUser.toFixed(1) }),
|
|
3338
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3339
|
+
"span",
|
|
3340
|
+
{
|
|
3341
|
+
className: `inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${feature.trend > 0 ? "bg-green-100 text-green-800" : feature.trend < 0 ? "bg-red-100 text-red-800" : "bg-gray-100 text-gray-800"}`,
|
|
3342
|
+
children: [
|
|
3343
|
+
feature.trend > 0 ? "+" : "",
|
|
3344
|
+
feature.trend.toFixed(1),
|
|
3345
|
+
"%"
|
|
3346
|
+
]
|
|
3347
|
+
}
|
|
3348
|
+
) })
|
|
3349
|
+
] }, feature.featureId)) })
|
|
3350
|
+
] }) })
|
|
3351
|
+
] });
|
|
3352
|
+
};
|
|
3353
|
+
const TopUsersTable = ({ data, loading }) => {
|
|
3354
|
+
const { t } = uiCore.useNiceTranslation();
|
|
3355
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
|
|
3356
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("usageAnalyticsDashboard.topActiveUsers", "Top Active Users") }) }),
|
|
3357
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
|
|
3358
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
3359
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.user", "User") }),
|
|
3360
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.sessions", "Sessions") }),
|
|
3361
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.duration", "Duration") }),
|
|
3362
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.features", "Features") }),
|
|
3363
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: t("usageAnalyticsDashboard.lastActive", "Last Active") })
|
|
3364
|
+
] }) }),
|
|
3365
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: t("usageAnalyticsDashboard.loading", "Loading...") }) }) : data.map((user) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
|
|
3366
|
+
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
|
|
3367
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: user.displayName || user.email }),
|
|
3368
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500 capitalize", children: user.tier })
|
|
3369
|
+
] }),
|
|
3370
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.sessionCount.toLocaleString() }),
|
|
3371
|
+
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3 text-right font-mono", children: [
|
|
3372
|
+
Math.round(user.totalDuration / 60),
|
|
3373
|
+
"h"
|
|
3374
|
+
] }),
|
|
3375
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.featuresUsed }),
|
|
3376
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-sm text-gray-500", children: new Date(user.lastActive).toLocaleDateString() })
|
|
3377
|
+
] }, user.userId)) })
|
|
3378
|
+
] }) })
|
|
3379
|
+
] });
|
|
3380
|
+
};
|
|
3381
|
+
const LicenseUtilizationChart = ({ data, loading }) => {
|
|
3382
|
+
const { t } = uiCore.useNiceTranslation();
|
|
3383
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
|
|
3384
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: t("usageAnalyticsDashboard.licenseUtilization", "License Utilization") }) }),
|
|
3385
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 space-y-4", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: t("usageAnalyticsDashboard.loading", "Loading...") }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: t("usageAnalyticsDashboard.noLicenses", "No licenses") }) : data.map((license) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3386
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm mb-1", children: [
|
|
3387
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium truncate max-w-[200px]", children: license.licensee }),
|
|
3388
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: t("usageAnalyticsDashboard.seats", "{usedSeats}/{totalSeats} seats").replace("{usedSeats}", String(license.usedSeats)).replace("{totalSeats}", String(license.totalSeats)) })
|
|
3249
3389
|
] }),
|
|
3250
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
3251
|
-
|
|
3252
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: feature.avgUsesPerUser.toFixed(1) }),
|
|
3253
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3254
|
-
"span",
|
|
3390
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2 bg-gray-100 rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3391
|
+
"div",
|
|
3255
3392
|
{
|
|
3256
|
-
className: `
|
|
3257
|
-
|
|
3258
|
-
feature.trend > 0 ? "+" : "",
|
|
3259
|
-
feature.trend.toFixed(1),
|
|
3260
|
-
"%"
|
|
3261
|
-
]
|
|
3393
|
+
className: `h-full rounded-full ${license.utilizationPercent >= 90 ? "bg-red-500" : license.utilizationPercent >= 70 ? "bg-yellow-500" : "bg-green-500"}`,
|
|
3394
|
+
style: { width: `${license.utilizationPercent}%` }
|
|
3262
3395
|
}
|
|
3263
3396
|
) })
|
|
3264
|
-
] },
|
|
3265
|
-
] })
|
|
3266
|
-
|
|
3267
|
-
const TopUsersTable = ({ data, loading }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 overflow-hidden", children: [
|
|
3268
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "Top Active Users" }) }),
|
|
3269
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "w-full", children: [
|
|
3270
|
-
/* @__PURE__ */ jsxRuntime.jsx("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
3271
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: "User" }),
|
|
3272
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Sessions" }),
|
|
3273
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Duration" }),
|
|
3274
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-right text-xs font-medium text-gray-500 uppercase", children: "Features" }),
|
|
3275
|
-
/* @__PURE__ */ jsxRuntime.jsx("th", { className: "px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase", children: "Last Active" })
|
|
3276
|
-
] }) }),
|
|
3277
|
-
/* @__PURE__ */ jsxRuntime.jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: 5, className: "px-4 py-8 text-center text-gray-500", children: "Loading..." }) }) : data.map((user) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { className: "hover:bg-gray-50", children: [
|
|
3278
|
-
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3", children: [
|
|
3279
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: user.displayName || user.email }),
|
|
3280
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500 capitalize", children: user.tier })
|
|
3281
|
-
] }),
|
|
3282
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.sessionCount.toLocaleString() }),
|
|
3283
|
-
/* @__PURE__ */ jsxRuntime.jsxs("td", { className: "px-4 py-3 text-right font-mono", children: [
|
|
3284
|
-
Math.round(user.totalDuration / 60),
|
|
3285
|
-
"h"
|
|
3286
|
-
] }),
|
|
3287
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-right font-mono", children: user.featuresUsed }),
|
|
3288
|
-
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "px-4 py-3 text-sm text-gray-500", children: new Date(user.lastActive).toLocaleDateString() })
|
|
3289
|
-
] }, user.userId)) })
|
|
3290
|
-
] }) })
|
|
3291
|
-
] });
|
|
3292
|
-
const LicenseUtilizationChart = ({ data, loading }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200", children: [
|
|
3293
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 border-b border-gray-200", children: /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold", children: "License Utilization" }) }),
|
|
3294
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-4 space-y-4", children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: "Loading..." }) : data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center text-gray-500", children: "No licenses" }) : data.map((license) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3295
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm mb-1", children: [
|
|
3296
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium truncate max-w-[200px]", children: license.licensee }),
|
|
3297
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-gray-500", children: [
|
|
3298
|
-
license.usedSeats,
|
|
3299
|
-
"/",
|
|
3300
|
-
license.totalSeats,
|
|
3301
|
-
" seats"
|
|
3302
|
-
] })
|
|
3303
|
-
] }),
|
|
3304
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-2 bg-gray-100 rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3305
|
-
"div",
|
|
3306
|
-
{
|
|
3307
|
-
className: `h-full rounded-full ${license.utilizationPercent >= 90 ? "bg-red-500" : license.utilizationPercent >= 70 ? "bg-yellow-500" : "bg-green-500"}`,
|
|
3308
|
-
style: { width: `${license.utilizationPercent}%` }
|
|
3309
|
-
}
|
|
3310
|
-
) })
|
|
3311
|
-
] }, license.licenseKey)) })
|
|
3312
|
-
] });
|
|
3397
|
+
] }, license.licenseKey)) })
|
|
3398
|
+
] });
|
|
3399
|
+
};
|
|
3313
3400
|
const UsageAnalyticsDashboard = (props) => {
|
|
3314
3401
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
3402
|
+
const { t } = uiCore.useNiceTranslation();
|
|
3315
3403
|
const { className, style, ...config } = props;
|
|
3316
3404
|
const { state, setTimeRange, refresh, exportData } = useUsageAnalytics(config);
|
|
3317
3405
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `nice-usage-analytics ${className || ""}`, style, children: [
|
|
3318
3406
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
|
|
3319
3407
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
3320
|
-
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: "Usage Analytics" }),
|
|
3321
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children:
|
|
3408
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t("usageAnalyticsDashboard.usageAnalytics", "Usage Analytics") }),
|
|
3409
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-gray-600", children: t(
|
|
3410
|
+
"usageAnalyticsDashboard.monitorLicenseUsageAndFeature",
|
|
3411
|
+
"Monitor license usage and feature adoption"
|
|
3412
|
+
) })
|
|
3322
3413
|
] }),
|
|
3323
3414
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
3324
3415
|
/* @__PURE__ */ jsxRuntime.jsx(TimeRangeSelector, { value: state.timeRange, onChange: setTimeRange }),
|
|
@@ -3327,7 +3418,7 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3327
3418
|
{
|
|
3328
3419
|
onClick: () => refresh(),
|
|
3329
3420
|
className: "p-2 text-gray-500 hover:text-gray-700 rounded-lg hover:bg-gray-100",
|
|
3330
|
-
title: "Refresh",
|
|
3421
|
+
title: t("usageAnalyticsDashboard.refresh", "Refresh"),
|
|
3331
3422
|
children: /* @__PURE__ */ jsxRuntime.jsx(marks.RefreshMark, {})
|
|
3332
3423
|
}
|
|
3333
3424
|
),
|
|
@@ -3336,7 +3427,7 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3336
3427
|
{
|
|
3337
3428
|
className: "px-4 py-2 bg-gray-200 text-gray-700 rounded-lg hover:bg-gray-300",
|
|
3338
3429
|
onClick: () => exportData("csv"),
|
|
3339
|
-
children: "Export"
|
|
3430
|
+
children: t("usageAnalyticsDashboard.export", "Export")
|
|
3340
3431
|
}
|
|
3341
3432
|
) })
|
|
3342
3433
|
] })
|
|
@@ -3346,7 +3437,7 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3346
3437
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3347
3438
|
MetricCard,
|
|
3348
3439
|
{
|
|
3349
|
-
title: "Active Licenses",
|
|
3440
|
+
title: t("usageAnalyticsDashboard.activeLicenses", "Active Licenses"),
|
|
3350
3441
|
value: ((_a = state.overview) == null ? void 0 : _a.activeLicenses) ?? 0,
|
|
3351
3442
|
change: (_b = state.overview) == null ? void 0 : _b.activeLicensesChange,
|
|
3352
3443
|
loading: state.loading
|
|
@@ -3355,7 +3446,7 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3355
3446
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3356
3447
|
MetricCard,
|
|
3357
3448
|
{
|
|
3358
|
-
title: "Active Users",
|
|
3449
|
+
title: t("usageAnalyticsDashboard.activeUsers", "Active Users"),
|
|
3359
3450
|
value: ((_c = state.overview) == null ? void 0 : _c.activeUsers) ?? 0,
|
|
3360
3451
|
change: (_d = state.overview) == null ? void 0 : _d.activeUsersChange,
|
|
3361
3452
|
loading: state.loading
|
|
@@ -3364,7 +3455,7 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3364
3455
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3365
3456
|
MetricCard,
|
|
3366
3457
|
{
|
|
3367
|
-
title: "Feature Uses",
|
|
3458
|
+
title: t("usageAnalyticsDashboard.featureUses", "Feature Uses"),
|
|
3368
3459
|
value: ((_e = state.overview) == null ? void 0 : _e.featureUses) ?? 0,
|
|
3369
3460
|
change: (_f = state.overview) == null ? void 0 : _f.featureUsesChange,
|
|
3370
3461
|
loading: state.loading
|
|
@@ -3373,7 +3464,7 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3373
3464
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3374
3465
|
MetricCard,
|
|
3375
3466
|
{
|
|
3376
|
-
title: "Avg Session",
|
|
3467
|
+
title: t("usageAnalyticsDashboard.avgSession", "Avg Session"),
|
|
3377
3468
|
value: ((_h = (_g = state.overview) == null ? void 0 : _g.avgSessionDuration) == null ? void 0 : _h.toFixed(1)) ?? "0",
|
|
3378
3469
|
suffix: "min",
|
|
3379
3470
|
change: (_i = state.overview) == null ? void 0 : _i.avgSessionDurationChange,
|
|
@@ -3383,7 +3474,7 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3383
3474
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3384
3475
|
MetricCard,
|
|
3385
3476
|
{
|
|
3386
|
-
title: "Utilization",
|
|
3477
|
+
title: t("usageAnalyticsDashboard.utilization", "Utilization"),
|
|
3387
3478
|
value: `${((_k = (_j = state.overview) == null ? void 0 : _j.utilizationRate) == null ? void 0 : _k.toFixed(0)) ?? 0}%`,
|
|
3388
3479
|
change: (_l = state.overview) == null ? void 0 : _l.utilizationRateChange,
|
|
3389
3480
|
loading: state.loading
|
|
@@ -3396,14 +3487,14 @@ const UsageAnalyticsDashboard = (props) => {
|
|
|
3396
3487
|
] }),
|
|
3397
3488
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-6", children: /* @__PURE__ */ jsxRuntime.jsx(TopUsersTable, { data: state.topUsers, loading: state.loading }) }),
|
|
3398
3489
|
state.geoData.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-white rounded-lg border border-gray-200 p-4", children: [
|
|
3399
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: "Geographic Distribution" }),
|
|
3490
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold mb-4", children: t("usageAnalyticsDashboard.geographicDistribution", "Geographic Distribution") }),
|
|
3400
3491
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4", children: state.geoData.slice(0, 6).map((geo) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center", children: [
|
|
3401
3492
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-2xl mb-1", children: getCountryFlag(geo.countryCode) }),
|
|
3402
3493
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium", children: geo.country }),
|
|
3403
|
-
/* @__PURE__ */ jsxRuntime.
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3494
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-gray-500", children: t("usageAnalyticsDashboard.users", "{users} users").replace(
|
|
3495
|
+
"{users}",
|
|
3496
|
+
String(geo.users)
|
|
3497
|
+
) })
|
|
3407
3498
|
] }, geo.countryCode)) })
|
|
3408
3499
|
] })
|
|
3409
3500
|
] });
|