@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.js CHANGED
@@ -225,11 +225,11 @@ function AttentionScreen({ client }) {
225
225
  ] });
226
226
  }
227
227
 
228
- // src/screens/ConfigScreen.tsx
229
- import { useAdminConfig } from "@fonderie/react-admin";
228
+ // src/screens/EnvironmentScreen.tsx
229
+ import { useAdminEnvironment } from "@fonderie/react-admin";
230
230
  import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
231
- function ConfigScreen({ client }) {
232
- const { report, isLoading, error } = useAdminConfig(client);
231
+ function EnvironmentScreen({ client }) {
232
+ const { report, isLoading, error } = useAdminEnvironment(client);
233
233
  return /* @__PURE__ */ jsxs3("div", { style: styles.container, children: [
234
234
  /* @__PURE__ */ jsx3("h1", { style: styles.title, children: "Configuration" }),
235
235
  isLoading ? /* @__PURE__ */ jsx3("p", { style: styles.status, children: "Loading\u2026" }) : error ? /* @__PURE__ */ jsx3("p", { style: styles.error, role: "alert", children: error.explanation }) : report ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
@@ -564,6 +564,7 @@ function TokensScreen({ client }) {
564
564
  }
565
565
 
566
566
  // src/screens/UsersScreen.tsx
567
+ import { describeLocation } from "@fonderie/client";
567
568
  import {
568
569
  useAdminLoginHistory,
569
570
  useAdminUser,
@@ -740,6 +741,10 @@ function UsersScreen({ client, pageSize = 50 }) {
740
741
  sessions.sessions.length === 0 ? /* @__PURE__ */ jsx9("p", { style: styles.muted, children: "None." }) : /* @__PURE__ */ jsx9("ul", { style: styles.list, children: sessions.sessions.map((s) => /* @__PURE__ */ jsxs9("li", { style: styles.row, children: [
741
742
  /* @__PURE__ */ jsx9("span", { style: styles.mono, children: s.ipAddress ?? "\u2014" }),
742
743
  " ",
744
+ describeLocation(s.location) ? /* @__PURE__ */ jsxs9("span", { style: styles.muted, children: [
745
+ describeLocation(s.location),
746
+ " "
747
+ ] }) : null,
743
748
  /* @__PURE__ */ jsx9("span", { style: styles.muted, children: s.userAgent ?? "" }),
744
749
  " ",
745
750
  /* @__PURE__ */ jsxs9("span", { style: styles.muted, children: [
@@ -753,6 +758,14 @@ function UsersScreen({ client, pageSize = 50 }) {
753
758
  " ",
754
759
  /* @__PURE__ */ jsx9("span", { style: styles.muted, children: e.method }),
755
760
  " ",
761
+ /* @__PURE__ */ jsx9("span", { style: styles.mono, children: e.ipAddress ?? "\u2014" }),
762
+ " ",
763
+ describeLocation(e.location) ? /* @__PURE__ */ jsx9("span", { style: styles.muted, children: describeLocation(e.location) }) : null,
764
+ e.location?.proxy || e.location?.hosting ? /* @__PURE__ */ jsxs9("span", { style: styles.bad, children: [
765
+ " ",
766
+ e.location.proxy ? "proxy/VPN" : "hosting"
767
+ ] }) : null,
768
+ " ",
756
769
  /* @__PURE__ */ jsx9("span", { style: styles.muted, children: new Date(e.createdAt).toLocaleString() })
757
770
  ] }, e.id)) }),
758
771
  history.hasMore && !history.isLoading ? /* @__PURE__ */ jsx9(
@@ -1179,7 +1192,7 @@ var NAV = [
1179
1192
  group: "System",
1180
1193
  items: [
1181
1194
  { page: "modules", label: "Modules" },
1182
- { page: "config", label: "Configuration" },
1195
+ { page: "environment", label: "Environment" },
1183
1196
  { page: "doctor", label: "Doctor" },
1184
1197
  { page: "routes", label: "Routes" }
1185
1198
  ]
@@ -1240,8 +1253,8 @@ function AdminShell({
1240
1253
  case "doctor":
1241
1254
  body = /* @__PURE__ */ jsx13(DoctorScreen, { client });
1242
1255
  break;
1243
- case "config":
1244
- body = /* @__PURE__ */ jsx13(ConfigScreen, { client });
1256
+ case "environment":
1257
+ body = /* @__PURE__ */ jsx13(EnvironmentScreen, { client });
1245
1258
  break;
1246
1259
  case "routes":
1247
1260
  body = /* @__PURE__ */ jsx13(RoutesScreen, { client });
@@ -1341,8 +1354,8 @@ export {
1341
1354
  AttentionScreen,
1342
1355
  AuditScreen,
1343
1356
  CatalogScreen,
1344
- ConfigScreen,
1345
1357
  DoctorScreen,
1358
+ EnvironmentScreen,
1346
1359
  MigrationsScreen,
1347
1360
  ModulesScreen,
1348
1361
  RoutesScreen,