@dovetail-v2/refine 0.0.48-alpha.0 → 0.0.49-alpha.0
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/{MonacoYamlDiffEditor-ed04648b.js → MonacoYamlDiffEditor-7cb1e598.js} +1 -1
- package/dist/{index-04f52e89.js → index-8f27c902.js} +39 -34
- package/dist/refine.js +1 -1
- package/dist/refine.umd.cjs +44 -39
- package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +1 -0
- package/lib/src/utils/match-selector.d.ts +1 -1
- package/package.json +6 -6
|
@@ -10,7 +10,7 @@ import React__default, { createElement, isValidElement, cloneElement, Children,
|
|
|
10
10
|
import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNavigation, useBreadcrumb, useList, useParsed, useGo, useCan, useTable, useDeleteMany, CanAccess, useShow, useUpdate, useDataProvider, useRefineContext, useTranslate, useWarnAboutChange, useForm as useForm$2, flattenObjectKeys, pickNotDeprecated, useMenu, Refine } from "@refinedev/core";
|
|
11
11
|
import { parse, stringify } from "qs";
|
|
12
12
|
import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
|
|
13
|
-
import { Typo, Tag, useUIKit, kitContext, Link as Link$1, OverflowTooltip, Tooltip, StatusCapsule,
|
|
13
|
+
import { Typo, Tag, useUIKit, kitContext, Link as Link$1, OverflowTooltip, Tooltip, StatusCapsule, usePushModal, Icon as Icon$1, Button, usePopModal, Loading, Divider, Fields, Space, Form, Modal, useMessage, ModalStack, KitStoreProvider } from "@cloudtower/eagle";
|
|
14
14
|
import { EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, EditPen16GradientBlueIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, Retry16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, ExclamationErrorCircleFill16RedIcon, Pause16GradientBlueIcon } from "@cloudtower/icons-react";
|
|
15
15
|
import { omit as omit$1, merge, get as get$3, first, debounce, last, isObject as isObject$4, keyBy } from "lodash-es";
|
|
16
16
|
import yaml from "js-yaml";
|
|
@@ -1010,7 +1010,7 @@ function useTranslation(ns) {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
const copy$1 = "Copy";
|
|
1012
1012
|
const reset_arguments$1 = "Reset";
|
|
1013
|
-
const view_changes$1 = "Show
|
|
1013
|
+
const view_changes$1 = "Show Diff";
|
|
1014
1014
|
const back_to_edit$1 = "Edit";
|
|
1015
1015
|
const configure_file$1 = "Configuration";
|
|
1016
1016
|
const yaml_format_wrong$1 = "Configuration is in an invalid YAML format.";
|
|
@@ -1023,7 +1023,7 @@ const obtain_data_error$1 = "Having trouble getting data.";
|
|
|
1023
1023
|
const retry$1 = "Retry";
|
|
1024
1024
|
const create_resource$1 = "Create {{resource}}";
|
|
1025
1025
|
const edit_resource$1 = "Edit {{resource}}";
|
|
1026
|
-
const state$1 = "
|
|
1026
|
+
const state$1 = "Status";
|
|
1027
1027
|
const name$1 = "Name";
|
|
1028
1028
|
const pod$1 = "Pod";
|
|
1029
1029
|
const cancel$1 = "Cancel";
|
|
@@ -1047,7 +1047,7 @@ const save$1 = "Save";
|
|
|
1047
1047
|
const workload$1 = "Workload";
|
|
1048
1048
|
const empty$1 = "No data available";
|
|
1049
1049
|
const schedule$1 = "Schedule";
|
|
1050
|
-
const lastScheduleTime$1 = "Last
|
|
1050
|
+
const lastScheduleTime$1 = "Last Schedule";
|
|
1051
1051
|
const duration$1 = "Duration";
|
|
1052
1052
|
const started$1 = "Start time";
|
|
1053
1053
|
const container$1 = "Container";
|
|
@@ -1074,7 +1074,7 @@ const rule$1 = "Rule";
|
|
|
1074
1074
|
const port$1 = "Port";
|
|
1075
1075
|
const cert$1 = "Certificate";
|
|
1076
1076
|
const ip_address$1 = "IP address";
|
|
1077
|
-
const last_seen$1 = "Last
|
|
1077
|
+
const last_seen$1 = "Last Seen";
|
|
1078
1078
|
const node_port$1 = "NodePort";
|
|
1079
1079
|
const protocol$1 = "Protocol";
|
|
1080
1080
|
const key$1 = "Key";
|
|
@@ -1144,9 +1144,9 @@ const regular_container$1 = "Regular container";
|
|
|
1144
1144
|
const suspend$1 = "Suspend";
|
|
1145
1145
|
const default_backend$1 = "Default backend";
|
|
1146
1146
|
const ingress_class$1 = "IngressClass";
|
|
1147
|
-
const pod_ready_num$1 = "Ready
|
|
1148
|
-
const pod_complete_num$1 = "Completion
|
|
1149
|
-
const pod_replicas_num$1 = "Desired
|
|
1147
|
+
const pod_ready_num$1 = "Ready Pod";
|
|
1148
|
+
const pod_complete_num$1 = "Completion Pod";
|
|
1149
|
+
const pod_replicas_num$1 = "Desired Pod";
|
|
1150
1150
|
const edit_replicas$1 = "Edit expected number of replicas";
|
|
1151
1151
|
const dns_record$1 = "DNS record";
|
|
1152
1152
|
const basic_info$1 = "Basic information";
|
|
@@ -9552,15 +9552,17 @@ var AccessControlAuth = /* @__PURE__ */ ((AccessControlAuth2) => {
|
|
|
9552
9552
|
AccessControlAuth2["Create"] = "Create";
|
|
9553
9553
|
return AccessControlAuth2;
|
|
9554
9554
|
})(AccessControlAuth || {});
|
|
9555
|
-
function matchSelector(pod2, selector) {
|
|
9555
|
+
function matchSelector(pod2, selector, namespace2 = "default") {
|
|
9556
9556
|
var _a, _b, _c;
|
|
9557
9557
|
let match = true;
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9558
|
+
if (selector) {
|
|
9559
|
+
for (const key2 in selector.matchLabels) {
|
|
9560
|
+
if (!((_b = (_a = pod2.metadata) == null ? void 0 : _a.labels) == null ? void 0 : _b[key2]) || ((_c = pod2.metadata.labels) == null ? void 0 : _c[key2]) !== selector.matchLabels[key2]) {
|
|
9561
|
+
match = false;
|
|
9562
|
+
}
|
|
9561
9563
|
}
|
|
9562
9564
|
}
|
|
9563
|
-
return match;
|
|
9565
|
+
return match && pod2.metadata.namespace === namespace2;
|
|
9564
9566
|
}
|
|
9565
9567
|
function shortenedImage(image2) {
|
|
9566
9568
|
return (image2 || "").replace(/^(index\.)?docker.io\/(library\/)?/, "").replace(/:latest$/, "").replace(/^(.*@sha256:)([0-9a-f]{8})[0-9a-f]+$/i, "$1$2…");
|
|
@@ -9600,8 +9602,8 @@ class JobModel extends WorkloadBaseModel {
|
|
|
9600
9602
|
});
|
|
9601
9603
|
const myPods = pods.items.filter(
|
|
9602
9604
|
(p) => {
|
|
9603
|
-
var _a
|
|
9604
|
-
return ((_a = this.spec) == null ? void 0 : _a.selector
|
|
9605
|
+
var _a;
|
|
9606
|
+
return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
|
|
9605
9607
|
}
|
|
9606
9608
|
);
|
|
9607
9609
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
@@ -9665,8 +9667,8 @@ class WorkloadModel extends WorkloadBaseModel {
|
|
|
9665
9667
|
});
|
|
9666
9668
|
const myPods = pods.items.filter(
|
|
9667
9669
|
(p) => {
|
|
9668
|
-
var _a
|
|
9669
|
-
return ((_a = this.spec) == null ? void 0 : _a.selector
|
|
9670
|
+
var _a;
|
|
9671
|
+
return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
|
|
9670
9672
|
}
|
|
9671
9673
|
);
|
|
9672
9674
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
@@ -9823,7 +9825,10 @@ class PodModel extends WorkloadBaseModel {
|
|
|
9823
9825
|
get restartCount() {
|
|
9824
9826
|
var _a, _b;
|
|
9825
9827
|
if ((_a = this._rawYaml.status) == null ? void 0 : _a.containerStatuses) {
|
|
9826
|
-
return ((_b = this._rawYaml.status) == null ? void 0 : _b.containerStatuses
|
|
9828
|
+
return ((_b = this._rawYaml.status) == null ? void 0 : _b.containerStatuses.reduce((count, container2) => {
|
|
9829
|
+
count += container2.restartCount;
|
|
9830
|
+
return count;
|
|
9831
|
+
}, 0)) || 0;
|
|
9827
9832
|
}
|
|
9828
9833
|
return 0;
|
|
9829
9834
|
}
|
|
@@ -10416,6 +10421,7 @@ function useOpenForm(options) {
|
|
|
10416
10421
|
const configs = useContext(ConfigsContext);
|
|
10417
10422
|
const { edit: edit2 } = useEdit();
|
|
10418
10423
|
const navigation = useNavigation();
|
|
10424
|
+
const pushModal = usePushModal();
|
|
10419
10425
|
const go = useGo();
|
|
10420
10426
|
return function openForm() {
|
|
10421
10427
|
var _a, _b;
|
|
@@ -11336,6 +11342,7 @@ function KeyValueSecret(props) {
|
|
|
11336
11342
|
}
|
|
11337
11343
|
const WorkloadPodsTable_1giuese = "";
|
|
11338
11344
|
const WorkloadPodsTable = ({
|
|
11345
|
+
namespace: namespace2,
|
|
11339
11346
|
selector,
|
|
11340
11347
|
hideToolbar
|
|
11341
11348
|
}) => {
|
|
@@ -11371,7 +11378,7 @@ const WorkloadPodsTable = ({
|
|
|
11371
11378
|
field: "",
|
|
11372
11379
|
value: "",
|
|
11373
11380
|
fn(item) {
|
|
11374
|
-
return
|
|
11381
|
+
return matchSelector(item, selector, item.metadata.namespace);
|
|
11375
11382
|
}
|
|
11376
11383
|
}]
|
|
11377
11384
|
}
|
|
@@ -11520,6 +11527,7 @@ function EditFieldModal(props) {
|
|
|
11520
11527
|
const {
|
|
11521
11528
|
i18n: i18n2
|
|
11522
11529
|
} = useTranslation();
|
|
11530
|
+
const popModal = usePopModal();
|
|
11523
11531
|
const {
|
|
11524
11532
|
submitting,
|
|
11525
11533
|
errorMsgs,
|
|
@@ -11564,6 +11572,7 @@ function EditField(props) {
|
|
|
11564
11572
|
const {
|
|
11565
11573
|
resource
|
|
11566
11574
|
} = useResource();
|
|
11575
|
+
const pushModal = usePushModal();
|
|
11567
11576
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
|
|
11568
11577
|
resource: resource == null ? void 0 : resource.name,
|
|
11569
11578
|
action: AccessControlAuth.Edit,
|
|
@@ -11796,6 +11805,7 @@ const PodsField = () => {
|
|
|
11796
11805
|
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
|
|
11797
11806
|
return r2.kind === "Pod" && r2.type === "creates";
|
|
11798
11807
|
})) == null ? void 0 : _b.selector,
|
|
11808
|
+
namespace: record.metadata.namespace,
|
|
11799
11809
|
hideToolbar: true
|
|
11800
11810
|
}
|
|
11801
11811
|
);
|
|
@@ -11889,6 +11899,7 @@ const ServicePodsField = () => {
|
|
|
11889
11899
|
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
|
|
11890
11900
|
return r2.kind === "Pod" && r2.type === "selects";
|
|
11891
11901
|
})) == null ? void 0 : _b.selector,
|
|
11902
|
+
namespace: record.metadata.namespace,
|
|
11892
11903
|
hideToolbar: true
|
|
11893
11904
|
}
|
|
11894
11905
|
);
|
|
@@ -18390,6 +18401,7 @@ function ReplicasDropdown(props) {
|
|
|
18390
18401
|
const { record, size, children } = props;
|
|
18391
18402
|
const kit = useUIKit();
|
|
18392
18403
|
const { t: t2 } = useTranslation();
|
|
18404
|
+
const pushModal = usePushModal();
|
|
18393
18405
|
const formRef = useRef(null);
|
|
18394
18406
|
const { action, resource } = useResource();
|
|
18395
18407
|
const isInShowPage = action === "show";
|
|
@@ -22864,7 +22876,7 @@ const Separator = () => {
|
|
|
22864
22876
|
});
|
|
22865
22877
|
};
|
|
22866
22878
|
const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
|
|
22867
|
-
const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-
|
|
22879
|
+
const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-7cb1e598.js"));
|
|
22868
22880
|
const YamlEditorComponent = forwardRef(
|
|
22869
22881
|
function YamlEditorComponent2(props, ref) {
|
|
22870
22882
|
const {
|
|
@@ -23480,9 +23492,6 @@ function YamlForm(props) {
|
|
|
23480
23492
|
errorNotification: false,
|
|
23481
23493
|
transformInitValues,
|
|
23482
23494
|
transformApplyValues,
|
|
23483
|
-
mutationMeta: {
|
|
23484
|
-
updateType: "put"
|
|
23485
|
-
},
|
|
23486
23495
|
...useFormProps
|
|
23487
23496
|
});
|
|
23488
23497
|
const kit = useUIKit();
|
|
@@ -23568,6 +23577,7 @@ function FormModal(props) {
|
|
|
23568
23577
|
const configs = useContext(ConfigsContext);
|
|
23569
23578
|
const [yamlSaveButtonProps, setYamlSaveButtonProps] = useState({});
|
|
23570
23579
|
const [isError, setIsError] = useState(false);
|
|
23580
|
+
const popModal = usePopModal();
|
|
23571
23581
|
const config = configs[resourceFromProps || (resource == null ? void 0 : resource.name) || ""];
|
|
23572
23582
|
const okText = i18n2.t(id ? "dovetail.save" : "dovetail.create");
|
|
23573
23583
|
const action = id ? "edit" : "create";
|
|
@@ -23588,7 +23598,7 @@ function FormModal(props) {
|
|
|
23588
23598
|
onErrorsChange(errors) {
|
|
23589
23599
|
setIsError(!!errors.length);
|
|
23590
23600
|
},
|
|
23591
|
-
onFinish:
|
|
23601
|
+
onFinish: usePopModal
|
|
23592
23602
|
};
|
|
23593
23603
|
}, [props.formProps, (_a = config.formConfig) == null ? void 0 : _a.transformInitValues, (_b = config.formConfig) == null ? void 0 : _b.transformApplyValues, config == null ? void 0 : config.initValue, id, action]);
|
|
23594
23604
|
const refineFormResult = useRefineForm({
|
|
@@ -24160,7 +24170,7 @@ const WorkloadRestartsColumnRenderer = (i18n2) => {
|
|
|
24160
24170
|
dataIndex,
|
|
24161
24171
|
align: "right",
|
|
24162
24172
|
title: i18n2.t("dovetail.restarts"),
|
|
24163
|
-
sortable:
|
|
24173
|
+
sortable: false
|
|
24164
24174
|
};
|
|
24165
24175
|
};
|
|
24166
24176
|
const ReplicasColumnRenderer = (i18n2) => {
|
|
@@ -24170,7 +24180,7 @@ const ReplicasColumnRenderer = (i18n2) => {
|
|
|
24170
24180
|
display: true,
|
|
24171
24181
|
dataIndex,
|
|
24172
24182
|
title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
|
|
24173
|
-
title: i18n2.t("dovetail.
|
|
24183
|
+
title: i18n2.t("dovetail.completion_num_tooltip"),
|
|
24174
24184
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
24175
24185
|
className: DashedTitleStyle,
|
|
24176
24186
|
children: i18n2.t("dovetail.pod_num")
|
|
@@ -24191,7 +24201,6 @@ const AgeColumnRenderer = (i18n2, config, {
|
|
|
24191
24201
|
isRelativeTime = true
|
|
24192
24202
|
} = {}) => {
|
|
24193
24203
|
const dataIndex = ["metadata", "creationTimestamp"];
|
|
24194
|
-
const kit = useUIKit();
|
|
24195
24204
|
return {
|
|
24196
24205
|
key: "creationTimestamp",
|
|
24197
24206
|
display: true,
|
|
@@ -24203,11 +24212,7 @@ const AgeColumnRenderer = (i18n2, config, {
|
|
|
24203
24212
|
return isRelativeTime ? /* @__PURE__ */ jsxRuntimeExports.jsx(Time, {
|
|
24204
24213
|
date: new Date(value2)
|
|
24205
24214
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
|
|
24206
|
-
value:
|
|
24207
|
-
date: value2,
|
|
24208
|
-
timeTemplate: "HH:mm:ss",
|
|
24209
|
-
dateTemplate: "YYYY-MM-DD"
|
|
24210
|
-
})
|
|
24215
|
+
value: dayjs(value2).format("YYYY-MM-DD hh:mm:ss")
|
|
24211
24216
|
});
|
|
24212
24217
|
},
|
|
24213
24218
|
...config
|
|
@@ -24548,8 +24553,8 @@ const PortMappingColumnRenderer = (i18n2) => {
|
|
|
24548
24553
|
}),
|
|
24549
24554
|
tooltip: `${v.servicePort} > ${v.targetPort}/${v.protocol}`
|
|
24550
24555
|
}, v.servicePort));
|
|
24551
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24552
|
-
|
|
24556
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
24557
|
+
children: content
|
|
24553
24558
|
});
|
|
24554
24559
|
}
|
|
24555
24560
|
};
|
package/dist/refine.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b7, bL, A, aA, aC, ak, bn, aK, H, bB, bp, au, x, C, h, bP, an, aO, Z, bR, a1, a8, b_, ac, bq, bo, c1, aq, aU, v, ai, aZ, c0, bM, b1, D, aH, b3, b$, aI, ay, ba, bO, bQ, bz, al, a2, q, p, bS, I, aR, ax, s, br, bU, ap, aQ, ad, ae, U, af, aB, aj, a_, b2, V, M, bA, b6, N, J, c, az, Q, b9, aW, aV, bT, bl, f, bt, X, P, aM, t, _, bk, aJ, bY, bX, aF, aS, o, ao, aL, w, aT, aG, c5, bN, b4, bb, bc, am, R, a0, a6, a5, b5, a3, bZ, a4, a9, g, bG, bJ, bF, bE, bH, bI, bC, bu, bx, by, bw, bv, bs, bd, ar, aP, ag, l, bg, k, aD, c4, n, bh, aE, m, aw, aN, i, c3, at, av, aY, aX, as, S, b0, a$, c2, bD, bm, bi, bj, Y, bW, $, W, bV, a7, ab, aa, e, bK, ah, be, y, K, d, T, O, L, r, b, B, z, E, F, u, b8, G, bf, a } from "./index-
|
|
1
|
+
import { b7, bL, A, aA, aC, ak, bn, aK, H, bB, bp, au, x, C, h, bP, an, aO, Z, bR, a1, a8, b_, ac, bq, bo, c1, aq, aU, v, ai, aZ, c0, bM, b1, D, aH, b3, b$, aI, ay, ba, bO, bQ, bz, al, a2, q, p, bS, I, aR, ax, s, br, bU, ap, aQ, ad, ae, U, af, aB, aj, a_, b2, V, M, bA, b6, N, J, c, az, Q, b9, aW, aV, bT, bl, f, bt, X, P, aM, t, _, bk, aJ, bY, bX, aF, aS, o, ao, aL, w, aT, aG, c5, bN, b4, bb, bc, am, R, a0, a6, a5, b5, a3, bZ, a4, a9, g, bG, bJ, bF, bE, bH, bI, bC, bu, bx, by, bw, bv, bs, bd, ar, aP, ag, l, bg, k, aD, c4, n, bh, aE, m, aw, aN, i, c3, at, av, aY, aX, as, S, b0, a$, c2, bD, bm, bi, bj, Y, bW, $, W, bV, a7, ab, aa, e, bK, ah, be, y, K, d, T, O, L, r, b, B, z, E, F, u, b8, G, bf, a } from "./index-8f27c902.js";
|
|
2
2
|
import "@cloudtower/eagle";
|
|
3
3
|
import "@refinedev/core";
|
|
4
4
|
import "@cloudtower/icons-react";
|
package/dist/refine.umd.cjs
CHANGED
|
@@ -1016,7 +1016,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
const copy$1 = "Copy";
|
|
1018
1018
|
const reset_arguments$1 = "Reset";
|
|
1019
|
-
const view_changes$1 = "Show
|
|
1019
|
+
const view_changes$1 = "Show Diff";
|
|
1020
1020
|
const back_to_edit$1 = "Edit";
|
|
1021
1021
|
const configure_file$1 = "Configuration";
|
|
1022
1022
|
const yaml_format_wrong$1 = "Configuration is in an invalid YAML format.";
|
|
@@ -1029,7 +1029,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1029
1029
|
const retry$1 = "Retry";
|
|
1030
1030
|
const create_resource$1 = "Create {{resource}}";
|
|
1031
1031
|
const edit_resource$1 = "Edit {{resource}}";
|
|
1032
|
-
const state$1 = "
|
|
1032
|
+
const state$1 = "Status";
|
|
1033
1033
|
const name$1 = "Name";
|
|
1034
1034
|
const pod$1 = "Pod";
|
|
1035
1035
|
const cancel$1 = "Cancel";
|
|
@@ -1053,7 +1053,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1053
1053
|
const workload$1 = "Workload";
|
|
1054
1054
|
const empty$1 = "No data available";
|
|
1055
1055
|
const schedule$1 = "Schedule";
|
|
1056
|
-
const lastScheduleTime$1 = "Last
|
|
1056
|
+
const lastScheduleTime$1 = "Last Schedule";
|
|
1057
1057
|
const duration$1 = "Duration";
|
|
1058
1058
|
const started$1 = "Start time";
|
|
1059
1059
|
const container$1 = "Container";
|
|
@@ -1080,7 +1080,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1080
1080
|
const port$1 = "Port";
|
|
1081
1081
|
const cert$1 = "Certificate";
|
|
1082
1082
|
const ip_address$1 = "IP address";
|
|
1083
|
-
const last_seen$1 = "Last
|
|
1083
|
+
const last_seen$1 = "Last Seen";
|
|
1084
1084
|
const node_port$1 = "NodePort";
|
|
1085
1085
|
const protocol$1 = "Protocol";
|
|
1086
1086
|
const key$1 = "Key";
|
|
@@ -1150,9 +1150,9 @@ var __publicField = (obj, key, value) => {
|
|
|
1150
1150
|
const suspend$1 = "Suspend";
|
|
1151
1151
|
const default_backend$1 = "Default backend";
|
|
1152
1152
|
const ingress_class$1 = "IngressClass";
|
|
1153
|
-
const pod_ready_num$1 = "Ready
|
|
1154
|
-
const pod_complete_num$1 = "Completion
|
|
1155
|
-
const pod_replicas_num$1 = "Desired
|
|
1153
|
+
const pod_ready_num$1 = "Ready Pod";
|
|
1154
|
+
const pod_complete_num$1 = "Completion Pod";
|
|
1155
|
+
const pod_replicas_num$1 = "Desired Pod";
|
|
1156
1156
|
const edit_replicas$1 = "Edit expected number of replicas";
|
|
1157
1157
|
const dns_record$1 = "DNS record";
|
|
1158
1158
|
const basic_info$1 = "Basic information";
|
|
@@ -9558,15 +9558,17 @@ var __publicField = (obj, key, value) => {
|
|
|
9558
9558
|
AccessControlAuth2["Create"] = "Create";
|
|
9559
9559
|
return AccessControlAuth2;
|
|
9560
9560
|
})(AccessControlAuth || {});
|
|
9561
|
-
function matchSelector(pod2, selector) {
|
|
9561
|
+
function matchSelector(pod2, selector, namespace2 = "default") {
|
|
9562
9562
|
var _a, _b, _c;
|
|
9563
9563
|
let match = true;
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9564
|
+
if (selector) {
|
|
9565
|
+
for (const key2 in selector.matchLabels) {
|
|
9566
|
+
if (!((_b = (_a = pod2.metadata) == null ? void 0 : _a.labels) == null ? void 0 : _b[key2]) || ((_c = pod2.metadata.labels) == null ? void 0 : _c[key2]) !== selector.matchLabels[key2]) {
|
|
9567
|
+
match = false;
|
|
9568
|
+
}
|
|
9567
9569
|
}
|
|
9568
9570
|
}
|
|
9569
|
-
return match;
|
|
9571
|
+
return match && pod2.metadata.namespace === namespace2;
|
|
9570
9572
|
}
|
|
9571
9573
|
function shortenedImage(image2) {
|
|
9572
9574
|
return (image2 || "").replace(/^(index\.)?docker.io\/(library\/)?/, "").replace(/:latest$/, "").replace(/^(.*@sha256:)([0-9a-f]{8})[0-9a-f]+$/i, "$1$2…");
|
|
@@ -9606,8 +9608,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9606
9608
|
});
|
|
9607
9609
|
const myPods = pods.items.filter(
|
|
9608
9610
|
(p) => {
|
|
9609
|
-
var _a
|
|
9610
|
-
return ((_a = this.spec) == null ? void 0 : _a.selector
|
|
9611
|
+
var _a;
|
|
9612
|
+
return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
|
|
9611
9613
|
}
|
|
9612
9614
|
);
|
|
9613
9615
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
@@ -9671,8 +9673,8 @@ var __publicField = (obj, key, value) => {
|
|
|
9671
9673
|
});
|
|
9672
9674
|
const myPods = pods.items.filter(
|
|
9673
9675
|
(p) => {
|
|
9674
|
-
var _a
|
|
9675
|
-
return ((_a = this.spec) == null ? void 0 : _a.selector
|
|
9676
|
+
var _a;
|
|
9677
|
+
return matchSelector(p, (_a = this.spec) == null ? void 0 : _a.selector, this.metadata.namespace);
|
|
9676
9678
|
}
|
|
9677
9679
|
);
|
|
9678
9680
|
const result = lodashExports.sumBy(myPods, "restartCount");
|
|
@@ -9829,7 +9831,10 @@ var __publicField = (obj, key, value) => {
|
|
|
9829
9831
|
get restartCount() {
|
|
9830
9832
|
var _a, _b;
|
|
9831
9833
|
if ((_a = this._rawYaml.status) == null ? void 0 : _a.containerStatuses) {
|
|
9832
|
-
return ((_b = this._rawYaml.status) == null ? void 0 : _b.containerStatuses
|
|
9834
|
+
return ((_b = this._rawYaml.status) == null ? void 0 : _b.containerStatuses.reduce((count, container2) => {
|
|
9835
|
+
count += container2.restartCount;
|
|
9836
|
+
return count;
|
|
9837
|
+
}, 0)) || 0;
|
|
9833
9838
|
}
|
|
9834
9839
|
return 0;
|
|
9835
9840
|
}
|
|
@@ -10422,6 +10427,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10422
10427
|
const configs = React.useContext(ConfigsContext);
|
|
10423
10428
|
const { edit: edit2 } = useEdit();
|
|
10424
10429
|
const navigation = core.useNavigation();
|
|
10430
|
+
const pushModal = eagle.usePushModal();
|
|
10425
10431
|
const go = core.useGo();
|
|
10426
10432
|
return function openForm() {
|
|
10427
10433
|
var _a, _b;
|
|
@@ -10429,7 +10435,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10429
10435
|
const config = configs[resource.name];
|
|
10430
10436
|
const formType = (_a = config.formConfig) == null ? void 0 : _a.formType;
|
|
10431
10437
|
if (formType === void 0 || formType === FormType.MODAL) {
|
|
10432
|
-
|
|
10438
|
+
pushModal({
|
|
10433
10439
|
component: FormModal,
|
|
10434
10440
|
props: {
|
|
10435
10441
|
resource: resource.name,
|
|
@@ -11342,6 +11348,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11342
11348
|
}
|
|
11343
11349
|
const WorkloadPodsTable_1giuese = "";
|
|
11344
11350
|
const WorkloadPodsTable = ({
|
|
11351
|
+
namespace: namespace2,
|
|
11345
11352
|
selector,
|
|
11346
11353
|
hideToolbar
|
|
11347
11354
|
}) => {
|
|
@@ -11377,7 +11384,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11377
11384
|
field: "",
|
|
11378
11385
|
value: "",
|
|
11379
11386
|
fn(item) {
|
|
11380
|
-
return
|
|
11387
|
+
return matchSelector(item, selector, item.metadata.namespace);
|
|
11381
11388
|
}
|
|
11382
11389
|
}]
|
|
11383
11390
|
}
|
|
@@ -11526,6 +11533,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11526
11533
|
const {
|
|
11527
11534
|
i18n: i18n2
|
|
11528
11535
|
} = useTranslation();
|
|
11536
|
+
const popModal = eagle.usePopModal();
|
|
11529
11537
|
const {
|
|
11530
11538
|
submitting,
|
|
11531
11539
|
errorMsgs,
|
|
@@ -11534,11 +11542,11 @@ var __publicField = (obj, key, value) => {
|
|
|
11534
11542
|
} = useSubmitForm({
|
|
11535
11543
|
formRef: form,
|
|
11536
11544
|
onSubmitSuccess: () => {
|
|
11537
|
-
|
|
11545
|
+
popModal();
|
|
11538
11546
|
}
|
|
11539
11547
|
});
|
|
11540
11548
|
const close = React.useCallback(() => {
|
|
11541
|
-
|
|
11549
|
+
popModal();
|
|
11542
11550
|
reset();
|
|
11543
11551
|
}, [reset]);
|
|
11544
11552
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.modal, {
|
|
@@ -11570,6 +11578,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11570
11578
|
const {
|
|
11571
11579
|
resource
|
|
11572
11580
|
} = core.useResource();
|
|
11581
|
+
const pushModal = eagle.usePushModal();
|
|
11573
11582
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(core.CanAccess, {
|
|
11574
11583
|
resource: resource == null ? void 0 : resource.name,
|
|
11575
11584
|
action: AccessControlAuth.Edit,
|
|
@@ -11577,7 +11586,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11577
11586
|
className: EditButtonStyle,
|
|
11578
11587
|
type: "link",
|
|
11579
11588
|
onClick: () => {
|
|
11580
|
-
|
|
11589
|
+
pushModal({
|
|
11581
11590
|
component: EditFieldModal,
|
|
11582
11591
|
props: modalProps
|
|
11583
11592
|
});
|
|
@@ -11802,6 +11811,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11802
11811
|
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
|
|
11803
11812
|
return r2.kind === "Pod" && r2.type === "creates";
|
|
11804
11813
|
})) == null ? void 0 : _b.selector,
|
|
11814
|
+
namespace: record.metadata.namespace,
|
|
11805
11815
|
hideToolbar: true
|
|
11806
11816
|
}
|
|
11807
11817
|
);
|
|
@@ -11895,6 +11905,7 @@ var __publicField = (obj, key, value) => {
|
|
|
11895
11905
|
selector: (_b = (_a = record.metadata.relations) == null ? void 0 : _a.find((r2) => {
|
|
11896
11906
|
return r2.kind === "Pod" && r2.type === "selects";
|
|
11897
11907
|
})) == null ? void 0 : _b.selector,
|
|
11908
|
+
namespace: record.metadata.namespace,
|
|
11898
11909
|
hideToolbar: true
|
|
11899
11910
|
}
|
|
11900
11911
|
);
|
|
@@ -18396,6 +18407,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18396
18407
|
const { record, size, children } = props;
|
|
18397
18408
|
const kit = eagle.useUIKit();
|
|
18398
18409
|
const { t: t2 } = useTranslation();
|
|
18410
|
+
const pushModal = eagle.usePushModal();
|
|
18399
18411
|
const formRef = React.useRef(null);
|
|
18400
18412
|
const { action, resource } = core.useResource();
|
|
18401
18413
|
const isInShowPage = action === "show";
|
|
@@ -18423,7 +18435,7 @@ var __publicField = (obj, key, value) => {
|
|
|
18423
18435
|
);
|
|
18424
18436
|
}
|
|
18425
18437
|
};
|
|
18426
|
-
|
|
18438
|
+
pushModal({
|
|
18427
18439
|
component: EditFieldModal,
|
|
18428
18440
|
props: modalProps
|
|
18429
18441
|
});
|
|
@@ -23486,9 +23498,6 @@ var __publicField = (obj, key, value) => {
|
|
|
23486
23498
|
errorNotification: false,
|
|
23487
23499
|
transformInitValues,
|
|
23488
23500
|
transformApplyValues,
|
|
23489
|
-
mutationMeta: {
|
|
23490
|
-
updateType: "put"
|
|
23491
|
-
},
|
|
23492
23501
|
...useFormProps
|
|
23493
23502
|
});
|
|
23494
23503
|
const kit = eagle.useUIKit();
|
|
@@ -23574,6 +23583,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23574
23583
|
const configs = React.useContext(ConfigsContext);
|
|
23575
23584
|
const [yamlSaveButtonProps, setYamlSaveButtonProps] = React.useState({});
|
|
23576
23585
|
const [isError, setIsError] = React.useState(false);
|
|
23586
|
+
const popModal = eagle.usePopModal();
|
|
23577
23587
|
const config = configs[resourceFromProps || (resource == null ? void 0 : resource.name) || ""];
|
|
23578
23588
|
const okText = i18n2.t(id ? "dovetail.save" : "dovetail.create");
|
|
23579
23589
|
const action = id ? "edit" : "create";
|
|
@@ -23594,7 +23604,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23594
23604
|
onErrorsChange(errors) {
|
|
23595
23605
|
setIsError(!!errors.length);
|
|
23596
23606
|
},
|
|
23597
|
-
onFinish: eagle.
|
|
23607
|
+
onFinish: eagle.usePopModal
|
|
23598
23608
|
};
|
|
23599
23609
|
}, [props.formProps, (_a = config.formConfig) == null ? void 0 : _a.transformInitValues, (_b = config.formConfig) == null ? void 0 : _b.transformApplyValues, config == null ? void 0 : config.initValue, id, action]);
|
|
23600
23610
|
const refineFormResult = useRefineForm({
|
|
@@ -23602,7 +23612,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23602
23612
|
id,
|
|
23603
23613
|
refineProps: {
|
|
23604
23614
|
onMutationSuccess: () => {
|
|
23605
|
-
|
|
23615
|
+
popModal();
|
|
23606
23616
|
},
|
|
23607
23617
|
redirect: false,
|
|
23608
23618
|
...(_c = config.formConfig) == null ? void 0 : _c.refineCoreProps
|
|
@@ -23626,7 +23636,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23626
23636
|
})();
|
|
23627
23637
|
const saveButtonProps = isYamlForm ? yamlSaveButtonProps : refineFormResult.formResult.saveButtonProps;
|
|
23628
23638
|
const onCancel = React.useCallback(() => {
|
|
23629
|
-
|
|
23639
|
+
popModal();
|
|
23630
23640
|
}, []);
|
|
23631
23641
|
const onOk = React.useCallback((e2) => {
|
|
23632
23642
|
var _a2;
|
|
@@ -24166,7 +24176,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24166
24176
|
dataIndex,
|
|
24167
24177
|
align: "right",
|
|
24168
24178
|
title: i18n2.t("dovetail.restarts"),
|
|
24169
|
-
sortable:
|
|
24179
|
+
sortable: false
|
|
24170
24180
|
};
|
|
24171
24181
|
};
|
|
24172
24182
|
const ReplicasColumnRenderer = (i18n2) => {
|
|
@@ -24176,7 +24186,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24176
24186
|
display: true,
|
|
24177
24187
|
dataIndex,
|
|
24178
24188
|
title: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
|
|
24179
|
-
title: i18n2.t("dovetail.
|
|
24189
|
+
title: i18n2.t("dovetail.completion_num_tooltip"),
|
|
24180
24190
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
24181
24191
|
className: DashedTitleStyle,
|
|
24182
24192
|
children: i18n2.t("dovetail.pod_num")
|
|
@@ -24197,7 +24207,6 @@ var __publicField = (obj, key, value) => {
|
|
|
24197
24207
|
isRelativeTime = true
|
|
24198
24208
|
} = {}) => {
|
|
24199
24209
|
const dataIndex = ["metadata", "creationTimestamp"];
|
|
24200
|
-
const kit = eagle.useUIKit();
|
|
24201
24210
|
return {
|
|
24202
24211
|
key: "creationTimestamp",
|
|
24203
24212
|
display: true,
|
|
@@ -24209,11 +24218,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24209
24218
|
return isRelativeTime ? /* @__PURE__ */ jsxRuntimeExports.jsx(Time, {
|
|
24210
24219
|
date: new Date(value2)
|
|
24211
24220
|
}) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
|
|
24212
|
-
value:
|
|
24213
|
-
date: value2,
|
|
24214
|
-
timeTemplate: "HH:mm:ss",
|
|
24215
|
-
dateTemplate: "YYYY-MM-DD"
|
|
24216
|
-
})
|
|
24221
|
+
value: dayjs(value2).format("YYYY-MM-DD hh:mm:ss")
|
|
24217
24222
|
});
|
|
24218
24223
|
},
|
|
24219
24224
|
...config
|
|
@@ -24554,8 +24559,8 @@ var __publicField = (obj, key, value) => {
|
|
|
24554
24559
|
}),
|
|
24555
24560
|
tooltip: `${v.servicePort} > ${v.targetPort}/${v.protocol}`
|
|
24556
24561
|
}, v.servicePort));
|
|
24557
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24558
|
-
|
|
24562
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
24563
|
+
children: content
|
|
24559
24564
|
});
|
|
24560
24565
|
}
|
|
24561
24566
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LabelSelector } from 'kubernetes-types/meta/v1';
|
|
2
2
|
import { PodModel } from '../models/pod-model';
|
|
3
|
-
export declare function matchSelector(pod: PodModel, selector
|
|
3
|
+
export declare function matchSelector(pod: PodModel, selector?: LabelSelector, namespace?: string): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"module": "./dist/refine.js",
|
|
11
11
|
"types": "./lib/src/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@cloudtower/eagle": "^0.
|
|
14
|
-
"@cloudtower/icons-react": "^0.
|
|
13
|
+
"@cloudtower/eagle": "^0.29.0-alpha.0",
|
|
14
|
+
"@cloudtower/icons-react": "^0.29.0-alpha.0",
|
|
15
15
|
"@patternfly/react-core": "^5.1.1",
|
|
16
16
|
"@patternfly/react-log-viewer": "^5.0.0",
|
|
17
17
|
"@refinedev/core": "^4.47.2",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dayjs": "^1.11.10",
|
|
22
22
|
"i18next": "^23.2.3",
|
|
23
23
|
"js-yaml": "^4.1.0",
|
|
24
|
-
"k8s-api-provider": "0.0.
|
|
24
|
+
"k8s-api-provider": "0.0.21",
|
|
25
25
|
"ky": "^0.33.3",
|
|
26
26
|
"lodash-es": "^4.17.21",
|
|
27
27
|
"mitt": "^3.0.1",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"vite-plugin-commonjs": "^0.10.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@cloudtower/eagle": "^0.
|
|
73
|
-
"@cloudtower/icons-react": "^0.
|
|
72
|
+
"@cloudtower/eagle": "^0.28.0-alpha.0",
|
|
73
|
+
"@cloudtower/icons-react": "^0.28.0-alpha.0",
|
|
74
74
|
"@refinedev/core": "^4.47.2",
|
|
75
75
|
"antd": "4.5.0",
|
|
76
76
|
"i18next": "^23.2.3",
|