@geekron/strapi 0.1.4 → 0.1.5

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.
@@ -20435,54 +20435,38 @@ var require_react_window = __commonJS((exports2) => {
20435
20435
  });
20436
20436
 
20437
20437
  // admin/src/components/ApiErrorAlert.tsx
20438
- var import_design_system9, import_icons12, jsx_dev_runtime27, ApiErrorAlert = ({
20438
+ var import_design_system9, jsx_dev_runtime27, ApiErrorAlert = ({
20439
20439
  message,
20440
- title = "接口访问异常",
20441
- suggestion,
20442
- isWarning = false
20440
+ title = "操作提醒",
20441
+ suggestion
20443
20442
  }) => {
20444
- const backgroundColor = isWarning ? "warning100" : "danger100";
20445
- const textColor = isWarning ? "warning700" : "danger700";
20446
- return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Box, {
20447
- background: backgroundColor,
20448
- padding: 4,
20449
- hasRadius: true,
20450
- children: /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Flex, {
20451
- gap: 2,
20452
- alignItems: "flex-start",
20453
- children: [
20454
- /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_icons12.WarningCircle, {
20455
- width: "1.2rem",
20456
- height: "1.2rem",
20457
- color: textColor
20458
- }, undefined, false, undefined, this),
20459
- /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Flex, {
20460
- direction: "column",
20461
- gap: 1,
20462
- children: [
20463
- title && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20464
- fontWeight: "bold",
20465
- textColor,
20466
- children: title
20467
- }, undefined, false, undefined, this),
20468
- /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20469
- textColor,
20470
- children: message
20471
- }, undefined, false, undefined, this),
20472
- suggestion && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20473
- textColor,
20474
- fontSize: 0,
20475
- children: suggestion
20476
- }, undefined, false, undefined, this)
20477
- ]
20478
- }, undefined, true, undefined, this)
20479
- ]
20480
- }, undefined, true, undefined, this)
20481
- }, undefined, false, undefined, this);
20443
+ return /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Flex, {
20444
+ justifyContent: "center",
20445
+ alignItems: "center",
20446
+ direction: "column",
20447
+ children: [
20448
+ /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20449
+ variant: "alpha",
20450
+ marginBottom: "1rem",
20451
+ children: title
20452
+ }, undefined, false, undefined, this),
20453
+ suggestion && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20454
+ variant: "omega",
20455
+ textColor: "neutral600",
20456
+ children: suggestion
20457
+ }, undefined, false, undefined, this),
20458
+ message && /* @__PURE__ */ jsx_dev_runtime27.jsxDEV(import_design_system9.Typography, {
20459
+ variant: "omega",
20460
+ textColor: "neutral600",
20461
+ lineHeight: 1.4,
20462
+ style: { opacity: 0.85 },
20463
+ children: message
20464
+ }, undefined, false, undefined, this)
20465
+ ]
20466
+ }, undefined, true, undefined, this);
20482
20467
  }, ApiErrorAlert_default;
20483
20468
  var init_ApiErrorAlert = __esm(() => {
20484
20469
  import_design_system9 = require("@strapi/design-system");
20485
- import_icons12 = require("@strapi/icons");
20486
20470
  jsx_dev_runtime27 = require("react/jsx-dev-runtime");
20487
20471
  ApiErrorAlert_default = ApiErrorAlert;
20488
20472
  });
@@ -20555,7 +20539,8 @@ var import_design_system10, import_admin7, import_react11, jsx_dev_runtime28, Da
20555
20539
  children: /* @__PURE__ */ jsx_dev_runtime28.jsxDEV(ApiErrorAlert_default, {
20556
20540
  message: error,
20557
20541
  title: "仪表盘数据加载失败",
20558
- suggestion: "请检查网络连接或联系管理员"
20542
+ suggestion: "请检查网络连接或联系管理员",
20543
+ type: "error"
20559
20544
  }, undefined, false, undefined, this)
20560
20545
  }, undefined, false, undefined, this);
20561
20546
  }
@@ -20667,7 +20652,7 @@ var init_DashboardStats = __esm(() => {
20667
20652
  });
20668
20653
 
20669
20654
  // admin/src/pages/Dashboard.tsx
