@fonderie/vue-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.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as vue from 'vue';
2
2
  import { PropType, VNode } from 'vue';
3
3
  import { AdminClient, ConfigAdminClient, CourierAdminClient, AuthAdminClient, BillingAdminClient, AuditAdminClient } from '@fonderie/client';
4
4
 
5
- type AdminPage = 'attention' | 'modules' | 'doctor' | 'config' | 'routes' | 'migrations' | 'tokens' | 'log' | 'settings' | 'templates' | 'users' | 'catalog' | 'subscriber' | 'audit';
5
+ type AdminPage = 'attention' | 'modules' | 'doctor' | 'environment' | 'routes' | 'migrations' | 'tokens' | 'log' | 'settings' | 'templates' | 'users' | 'catalog' | 'subscriber' | 'audit';
6
6
  declare const AdminShell: vue.DefineComponent<vue.ExtractPropTypes<{
7
7
  client: {
8
8
  type: PropType<AdminClient>;
@@ -77,12 +77,12 @@ declare const AdminShell: vue.DefineComponent<vue.ExtractPropTypes<{
77
77
  onNavigate?: (_page: AdminPage) => any;
78
78
  }>, {
79
79
  page: AdminPage;
80
+ environment: string;
80
81
  configClient: ConfigAdminClient;
81
82
  courierClient: CourierAdminClient;
82
83
  authClient: AuthAdminClient;
83
84
  billingClient: BillingAdminClient;
84
85
  auditClient: AuditAdminClient;
85
- environment: string;
86
86
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
87
87
 
88
88
  declare const AttentionScreen: vue.DefineComponent<vue.ExtractPropTypes<{
@@ -127,7 +127,7 @@ declare const DoctorScreen: vue.DefineComponent<vue.ExtractPropTypes<{
127
127
  };
128
128
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
129
129
 
130
- declare const ConfigScreen: vue.DefineComponent<vue.ExtractPropTypes<{
130
+ declare const EnvironmentScreen: vue.DefineComponent<vue.ExtractPropTypes<{
131
131
  client: {
132
132
  type: PropType<AdminClient>;
133
133
  required: true;
@@ -293,4 +293,4 @@ declare const AuditScreen: vue.DefineComponent<vue.ExtractPropTypes<{
293
293
  pageSize: number;
294
294
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
295
295
 
296
- export { AdminLogScreen, type AdminPage, AdminShell, AttentionScreen, AuditScreen, CatalogScreen, ConfigScreen, DoctorScreen, MigrationsScreen, ModulesScreen, RoutesScreen, SubscriberScreen, TokensScreen, UsersScreen };
296
+ export { AdminLogScreen, type AdminPage, AdminShell, AttentionScreen, AuditScreen, CatalogScreen, DoctorScreen, EnvironmentScreen, MigrationsScreen, ModulesScreen, RoutesScreen, SubscriberScreen, TokensScreen, UsersScreen };
package/dist/index.js CHANGED
@@ -262,14 +262,14 @@ var AttentionScreen = defineComponent2({
262
262
  }
263
263
  });
264
264
 
265
- // src/screens/ConfigScreen.ts
266
- import { useAdminConfig } from "@fonderie/vue-admin";
265
+ // src/screens/EnvironmentScreen.ts
266
+ import { useAdminEnvironment } from "@fonderie/vue-admin";
267
267
  import { defineComponent as defineComponent3, h as h4 } from "vue";
268
- var ConfigScreen = defineComponent3({
269
- name: "FonderieConfigScreen",
268
+ var EnvironmentScreen = defineComponent3({
269
+ name: "FonderieEnvironmentScreen",
270
270
  props: { client: { type: Object, required: true } },
271
271
  setup(props) {
272
- const { report, isLoading, error } = useAdminConfig(props.client);
272
+ const { report, isLoading, error } = useAdminEnvironment(props.client);
273
273
  return () => page("Configuration", { isLoading, error }, () => {
274
274
  const r = report.value;
275
275
  if (!r) return null;
@@ -685,6 +685,7 @@ var TokensScreen = defineComponent8({
685
685
  });
686
686
 
687
687
  // src/screens/UsersScreen.ts
688
+ import { describeLocation } from "@fonderie/client";
688
689
  import {
689
690
  useAdminLoginHistory,
690
691
  useAdminUser,
@@ -831,6 +832,8 @@ var UsersScreen = defineComponent9({
831
832
  (s) => h10("li", { key: s.id, style: styles.row }, [
832
833
  h10("span", { style: styles.mono }, s.ipAddress ?? "\u2014"),
833
834
  " ",
835
+ h10("span", { style: styles.muted }, describeLocation(s.location) ?? ""),
836
+ " ",
834
837
  h10("span", { style: styles.muted }, s.userAgent ?? ""),
835
838
  " ",
836
839
  h10(
@@ -855,6 +858,11 @@ var UsersScreen = defineComponent9({
855
858
  " ",
856
859
  h10("span", { style: styles.muted }, e.method),
857
860
  " ",
861
+ h10("span", { style: styles.mono }, e.ipAddress ?? "\u2014"),
862
+ " ",
863
+ h10("span", { style: styles.muted }, describeLocation(e.location) ?? ""),
864
+ e.location?.proxy || e.location?.hosting ? h10("span", { style: styles.bad }, e.location.proxy ? " proxy/VPN" : " hosting") : "",
865
+ " ",
858
866
  h10("span", { style: styles.muted }, new Date(e.createdAt).toLocaleString())
859
867
  ])
860
868
  )
@@ -1257,7 +1265,7 @@ var NAV = [
1257
1265
  group: "System",
1258
1266
  items: [
1259
1267
  { page: "modules", label: "Modules" },
1260
- { page: "config", label: "Configuration" },
1268
+ { page: "environment", label: "Environment" },
1261
1269
  { page: "doctor", label: "Doctor" },
1262
1270
  { page: "routes", label: "Routes" }
1263
1271
  ]
@@ -1325,8 +1333,8 @@ var AdminShell = defineComponent13({
1325
1333
  return h14(ModulesScreen, { client: c });
1326
1334
  case "doctor":
1327
1335
  return h14(DoctorScreen, { client: c });
1328
- case "config":
1329
- return h14(ConfigScreen, { client: c });
1336
+ case "environment":
1337
+ return h14(EnvironmentScreen, { client: c });
1330
1338
  case "routes":
1331
1339
  return h14(RoutesScreen, { client: c });
1332
1340
  case "tokens":
@@ -1447,8 +1455,8 @@ export {
1447
1455
  AttentionScreen,
1448
1456
  AuditScreen,
1449
1457
  CatalogScreen,
1450
- ConfigScreen,
1451
1458
  DoctorScreen,
1459
+ EnvironmentScreen,
1452
1460
  MigrationsScreen,
1453
1461
  ModulesScreen,
1454
1462
  RoutesScreen,