@dovetail-v2/refine 0.0.14-beta.0 → 0.0.14-beta.2
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.8847f437.js → MonacoYamlDiffEditor.e41c15eb.js} +1 -1
- package/dist/{index.0c2122ef.js → index.453e0071.js} +40 -31
- package/dist/refine.js +2 -1
- package/dist/refine.umd.cjs +39 -30
- package/lib/src/hooks/useEagleTable/columns.d.ts +3 -3
- package/lib/src/models/event-model.d.ts +8 -0
- package/lib/src/models/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -6857,18 +6857,14 @@ const useEagleForm = ({
|
|
|
6857
6857
|
const warnWhenUnsavedChanges = warnWhenUnsavedChangesProp != null ? warnWhenUnsavedChangesProp : warnWhenUnsavedChangesRefine;
|
|
6858
6858
|
React.useEffect(() => {
|
|
6859
6859
|
var _a2;
|
|
6860
|
-
form.resetFields();
|
|
6861
6860
|
if (editor.current) {
|
|
6862
|
-
const editorValue = yaml.dump(form.getFieldsValue(true));
|
|
6863
6861
|
const editorInstance = editor.current.getEditorInstance();
|
|
6864
|
-
editor.current.setEditorValue(editorValue);
|
|
6865
|
-
editor.current.setValue(editorValue);
|
|
6866
6862
|
if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && editorInstance && !isFoldRef.current) {
|
|
6867
6863
|
fold(editorInstance);
|
|
6868
6864
|
isFoldRef.current = true;
|
|
6869
6865
|
}
|
|
6870
6866
|
}
|
|
6871
|
-
}, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id,
|
|
6867
|
+
}, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, fold]);
|
|
6872
6868
|
React.useEffect(() => {
|
|
6873
6869
|
var _a2, _b2;
|
|
6874
6870
|
const response = (_a2 = useFormCoreResult.mutationResult.error) == null ? void 0 : _a2.response;
|
|
@@ -7402,7 +7398,7 @@ const WorkloadReplicas = ({
|
|
|
7402
7398
|
const currentReplicas = get(record, "spec.replicas", 0);
|
|
7403
7399
|
const scale = (delta) => {
|
|
7404
7400
|
const v = record.scale(currentReplicas + delta);
|
|
7405
|
-
const id =
|
|
7401
|
+
const id = record.id;
|
|
7406
7402
|
pruneBeforeEdit(v);
|
|
7407
7403
|
mutate({
|
|
7408
7404
|
id,
|
|
@@ -7787,7 +7783,7 @@ const DurationColumnRenderer = () => {
|
|
|
7787
7783
|
};
|
|
7788
7784
|
};
|
|
7789
7785
|
const ServiceTypeColumnRenderer = () => {
|
|
7790
|
-
const dataIndex = ["
|
|
7786
|
+
const dataIndex = ["spec", "type"];
|
|
7791
7787
|
return {
|
|
7792
7788
|
key: "type",
|
|
7793
7789
|
title: i18n.t("dovetail.type"),
|
|
@@ -8927,7 +8923,7 @@ const DataField = () => {
|
|
|
8927
8923
|
return {
|
|
8928
8924
|
key: "data",
|
|
8929
8925
|
title: i18n.t("dovetail.data"),
|
|
8930
|
-
path: ["
|
|
8926
|
+
path: ["data"],
|
|
8931
8927
|
render: (val) => {
|
|
8932
8928
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(KeyValue, { value: val });
|
|
8933
8929
|
}
|
|
@@ -8937,7 +8933,7 @@ const SecretDataField = () => {
|
|
|
8937
8933
|
return {
|
|
8938
8934
|
key: "data",
|
|
8939
8935
|
title: i18n.t("dovetail.data"),
|
|
8940
|
-
path: ["
|
|
8936
|
+
path: ["data"],
|
|
8941
8937
|
render: (val) => {
|
|
8942
8938
|
const decodeVal = {};
|
|
8943
8939
|
for (const key in val) {
|
|
@@ -8961,21 +8957,21 @@ const ServiceTypeField = () => {
|
|
|
8961
8957
|
return {
|
|
8962
8958
|
key: "type",
|
|
8963
8959
|
title: i18n.t("dovetail.type"),
|
|
8964
|
-
path: ["
|
|
8960
|
+
path: ["spec", "type"]
|
|
8965
8961
|
};
|
|
8966
8962
|
};
|
|
8967
8963
|
const ClusterIpField = () => {
|
|
8968
8964
|
return {
|
|
8969
8965
|
key: "clusterIp",
|
|
8970
8966
|
title: i18n.t("dovetail.clusterIp"),
|
|
8971
|
-
path: ["
|
|
8967
|
+
path: ["spec", "clusterIP"]
|
|
8972
8968
|
};
|
|
8973
8969
|
};
|
|
8974
8970
|
const SessionAffinityField = () => {
|
|
8975
8971
|
return {
|
|
8976
8972
|
key: "clusterIp",
|
|
8977
8973
|
title: i18n.t("dovetail.sessionAffinity"),
|
|
8978
|
-
path: ["
|
|
8974
|
+
path: ["spec", "sessionAffinity"]
|
|
8979
8975
|
};
|
|
8980
8976
|
};
|
|
8981
8977
|
const ServicePodsField = () => {
|
|
@@ -9171,46 +9167,45 @@ const EventsTable = ({}) => {
|
|
|
9171
9167
|
{
|
|
9172
9168
|
key: "type",
|
|
9173
9169
|
display: true,
|
|
9174
|
-
dataIndex: ["
|
|
9170
|
+
dataIndex: ["type"],
|
|
9175
9171
|
title: i18n2.t("dovetail.type"),
|
|
9176
9172
|
sortable: true,
|
|
9177
|
-
sorter: CommonSorter(["
|
|
9173
|
+
sorter: CommonSorter(["type"])
|
|
9178
9174
|
},
|
|
9179
9175
|
{
|
|
9180
9176
|
key: "reason",
|
|
9181
9177
|
display: true,
|
|
9182
|
-
dataIndex: ["
|
|
9178
|
+
dataIndex: ["reason"],
|
|
9183
9179
|
title: i18n2.t("dovetail.reason"),
|
|
9184
9180
|
sortable: true,
|
|
9185
|
-
sorter: CommonSorter(["
|
|
9181
|
+
sorter: CommonSorter(["reason"])
|
|
9186
9182
|
},
|
|
9187
9183
|
{
|
|
9188
9184
|
key: "object",
|
|
9189
9185
|
display: true,
|
|
9190
|
-
dataIndex: ["
|
|
9186
|
+
dataIndex: ["regarding", "name"],
|
|
9191
9187
|
title: i18n2.t("dovetail.object"),
|
|
9192
9188
|
sortable: true,
|
|
9193
|
-
sorter: CommonSorter(["
|
|
9189
|
+
sorter: CommonSorter(["regarding", "name"])
|
|
9194
9190
|
},
|
|
9195
9191
|
{
|
|
9196
9192
|
key: "note",
|
|
9197
9193
|
display: true,
|
|
9198
|
-
dataIndex: ["
|
|
9194
|
+
dataIndex: ["note"],
|
|
9199
9195
|
title: i18n2.t("dovetail.note"),
|
|
9200
9196
|
sortable: true,
|
|
9201
|
-
sorter: CommonSorter(["
|
|
9197
|
+
sorter: CommonSorter(["note"])
|
|
9202
9198
|
},
|
|
9203
9199
|
AgeColumnRenderer()
|
|
9204
9200
|
],
|
|
9205
9201
|
[i18n2]
|
|
9206
9202
|
);
|
|
9207
|
-
const dataSource = useMemo(
|
|
9208
|
-
|
|
9203
|
+
const dataSource = useMemo(() => {
|
|
9204
|
+
return data2 == null ? void 0 : data2.data.filter((d) => {
|
|
9209
9205
|
const objectId = `${d.regarding.namespace}/${d.regarding.name}`;
|
|
9210
9206
|
return objectId === parsed.id;
|
|
9211
|
-
})
|
|
9212
|
-
|
|
9213
|
-
);
|
|
9207
|
+
});
|
|
9208
|
+
}, [data2 == null ? void 0 : data2.data, parsed]);
|
|
9214
9209
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9215
9210
|
Table,
|
|
9216
9211
|
{
|
|
@@ -9676,7 +9671,7 @@ const Separator = () => {
|
|
|
9676
9671
|
});
|
|
9677
9672
|
};
|
|
9678
9673
|
const MonacoYamlEditor = React.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
|
|
9679
|
-
const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.
|
|
9674
|
+
const MonacoYamlDiffEditor = React.lazy(() => import("./MonacoYamlDiffEditor.e41c15eb.js"));
|
|
9680
9675
|
const YamlEditorComponent = forwardRef(
|
|
9681
9676
|
function YamlEditorComponent2(props, ref) {
|
|
9682
9677
|
const {
|
|
@@ -10172,6 +10167,9 @@ function YamlForm(props) {
|
|
|
10172
10167
|
i18n: i18n2
|
|
10173
10168
|
} = useTranslation();
|
|
10174
10169
|
const responseErrors = errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [];
|
|
10170
|
+
const schema = useMemo(() => {
|
|
10171
|
+
return editorProps.schema || {};
|
|
10172
|
+
}, [editorProps.schema]);
|
|
10175
10173
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(FormLayout, {
|
|
10176
10174
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(kit.form, {
|
|
10177
10175
|
...formProps,
|
|
@@ -10190,7 +10188,7 @@ function YamlForm(props) {
|
|
|
10190
10188
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(YamlEditorComponent, {
|
|
10191
10189
|
...editorProps,
|
|
10192
10190
|
className: EditorStyle,
|
|
10193
|
-
schema
|
|
10191
|
+
schema,
|
|
10194
10192
|
collapsable: false
|
|
10195
10193
|
})
|
|
10196
10194
|
}), /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.form.Item, {
|
|
@@ -16350,7 +16348,8 @@ class WorkloadModel extends WorkloadBaseModel {
|
|
|
16350
16348
|
this.restarts = result;
|
|
16351
16349
|
}
|
|
16352
16350
|
redeploy() {
|
|
16353
|
-
const
|
|
16351
|
+
const rawYaml = this._globalStore.restoreItem(this);
|
|
16352
|
+
const newOne = lodash.exports.cloneDeep(rawYaml);
|
|
16354
16353
|
const path = "spec.template.metadata.annotations";
|
|
16355
16354
|
const annotations = lodash.exports.get(newOne, path, {});
|
|
16356
16355
|
lodash.exports.set(newOne, path, {
|
|
@@ -16360,7 +16359,8 @@ class WorkloadModel extends WorkloadBaseModel {
|
|
|
16360
16359
|
return newOne;
|
|
16361
16360
|
}
|
|
16362
16361
|
scale(value) {
|
|
16363
|
-
const
|
|
16362
|
+
const rawYaml = this._globalStore.restoreItem(this);
|
|
16363
|
+
const newOne = lodash.exports.cloneDeep(rawYaml);
|
|
16364
16364
|
if (newOne.kind === "Deployment" || newOne.kind === "StatefulSet") {
|
|
16365
16365
|
lodash.exports.set(newOne, "spec.replicas", value);
|
|
16366
16366
|
}
|
|
@@ -16491,13 +16491,22 @@ class CronJobModel extends WorkloadBaseModel {
|
|
|
16491
16491
|
return newOne;
|
|
16492
16492
|
}
|
|
16493
16493
|
}
|
|
16494
|
+
class EventModel extends ResourceModel {
|
|
16495
|
+
constructor(_rawYaml, _globalStore) {
|
|
16496
|
+
super(_rawYaml, _globalStore);
|
|
16497
|
+
this._rawYaml = _rawYaml;
|
|
16498
|
+
this._globalStore = _globalStore;
|
|
16499
|
+
this.id = _rawYaml.metadata.uid || _rawYaml.id;
|
|
16500
|
+
}
|
|
16501
|
+
}
|
|
16494
16502
|
const ModelMap = {
|
|
16495
16503
|
Deployment: WorkloadModel,
|
|
16496
16504
|
DaemonSet: WorkloadModel,
|
|
16497
16505
|
StatefulSet: WorkloadModel,
|
|
16498
16506
|
CronJob: CronJobModel,
|
|
16499
16507
|
Job: JobModel,
|
|
16500
|
-
Pod: PodModel
|
|
16508
|
+
Pod: PodModel,
|
|
16509
|
+
Event: EventModel
|
|
16501
16510
|
};
|
|
16502
16511
|
class ModelPlugin {
|
|
16503
16512
|
constructor() {
|
|
@@ -16679,7 +16688,6 @@ var RESOURCE_GROUP = /* @__PURE__ */ ((RESOURCE_GROUP2) => {
|
|
|
16679
16688
|
RESOURCE_GROUP2["CLUSTER"] = "CLUSTER";
|
|
16680
16689
|
return RESOURCE_GROUP2;
|
|
16681
16690
|
})(RESOURCE_GROUP || {});
|
|
16682
|
-
console.log("betaversion");
|
|
16683
16691
|
export {
|
|
16684
16692
|
ConditionsField as $,
|
|
16685
16693
|
AgeColumnRenderer as A,
|
|
@@ -16726,6 +16734,7 @@ export {
|
|
|
16726
16734
|
PodMetricsModel as aD,
|
|
16727
16735
|
ResourceModel as aE,
|
|
16728
16736
|
CronJobModel as aF,
|
|
16737
|
+
EventModel as aG,
|
|
16729
16738
|
SchemaStrategy as aa,
|
|
16730
16739
|
DeleteManyButton as ab,
|
|
16731
16740
|
ListPage as ac,
|
package/dist/refine.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ai, A, an, B, ap, a6, g, C, f, ay, $, v, y, J, aF, Q, aq, ao, a2, V, ab, aw, ae, D, ag, Z, I, ar, az, a1, T, K, X, ac, af, M, ah, N, m, b, q, ak, d, at, t, P, w, am, aD, aC, a0, ax, _, R, G, F, z, aE, E, L, e, au, as, aa, a3, U, a8, S, a5, a7, a9, a4, ad, av, al, aB, x, W, aA, H, O, c, Y, n, s, p, o, r, a, i, h, k, l, aj, u } from "./index.
|
|
1
|
+
import { ai, A, an, B, ap, a6, g, C, f, ay, $, v, y, J, aF, Q, aq, ao, a2, V, ab, aw, ae, D, ag, aG, Z, I, ar, az, a1, T, K, X, ac, af, M, ah, N, m, b, q, ak, d, at, t, P, w, am, aD, aC, a0, ax, _, R, G, F, z, aE, E, L, e, au, as, aa, a3, U, a8, S, a5, a7, a9, a4, ad, av, al, aB, x, W, aA, H, O, c, Y, n, s, p, o, r, a, i, h, k, l, aj, u } from "./index.453e0071.js";
|
|
2
2
|
import "@cloudtower/eagle";
|
|
3
3
|
import "@refinedev/core";
|
|
4
4
|
import "js-yaml";
|
|
@@ -40,6 +40,7 @@ export {
|
|
|
40
40
|
ae as DrawerShow,
|
|
41
41
|
D as DurationColumnRenderer,
|
|
42
42
|
ag as EditButton,
|
|
43
|
+
aG as EventModel,
|
|
43
44
|
Z as ImageField,
|
|
44
45
|
I as ImageNames,
|
|
45
46
|
ar as JOB_INIT_VALUE,
|
package/dist/refine.umd.cjs
CHANGED
|
@@ -6870,18 +6870,14 @@ var __publicField = (obj, key, value) => {
|
|
|
6870
6870
|
const warnWhenUnsavedChanges = warnWhenUnsavedChangesProp != null ? warnWhenUnsavedChangesProp : warnWhenUnsavedChangesRefine;
|
|
6871
6871
|
React__default.default.useEffect(() => {
|
|
6872
6872
|
var _a2;
|
|
6873
|
-
form.resetFields();
|
|
6874
6873
|
if (editor.current) {
|
|
6875
|
-
const editorValue = yaml__default.default.dump(form.getFieldsValue(true));
|
|
6876
6874
|
const editorInstance = editor.current.getEditorInstance();
|
|
6877
|
-
editor.current.setEditorValue(editorValue);
|
|
6878
|
-
editor.current.setValue(editorValue);
|
|
6879
6875
|
if (((_a2 = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a2.data) && editorInstance && !isFoldRef.current) {
|
|
6880
6876
|
fold(editorInstance);
|
|
6881
6877
|
isFoldRef.current = true;
|
|
6882
6878
|
}
|
|
6883
6879
|
}
|
|
6884
|
-
}, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id,
|
|
6880
|
+
}, [(_a = queryResult == null ? void 0 : queryResult.data) == null ? void 0 : _a.data, id, fold]);
|
|
6885
6881
|
React__default.default.useEffect(() => {
|
|
6886
6882
|
var _a2, _b2;
|
|
6887
6883
|
const response = (_a2 = useFormCoreResult.mutationResult.error) == null ? void 0 : _a2.response;
|
|
@@ -7415,7 +7411,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7415
7411
|
const currentReplicas = lodashEs.get(record, "spec.replicas", 0);
|
|
7416
7412
|
const scale = (delta) => {
|
|
7417
7413
|
const v = record.scale(currentReplicas + delta);
|
|
7418
|
-
const id =
|
|
7414
|
+
const id = record.id;
|
|
7419
7415
|
pruneBeforeEdit(v);
|
|
7420
7416
|
mutate({
|
|
7421
7417
|
id,
|
|
@@ -7800,7 +7796,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7800
7796
|
};
|
|
7801
7797
|
};
|
|
7802
7798
|
const ServiceTypeColumnRenderer = () => {
|
|
7803
|
-
const dataIndex = ["
|
|
7799
|
+
const dataIndex = ["spec", "type"];
|
|
7804
7800
|
return {
|
|
7805
7801
|
key: "type",
|
|
7806
7802
|
title: i18n__default.default.t("dovetail.type"),
|
|
@@ -8940,7 +8936,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8940
8936
|
return {
|
|
8941
8937
|
key: "data",
|
|
8942
8938
|
title: i18n__default.default.t("dovetail.data"),
|
|
8943
|
-
path: ["
|
|
8939
|
+
path: ["data"],
|
|
8944
8940
|
render: (val) => {
|
|
8945
8941
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(KeyValue, { value: val });
|
|
8946
8942
|
}
|
|
@@ -8950,7 +8946,7 @@ var __publicField = (obj, key, value) => {
|
|
|
8950
8946
|
return {
|
|
8951
8947
|
key: "data",
|
|
8952
8948
|
title: i18n__default.default.t("dovetail.data"),
|
|
8953
|
-
path: ["
|
|
8949
|
+
path: ["data"],
|
|
8954
8950
|
render: (val) => {
|
|
8955
8951
|
const decodeVal = {};
|
|
8956
8952
|
for (const key in val) {
|
|
@@ -8974,21 +8970,21 @@ var __publicField = (obj, key, value) => {
|
|
|
8974
8970
|
return {
|
|
8975
8971
|
key: "type",
|
|
8976
8972
|
title: i18n__default.default.t("dovetail.type"),
|
|
8977
|
-
path: ["
|
|
8973
|
+
path: ["spec", "type"]
|
|
8978
8974
|
};
|
|
8979
8975
|
};
|
|
8980
8976
|
const ClusterIpField = () => {
|
|
8981
8977
|
return {
|
|
8982
8978
|
key: "clusterIp",
|
|
8983
8979
|
title: i18n__default.default.t("dovetail.clusterIp"),
|
|
8984
|
-
path: ["
|
|
8980
|
+
path: ["spec", "clusterIP"]
|
|
8985
8981
|
};
|
|
8986
8982
|
};
|
|
8987
8983
|
const SessionAffinityField = () => {
|
|
8988
8984
|
return {
|
|
8989
8985
|
key: "clusterIp",
|
|
8990
8986
|
title: i18n__default.default.t("dovetail.sessionAffinity"),
|
|
8991
|
-
path: ["
|
|
8987
|
+
path: ["spec", "sessionAffinity"]
|
|
8992
8988
|
};
|
|
8993
8989
|
};
|
|
8994
8990
|
const ServicePodsField = () => {
|
|
@@ -9184,46 +9180,45 @@ var __publicField = (obj, key, value) => {
|
|
|
9184
9180
|
{
|
|
9185
9181
|
key: "type",
|
|
9186
9182
|
display: true,
|
|
9187
|
-
dataIndex: ["
|
|
9183
|
+
dataIndex: ["type"],
|
|
9188
9184
|
title: i18n2.t("dovetail.type"),
|
|
9189
9185
|
sortable: true,
|
|
9190
|
-
sorter: CommonSorter(["
|
|
9186
|
+
sorter: CommonSorter(["type"])
|
|
9191
9187
|
},
|
|
9192
9188
|
{
|
|
9193
9189
|
key: "reason",
|
|
9194
9190
|
display: true,
|
|
9195
|
-
dataIndex: ["
|
|
9191
|
+
dataIndex: ["reason"],
|
|
9196
9192
|
title: i18n2.t("dovetail.reason"),
|
|
9197
9193
|
sortable: true,
|
|
9198
|
-
sorter: CommonSorter(["
|
|
9194
|
+
sorter: CommonSorter(["reason"])
|
|
9199
9195
|
},
|
|
9200
9196
|
{
|
|
9201
9197
|
key: "object",
|
|
9202
9198
|
display: true,
|
|
9203
|
-
dataIndex: ["
|
|
9199
|
+
dataIndex: ["regarding", "name"],
|
|
9204
9200
|
title: i18n2.t("dovetail.object"),
|
|
9205
9201
|
sortable: true,
|
|
9206
|
-
sorter: CommonSorter(["
|
|
9202
|
+
sorter: CommonSorter(["regarding", "name"])
|
|
9207
9203
|
},
|
|
9208
9204
|
{
|
|
9209
9205
|
key: "note",
|
|
9210
9206
|
display: true,
|
|
9211
|
-
dataIndex: ["
|
|
9207
|
+
dataIndex: ["note"],
|
|
9212
9208
|
title: i18n2.t("dovetail.note"),
|
|
9213
9209
|
sortable: true,
|
|
9214
|
-
sorter: CommonSorter(["
|
|
9210
|
+
sorter: CommonSorter(["note"])
|
|
9215
9211
|
},
|
|
9216
9212
|
AgeColumnRenderer()
|
|
9217
9213
|
],
|
|
9218
9214
|
[i18n2]
|
|
9219
9215
|
);
|
|
9220
|
-
const dataSource = React.useMemo(
|
|
9221
|
-
|
|
9216
|
+
const dataSource = React.useMemo(() => {
|
|
9217
|
+
return data2 == null ? void 0 : data2.data.filter((d) => {
|
|
9222
9218
|
const objectId = `${d.regarding.namespace}/${d.regarding.name}`;
|
|
9223
9219
|
return objectId === parsed.id;
|
|
9224
|
-
})
|
|
9225
|
-
|
|
9226
|
-
);
|
|
9220
|
+
});
|
|
9221
|
+
}, [data2 == null ? void 0 : data2.data, parsed]);
|
|
9227
9222
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(
|
|
9228
9223
|
Table,
|
|
9229
9224
|
{
|
|
@@ -10185,6 +10180,9 @@ var __publicField = (obj, key, value) => {
|
|
|
10185
10180
|
i18n: i18n2
|
|
10186
10181
|
} = useTranslation();
|
|
10187
10182
|
const responseErrors = errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [];
|
|
10183
|
+
const schema = React.useMemo(() => {
|
|
10184
|
+
return editorProps.schema || {};
|
|
10185
|
+
}, [editorProps.schema]);
|
|
10188
10186
|
return /* @__PURE__ */ jsxRuntime.exports.jsx(FormLayout, {
|
|
10189
10187
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(kit.form, {
|
|
10190
10188
|
...formProps,
|
|
@@ -10203,7 +10201,7 @@ var __publicField = (obj, key, value) => {
|
|
|
10203
10201
|
children: /* @__PURE__ */ jsxRuntime.exports.jsx(YamlEditorComponent, {
|
|
10204
10202
|
...editorProps,
|
|
10205
10203
|
className: EditorStyle,
|
|
10206
|
-
schema
|
|
10204
|
+
schema,
|
|
10207
10205
|
collapsable: false
|
|
10208
10206
|
})
|
|
10209
10207
|
}), /* @__PURE__ */ jsxRuntime.exports.jsxs(kit.form.Item, {
|
|
@@ -16363,7 +16361,8 @@ var __publicField = (obj, key, value) => {
|
|
|
16363
16361
|
this.restarts = result;
|
|
16364
16362
|
}
|
|
16365
16363
|
redeploy() {
|
|
16366
|
-
const
|
|
16364
|
+
const rawYaml = this._globalStore.restoreItem(this);
|
|
16365
|
+
const newOne = lodash.exports.cloneDeep(rawYaml);
|
|
16367
16366
|
const path = "spec.template.metadata.annotations";
|
|
16368
16367
|
const annotations = lodash.exports.get(newOne, path, {});
|
|
16369
16368
|
lodash.exports.set(newOne, path, {
|
|
@@ -16373,7 +16372,8 @@ var __publicField = (obj, key, value) => {
|
|
|
16373
16372
|
return newOne;
|
|
16374
16373
|
}
|
|
16375
16374
|
scale(value) {
|
|
16376
|
-
const
|
|
16375
|
+
const rawYaml = this._globalStore.restoreItem(this);
|
|
16376
|
+
const newOne = lodash.exports.cloneDeep(rawYaml);
|
|
16377
16377
|
if (newOne.kind === "Deployment" || newOne.kind === "StatefulSet") {
|
|
16378
16378
|
lodash.exports.set(newOne, "spec.replicas", value);
|
|
16379
16379
|
}
|
|
@@ -16504,13 +16504,22 @@ var __publicField = (obj, key, value) => {
|
|
|
16504
16504
|
return newOne;
|
|
16505
16505
|
}
|
|
16506
16506
|
}
|
|
16507
|
+
class EventModel extends ResourceModel {
|
|
16508
|
+
constructor(_rawYaml, _globalStore) {
|
|
16509
|
+
super(_rawYaml, _globalStore);
|
|
16510
|
+
this._rawYaml = _rawYaml;
|
|
16511
|
+
this._globalStore = _globalStore;
|
|
16512
|
+
this.id = _rawYaml.metadata.uid || _rawYaml.id;
|
|
16513
|
+
}
|
|
16514
|
+
}
|
|
16507
16515
|
const ModelMap = {
|
|
16508
16516
|
Deployment: WorkloadModel,
|
|
16509
16517
|
DaemonSet: WorkloadModel,
|
|
16510
16518
|
StatefulSet: WorkloadModel,
|
|
16511
16519
|
CronJob: CronJobModel,
|
|
16512
16520
|
Job: JobModel,
|
|
16513
|
-
Pod: PodModel
|
|
16521
|
+
Pod: PodModel,
|
|
16522
|
+
Event: EventModel
|
|
16514
16523
|
};
|
|
16515
16524
|
class ModelPlugin {
|
|
16516
16525
|
constructor() {
|
|
@@ -16692,7 +16701,6 @@ var __publicField = (obj, key, value) => {
|
|
|
16692
16701
|
RESOURCE_GROUP2["CLUSTER"] = "CLUSTER";
|
|
16693
16702
|
return RESOURCE_GROUP2;
|
|
16694
16703
|
})(RESOURCE_GROUP || {});
|
|
16695
|
-
console.log("betaversion");
|
|
16696
16704
|
const MonacoYamlDiffEditor = (props) => {
|
|
16697
16705
|
const ref = React.useRef(null);
|
|
16698
16706
|
const { origin, modified, id, height } = props;
|
|
@@ -16758,6 +16766,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16758
16766
|
exports2.DrawerShow = DrawerShow;
|
|
16759
16767
|
exports2.DurationColumnRenderer = DurationColumnRenderer;
|
|
16760
16768
|
exports2.EditButton = EditButton;
|
|
16769
|
+
exports2.EventModel = EventModel;
|
|
16761
16770
|
exports2.ImageField = ImageField;
|
|
16762
16771
|
exports2.ImageNames = ImageNames;
|
|
16763
16772
|
exports2.JOB_INIT_VALUE = JOB_INIT_VALUE;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Column } from '../../components/Table';
|
|
2
|
-
import { JobModel, PodModel, ResourceModel, WorkloadModel, WorkloadBaseModel } from '../../models';
|
|
2
|
+
import { JobModel, PodModel, ResourceModel, WorkloadModel, WorkloadBaseModel, CronJobModel } from '../../models';
|
|
3
3
|
export declare const CommonSorter: (dataIndex: string[]) => (a: unknown, b: unknown) => 0 | 1 | -1;
|
|
4
4
|
export declare const NameColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(resource?: string) => Column<Model>;
|
|
5
5
|
export declare const NameSpaceColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>() => Column<Model>;
|
|
@@ -10,6 +10,6 @@ export declare const ReplicasColumnRenderer: <Model extends WorkloadModel>() =>
|
|
|
10
10
|
export declare const AgeColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>() => Column<Model>;
|
|
11
11
|
export declare const NodeNameColumnRenderer: <Model extends PodModel>(options?: Partial<Column<Model>> | undefined) => Column<Model>;
|
|
12
12
|
export declare const RestartCountColumnRenderer: <Model extends PodModel>() => Column<Model>;
|
|
13
|
-
export declare const CompletionsCountColumnRenderer: <Model extends JobModel>() => Column<Model>;
|
|
14
|
-
export declare const DurationColumnRenderer: <Model extends JobModel>() => Column<Model>;
|
|
13
|
+
export declare const CompletionsCountColumnRenderer: <Model extends JobModel | CronJobModel>() => Column<Model>;
|
|
14
|
+
export declare const DurationColumnRenderer: <Model extends JobModel | CronJobModel>() => Column<Model>;
|
|
15
15
|
export declare const ServiceTypeColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>() => Column<Model>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GlobalStore, Unstructured } from 'k8s-api-provider';
|
|
2
|
+
import { Event } from 'kubernetes-types/core/v1';
|
|
3
|
+
import { ResourceModel } from './resource-model';
|
|
4
|
+
export declare class EventModel extends ResourceModel {
|
|
5
|
+
_rawYaml: Unstructured & Event;
|
|
6
|
+
_globalStore: GlobalStore;
|
|
7
|
+
constructor(_rawYaml: Unstructured & Event, _globalStore: GlobalStore);
|
|
8
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.0.14-beta.
|
|
3
|
+
"version": "0.0.14-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dayjs": "^1.11.10",
|
|
21
21
|
"i18next": "^23.2.3",
|
|
22
22
|
"js-yaml": "^4.1.0",
|
|
23
|
-
"k8s-api-provider": "0.0.15-beta.
|
|
23
|
+
"k8s-api-provider": "0.0.15-beta.2",
|
|
24
24
|
"ky": "^0.33.3",
|
|
25
25
|
"lodash-es": "^4.17.21",
|
|
26
26
|
"mitt": "^3.0.1",
|