20670
- var import_design_system12, import_icons14, import_admin9, jsx_dev_runtime30, Dashboard = () => {
20655
+ var import_design_system12, import_icons13, import_admin9, jsx_dev_runtime30, Dashboard = () => {
20671
20656
  return /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_admin9.Page.Main, {
20672
20657
  children: /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_design_system12.Box, {
20673
20658
  padding: 8,
@@ -20686,7 +20671,7 @@ var import_design_system12, import_icons14, import_admin9, jsx_dev_runtime30, Da
20686
20671
  alignItems: "center",
20687
20672
  gap: 2,
20688
20673
  children: [
20689
- /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_icons14.ChartPie, {
20674
+ /* @__PURE__ */ jsx_dev_runtime30.jsxDEV(import_icons13.ChartPie, {
20690
20675
  width: "24px",
20691
20676
  height: "24px"
20692
20677
  }, undefined, false, undefined, this),
@@ -20711,14 +20696,14 @@ var import_design_system12, import_icons14, import_admin9, jsx_dev_runtime30, Da
20711
20696
  var init_Dashboard = __esm(() => {
20712
20697
  init_DashboardStats();
20713
20698
  import_design_system12 = require("@strapi/design-system");
20714
- import_icons14 = require("@strapi/icons");
20699
+ import_icons13 = require("@strapi/icons");
20715
20700
  import_admin9 = require("@strapi/strapi/admin");
20716
20701
  jsx_dev_runtime30 = require("react/jsx-dev-runtime");
20717
20702
  Dashboard_default = Dashboard;
20718
20703
  });
20719
20704
 
20720
20705
  // admin/src/pages/Inquiry.tsx
20721
- var import_design_system13, import_icons15, import_symbols, import_admin10, import_react13, import_react_router_dom, jsx_dev_runtime31, Inquiry = () => {
20706
+ var import_design_system13, import_icons14, import_symbols, import_admin10, import_react13, import_react_router_dom, jsx_dev_runtime31, Inquiry = () => {
20722
20707
  const navigate = import_react_router_dom.useNavigate();
20723
20708
  const fetchClient = import_admin10.useFetchClient();
20724
20709
  const { toggleNotification } = import_admin10.useNotification();
@@ -20815,7 +20800,8 @@ var import_design_system13, import_icons15, import_symbols, import_admin10, impo
20815
20800
  children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(ApiErrorAlert_default, {
20816
20801
  message: error,
20817
20802
  title: "询盘列表加载失败",
20818
- suggestion: "请检查网络连接或联系管理员"
20803
+ suggestion: "请检查网络连接或联系管理员",
20804
+ type: "error"
20819
20805
  }, undefined, false, undefined, this)
20820
20806
  }, undefined, false, undefined, this)
20821
20807
  }, undefined, false, undefined, this)
@@ -20907,7 +20893,7 @@ var import_design_system13, import_icons15, import_symbols, import_admin10, impo
20907
20893
  onClick: () => handleViewDetail(row.id),
20908
20894
  label: "查看详情",
20909
20895
  borderWidth: 0,
20910
- children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_icons15.Eye, {}, undefined, false, undefined, this)
20896
+ children: /* @__PURE__ */ jsx_dev_runtime31.jsxDEV(import_icons14.Eye, {}, undefined, false, undefined, this)
20911
20897
  }, undefined, false, undefined, this)
20912
20898
  }, undefined, false, undefined, this)
20913
20899
  }
@@ -20930,7 +20916,7 @@ var init_Inquiry = __esm(() => {
20930
20916
  init_ApiErrorAlert();
20931
20917
  init_DataTable();
20932
20918
  import_design_system13 = require("@strapi/design-system");
20933
- import_icons15 = require("@strapi/icons");
20919
+ import_icons14 = require("@strapi/icons");
20934
20920
  import_symbols = require("@strapi/icons/symbols");
20935
20921
  import_admin10 = require("@strapi/strapi/admin");
20936
20922
  import_react13 = require("react");
@@ -21517,7 +21503,8 @@ var import_design_system15, import_symbols2, import_admin12, import_react15, jsx
21517
21503
  children: /* @__PURE__ */ jsx_dev_runtime33.jsxDEV(ApiErrorAlert_default, {
21518
21504
  message: error,
21519
21505
  title: "访客记录加载失败",
21520
- suggestion: "请检查网络连接或联系管理员"
21506
+ suggestion: "请检查网络连接或联系管理员",
21507
+ type: "error"
21521
21508
  }, undefined, false, undefined, this)
21522
21509
  }, undefined, false, undefined, this)
21523
21510
  }, undefined, false, undefined, this)
@@ -21683,22 +21670,18 @@ var import_strapi_admin, import_design_system16, import_react16, import_react_ro
21683
21670
  const [isConnected, setIsConnected] = import_react16.default.useState(null);
21684
21671
  const [checking, setChecking] = import_react16.default.useState(true);
21685
21672
  import_react16.default.useEffect(() => {
21686
- const checkConnection = async () => {
21687
- try {
21688
- const response = await client.get("/website/hello");
21689
- if (response?.data?.message) {
21690
- setIsConnected(true);
21691
- } else {
21692
- setIsConnected(false);
21693
- }
21694
- } catch (error) {
21695
- console.error("Network check failed:", error);
21673
+ client.get("/website/check").then((response) => {
21674
+ if (response?.data?.message) {
21675
+ setIsConnected(true);
21676
+ } else {
21696
21677
  setIsConnected(false);
21697
- } finally {
21698
- setChecking(false);
21699
21678
  }
21700
- };
21701
- checkConnection();
21679
+ }).catch((error) => {
21680
+ console.error("Network check failed:", error);
21681
+ setIsConnected(false);
21682
+ }).finally(() => {
21683
+ setChecking(false);
21684
+ });
21702
21685
  }, [client]);
21703
21686
  if (checking) {
21704
21687
  return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Flex, {
@@ -21715,23 +21698,21 @@ var import_strapi_admin, import_design_system16, import_react16, import_react_ro
21715
21698
  return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Flex, {
21716
21699
  justifyContent: "center",
21717
21700
  alignItems: "center",
21701
+ direction: "column",
21718
21702
  height: "100vh",
21719
- children: /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Box, {
21720
- textAlign: "center",
21721
- children: [
21722
- /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21723
- variant: "alpha",
21724
- marginBottom: "1rem",
21725
- children: "网站信息未正确配置"
21726
- }, undefined, false, undefined, this),
21727
- /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21728
- variant: "omega",
21729
- textColor: "neutral600",
21730
- children: "无法连接到网站服务,请检查网站配置"
21731
- }, undefined, false, undefined, this)
21732
- ]
21733
- }, undefined, true, undefined, this)
21734
- }, undefined, false, undefined, this);
21703
+ children: [
21704
+ /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21705
+ variant: "alpha",
21706
+ marginBottom: "1rem",
21707
+ children: "网站信息未正确配置"
21708
+ }, undefined, false, undefined, this),
21709
+ /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(import_design_system16.Typography, {
21710
+ variant: "omega",
21711
+ textColor: "neutral600",
21712
+ children: "无法连接到网站服务,请检查网站配置"
21713
+ }, undefined, false, undefined, this)
21714
+ ]
21715
+ }, undefined, true, undefined, this);
21735
21716
  }
