@dovetail-v2/refine 0.0.29 → 0.0.30

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.
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntimeExports } from "./index-3716ce7b.js";
1
+ import { j as jsxRuntimeExports } from "./index-d02782c8.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "i18next";
@@ -337,7 +337,7 @@ const dovetail$1 = {
337
337
  edit_resource: edit_resource$1,
338
338
  status: status$1
339
339
  };
340
- const D2LocalesEN = {
340
+ const EN = {
341
341
  dovetail: dovetail$1
342
342
  };
343
343
  const copy = "复制";
@@ -519,14 +519,13 @@ const dovetail = {
519
519
  ingress_rule_type,
520
520
  port
521
521
  };
522
- const D2LocalesZH = {
522
+ const ZH = {
523
523
  dovetail
524
524
  };
525
- const D2Locales = {
526
- "en-US": D2LocalesEN,
527
- "zh-CN": D2LocalesZH
525
+ const resources = {
526
+ "en-US": EN,
527
+ "zh-CN": ZH
528
528
  };
529
- const resources = D2Locales;
530
529
  i18n.use(initReactI18next).init({
531
530
  supportedLngs: ["en-US", "zh-CN"],
532
531
  resources,
@@ -536,11 +535,6 @@ i18n.use(initReactI18next).init({
536
535
  lng: "zh-CN",
537
536
  nsSeparator: "."
538
537
  });
539
- const useD2Translation = () => {
540
- return useTranslation(void 0, {
541
- i18n
542
- });
543
- };
544
538
  var jsxRuntime = { exports: {} };
545
539
  var reactJsxRuntime_production_min = {};
546
540
  /** @license React v16.14.0
@@ -7093,7 +7087,7 @@ const useEagleForm = ({
7093
7087
  var _a, _b, _c;
7094
7088
  const editor = useRef(null);
7095
7089
  const isFoldRef = useRef(false);
7096
- const { t } = useD2Translation();
7090
+ const { t } = useTranslation();
7097
7091
  const [enableEditor, setEnableEditor] = useState(false);
7098
7092
  const [isYamlValid, setIsYamlValid] = useState(true);
7099
7093
  const [isSchemaValid, setIsSchemaValid] = useState(true);
@@ -7266,7 +7260,7 @@ const useDeleteModal = (resource) => {
7266
7260
  const [visible, setVisible] = useState(false);
7267
7261
  const navigation = useNavigation();
7268
7262
  const [id, setId] = useState("");
7269
- const { t } = useD2Translation();
7263
+ const { t } = useTranslation();
7270
7264
  const modalProps = {
7271
7265
  title: t("dovetail.delete"),
7272
7266
  okText: t("dovetail.delete"),
@@ -7532,7 +7526,7 @@ const WidgetErrorContent$1 = (props) => {
7532
7526
  const kit = useContext(kitContext);
7533
7527
  const {
7534
7528
  t
7535
- } = useD2Translation();
7529
+ } = useTranslation();
7536
7530
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
7537
7531
  className: ErrorWrapper$1,
7538
7532
  style: props.style,
@@ -7875,7 +7869,7 @@ const Time = (props) => {
7875
7869
  };
7876
7870
  const ConditionsTable = ({ conditions = [] }) => {
7877
7871
  const kit = useUIKit();
7878
- const { t } = useD2Translation();
7872
+ const { t } = useTranslation();
7879
7873
  const conditionsWithId = addId(conditions, "type");
7880
7874
  const columns = [
7881
7875
  {
@@ -8061,7 +8055,7 @@ function Table(props) {
8061
8055
  const kit = useUIKit();
8062
8056
  const {
8063
8057
  t
8064
- } = useD2Translation();
8058
+ } = useTranslation();
8065
8059
  const {
8066
8060
  loading,
8067
8061
  error,
@@ -9778,7 +9772,7 @@ const WidgetErrorContent = (props) => {
9778
9772
  const kit = useContext(kitContext);
9779
9773
  const {
9780
9774
  t
9781
- } = useD2Translation();
9775
+ } = useTranslation();
9782
9776
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorWrapper, {
9783
9777
  className: props.className,
9784
9778
  style: props.style,
@@ -9830,7 +9824,7 @@ function FormLayout(props) {
9830
9824
  } = useResource();
9831
9825
  const {
9832
9826
  t
9833
- } = useD2Translation();
9827
+ } = useTranslation();
9834
9828
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
9835
9829
  className: WrapperStyle$3,
9836
9830
  children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
@@ -9864,7 +9858,7 @@ const ErrorMsgStyle = "eh2qjnl";
9864
9858
  const ErrorWrapperStyle = "e19q2bnp";
9865
9859
  const YamlEditorStyle = "y16u5v3w";
9866
9860
  const MonacoYamlEditor$2 = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$1));
9867
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-37f2db86.js"));
9861
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-7505595f.js"));
9868
9862
  const YamlEditorComponent = forwardRef(
9869
9863
  function YamlEditorComponent2(props, ref) {
9870
9864
  const {
@@ -9880,7 +9874,7 @@ const YamlEditorComponent = forwardRef(
9880
9874
  className
9881
9875
  } = props;
9882
9876
  const kit = useUIKit();
9883
- const { t } = useD2Translation();
9877
+ const { t } = useTranslation();
9884
9878
  const [isCollapsed, setIsCollapsed] = useState(
9885
9879
  collapsable ? isDefaultCollapsed : false
9886
9880
  );
@@ -10402,7 +10396,7 @@ function YamlForm(props) {
10402
10396
  const {
10403
10397
  t,
10404
10398
  i18n: i18n2
10405
- } = useD2Translation();
10399
+ } = useTranslation();
10406
10400
  const responseErrors = errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [];
10407
10401
  const FormWrapper = isShowLayout ? FormLayout : React__default.Fragment;
10408
10402
  const schema = useMemo(() => {
@@ -10467,7 +10461,7 @@ function FormModal(props) {
10467
10461
  } = props;
10468
10462
  const {
10469
10463
  i18n: i18n2
10470
- } = useD2Translation();
10464
+ } = useTranslation();
10471
10465
  const {
10472
10466
  resource
10473
10467
  } = useResource();
@@ -10589,14 +10583,14 @@ function useOpenForm(options) {
10589
10583
  }
10590
10584
  function CreateButton() {
10591
10585
  const kit = useUIKit();
10592
- const { t } = useD2Translation();
10586
+ const { t } = useTranslation();
10593
10587
  const openForm = useOpenForm();
10594
10588
  return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: openForm, children: t("dovetail.create") });
10595
10589
  }
10596
10590
  const useDeleteManyModal = (resource, ids) => {
10597
10591
  const { mutate } = useDeleteMany();
10598
10592
  const [visible, setVisible] = useState(false);
10599
- const { t } = useD2Translation();
10593
+ const { t } = useTranslation();
10600
10594
  const modalProps = {
10601
10595
  title: t("dovetail.delete"),
10602
10596
  okText: t("dovetail.delete"),
@@ -10624,7 +10618,7 @@ const useDeleteManyModal = (resource, ids) => {
10624
10618
  const DeleteManyButton = (props) => {
10625
10619
  const { resource } = useResource();
10626
10620
  const kit = useUIKit();
10627
- const { t } = useD2Translation();
10621
+ const { t } = useTranslation();
10628
10622
  const { modalProps, visible, setVisible } = useDeleteManyModal(
10629
10623
  (resource == null ? void 0 : resource.name) || "",
10630
10624
  props.ids
@@ -10673,7 +10667,7 @@ const CronjobJobsTable = ({
10673
10667
  }) => {
10674
10668
  const {
10675
10669
  i18n: i18n2
10676
- } = useD2Translation();
10670
+ } = useTranslation();
10677
10671
  const kit = useUIKit();
10678
10672
  const [selectedKeys, setSelectedKeys] = useState([]);
10679
10673
  const [currentPage, setCurrentPage] = useState(1);
@@ -10715,7 +10709,7 @@ const CronjobJobsTable = ({
10715
10709
  });
10716
10710
  };
10717
10711
  const EventsTable = ({}) => {
10718
- const { i18n: i18n2 } = useD2Translation();
10712
+ const { i18n: i18n2 } = useTranslation();
10719
10713
  const [currentPage, setCurrentPage] = useState(1);
10720
10714
  const { data: data2, isLoading } = useList({
10721
10715
  resource: "events",
@@ -10791,7 +10785,7 @@ const ImageNames = ({
10791
10785
  const kit = useUIKit();
10792
10786
  const {
10793
10787
  t
10794
- } = useD2Translation();
10788
+ } = useTranslation();
10795
10789
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
10796
10790
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
10797
10791
  children: value[0]
@@ -10830,7 +10824,7 @@ const ResourceLink = (props) => {
10830
10824
  };
10831
10825
  const IngressRulesTable = ({ ingress }) => {
10832
10826
  const kit = useUIKit();
10833
- const { t } = useD2Translation();
10827
+ const { t } = useTranslation();
10834
10828
  const rows = useMemo(() => {
10835
10829
  return addId(ingress.flattenedRules, "fullPath");
10836
10830
  }, [ingress.flattenedRules]);
@@ -10937,7 +10931,7 @@ const WorkloadPodsTable = ({
10937
10931
  }) => {
10938
10932
  const {
10939
10933
  i18n: i18n2
10940
- } = useD2Translation();
10934
+ } = useTranslation();
10941
10935
  const kit = useUIKit();
10942
10936
  const [selectedKeys, setSelectedKeys] = useState([]);
10943
10937
  const [currentPage, setCurrentPage] = useState(1);
@@ -10983,7 +10977,7 @@ const WorkloadPodsTable = ({
10983
10977
  };
10984
10978
  function useSubmitForm(options) {
10985
10979
  const { formRef, onSubmitSuccess } = options;
10986
- const { i18n: i18n2 } = useD2Translation();
10980
+ const { i18n: i18n2 } = useTranslation();
10987
10981
  const [submitting, setSubmitting] = useState(false);
10988
10982
  const [errorMsgs, setErrorMsgs] = useState([]);
10989
10983
  const reset = useCallback(() => {
@@ -11030,7 +11024,7 @@ function EditFieldModal(props) {
11030
11024
  const kit = useUIKit();
11031
11025
  const {
11032
11026
  i18n: i18n2
11033
- } = useD2Translation();
11027
+ } = useTranslation();
11034
11028
  const {
11035
11029
  submitting,
11036
11030
  errorMsgs,
@@ -11067,7 +11061,7 @@ function EditField(props) {
11067
11061
  const kit = useUIKit();
11068
11062
  const {
11069
11063
  i18n: i18n2
11070
- } = useD2Translation();
11064
+ } = useTranslation();
11071
11065
  return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
11072
11066
  className: EditButtonStyle,
11073
11067
  type: "link",
@@ -11351,7 +11345,7 @@ function K8sDropdown(props) {
11351
11345
  (resource == null ? void 0 : resource.name) || ""
11352
11346
  );
11353
11347
  const download2 = useDownloadYAML();
11354
- const { t } = useD2Translation();
11348
+ const { t } = useTranslation();
11355
11349
  const openForm = useOpenForm({ id: record.id });
11356
11350
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11357
11351
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -11414,7 +11408,7 @@ function KeyValueData(props) {
11414
11408
  const kit = useUIKit();
11415
11409
  const {
11416
11410
  t
11417
- } = useD2Translation();
11411
+ } = useTranslation();
11418
11412
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
11419
11413
  className: WrapperStyle$1,
11420
11414
  children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
@@ -11610,7 +11604,7 @@ var WorkloadState = /* @__PURE__ */ ((WorkloadState2) => {
11610
11604
  })(WorkloadState || {});
11611
11605
  const StateTag = ({ state: state2 = WorkloadState.UPDATEING, className }) => {
11612
11606
  const kit = useUIKit();
11613
- const { t } = useD2Translation();
11607
+ const { t } = useTranslation();
11614
11608
  const colorMap = {
11615
11609
  updating: "blue",
11616
11610
  ready: "green",
@@ -11689,7 +11683,7 @@ const ShowContent = (props) => {
11689
11683
  });
11690
11684
  const {
11691
11685
  t
11692
- } = useD2Translation();
11686
+ } = useTranslation();
11693
11687
  const {
11694
11688
  fold: fold2
11695
11689
  } = useK8sYamlEditor();
@@ -11873,7 +11867,7 @@ const PodContainersTable = ({
11873
11867
  initContainerStatuses
11874
11868
  }) => {
11875
11869
  const kit = useUIKit();
11876
- const { i18n: i18n2 } = useD2Translation();
11870
+ const { i18n: i18n2 } = useTranslation();
11877
11871
  const columns = useMemo(
11878
11872
  () => [
11879
11873
  {
@@ -11967,7 +11961,7 @@ function WorkloadDropdown(props) {
11967
11961
  const kit = useUIKit();
11968
11962
  const { resource } = useResource();
11969
11963
  const { mutate } = useUpdate();
11970
- const { t } = useD2Translation();
11964
+ const { t } = useTranslation();
11971
11965
  return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
11972
11966
  kit.menu.Item,
11973
11967
  {
@@ -12015,7 +12009,7 @@ function ListPage(props) {
12015
12009
  }
12016
12010
  function ResourceList(props) {
12017
12011
  const { formatter, name: name2, columns, Dropdown } = props;
12018
- const { i18n: i18n2 } = useD2Translation();
12012
+ const { i18n: i18n2 } = useTranslation();
12019
12013
  const { tableProps, selectedKeys } = useEagleTable({
12020
12014
  useTableParams: {},
12021
12015
  columns: [NameColumnRenderer(i18n2), ...columns],
@@ -12088,7 +12082,7 @@ function CronJobDropdown(props) {
12088
12082
  const kit = useUIKit();
12089
12083
  const { resource } = useResource();
12090
12084
  const { mutate } = useUpdate();
12091
- const { t } = useD2Translation();
12085
+ const { t } = useTranslation();
12092
12086
  const suspended2 = Boolean(spec == null ? void 0 : spec.suspend);
12093
12087
  return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12094
12088
  kit.menu.Item,
@@ -12243,7 +12237,7 @@ const DeleteButton = () => {
12243
12237
  const { resource } = useResource();
12244
12238
  const { id } = useParsed();
12245
12239
  const kit = useUIKit();
12246
- const { t } = useD2Translation();
12240
+ const { t } = useTranslation();
12247
12241
  const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
12248
12242
  (resource == null ? void 0 : resource.name) || ""
12249
12243
  );
@@ -12417,7 +12411,7 @@ const useNamespacesFilter = () => {
12417
12411
  };
12418
12412
  const NamespacesFilter = () => {
12419
12413
  const kit = useUIKit();
12420
- const { t } = useD2Translation();
12414
+ const { t } = useTranslation();
12421
12415
  const { data: data2 } = useList({
12422
12416
  resource: "namespaces",
12423
12417
  meta: {
@@ -18153,7 +18147,7 @@ const PodLog = ({
18153
18147
  const apiUrl = dataProvider2()["getApiUrl"]();
18154
18148
  const {
18155
18149
  t
18156
- } = useD2Translation();
18150
+ } = useTranslation();
18157
18151
  useEffect(() => {
18158
18152
  if (!paused && logs.length > 0) {
18159
18153
  setCurrentItemCount(logs.length);
@@ -18305,7 +18299,7 @@ const NetworkPolicyRulesTable = ({ ingressOrEgress }) => {
18305
18299
  };
18306
18300
  const IngressRuleTable = ({ peers }) => {
18307
18301
  const kit = useUIKit();
18308
- const { t } = useD2Translation();
18302
+ const { t } = useTranslation();
18309
18303
  const rows = useMemo(() => {
18310
18304
  const rows2 = (peers == null ? void 0 : peers.map((p) => {
18311
18305
  return Object.keys(p).map((key) => {
@@ -19329,124 +19323,123 @@ const relationPlugin = new RelationPlugin();
19329
19323
  const ProviderPlugins = [relationPlugin, modelPlugin];
19330
19324
  const dovetailRefineI18n = i18n;
19331
19325
  export {
19332
- YamlEditorComponent as $,
19326
+ DeleteButton as $,
19333
19327
  AgeColumnRenderer as A,
19334
19328
  Breadcrumb as B,
19335
19329
  CommonSorter as C,
19336
- D2Locales as D,
19337
- PodContainersTable as E,
19338
- WorkloadDropdown as F,
19339
- CreateButton as G,
19340
- ImageNames as H,
19330
+ DurationColumnRenderer as D,
19331
+ WorkloadDropdown as E,
19332
+ CreateButton as F,
19333
+ ImageNames as G,
19334
+ ResourceList as H,
19341
19335
  IngressRulesColumnRenderer as I,
19342
- ResourceList as J,
19336
+ ResourceShow as J,
19343
19337
  KeyValueListWidget as K,
19344
- ResourceShow as L,
19338
+ ResourceForm as L,
19345
19339
  MetadataForm as M,
19346
19340
  NameColumnRenderer as N,
19347
- ResourceForm as O,
19341
+ ResourceCRUD as O,
19348
19342
  PodWorkloadColumnRenderer as P,
19349
- ResourceCRUD as Q,
19343
+ WorkloadPodsTable as Q,
19350
19344
  ReplicasColumnRenderer as R,
19351
19345
  StateDisplayColumnRenderer as S,
19352
- WorkloadPodsTable as T,
19353
- CronJobDropdown as U,
19354
- ResourceUsageBar as V,
19346
+ CronJobDropdown as T,
19347
+ ResourceUsageBar as U,
19348
+ WorkloadReplicas as V,
19355
19349
  WorkloadImageColumnRenderer as W,
19356
- WorkloadReplicas as X,
19357
- CronjobJobsTable as Y,
19358
- KeyValue as Z,
19359
- Separator as _,
19350
+ CronjobJobsTable as X,
19351
+ KeyValue as Y,
19352
+ Separator as Z,
19353
+ YamlEditorComponent as _,
19360
19354
  useDeleteModal as a,
19361
- DaemonSetModel as a$,
19362
- DeleteButton as a0,
19363
- Layout as a1,
19364
- ImageField as a2,
19365
- ReplicaField as a3,
19366
- ConditionsField as a4,
19367
- PodsField as a5,
19368
- JobsField as a6,
19369
- DataField as a7,
19370
- SecretDataField as a8,
19371
- StartTimeField as a9,
19372
- CRONJOB_INIT_VALUE as aA,
19373
- DAEMONSET_INIT_VALUE as aB,
19374
- JOB_INIT_VALUE as aC,
19375
- STATEFULSET_INIT_VALUE as aD,
19376
- POD_INIT_VALUE as aE,
19377
- SERVICE_INIT_VALUE as aF,
19378
- INGRESS_INIT_VALUE as aG,
19379
- NETWORK_POLICY_INIT_VALUE as aH,
19380
- TIMESTAMP_LABEL as aI,
19381
- WorkloadState as aJ,
19382
- Dovetail as aK,
19383
- RESOURCE_GROUP as aL,
19384
- FormType as aM,
19385
- ComponentContext as aN,
19386
- GlobalStoreContext as aO,
19387
- ConfigsContext as aP,
19388
- IngressModel as aQ,
19389
- NetworkPolicyModel as aR,
19390
- JobModel as aS,
19391
- WorkloadModel as aT,
19392
- WorkloadBaseModel as aU,
19393
- PodModel as aV,
19394
- PodMetricsModel as aW,
19395
- ResourceModel as aX,
19396
- CronJobModel as aY,
19397
- EventModel as aZ,
19398
- DeploymentModel as a_,
19399
- ServiceTypeField as aa,
19400
- ClusterIpField as ab,
19401
- SessionAffinityField as ac,
19402
- ServicePodsField as ad,
19403
- IngressRulesTableTabField as ae,
19404
- EventsTableTabField as af,
19405
- ShowContent as ag,
19406
- SchemaStrategy as ah,
19407
- DeleteManyButton as ai,
19408
- ListPage as aj,
19409
- StateTag as ak,
19410
- DrawerShow as al,
19411
- Menu as am,
19412
- EditButton as an,
19413
- ReferenceLink as ao,
19414
- ResourceLink as ap,
19415
- NS_STORE_KEY as aq,
19416
- ALL_NS as ar,
19417
- useNamespacesFilter as as,
19418
- NamespacesFilter as at,
19419
- Tags as au,
19420
- PodLog as av,
19421
- FormModal as aw,
19422
- NetworkPolicyRulesTable as ax,
19423
- BASE_INIT_VALUE as ay,
19424
- DEPLOYMENT_INIT_VALUE as az,
19355
+ StatefulSetModel as a$,
19356
+ Layout as a0,
19357
+ ImageField as a1,
19358
+ ReplicaField as a2,
19359
+ ConditionsField as a3,
19360
+ PodsField as a4,
19361
+ JobsField as a5,
19362
+ DataField as a6,
19363
+ SecretDataField as a7,
19364
+ StartTimeField as a8,
19365
+ ServiceTypeField as a9,
19366
+ DAEMONSET_INIT_VALUE as aA,
19367
+ JOB_INIT_VALUE as aB,
19368
+ STATEFULSET_INIT_VALUE as aC,
19369
+ POD_INIT_VALUE as aD,
19370
+ SERVICE_INIT_VALUE as aE,
19371
+ INGRESS_INIT_VALUE as aF,
19372
+ NETWORK_POLICY_INIT_VALUE as aG,
19373
+ TIMESTAMP_LABEL as aH,
19374
+ WorkloadState as aI,
19375
+ Dovetail as aJ,
19376
+ RESOURCE_GROUP as aK,
19377
+ FormType as aL,
19378
+ ComponentContext as aM,
19379
+ GlobalStoreContext as aN,
19380
+ ConfigsContext as aO,
19381
+ IngressModel as aP,
19382
+ NetworkPolicyModel as aQ,
19383
+ JobModel as aR,
19384
+ WorkloadModel as aS,
19385
+ WorkloadBaseModel as aT,
19386
+ PodModel as aU,
19387
+ PodMetricsModel as aV,
19388
+ ResourceModel as aW,
19389
+ CronJobModel as aX,
19390
+ EventModel as aY,
19391
+ DeploymentModel as aZ,
19392
+ DaemonSetModel as a_,
19393
+ ClusterIpField as aa,
19394
+ SessionAffinityField as ab,
19395
+ ServicePodsField as ac,
19396
+ IngressRulesTableTabField as ad,
19397
+ EventsTableTabField as ae,
19398
+ ShowContent as af,
19399
+ SchemaStrategy as ag,
19400
+ DeleteManyButton as ah,
19401
+ ListPage as ai,
19402
+ StateTag as aj,
19403
+ DrawerShow as ak,
19404
+ Menu as al,
19405
+ EditButton as am,
19406
+ ReferenceLink as an,
19407
+ ResourceLink as ao,
19408
+ NS_STORE_KEY as ap,
19409
+ ALL_NS as aq,
19410
+ useNamespacesFilter as ar,
19411
+ NamespacesFilter as as,
19412
+ Tags as at,
19413
+ PodLog as au,
19414
+ FormModal as av,
19415
+ NetworkPolicyRulesTable as aw,
19416
+ BASE_INIT_VALUE as ax,
19417
+ DEPLOYMENT_INIT_VALUE as ay,
19418
+ CRONJOB_INIT_VALUE as az,
19425
19419
  NameSpaceColumnRenderer as b,
19426
- StatefulSetModel as b0,
19427
- ProviderPlugins as b1,
19420
+ ProviderPlugins as b0,
19428
19421
  WorkloadRestartsColumnRenderer as c,
19429
19422
  dovetailRefineI18n as d,
19430
19423
  NodeNameColumnRenderer as e,
19431
19424
  RestartCountColumnRenderer as f,
19432
19425
  CompletionsCountColumnRenderer as g,
19433
- DurationColumnRenderer as h,
19434
- ServiceTypeColumnRenderer as i,
19426
+ ServiceTypeColumnRenderer as h,
19427
+ IngressDefaultBackendColumnRenderer as i,
19435
19428
  jsxRuntimeExports as j,
19436
- IngressDefaultBackendColumnRenderer as k,
19437
- ColumnKeys as l,
19438
- useEagleTable as m,
19439
- useDownloadYAML as n,
19440
- useEdit as o,
19441
- useGlobalStore as p,
19442
- NameInputWidget as q,
19429
+ ColumnKeys as k,
19430
+ useEagleTable as l,
19431
+ useDownloadYAML as m,
19432
+ useEdit as n,
19433
+ useGlobalStore as o,
19434
+ NameInputWidget as p,
19435
+ dnsSubDomainRules as q,
19443
19436
  routerProvider as r,
19444
- dnsSubDomainRules as s,
19445
- rfc1123LabelRules as t,
19437
+ rfc1123LabelRules as s,
19438
+ rfc1035LabelRules as t,
19446
19439
  useSchema as u,
19447
- rfc1035LabelRules as v,
19448
- NamespaceSelectWidget as w,
19449
- namespaceRules as x,
19450
- PageShow as y,
19451
- ConditionsTable as z
19440
+ NamespaceSelectWidget as v,
19441
+ namespaceRules as w,
19442
+ PageShow as x,
19443
+ ConditionsTable as y,
19444
+ PodContainersTable as z
19452
19445
  };
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ar, A, ay, B, aA, ab, l, C, g, aN, a4, z, aP, G, U, aY, Y, D, aB, az, a$, a7, a0, ai, a_, aK, al, h, an, aZ, af, aw, aM, aO, aG, a2, H, k, aQ, I, ae, aC, aS, a6, Z, K, a1, aj, am, M, aH, aq, N, q, b, w, at, aR, ax, e, aE, y, E, av, aW, aV, P, a5, b1, aL, ao, a3, R, Q, O, ap, J, aX, L, V, f, aF, aD, ah, a8, _, ad, i, aa, ac, ag, a9, S, ak, b0, aI, au, aU, F, W, aT, T, X, c, aJ, $, s, d, x, v, t, r, a, n, m, o, p, as, u } from "./index-3716ce7b.js";
1
+ import { aq, A, ax, B, az, aa, k, C, g, aM, a3, y, aO, F, T, aX, X, aA, ay, a_, a6, $, ah, aZ, aJ, ak, D, am, aY, ae, av, aL, aN, aF, a1, G, i, aP, I, ad, aB, aR, a5, Y, K, a0, ai, al, M, aG, ap, N, p, b, v, as, aQ, aw, e, aD, x, z, au, aV, aU, P, a4, b0, aK, an, a2, R, O, L, ao, H, aW, J, U, f, aE, aC, ag, a7, Z, ac, h, a9, ab, af, a8, S, aj, a$, aH, at, aT, E, W, aS, Q, V, c, aI, _, q, d, w, t, s, r, a, m, l, n, o, ar, u } from "./index-d02782c8.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "js-yaml";
@@ -15,123 +15,122 @@ import "react-dom";
15
15
  import "antd";
16
16
  import "k8s-api-provider";
17
17
  export {
18
- ar as ALL_NS,
18
+ aq as ALL_NS,
19
19
  A as AgeColumnRenderer,
20
- ay as BASE_INIT_VALUE,
20
+ ax as BASE_INIT_VALUE,
21
21
  B as Breadcrumb,
22
- aA as CRONJOB_INIT_VALUE,
23
- ab as ClusterIpField,
24
- l as ColumnKeys,
22
+ az as CRONJOB_INIT_VALUE,
23
+ aa as ClusterIpField,
24
+ k as ColumnKeys,
25
25
  C as CommonSorter,
26
26
  g as CompletionsCountColumnRenderer,
27
- aN as ComponentContext,
28
- a4 as ConditionsField,
29
- z as ConditionsTable,
30
- aP as ConfigsContext,
31
- G as CreateButton,
32
- U as CronJobDropdown,
33
- aY as CronJobModel,
34
- Y as CronjobJobsTable,
35
- D as D2Locales,
36
- aB as DAEMONSET_INIT_VALUE,
37
- az as DEPLOYMENT_INIT_VALUE,
38
- a$ as DaemonSetModel,
39
- a7 as DataField,
40
- a0 as DeleteButton,
41
- ai as DeleteManyButton,
42
- a_ as DeploymentModel,
43
- aK as Dovetail,
44
- al as DrawerShow,
45
- h as DurationColumnRenderer,
46
- an as EditButton,
47
- aZ as EventModel,
48
- af as EventsTableTabField,
49
- aw as FormModal,
50
- aM as FormType,
51
- aO as GlobalStoreContext,
52
- aG as INGRESS_INIT_VALUE,
53
- a2 as ImageField,
54
- H as ImageNames,
55
- k as IngressDefaultBackendColumnRenderer,
56
- aQ as IngressModel,
27
+ aM as ComponentContext,
28
+ a3 as ConditionsField,
29
+ y as ConditionsTable,
30
+ aO as ConfigsContext,
31
+ F as CreateButton,
32
+ T as CronJobDropdown,
33
+ aX as CronJobModel,
34
+ X as CronjobJobsTable,
35
+ aA as DAEMONSET_INIT_VALUE,
36
+ ay as DEPLOYMENT_INIT_VALUE,
37
+ a_ as DaemonSetModel,
38
+ a6 as DataField,
39
+ $ as DeleteButton,
40
+ ah as DeleteManyButton,
41
+ aZ as DeploymentModel,
42
+ aJ as Dovetail,
43
+ ak as DrawerShow,
44
+ D as DurationColumnRenderer,
45
+ am as EditButton,
46
+ aY as EventModel,
47
+ ae as EventsTableTabField,
48
+ av as FormModal,
49
+ aL as FormType,
50
+ aN as GlobalStoreContext,
51
+ aF as INGRESS_INIT_VALUE,
52
+ a1 as ImageField,
53
+ G as ImageNames,
54
+ i as IngressDefaultBackendColumnRenderer,
55
+ aP as IngressModel,
57
56
  I as IngressRulesColumnRenderer,
58
- ae as IngressRulesTableTabField,
59
- aC as JOB_INIT_VALUE,
60
- aS as JobModel,
61
- a6 as JobsField,
62
- Z as KeyValue,
57
+ ad as IngressRulesTableTabField,
58
+ aB as JOB_INIT_VALUE,
59
+ aR as JobModel,
60
+ a5 as JobsField,
61
+ Y as KeyValue,
63
62
  K as KeyValueListWidget,
64
- a1 as Layout,
65
- aj as ListPage,
66
- am as Menu,
63
+ a0 as Layout,
64
+ ai as ListPage,
65
+ al as Menu,
67
66
  M as MetadataForm,
68
- aH as NETWORK_POLICY_INIT_VALUE,
69
- aq as NS_STORE_KEY,
67
+ aG as NETWORK_POLICY_INIT_VALUE,
68
+ ap as NS_STORE_KEY,
70
69
  N as NameColumnRenderer,
71
- q as NameInputWidget,
70
+ p as NameInputWidget,
72
71
  b as NameSpaceColumnRenderer,
73
- w as NamespaceSelectWidget,
74
- at as NamespacesFilter,
75
- aR as NetworkPolicyModel,
76
- ax as NetworkPolicyRulesTable,
72
+ v as NamespaceSelectWidget,
73
+ as as NamespacesFilter,
74
+ aQ as NetworkPolicyModel,
75
+ aw as NetworkPolicyRulesTable,
77
76
  e as NodeNameColumnRenderer,
78
- aE as POD_INIT_VALUE,
79
- y as PageShow,
80
- E as PodContainersTable,
81
- av as PodLog,
82
- aW as PodMetricsModel,
83
- aV as PodModel,
77
+ aD as POD_INIT_VALUE,
78
+ x as PageShow,
79
+ z as PodContainersTable,
80
+ au as PodLog,
81
+ aV as PodMetricsModel,
82
+ aU as PodModel,
84
83
  P as PodWorkloadColumnRenderer,
85
- a5 as PodsField,
86
- b1 as ProviderPlugins,
87
- aL as RESOURCE_GROUP,
88
- ao as ReferenceLink,
89
- a3 as ReplicaField,
84
+ a4 as PodsField,
85
+ b0 as ProviderPlugins,
86
+ aK as RESOURCE_GROUP,
87
+ an as ReferenceLink,
88
+ a2 as ReplicaField,
90
89
  R as ReplicasColumnRenderer,
91
- Q as ResourceCRUD,
92
- O as ResourceForm,
93
- ap as ResourceLink,
94
- J as ResourceList,
95
- aX as ResourceModel,
96
- L as ResourceShow,
97
- V as ResourceUsageBar,
90
+ O as ResourceCRUD,
91
+ L as ResourceForm,
92
+ ao as ResourceLink,
93
+ H as ResourceList,
94
+ aW as ResourceModel,
95
+ J as ResourceShow,
96
+ U as ResourceUsageBar,
98
97
  f as RestartCountColumnRenderer,
99
- aF as SERVICE_INIT_VALUE,
100
- aD as STATEFULSET_INIT_VALUE,
101
- ah as SchemaStrategy,
102
- a8 as SecretDataField,
103
- _ as Separator,
104
- ad as ServicePodsField,
105
- i as ServiceTypeColumnRenderer,
106
- aa as ServiceTypeField,
107
- ac as SessionAffinityField,
108
- ag as ShowContent,
109
- a9 as StartTimeField,
98
+ aE as SERVICE_INIT_VALUE,
99
+ aC as STATEFULSET_INIT_VALUE,
100
+ ag as SchemaStrategy,
101
+ a7 as SecretDataField,
102
+ Z as Separator,
103
+ ac as ServicePodsField,
104
+ h as ServiceTypeColumnRenderer,
105
+ a9 as ServiceTypeField,
106
+ ab as SessionAffinityField,
107
+ af as ShowContent,
108
+ a8 as StartTimeField,
110
109
  S as StateDisplayColumnRenderer,
111
- ak as StateTag,
112
- b0 as StatefulSetModel,
113
- aI as TIMESTAMP_LABEL,
114
- au as Tags,
115
- aU as WorkloadBaseModel,
116
- F as WorkloadDropdown,
110
+ aj as StateTag,
111
+ a$ as StatefulSetModel,
112
+ aH as TIMESTAMP_LABEL,
113
+ at as Tags,
114
+ aT as WorkloadBaseModel,
115
+ E as WorkloadDropdown,
117
116
  W as WorkloadImageColumnRenderer,
118
- aT as WorkloadModel,
119
- T as WorkloadPodsTable,
120
- X as WorkloadReplicas,
117
+ aS as WorkloadModel,
118
+ Q as WorkloadPodsTable,
119
+ V as WorkloadReplicas,
121
120
  c as WorkloadRestartsColumnRenderer,
122
- aJ as WorkloadState,
123
- $ as YamlEditorComponent,
124
- s as dnsSubDomainRules,
121
+ aI as WorkloadState,
122
+ _ as YamlEditorComponent,
123
+ q as dnsSubDomainRules,
125
124
  d as dovetailRefineI18n,
126
- x as namespaceRules,
127
- v as rfc1035LabelRules,
128
- t as rfc1123LabelRules,
125
+ w as namespaceRules,
126
+ t as rfc1035LabelRules,
127
+ s as rfc1123LabelRules,
129
128
  r as routerProvider,
130
129
  a as useDeleteModal,
131
- n as useDownloadYAML,
132
- m as useEagleTable,
133
- o as useEdit,
134
- p as useGlobalStore,
135
- as as useNamespacesFilter,
130
+ m as useDownloadYAML,
131
+ l as useEagleTable,
132
+ n as useEdit,
133
+ o as useGlobalStore,
134
+ ar as useNamespacesFilter,
136
135
  u as useSchema
137
136
  };
@@ -1,6 +1,6 @@
1
1
  (function(global2, factory) {
2
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("i18next"), require("react"), require("@refinedev/core"), require("qs"), require("react-router-dom"), require("@cloudtower/eagle"), require("js-yaml"), require("lodash-es"), require("sunflower-antd"), require("@cloudtower/icons-react"), require("monaco-editor"), require("monaco-yaml"), require("react-dom"), require("antd"), require("k8s-api-provider")) : typeof define === "function" && define.amd ? define(["exports", "i18next", "react", "@refinedev/core", "qs", "react-router-dom", "@cloudtower/eagle", "js-yaml", "lodash-es", "sunflower-antd", "@cloudtower/icons-react", "monaco-editor", "monaco-yaml", "react-dom", "antd", "k8s-api-provider"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.dovetail = {}, global2.i18n, global2.React, global2.core, global2.qs, global2.reactRouterDom, global2.eagle, global2.yaml, global2.lodashEs, global2.sunflowerAntd, global2.iconsReact, global2.monaco, global2.monacoYaml, global2.ReactDOM, global2.antd, global2.k8sApiProvider));
3
- })(this, function(exports2, i18n, React, core, qs, reactRouterDom, eagle, yaml, lodashEs, sunflowerAntd, iconsReact, monaco, monacoYaml, ReactDOM, antd, k8sApiProvider) {
2
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("i18next"), require("@refinedev/core"), require("qs"), require("react"), require("react-router-dom"), require("@cloudtower/eagle"), require("js-yaml"), require("lodash-es"), require("sunflower-antd"), require("@cloudtower/icons-react"), require("monaco-editor"), require("monaco-yaml"), require("react-dom"), require("antd"), require("k8s-api-provider")) : typeof define === "function" && define.amd ? define(["exports", "i18next", "@refinedev/core", "qs", "react", "react-router-dom", "@cloudtower/eagle", "js-yaml", "lodash-es", "sunflower-antd", "@cloudtower/icons-react", "monaco-editor", "monaco-yaml", "react-dom", "antd", "k8s-api-provider"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.dovetail = {}, global2.i18n, global2.core, global2.qs, global2.React, global2.reactRouterDom, global2.eagle, global2.yaml, global2.lodashEs, global2.sunflowerAntd, global2.iconsReact, global2.monaco, global2.monacoYaml, global2.ReactDOM, global2.antd, global2.k8sApiProvider));
3
+ })(this, function(exports2, i18n, core, qs, React, reactRouterDom, eagle, yaml, lodashEs, sunflowerAntd, iconsReact, monaco, monacoYaml, ReactDOM, antd, k8sApiProvider) {
4
4
  "use strict";var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
6
  var __publicField = (obj, key, value) => {
@@ -343,7 +343,7 @@ var __publicField = (obj, key, value) => {
343
343
  edit_resource: edit_resource$1,
344
344
  status: status$1
345
345
  };
346
- const D2LocalesEN = {
346
+ const EN = {
347
347
  dovetail: dovetail$1
348
348
  };
349
349
  const copy = "复制";
@@ -525,14 +525,13 @@ var __publicField = (obj, key, value) => {
525
525
  ingress_rule_type,
526
526
  port
527
527
  };
528
- const D2LocalesZH = {
528
+ const ZH = {
529
529
  dovetail
530
530
  };
531
- const D2Locales = {
532
- "en-US": D2LocalesEN,
533
- "zh-CN": D2LocalesZH
531
+ const resources = {
532
+ "en-US": EN,
533
+ "zh-CN": ZH
534
534
  };
535
- const resources = D2Locales;
536
535
  i18n.use(initReactI18next).init({
537
536
  supportedLngs: ["en-US", "zh-CN"],
538
537
  resources,
@@ -542,11 +541,6 @@ var __publicField = (obj, key, value) => {
542
541
  lng: "zh-CN",
543
542
  nsSeparator: "."
544
543
  });
545
- const useD2Translation = () => {
546
- return useTranslation(void 0, {
547
- i18n
548
- });
549
- };
550
544
  var jsxRuntime = { exports: {} };
551
545
  var reactJsxRuntime_production_min = {};
552
546
  /** @license React v16.14.0
@@ -7099,7 +7093,7 @@ var __publicField = (obj, key, value) => {
7099
7093
  var _a, _b, _c;
7100
7094
  const editor = React.useRef(null);
7101
7095
  const isFoldRef = React.useRef(false);
7102
- const { t } = useD2Translation();
7096
+ const { t } = useTranslation();
7103
7097
  const [enableEditor, setEnableEditor] = React.useState(false);
7104
7098
  const [isYamlValid, setIsYamlValid] = React.useState(true);
7105
7099
  const [isSchemaValid, setIsSchemaValid] = React.useState(true);
@@ -7272,7 +7266,7 @@ var __publicField = (obj, key, value) => {
7272
7266
  const [visible, setVisible] = React.useState(false);
7273
7267
  const navigation = core.useNavigation();
7274
7268
  const [id, setId] = React.useState("");
7275
- const { t } = useD2Translation();
7269
+ const { t } = useTranslation();
7276
7270
  const modalProps = {
7277
7271
  title: t("dovetail.delete"),
7278
7272
  okText: t("dovetail.delete"),
@@ -7538,7 +7532,7 @@ var __publicField = (obj, key, value) => {
7538
7532
  const kit = React.useContext(eagle.kitContext);
7539
7533
  const {
7540
7534
  t
7541
- } = useD2Translation();
7535
+ } = useTranslation();
7542
7536
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
7543
7537
  className: ErrorWrapper$1,
7544
7538
  style: props.style,
@@ -7881,7 +7875,7 @@ var __publicField = (obj, key, value) => {
7881
7875
  };
7882
7876
  const ConditionsTable = ({ conditions = [] }) => {
7883
7877
  const kit = eagle.useUIKit();
7884
- const { t } = useD2Translation();
7878
+ const { t } = useTranslation();
7885
7879
  const conditionsWithId = addId(conditions, "type");
7886
7880
  const columns = [
7887
7881
  {
@@ -8067,7 +8061,7 @@ var __publicField = (obj, key, value) => {
8067
8061
  const kit = eagle.useUIKit();
8068
8062
  const {
8069
8063
  t
8070
- } = useD2Translation();
8064
+ } = useTranslation();
8071
8065
  const {
8072
8066
  loading,
8073
8067
  error,
@@ -9784,7 +9778,7 @@ var __publicField = (obj, key, value) => {
9784
9778
  const kit = React.useContext(eagle.kitContext);
9785
9779
  const {
9786
9780
  t
9787
- } = useD2Translation();
9781
+ } = useTranslation();
9788
9782
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorWrapper, {
9789
9783
  className: props.className,
9790
9784
  style: props.style,
@@ -9836,7 +9830,7 @@ var __publicField = (obj, key, value) => {
9836
9830
  } = core.useResource();
9837
9831
  const {
9838
9832
  t
9839
- } = useD2Translation();
9833
+ } = useTranslation();
9840
9834
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
9841
9835
  className: WrapperStyle$3,
9842
9836
  children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
@@ -9886,7 +9880,7 @@ var __publicField = (obj, key, value) => {
9886
9880
  className
9887
9881
  } = props;
9888
9882
  const kit = eagle.useUIKit();
9889
- const { t } = useD2Translation();
9883
+ const { t } = useTranslation();
9890
9884
  const [isCollapsed, setIsCollapsed] = React.useState(
9891
9885
  collapsable ? isDefaultCollapsed : false
9892
9886
  );
@@ -10408,7 +10402,7 @@ var __publicField = (obj, key, value) => {
10408
10402
  const {
10409
10403
  t,
10410
10404
  i18n: i18n2
10411
- } = useD2Translation();
10405
+ } = useTranslation();
10412
10406
  const responseErrors = errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [];
10413
10407
  const FormWrapper = isShowLayout ? FormLayout : React.Fragment;
10414
10408
  const schema = React.useMemo(() => {
@@ -10473,7 +10467,7 @@ var __publicField = (obj, key, value) => {
10473
10467
  } = props;
10474
10468
  const {
10475
10469
  i18n: i18n2
10476
- } = useD2Translation();
10470
+ } = useTranslation();
10477
10471
  const {
10478
10472
  resource
10479
10473
  } = core.useResource();
@@ -10595,14 +10589,14 @@ var __publicField = (obj, key, value) => {
10595
10589
  }
10596
10590
  function CreateButton() {
10597
10591
  const kit = eagle.useUIKit();
10598
- const { t } = useD2Translation();
10592
+ const { t } = useTranslation();
10599
10593
  const openForm = useOpenForm();
10600
10594
  return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, { type: "primary", onClick: openForm, children: t("dovetail.create") });
10601
10595
  }
10602
10596
  const useDeleteManyModal = (resource, ids) => {
10603
10597
  const { mutate } = core.useDeleteMany();
10604
10598
  const [visible, setVisible] = React.useState(false);
10605
- const { t } = useD2Translation();
10599
+ const { t } = useTranslation();
10606
10600
  const modalProps = {
10607
10601
  title: t("dovetail.delete"),
10608
10602
  okText: t("dovetail.delete"),
@@ -10630,7 +10624,7 @@ var __publicField = (obj, key, value) => {
10630
10624
  const DeleteManyButton = (props) => {
10631
10625
  const { resource } = core.useResource();
10632
10626
  const kit = eagle.useUIKit();
10633
- const { t } = useD2Translation();
10627
+ const { t } = useTranslation();
10634
10628
  const { modalProps, visible, setVisible } = useDeleteManyModal(
10635
10629
  (resource == null ? void 0 : resource.name) || "",
10636
10630
  props.ids
@@ -10679,7 +10673,7 @@ var __publicField = (obj, key, value) => {
10679
10673
  }) => {
10680
10674
  const {
10681
10675
  i18n: i18n2
10682
- } = useD2Translation();
10676
+ } = useTranslation();
10683
10677
  const kit = eagle.useUIKit();
10684
10678
  const [selectedKeys, setSelectedKeys] = React.useState([]);
10685
10679
  const [currentPage, setCurrentPage] = React.useState(1);
@@ -10721,7 +10715,7 @@ var __publicField = (obj, key, value) => {
10721
10715
  });
10722
10716
  };
10723
10717
  const EventsTable = ({}) => {
10724
- const { i18n: i18n2 } = useD2Translation();
10718
+ const { i18n: i18n2 } = useTranslation();
10725
10719
  const [currentPage, setCurrentPage] = React.useState(1);
10726
10720
  const { data: data2, isLoading } = core.useList({
10727
10721
  resource: "events",
@@ -10797,7 +10791,7 @@ var __publicField = (obj, key, value) => {
10797
10791
  const kit = eagle.useUIKit();
10798
10792
  const {
10799
10793
  t
10800
- } = useD2Translation();
10794
+ } = useTranslation();
10801
10795
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
10802
10796
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
10803
10797
  children: value[0]
@@ -10836,7 +10830,7 @@ var __publicField = (obj, key, value) => {
10836
10830
  };
10837
10831
  const IngressRulesTable = ({ ingress }) => {
10838
10832
  const kit = eagle.useUIKit();
10839
- const { t } = useD2Translation();
10833
+ const { t } = useTranslation();
10840
10834
  const rows = React.useMemo(() => {
10841
10835
  return addId(ingress.flattenedRules, "fullPath");
10842
10836
  }, [ingress.flattenedRules]);
@@ -10943,7 +10937,7 @@ var __publicField = (obj, key, value) => {
10943
10937
  }) => {
10944
10938
  const {
10945
10939
  i18n: i18n2
10946
- } = useD2Translation();
10940
+ } = useTranslation();
10947
10941
  const kit = eagle.useUIKit();
10948
10942
  const [selectedKeys, setSelectedKeys] = React.useState([]);
10949
10943
  const [currentPage, setCurrentPage] = React.useState(1);
@@ -10989,7 +10983,7 @@ var __publicField = (obj, key, value) => {
10989
10983
  };
10990
10984
  function useSubmitForm(options) {
10991
10985
  const { formRef, onSubmitSuccess } = options;
10992
- const { i18n: i18n2 } = useD2Translation();
10986
+ const { i18n: i18n2 } = useTranslation();
10993
10987
  const [submitting, setSubmitting] = React.useState(false);
10994
10988
  const [errorMsgs, setErrorMsgs] = React.useState([]);
10995
10989
  const reset = React.useCallback(() => {
@@ -11036,7 +11030,7 @@ var __publicField = (obj, key, value) => {
11036
11030
  const kit = eagle.useUIKit();
11037
11031
  const {
11038
11032
  i18n: i18n2
11039
- } = useD2Translation();
11033
+ } = useTranslation();
11040
11034
  const {
11041
11035
  submitting,
11042
11036
  errorMsgs,
@@ -11073,7 +11067,7 @@ var __publicField = (obj, key, value) => {
11073
11067
  const kit = eagle.useUIKit();
11074
11068
  const {
11075
11069
  i18n: i18n2
11076
- } = useD2Translation();
11070
+ } = useTranslation();
11077
11071
  return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.button, {
11078
11072
  className: EditButtonStyle,
11079
11073
  type: "link",
@@ -11357,7 +11351,7 @@ var __publicField = (obj, key, value) => {
11357
11351
  (resource == null ? void 0 : resource.name) || ""
11358
11352
  );
11359
11353
  const download2 = useDownloadYAML();
11360
- const { t } = useD2Translation();
11354
+ const { t } = useTranslation();
11361
11355
  const openForm = useOpenForm({ id: record.id });
11362
11356
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11363
11357
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -11420,7 +11414,7 @@ var __publicField = (obj, key, value) => {
11420
11414
  const kit = eagle.useUIKit();
11421
11415
  const {
11422
11416
  t
11423
- } = useD2Translation();
11417
+ } = useTranslation();
11424
11418
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
11425
11419
  className: WrapperStyle$1,
11426
11420
  children: [/* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
@@ -11616,7 +11610,7 @@ var __publicField = (obj, key, value) => {
11616
11610
  })(WorkloadState || {});
11617
11611
  const StateTag = ({ state: state2 = WorkloadState.UPDATEING, className }) => {
11618
11612
  const kit = eagle.useUIKit();
11619
- const { t } = useD2Translation();
11613
+ const { t } = useTranslation();
11620
11614
  const colorMap = {
11621
11615
  updating: "blue",
11622
11616
  ready: "green",
@@ -11695,7 +11689,7 @@ var __publicField = (obj, key, value) => {
11695
11689
  });
11696
11690
  const {
11697
11691
  t
11698
- } = useD2Translation();
11692
+ } = useTranslation();
11699
11693
  const {
11700
11694
  fold: fold2
11701
11695
  } = useK8sYamlEditor();
@@ -11879,7 +11873,7 @@ var __publicField = (obj, key, value) => {
11879
11873
  initContainerStatuses
11880
11874
  }) => {
11881
11875
  const kit = eagle.useUIKit();
11882
- const { i18n: i18n2 } = useD2Translation();
11876
+ const { i18n: i18n2 } = useTranslation();
11883
11877
  const columns = React.useMemo(
11884
11878
  () => [
11885
11879
  {
@@ -11973,7 +11967,7 @@ var __publicField = (obj, key, value) => {
11973
11967
  const kit = eagle.useUIKit();
11974
11968
  const { resource } = core.useResource();
11975
11969
  const { mutate } = core.useUpdate();
11976
- const { t } = useD2Translation();
11970
+ const { t } = useTranslation();
11977
11971
  return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
11978
11972
  kit.menu.Item,
11979
11973
  {
@@ -12021,7 +12015,7 @@ var __publicField = (obj, key, value) => {
12021
12015
  }
12022
12016
  function ResourceList(props) {
12023
12017
  const { formatter, name: name2, columns, Dropdown } = props;
12024
- const { i18n: i18n2 } = useD2Translation();
12018
+ const { i18n: i18n2 } = useTranslation();
12025
12019
  const { tableProps, selectedKeys } = useEagleTable({
12026
12020
  useTableParams: {},
12027
12021
  columns: [NameColumnRenderer(i18n2), ...columns],
@@ -12094,7 +12088,7 @@ var __publicField = (obj, key, value) => {
12094
12088
  const kit = eagle.useUIKit();
12095
12089
  const { resource } = core.useResource();
12096
12090
  const { mutate } = core.useUpdate();
12097
- const { t } = useD2Translation();
12091
+ const { t } = useTranslation();
12098
12092
  const suspended2 = Boolean(spec == null ? void 0 : spec.suspend);
12099
12093
  return /* @__PURE__ */ jsxRuntimeExports.jsx(K8sDropdown, { record, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12100
12094
  kit.menu.Item,
@@ -12249,7 +12243,7 @@ var __publicField = (obj, key, value) => {
12249
12243
  const { resource } = core.useResource();
12250
12244
  const { id } = core.useParsed();
12251
12245
  const kit = eagle.useUIKit();
12252
- const { t } = useD2Translation();
12246
+ const { t } = useTranslation();
12253
12247
  const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
12254
12248
  (resource == null ? void 0 : resource.name) || ""
12255
12249
  );
@@ -12423,7 +12417,7 @@ var __publicField = (obj, key, value) => {
12423
12417
  };
12424
12418
  const NamespacesFilter = () => {
12425
12419
  const kit = eagle.useUIKit();
12426
- const { t } = useD2Translation();
12420
+ const { t } = useTranslation();
12427
12421
  const { data: data2 } = core.useList({
12428
12422
  resource: "namespaces",
12429
12423
  meta: {
@@ -18159,7 +18153,7 @@ var __publicField = (obj, key, value) => {
18159
18153
  const apiUrl = dataProvider()["getApiUrl"]();
18160
18154
  const {
18161
18155
  t
18162
- } = useD2Translation();
18156
+ } = useTranslation();
18163
18157
  React.useEffect(() => {
18164
18158
  if (!paused && logs.length > 0) {
18165
18159
  setCurrentItemCount(logs.length);
@@ -18311,7 +18305,7 @@ var __publicField = (obj, key, value) => {
18311
18305
  };
18312
18306
  const IngressRuleTable = ({ peers }) => {
18313
18307
  const kit = eagle.useUIKit();
18314
- const { t } = useD2Translation();
18308
+ const { t } = useTranslation();
18315
18309
  const rows = React.useMemo(() => {
18316
18310
  const rows2 = (peers == null ? void 0 : peers.map((p) => {
18317
18311
  return Object.keys(p).map((key) => {
@@ -19391,7 +19385,6 @@ var __publicField = (obj, key, value) => {
19391
19385
  exports2.CronJobDropdown = CronJobDropdown;
19392
19386
  exports2.CronJobModel = CronJobModel;
19393
19387
  exports2.CronjobJobsTable = CronjobJobsTable;
19394
- exports2.D2Locales = D2Locales;
19395
19388
  exports2.DAEMONSET_INIT_VALUE = DAEMONSET_INIT_VALUE;
19396
19389
  exports2.DEPLOYMENT_INIT_VALUE = DEPLOYMENT_INIT_VALUE;
19397
19390
  exports2.DaemonSetModel = DaemonSetModel;
package/lib/src/i18n.d.ts CHANGED
@@ -114,5 +114,4 @@ export declare const resources: {
114
114
  };
115
115
  };
116
116
  };
117
- export declare const useD2Translation: () => import("react-i18next").UseTranslationResponse<"translation", undefined>;
118
117
  export default i18n;
@@ -1,5 +1,4 @@
1
1
  export declare const dovetailRefineI18n: import("i18next").i18n;
2
- export { D2Locales } from './locales';
3
2
  export * from './providers';
4
3
  export * from './hooks';
5
4
  export * from './components';
@@ -1,115 +1,2 @@
1
- export declare const D2Locales: {
2
- 'en-US': {
3
- dovetail: {
4
- copy: string;
5
- reset_arguments: string;
6
- view_changes: string;
7
- back_to_edit: string;
8
- configure_file: string;
9
- yaml_format_wrong: string;
10
- yaml_value_wrong: string;
11
- edit_yaml: string;
12
- copied: string;
13
- already_reset: string;
14
- fetch_schema_fail: string;
15
- obtain_data_error: string;
16
- retry: string;
17
- create_resource: string;
18
- edit_resource: string;
19
- status: string;
20
- };
21
- };
22
- 'zh-CN': {
23
- dovetail: {
24
- copy: string;
25
- reset_arguments: string;
26
- view_changes: string;
27
- back_to_edit: string;
28
- configure_file: string;
29
- yaml_format_wrong: string;
30
- yaml_value_wrong: string;
31
- edit_yaml: string;
32
- copied: string;
33
- already_reset: string;
34
- cancel: string;
35
- delete: string;
36
- create: string;
37
- confirm_delete_text: string;
38
- edit: string;
39
- namespace: string;
40
- name: string;
41
- state: string;
42
- status: string;
43
- phase: string;
44
- image: string;
45
- replicas: string;
46
- created_time: string;
47
- label: string;
48
- annotation: string;
49
- type: string;
50
- event: string;
51
- reason: string;
52
- object: string;
53
- note: string;
54
- condition: string;
55
- download_yaml: string;
56
- detail: string;
57
- node_name: string;
58
- restarts: string;
59
- updated_time: string;
60
- message: string;
61
- save: string;
62
- more: string;
63
- workload: string;
64
- all_namespaces: string;
65
- empty: string;
66
- schedule: string;
67
- lastScheduleTime: string;
68
- duration: string;
69
- completions: string;
70
- started: string;
71
- init_container: string;
72
- container: string;
73
- redeploy: string;
74
- data: string;
75
- suspend: string;
76
- resume: string;
77
- cluster: string;
78
- storage: string;
79
- network: string;
80
- clusterIp: string;
81
- sessionAffinity: string;
82
- log: string;
83
- select_container: string;
84
- wrap: string;
85
- resume_log: string;
86
- log_new_lines: string;
87
- fetch_schema_fail: string;
88
- obtain_data_error: string;
89
- retry: string;
90
- ready: string;
91
- updating: string;
92
- completed: string;
93
- failed: string;
94
- suspended: string;
95
- running: string;
96
- terminating: string;
97
- succeeded: string;
98
- unknown: string;
99
- pending: string;
100
- waiting: string;
101
- create_resource: string;
102
- edit_resource: string;
103
- sec: string;
104
- min: string;
105
- hr: string;
106
- day: string;
107
- expand: string;
108
- fold: string;
109
- rule: string;
110
- default_backend: string;
111
- ingress_rule_type: string;
112
- port: string;
113
- };
114
- };
115
- };
1
+ import './en-US';
2
+ import './zh-CN';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -79,7 +79,7 @@
79
79
  "scripts": {
80
80
  "dev": "refine dev",
81
81
  "dev:test": "VITE_IS_TEST=true refine dev",
82
- "build": "tsc && vite build",
82
+ "build": "tsc --emitDeclarationOnly && vite build",
83
83
  "preview": "refine start",
84
84
  "refine": "refine",
85
85
  "unit-test": "jest",