@fonderie/react-admin-screens 0.8.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -25,8 +25,8 @@ __export(index_exports, {
25
25
  AttentionScreen: () => AttentionScreen,
26
26
  AuditScreen: () => AuditScreen,
27
27
  CatalogScreen: () => CatalogScreen,
28
- ConfigScreen: () => ConfigScreen,
29
28
  DoctorScreen: () => DoctorScreen,
29
+ EnvironmentScreen: () => EnvironmentScreen,
30
30
  MigrationsScreen: () => MigrationsScreen,
31
31
  ModulesScreen: () => ModulesScreen,
32
32
  RoutesScreen: () => RoutesScreen,
@@ -263,11 +263,11 @@ function AttentionScreen({ client }) {
263
263
  ] });
264
264
  }
265
265
 
266
- // src/screens/ConfigScreen.tsx
266
+ // src/screens/EnvironmentScreen.tsx
267
267
  var import_react_admin3 = require("@fonderie/react-admin");
268
268
  var import_jsx_runtime3 = require("react/jsx-runtime");
269
- function ConfigScreen({ client }) {
270
- const { report, isLoading, error } = (0, import_react_admin3.useAdminConfig)(client);
269
+ function EnvironmentScreen({ client }) {
270
+ const { report, isLoading, error } = (0, import_react_admin3.useAdminEnvironment)(client);
271
271
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { style: styles.container, children: [
272
272
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { style: styles.title, children: "Configuration" }),
273
273
  isLoading ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: styles.status, children: "Loading\u2026" }) : error ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { style: styles.error, role: "alert", children: error.explanation }) : report ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
@@ -602,6 +602,7 @@ function TokensScreen({ client }) {
602
602
  }
603
603
 
604
604
  // src/screens/UsersScreen.tsx
605
+ var import_client = require("@fonderie/client");
605
606
  var import_react_admin9 = require("@fonderie/react-admin");
606
607
  var import_react2 = require("react");
607
608
  var import_jsx_runtime9 = require("react/jsx-runtime");
@@ -773,6 +774,10 @@ function UsersScreen({ client, pageSize = 50 }) {
773
774
  sessions.sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { style: styles.muted, children: "None." }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { style: styles.list, children: sessions.sessions.map((s) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("li", { style: styles.row, children: [
774
775
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: styles.mono, children: s.ipAddress ?? "\u2014" }),
775
776
  " ",
777
+ (0, import_client.describeLocation)(s.location) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: styles.muted, children: [
778
+ (0, import_client.describeLocation)(s.location),
779
+ " "
780
+ ] }) : null,
776
781
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: styles.muted, children: s.userAgent ?? "" }),
777
782
  " ",
778
783
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: styles.muted, children: [
@@ -786,6 +791,14 @@ function UsersScreen({ client, pageSize = 50 }) {
786
791
  " ",
787
792
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: styles.muted, children: e.method }),
788
793
  " ",
794
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: styles.mono, children: e.ipAddress ?? "\u2014" }),
795
+ " ",
796
+ (0, import_client.describeLocation)(e.location) ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: styles.muted, children: (0, import_client.describeLocation)(e.location) }) : null,
797
+ e.location?.proxy || e.location?.hosting ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { style: styles.bad, children: [
798
+ " ",
799
+ e.location.proxy ? "proxy/VPN" : "hosting"
800
+ ] }) : null,
801
+ " ",
789
802
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: styles.muted, children: new Date(e.createdAt).toLocaleString() })
790
803
  ] }, e.id)) }),
791
804
  history.hasMore && !history.isLoading ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -1212,7 +1225,7 @@ var NAV = [
1212
1225
  group: "System",
1213
1226
  items: [
1214
1227
  { page: "modules", label: "Modules" },
1215
- { page: "config", label: "Configuration" },
1228
+ { page: "environment", label: "Environment" },
1216
1229
  { page: "doctor", label: "Doctor" },
1217
1230
  { page: "routes", label: "Routes" }
1218
1231
  ]
@@ -1273,8 +1286,8 @@ function AdminShell({
1273
1286
  case "doctor":
1274
1287
  body = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DoctorScreen, { client });
1275
1288
  break;
1276
- case "config":
1277
- body = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ConfigScreen, { client });
1289
+ case "environment":
1290
+ body = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(EnvironmentScreen, { client });
1278
1291
  break;
1279
1292
  case "routes":
1280
1293
  body = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RoutesScreen, { client });
@@ -1375,8 +1388,8 @@ function AdminShell({
1375
1388
  AttentionScreen,
1376
1389
  AuditScreen,
1377
1390
  CatalogScreen,
1378
- ConfigScreen,
1379
1391
  DoctorScreen,
1392
+ EnvironmentScreen,
1380
1393
  MigrationsScreen,
1381
1394
  ModulesScreen,
1382
1395
  RoutesScreen,