21736
21717
  return /* @__PURE__ */ jsx_dev_runtime34.jsxDEV(LayoutContainer, {
21737
21718
  children: [
@@ -21836,14 +21817,111 @@ __export(exports_src, {
21836
21817
  });
21837
21818
  module.exports = __toCommonJS(exports_src);
21838
21819
 
21820
+ // admin/src/boot/handle-missing-translations.ts
21821
+ function extractTranslationInfo(logMessage) {
21822
+ const regex = /Missing message: "([^"]+)"[^,]+, using default message \(([^)]+)\)/;
21823
+ const match = logMessage.match(regex);
21824
+ if (match) {
21825
+ return {
21826
+ messageId: match[1],
21827
+ defaultMessage: match[2]
21828
+ };
21829
+ }
21830
+ return null;
21831
+ }
21832
+ var missTranslations = {};
21833
+ var handleMissingTranslations = (message) => {
21834
+ const info = extractTranslationInfo(message);
21835
+ if (info?.messageId)
21836
+ missTranslations[info.messageId] = info.defaultMessage;
21837
+ console.log(JSON.stringify(missTranslations));
21838
+ };
21839
+ var originalError = console.error;
21840
+ var originalWarn = () => {};
21841
+ console.warn = (..._args) => {
21842
+ originalWarn();
21843
+ };
21844
+ console.error = (error) => {
21845
+ try {
21846
+ if (error?.message?.includes("MISSING_TRANSLATION")) {
21847
+ handleMissingTranslations(error.message);
21848
+ } else {
21849
+ originalError(error);
21850
+ }
21851
+ } catch (error2) {
21852
+ originalError(error2);
21853
+ }
21854
+ };
21855
+
21856
+ // admin/src/boot/remove-links.ts
21857
+ function waitForLi(href, callback) {
21858
+ const findLi = () => {
21859
+ const anchor = document.querySelector(`li a[href="${href}"]`);
21860
+ if (anchor) {
21861
+ const li = anchor.closest("li");
21862
+ if (li)
21863
+ return li;
21864
+ }
21865
+ return null;
21866
+ };
21867
+ setInterval(() => {
21868
+ const initial = findLi();
21869
+ if (initial) {
21870
+ callback(initial);
21871
+ return;
21872
+ }
21873
+ });
21874
+ }
21875
+ function waitForDD(href, callback) {
21876
+ const findDD = () => {
21877
+ const anchor = document.querySelector(`div a[href="${href}"]`);
21878
+ if (anchor) {
21879
+ const dd = anchor.closest("div");
21880
+ if (dd)
21881
+ return dd;
21882
+ }
21883
+ return null;
21884
+ };
21885
+ setInterval(() => {
21886
+ const initial = findDD();
21887
+ if (initial) {
21888
+ callback(initial);
21889
+ return;
21890
+ }
21891
+ });
21892
+ }
21893
+ var removeLinks = () => {
21894
+ const hrefs = [
21895
+ "/admin/settings/purchase-content-history",
21896
+ "/admin/settings/plugins/purchase-content-releases",
21897
+ "/admin/settings/purchase-review-workflows",
21898
+ "/admin/settings/purchase-single-sign-on",
21899
+ "/admin/settings/purchase-audit-logs"
21900
+ ];
21901
+ hrefs.forEach((href) => {
21902
+ waitForLi(href, (li) => {
21903
+ const parent = li.parentNode;
21904
+ parent.removeChild(li);
21905
+ });
21906
+ });
21907
+ const ddHrefs = ["https://strapi.io/pricing-self-hosted"];
21908
+ ddHrefs.forEach((href) => {
21909
+ waitForDD(href, (dd) => {
21910
+ const parent = dd.parentNode;
21911
+ parent.removeChild(dd);
21912
+ });
21913
+ });
21914
+ };
21915
+
21839
21916
  // admin/src/bootstrap.ts
21840
21917
  var bootstrap = (_app) => {
21841
21918
  console.log("website admin plugin: bootstrap");
21919
+ removeLinks();
21842
21920
  };
21843
21921
  var bootstrap_default = bootstrap;
21844
21922
 
21845
21923
  // admin/src/register.ts
21846
- var import_icons16 = require("@strapi/icons");
21924
+ var import_icons15 = require("@strapi/icons");
21847
21925
 
21848
21926
  // admin/src/contract.ts
21849
21927
  var pluginId = "website";
@@ -51028,7 +51106,7 @@ var registerFields = (app) => {
51028
51106
  };
51029
51107
 
51030
51108
  // admin/src/widgets/index.ts
51031
- var import_icons13 = require("@strapi/icons");
51109
+ var import_icons12 = require("@strapi/icons");
51032
51110
 
51033
51111
  // admin/src/widgets/WelcomeWidget.tsx
51034
51112
  init_DashboardStats();
@@ -51116,7 +51194,7 @@ var WelcomeWidget_default = WelcomeWidget;
51116
51194
  // admin/src/widgets/index.ts
51117
51195
  var registerWidgets = (app) => {
51118
51196
  app.widgets.register({
51119
- icon: import_icons13.ChartPie,
51197
+ icon: import_icons12.ChartPie,
51120
51198
  title: {
51121
51199
  id: `${pluginId}.widget.title`,
51122
51200
  defaultMessage: "Dashboard"
@@ -51142,7 +51220,7 @@ var register = (app) => {
51142
51220
  });
51143
51221
  app.addMenuLink({
51144
51222
  to: `/website`,
51145
- icon: import_icons16.ChartPie,
51223
+ icon: import_icons15.ChartPie,
51146
51224
  intlLabel: {
51147
51225
  id: `${pluginId}.plugin.name`,
51148
51226
  defaultMessage: "Website"
@@ -20443,60 +20443,44 @@ var require_react_window = __commonJS((exports) => {
20443
20443
  });
20444
20444
 
20445
20445
  // admin/src/components/ApiErrorAlert.tsx
20446
- import { Box as Box6, Flex as Flex7, Typography as Typography7 } from "@strapi/design-system";
20447
- import { WarningCircle as WarningCircle2 } from "@strapi/icons";
20446
+ import { Flex as Flex7, Typography as Typography7 } from "@strapi/design-system";
20448
20447
  import { jsxDEV as jsxDEV27 } from "react/jsx-dev-runtime";
20449
20448
  var ApiErrorAlert = ({
20450
20449
  message,
20451
- title = "接口访问异常",
20452
- suggestion,
20453
- isWarning = false
20450
+ title = "操作提醒",
20451
+ suggestion
20454
20452
  }) => {
20455
- const backgroundColor = isWarning ? "warning100" : "danger100";
20456
- const textColor = isWarning ? "warning700" : "danger700";
20457
- return /* @__PURE__ */ jsxDEV27(Box6, {
20458
- background: backgroundColor,
20459
- padding: 4,
20460
- hasRadius: true,
20461
- children: /* @__PURE__ */ jsxDEV27(Flex7, {
20462
- gap: 2,
20463
- alignItems: "flex-start",
20464
- children: [
20465
- /* @__PURE__ */ jsxDEV27(WarningCircle2, {
20466
- width: "1.2rem",
20467
- height: "1.2rem",
20468
- color: textColor
20469
- }, undefined, false, undefined, this),
20470
- /* @__PURE__ */ jsxDEV27(Flex7, {
20471
- direction: "column",
20472
- gap: 1,
20473
- children: [
20474
- title && /* @__PURE__ */ jsxDEV27(Typography7, {
20475
- fontWeight: "bold",
20476
- textColor,
20477
- children: title
20478
- }, undefined, false, undefined, this),
20479
- /* @__PURE__ */ jsxDEV27(Typography7, {
20480
- textColor,
20481
- children: message
20482
- }, undefined, false, undefined, this),
20483
- suggestion && /* @__PURE__ */ jsxDEV27(Typography7, {
20484
- textColor,
20485
- fontSize: 0,
20486
- children: suggestion
20487
- }, undefined, false, undefined, this)
20488
- ]
20489
- }, undefined, true, undefined, this)
20490
- ]
20491
- }, undefined, true, undefined, this)
20492
- }, undefined, false, undefined, this);
20453
+ return /* @__PURE__ */ jsxDEV27(Flex7, {
20454
+ justifyContent: "center",
20455
+ alignItems: "center",
20456
+ direction: "column",
20457
+ children: [
20458
+ /* @__PURE__ */ jsxDEV27(Typography7, {
20459
+ variant: "alpha",
20460
+ marginBottom: "1rem",
20461
+ children: title
20462
+ }, undefined, false, undefined, this),
20463
+ suggestion && /* @__PURE__ */ jsxDEV27(Typography7, {
20464
+ variant: "omega",
20465
+ textColor: "neutral600",
20466
+ children: suggestion
20467
+ }, undefined, false, undefined, this),
20468
+ message && /* @__PURE__ */ jsxDEV27(Typography7, {
20469
+ variant: "omega",
20470
+ textColor: "neutral600",
20471
+ lineHeight: 1.4,
20472
+ style: { opacity: 0.85 },
20473
+ children: message
20474
+ }, undefined, false, undefined, this)
20475
+ ]
20476
+ }, undefined, true, undefined, this);
20493
20477
  }, ApiErrorAlert_default;
20494
20478
  var init_ApiErrorAlert = __esm(() => {
20495
20479
  ApiErrorAlert_default = ApiErrorAlert;
20496
20480
  });
20497
20481
 
20498
20482
  // admin/src/components/DashboardStats.tsx
20499
- import { Box as Box7, Grid as Grid2, Typography as Typography8 } from "@strapi/design-system";
20483
+ import { Box as Box6, Grid as Grid2, Typography as Typography8 } from "@strapi/design-system";
20500
20484
  import { useFetchClient as useFetchClient3, useNotification as useNotification2 } from "@strapi/strapi/admin";
20501
20485
  import { useEffect as useEffect7, useState as useState12 } from "react";
20502
20486
  import { jsxDEV as jsxDEV28 } from "react/jsx-dev-runtime";
@@ -20551,7 +20535,7 @@ var DashboardStats = ({
20551
20535
  }
20552
20536
  }, [externalData]);
20553
20537
  if (isLoading && showLoading) {
20554
- return /* @__PURE__ */ jsxDEV28(Box7, {
20538
+ return /* @__PURE__ */ jsxDEV28(Box6, {
20555
20539
  paddingTop: 4,
20556
20540
  width: "100%",
20557
20541
  children: /* @__PURE__ */ jsxDEV28(Typography8, {
@@ -20561,17 +20545,18 @@ var DashboardStats = ({
20561
20545
  }, undefined, false, undefined, this);
20562
20546
  }
20563
20547
  if (error) {
20564
- return /* @__PURE__ */ jsxDEV28(Box7, {
20548
+ return /* @__PURE__ */ jsxDEV28(Box6, {
20565
20549
  paddingTop: 4,
20566
20550
  width: "100%",
20567
20551
  children: /* @__PURE__ */ jsxDEV28(ApiErrorAlert_default, {
20568
20552
  message: error,
20569
20553
  title: "仪表盘数据加载失败",
20570
- suggestion: "请检查网络连接或联系管理员"
20554
+ suggestion: "请检查网络连接或联系管理员",
20555
+ type: "error"
20571
20556
  }, undefined, false, undefined, this)
20572
20557
  }, undefined, false, undefined, this);
20573
20558
  }
20574
- return /* @__PURE__ */ jsxDEV28(Box7, {
20559
+ return /* @__PURE__ */ jsxDEV28(Box6, {
20575
20560
  paddingTop: 4,
20576
20561
  width: "100%",
20577
20562
  children: /* @__PURE__ */ jsxDEV28(Grid2.Root, {
@@ -20579,7 +20564,7 @@ var DashboardStats = ({
20579
20564
  children: [
20580
20565
  /* @__PURE__ */ jsxDEV28(Grid2.Item, {
20581
20566
  col: 3,
20582
- children: /* @__PURE__ */ jsxDEV28(Box7, {
20567
+ children: /* @__PURE__ */ jsxDEV28(Box6, {
20583
20568
  padding: 4,
20584
20569
  background: "warning100",
20585
20570
  hasRadius: true,
@@ -20601,7 +20586,7 @@ var DashboardStats = ({
20601
20586
  }, undefined, false, undefined, this),
20602
20587
  /* @__PURE__ */ jsxDEV28(Grid2.Item, {
20603
20588
  col: 3,
20604
- children: /* @__PURE__ */ jsxDEV28(Box7, {
20589
+ children: /* @__PURE__ */ jsxDEV28(Box6, {
20605
20590
  padding: 4,
20606
20591
  background: "secondary100",
20607
20592
  hasRadius: true,
@@ -20623,7 +20608,7 @@ var DashboardStats = ({
20623
20608
  }, undefined, false, undefined, this),
20624
20609
  /* @__PURE__ */ jsxDEV28(Grid2.Item, {
20625
20610
  col: 3,
20626
- children: /* @__PURE__ */ jsxDEV28(Box7, {
20611
+ children: /* @__PURE__ */ jsxDEV28(Box6, {
20627
20612
  padding: 4,
20628
20613
  background: "success100",
20629
20614
  hasRadius: true,
@@ -20645,7 +20630,7 @@ var DashboardStats = ({
20645
20630
  }, undefined, false, undefined, this),
20646
20631
  /* @__PURE__ */ jsxDEV28(Grid2.Item, {
20647
20632
  col: 3,
20648
- children: /* @__PURE__ */ jsxDEV28(Box7, {
20633
+ children: /* @__PURE__ */ jsxDEV28(Box6, {
20649
20634
  padding: 4,
20650
20635
  background: "primary100",
20651
20636
  hasRadius: true,
@@ -20675,16 +20660,16 @@ var init_DashboardStats = __esm(() => {
20675
20660
  });
20676
20661
 
20677
20662
  // admin/src/pages/Dashboard.tsx
20678
- import { Box as Box9, Flex as Flex9, Typography as Typography10 } from "@strapi/design-system";
20663
+ import { Box as Box8, Flex as Flex9, Typography as Typography10 } from "@strapi/design-system";
20679
20664
  import { ChartPie as ChartPie2 } from "@strapi/icons";
20680
20665
  import { Page } from "@strapi/strapi/admin";
20681
20666
  import { jsxDEV as jsxDEV30 } from "react/jsx-dev-runtime";
20682
20667
  var Dashboard = () => {
20683
20668
  return /* @__PURE__ */ jsxDEV30(Page.Main, {
20684
- children: /* @__PURE__ */ jsxDEV30(Box9, {
20669
+ children: /* @__PURE__ */ jsxDEV30(Box8, {
20685
20670
  padding: 8,
20686
20671
  background: "neutral100",
20687
- children: /* @__PURE__ */ jsxDEV30(Box9, {
20672
+ children: /* @__PURE__ */ jsxDEV30(Box8, {
20688
20673
  padding: 6,
20689
20674
  background: "neutral0",
20690
20675
  shadow: "filterShadow",
@@ -20728,7 +20713,7 @@ var init_Dashboard = __esm(() => {
20728
20713
  // admin/src/pages/Inquiry.tsx
20729
20714
  import {
20730
20715
  Badge,
20731
- Box as Box10,
20716
+ Box as Box9,
20732
20717
  EmptyStateLayout,
20733
20718
  Flex as Flex10,
20734
20719
  IconButton as IconButton2,
@@ -20838,12 +20823,13 @@ var Inquiry = () => {
20838
20823
  navigationAction: /* @__PURE__ */ jsxDEV31(BackButton, {}, undefined, false, undefined, this)
20839
20824
  }, undefined, false, undefined, this),
20840
20825
  /* @__PURE__ */ jsxDEV31(Layouts.Content, {
20841
- children: /* @__PURE__ */ jsxDEV31(Box10, {
20826
+ children: /* @__PURE__ */ jsxDEV31(Box9, {
20842
20827
  padding: 8,
20843
20828
  children: /* @__PURE__ */ jsxDEV31(ApiErrorAlert_default, {
20844
20829
  message: error,
20845
20830
  title: "询盘列表加载失败",
20846
- suggestion: "请检查网络连接或联系管理员"
20831
+ suggestion: "请检查网络连接或联系管理员",
20832
+ type: "error"
20847
20833
  }, undefined, false, undefined, this)
20848
20834
  }, undefined, false, undefined, this)
20849
20835
  }, undefined, false, undefined, this)
@@ -20861,7 +20847,7 @@ var Inquiry = () => {
20861
20847
  subtitle: `共 ${pagination.total} 条询盘记录`
20862
20848
  }, undefined, false, undefined, this),
20863
20849
  /* @__PURE__ */ jsxDEV31(Layouts.Content, {
20864
- children: /* @__PURE__ */ jsxDEV31(Box10, {
20850
+ children: /* @__PURE__ */ jsxDEV31(Box9, {
20865
20851
  background: "neutral0",
20866
20852
  shadow: "filterShadow",
20867
20853
  hasRadius: true,
@@ -21305,7 +21291,7 @@ var init_InquiryDetail = __esm(() => {
21305
21291
 
21306
21292
  // admin/src/pages/Visitor.tsx
21307
21293
  import {
21308
- Box as Box11,
21294
+ Box as Box10,
21309
21295
  EmptyStateLayout as EmptyStateLayout2,
21310
21296
  Flex as Flex11,
21311
21297
  Loader as Loader2,
@@ -21557,12 +21543,13 @@ var Visitor = () => {
21557
21543
  navigationAction: /* @__PURE__ */ jsxDEV33(BackButton3, {}, undefined, false, undefined, this)
21558
21544
  }, undefined, false, undefined, this),
21559
21545
  /* @__PURE__ */ jsxDEV33(Layouts3.Content, {
21560
- children: /* @__PURE__ */ jsxDEV33(Box11, {
21546
+ children: /* @__PURE__ */ jsxDEV33(Box10, {
21561
21547
  padding: 8,
21562
21548
  children: /* @__PURE__ */ jsxDEV33(ApiErrorAlert_default, {
21563
21549
  message: error,
21564
21550
  title: "访客记录加载失败",
21565
- suggestion: "请检查网络连接或联系管理员"
21551
+ suggestion: "请检查网络连接或联系管理员",
21552
+ type: "error"
21566
21553
  }, undefined, false, undefined, this)
21567
21554
  }, undefined, false, undefined, this)
21568
21555
  }, undefined, false, undefined, this)
@@ -21581,7 +21568,7 @@ var Visitor = () => {
21581
21568
  navigationAction: /* @__PURE__ */ jsxDEV33(BackButton3, {}, undefined, false, undefined, this)
21582
21569
  }, undefined, false, undefined, this),
21583
21570
  /* @__PURE__ */ jsxDEV33(Layouts3.Content, {
21584
- children: /* @__PURE__ */ jsxDEV33(Box11, {
21571
+ children: /* @__PURE__ */ jsxDEV33(Box10, {
21585
21572
  background: "neutral0",
21586
21573
  shadow: "filterShadow",
21587
21574
  hasRadius: true,
@@ -21608,7 +21595,7 @@ var Visitor = () => {
21608
21595
  navigationAction: /* @__PURE__ */ jsxDEV33(BackButton3, {}, undefined, false, undefined, this)
21609
21596
  }, undefined, false, undefined, this),
21610
21597
  /* @__PURE__ */ jsxDEV33(Layouts3.Content, {
21611
- children: /* @__PURE__ */ jsxDEV33(Box11, {
21598
+ children: /* @__PURE__ */ jsxDEV33(Box10, {
21612
21599
  background: "neutral0",
21613
21600
  padding: 6,
21614
21601
  shadow: "filterShadow",
@@ -21634,7 +21621,7 @@ var Visitor = () => {
21634
21621
  }, undefined, false, undefined, this)
21635
21622
  ]
21636
21623
  }, undefined, true, undefined, this),
21637
- /* @__PURE__ */ jsxDEV33(Box11, {
21624
+ /* @__PURE__ */ jsxDEV33(Box10, {
21638
21625
  paddingTop: 6,
21639
21626
  children: isLoading ? /* @__PURE__ */ jsxDEV33(Flex11, {
21640
21627
  justifyContent: "center",
@@ -21678,7 +21665,7 @@ __export(exports_App, {
21678
21665
  default: () => App_default
21679
21666
  });
21680
21667
  import { useFetchClient as useFetchClient8 } from "@strapi/admin/strapi-admin";
21681
- import { Box as Box12, Divider, Flex as Flex12, Typography as Typography13 } from "@strapi/design-system";
21668
+ import { Box as Box11, Divider, Flex as Flex12, Typography as Typography13 } from "@strapi/design-system";
21682
21669
  import React13 from "react";
21683
21670
  import { Navigate, NavLink, Route, Routes } from "react-router-dom";
21684
21671
  import styled15 from "styled-components";
@@ -21686,7 +21673,7 @@ import { jsxDEV as jsxDEV34 } from "react/jsx-dev-runtime";
21686
21673
  var LayoutContainer, Sidebar, MainContent, StyledNavLink, SidebarNav = () => {
21687
21674
  return /* @__PURE__ */ jsxDEV34(Sidebar, {
21688
21675
  children: [
21689
- /* @__PURE__ */ jsxDEV34(Box12, {
21676
+ /* @__PURE__ */ jsxDEV34(Box11, {
21690
21677
  height: "5.6rem",
21691
21678
  display: "flex",
21692
21679
  style: { alignItems: "center" },
@@ -21698,7 +21685,7 @@ var LayoutContainer, Sidebar, MainContent, StyledNavLink, SidebarNav = () => {
21698
21685
  }, undefined, false, undefined, this)
21699
21686
  }, undefined, false, undefined, this),
21700
21687
  /* @__PURE__ */ jsxDEV34(Divider, {}, undefined, false, undefined, this),
21701
- /* @__PURE__ */ jsxDEV34(Box12, {
21688
+ /* @__PURE__ */ jsxDEV34(Box11, {
21702
21689
  style: { padding: "8px 3px" },
21703
21690
  children: [
21704
21691
  /* @__PURE__ */ jsxDEV34(StyledNavLink, {
@@ -21729,22 +21716,18 @@ var LayoutContainer, Sidebar, MainContent, StyledNavLink, SidebarNav = () => {
21729
21716
  const [isConnected, setIsConnected] = React13.useState(null);
21730
21717
  const [checking, setChecking] = React13.useState(true);
21731
21718
  React13.useEffect(() => {
21732
- const checkConnection = async () => {
21733
- try {
21734
- const response = await client.get("/website/hello");
21735
- if (response?.data?.message) {
21736
- setIsConnected(true);
21737
- } else {
21738
- setIsConnected(false);
21739
- }
21740
- } catch (error) {
21741
- console.error("Network check failed:", error);
21719
+ client.get("/website/check").then((response) => {
21720
+ if (response?.data?.message) {
21721
+ setIsConnected(true);
21722
+ } else {
21742
21723
  setIsConnected(false);
21743
- } finally {
21744
- setChecking(false);
21745
21724
  }
21746
- };
21747
- checkConnection();
21725
+ }).catch((error) => {
21726
+ console.error("Network check failed:", error);
21727
+ setIsConnected(false);
21728
+ }).finally(() => {
21729
+ setChecking(false);
21730
+ });
21748
21731
  }, [client]);
21749
21732
  if (checking) {
21750
21733
  return /* @__PURE__ */ jsxDEV34(Flex12, {
@@ -21761,23 +21744,21 @@ var LayoutContainer, Sidebar, MainContent, StyledNavLink, SidebarNav = () => {
21761
21744
  return /* @__PURE__ */ jsxDEV34(Flex12, {
21762
21745
  justifyContent: "center",
21763
21746
  alignItems: "center",
21747
+ direction: "column",
21764
21748
  height: "100vh",
21765
- children: /* @__PURE__ */ jsxDEV34(Box12, {
21766
- textAlign: "center",
21767
- children: [
21768
- /* @__PURE__ */ jsxDEV34(Typography13, {
21769
- variant: "alpha",
21770
- marginBottom: "1rem",
21771
- children: "网站信息未正确配置"
21772
- }, undefined, false, undefined, this),
21773
- /* @__PURE__ */ jsxDEV34(Typography13, {
21774
- variant: "omega",
21775
- textColor: "neutral600",
21776
- children: "无法连接到网站服务,请检查网站配置"
21777
- }, undefined, false, undefined, this)
21778
- ]
21779
- }, undefined, true, undefined, this)
21780
- }, undefined, false, undefined, this);
21749
+ children: [
21750
+ /* @__PURE__ */ jsxDEV34(Typography13, {
21751
+ variant: "alpha",
21752
+ marginBottom: "1rem",
21753
+ children: "网站信息未正确配置"
21754
+ }, undefined, false, undefined, this),
21755
+ /* @__PURE__ */ jsxDEV34(Typography13, {
21756
+ variant: "omega",
21757
+ textColor: "neutral600",
21758
+ children: "无法连接到网站服务,请检查网站配置"
21759
+ }, undefined, false, undefined, this)
21760
+ ]
21761
+ }, undefined, true, undefined, this);
21781
21762
  }
21782
21763
  return /* @__PURE__ */ jsxDEV34(LayoutContainer, {
21783
21764
  children: [
@@ -21823,7 +21804,7 @@ var init_App = __esm(() => {
21823
21804
  height: 100vh;
21824
21805
  overflow: hidden;
21825
21806
  `;
21826
- Sidebar = styled15(Box12)`
21807
+ Sidebar = styled15(Box11)`
21827
21808
  height: 100%;
21828
21809
  width: 240px;
21829
21810
  background-color: ${({ theme }) => theme.colors.neutral0};
@@ -21831,7 +21812,7 @@ var init_App = __esm(() => {
21831
21812
  overflow-y: auto;
21832
21813
  flex-shrink: 0;
21833
21814
  `;
21834
- MainContent = styled15(Box12)`
21815
+ MainContent = styled15(Box11)`
21835
21816
  height: 100%;
21836
21817
  flex: 1;
21837
21818
  overflow-y: auto;
@@ -21869,9 +21850,106 @@ var init_App = __esm(() => {
21869
21850
  App_default = App;
21870
21851
  });
21871
21852
 
21853
+ // admin/src/boot/handle-missing-translations.ts
21854
+ function extractTranslationInfo(logMessage) {
21855
+ const regex = /Missing message: "([^"]+)"[^,]+, using default message \(([^)]+)\)/;
21856
+ const match = logMessage.match(regex);
21857
+ if (match) {
21858
+ return {
21859
+ messageId: match[1],
21860
+ defaultMessage: match[2]
21861
+ };
21862
+ }
21863
+ return null;
21864
+ }
21865
+ var missTranslations = {};
21866
+ var handleMissingTranslations = (message) => {
21867
+ const info = extractTranslationInfo(message);
21868
+ if (info?.messageId)
21869
+ missTranslations[info.messageId] = info.defaultMessage;
21870
+ console.log(JSON.stringify(missTranslations));
21871
+ };
21872
+ var originalError = console.error;
21873
+ var originalWarn = () => {};
21874
+ console.warn = (..._args) => {
21875
+ originalWarn();
21876
+ };
21877
+ console.error = (error) => {
21878
+ try {
21879
+ if (error?.message?.includes("MISSING_TRANSLATION")) {
21880
+ handleMissingTranslations(error.message);
21881
+ } else {
21882
+ originalError(error);
21883
+ }
21884
+ } catch (error2) {
21885
+ originalError(error2);
21886
+ }
21887
+ };
21888
+
21889
+ // admin/src/boot/remove-links.ts
21890
+ function waitForLi(href, callback) {
21891
+ const findLi = () => {
21892
+ const anchor = document.querySelector(`li a[href="${href}"]`);
21893
+ if (anchor) {
21894
+ const li = anchor.closest("li");
21895
+ if (li)
21896
+ return li;
21897
+ }
21898
+ return null;
21899
+ };
21900
+ setInterval(() => {
21901
+ const initial = findLi();
21902
+ if (initial) {
21903
+ callback(initial);
21904
+ return;
21905
+ }
21906
+ });
21907
+ }
21908
+ function waitForDD(href, callback) {
21909
+ const findDD = () => {
21910
+ const anchor = document.querySelector(`div a[href="${href}"]`);
21911
+ if (anchor) {
21912
+ const dd = anchor.closest("div");
21913
+ if (dd)
21914
+ return dd;
21915
+ }
21916
+ return null;
21917
+ };
21918
+ setInterval(() => {
21919
+ const initial = findDD();
21920
+ if (initial) {
21921
+ callback(initial);
21922
+ return;
21923
+ }
21924
+ });
21925
+ }
21926
+ var removeLinks = () => {
21927
+ const hrefs = [
21928
+ "/admin/settings/purchase-content-history",
21929
+ "/admin/settings/plugins/purchase-content-releases",
21930
+ "/admin/settings/purchase-review-workflows",
21931
+ "/admin/settings/purchase-single-sign-on",
21932
+ "/admin/settings/purchase-audit-logs"
21933
+ ];
21934
+ hrefs.forEach((href) => {
21935
+ waitForLi(href, (li) => {
21936
+ const parent = li.parentNode;
21937
+ parent.removeChild(li);
21938
+ });
21939
+ });
21940
+ const ddHrefs = ["https://strapi.io/pricing-self-hosted"];
21941
+ ddHrefs.forEach((href) => {
21942
+ waitForDD(href, (dd) => {
21943
+ const parent = dd.parentNode;
21944
+ parent.removeChild(dd);
21945
+ });
21946
+ });
21947
+ };
21948
+
21872
21949
  // admin/src/bootstrap.ts
21873
21950
  var bootstrap = (_app) => {
21874
21951
  console.log("website admin plugin: bootstrap");
21952
+ removeLinks();
21875
21953
  };
21876
21954
  var bootstrap_default = bootstrap;
21877
21955
 
@@ -51089,7 +51167,7 @@ import { ChartPie } from "@strapi/icons";
51089
51167
  // admin/src/widgets/WelcomeWidget.tsx
51090
51168
  init_DashboardStats();
51091
51169
  import {
51092
- Box as Box8,
51170
+ Box as Box7,
51093
51171
  Button as Button5,
51094
51172
  Flex as Flex8,
51095
51173
  LinkButton,
@@ -51115,13 +51193,13 @@ var WelcomeWidget = () => {
51115
51193
  setRefresh(false);
51116
51194
  }
51117
51195
  };
51118
- return /* @__PURE__ */ jsxDEV29(Box8, {
51196
+ return /* @__PURE__ */ jsxDEV29(Box7, {
51119
51197
  padding: 4,
51120
51198
  children: /* @__PURE__ */ jsxDEV29(Flex8, {
51121
51199
  direction: "column",
51122
51200
  gap: 4,
51123
51201
  children: [
51124
- /* @__PURE__ */ jsxDEV29(Box8, {
51202
+ /* @__PURE__ */ jsxDEV29(Box7, {
51125
51203
  background: "neutral0",
51126
51204
  hasRadius: true,
51127
51205
  width: "100%",
@@ -51161,7 +51239,7 @@ var WelcomeWidget = () => {
51161
51239
  }, undefined, true, undefined, this)
51162
51240
  ]
51163
51241
  }, undefined, true, undefined, this),
51164
- /* @__PURE__ */ jsxDEV29(Box8, {
51242
+ /* @__PURE__ */ jsxDEV29(Box7, {
51165
51243
  background: "neutral0",
51166
51244
  hasRadius: true,
51167
51245
  width: "100%",
@@ -625,6 +625,13 @@ var visitors_default = visitors;
625
625
  var hello = async () => {
626
626
  return { message: "hello world" };
627
627
  };
628
+ var check = async (ctx) => {
629
+ try {
630
+ return await fetchWebsite("/api/site/hello");
631
+ } catch (error) {
632
+ return handleError(ctx, error, "Failed to refresh website cache");
633
+ }
634
+ };
628
635
  var refresh = async (ctx) => {
629
636
  try {
630
637
  return await fetchWebsite("/api/site/refresh");
@@ -641,6 +648,7 @@ var dashboard = async (ctx) => {
641
648
  };
642
649
  var website = {
643
650
  hello,
651
+ check,
644
652
  refresh,
645
653
  dashboard
646
654
  };
@@ -875,6 +883,13 @@ var routes2 = {
875
883
  config: { auth: false },
876
884
  info: {}
877
885
  },
886
+ {
887
+ method: "GET",
888
+ path: "/check",
889
+ handler: "website.check",
890
+ config: {},
891
+ info: {}
892
+ },
878
893
  {
879
894
  method: "GET",
880
895
  path: "/refresh",
@@ -590,6 +590,13 @@ var visitors_default = visitors;
590
590
  var hello = async () => {
591
591
  return { message: "hello world" };
592
592
  };
593
+ var check = async (ctx) => {
594
+ try {
595
+ return await fetchWebsite("/api/site/hello");
596
+ } catch (error) {
597
+ return handleError(ctx, error, "Failed to refresh website cache");
598
+ }
599
+ };
593
600
  var refresh = async (ctx) => {
594
601
  try {
595
602
  return await fetchWebsite("/api/site/refresh");
@@ -606,6 +613,7 @@ var dashboard = async (ctx) => {
606
613
  };
607
614
  var website = {
608
615
  hello,
616
+ check,
609
617
  refresh,
610
618
  dashboard
611
619
  };
@@ -840,6 +848,13 @@ var routes2 = {
840
848
  config: { auth: false },
841
849
  info: {}
842
850
  },
851
+ {
852
+ method: "GET",
853
+ path: "/check",
854
+ handler: "website.check",
855
+ config: {},
856
+ info: {}
857
+ },
843
858
  {
844
859
  method: "GET",
845
860
  path: "/refresh",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekron/strapi",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "极客领航网站管理插件",
5
5
  "type": "commonjs",
6
6
  "author": "Geekron",