@dovetail-v2/refine 0.2.4-alpha.0 → 0.2.4
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-7de94ad2.js → MonacoYamlDiffEditor-e0b05820.js} +24 -1
- package/dist/{MonacoYamlEditor-bc70e03e.js → MonacoYamlEditor-96d9a48c.js} +9 -2
- package/dist/{index-44cc930a.js → index-d8439125.js} +1919 -273
- package/dist/refine.js +257 -247
- package/dist/refine.umd.cjs +20793 -0
- package/dist/style.css +838 -883
- package/{dist → lib}/components/PodShellModal/PodShell.d.ts +5 -3
- package/lib/components/PodShellModal/index.d.ts +10 -0
- package/{dist → lib}/components/Shell/index.d.ts +5 -1
- package/{dist → lib}/components/index.d.ts +1 -0
- package/{dist → lib}/utils/index.d.ts +1 -0
- package/package.json +4 -4
- package/dist/MonacoYamlDiffEditor-7a07db88.cjs +0 -59
- package/dist/MonacoYamlEditor-bc33cd45.cjs +0 -206
- package/dist/PodShell-43c7028e.cjs +0 -216
- package/dist/PodShell-ba204cde.js +0 -216
- package/dist/common-1eb43414.cjs +0 -982
- package/dist/common-feae5742.js +0 -983
- package/dist/components/PodShellModal/index.d.ts +0 -10
- package/dist/components/Shell/Connecting.d.ts +0 -2
- package/dist/components/Shell/common.d.ts +0 -5
- package/dist/index-31874f77.cjs +0 -496
- package/dist/index-40deb620.js +0 -497
- package/dist/index-ee8ac828.cjs +0 -18959
- package/dist/refine.cjs +0 -279
- package/dist/shell.cjs +0 -17
- package/dist/shell.d.ts +0 -2
- package/dist/shell.js +0 -17
- /package/{dist → lib}/App.d.ts +0 -0
- /package/{dist → lib}/Dovetail.d.ts +0 -0
- /package/{dist → lib}/components/Breadcrumb/index.d.ts +0 -0
- /package/{dist → lib}/components/ConditionsTable/ConditionsTable.d.ts +0 -0
- /package/{dist → lib}/components/ConditionsTable/index.d.ts +0 -0
- /package/{dist → lib}/components/CreateButton/index.d.ts +0 -0
- /package/{dist → lib}/components/CronjobJobsTable/index.d.ts +0 -0
- /package/{dist → lib}/components/DeleteButton/index.d.ts +0 -0
- /package/{dist → lib}/components/DeleteManyButton/index.d.ts +0 -0
- /package/{dist → lib}/components/DrawerShow/DrawerShow.d.ts +0 -0
- /package/{dist → lib}/components/DrawerShow/index.d.ts +0 -0
- /package/{dist → lib}/components/DropdownMenuItems/EditAnnotationDropdownMenuItem.d.ts +0 -0
- /package/{dist → lib}/components/DropdownMenuItems/EditLabelDropdownMenuItem.d.ts +0 -0
- /package/{dist → lib}/components/DropdownMenuItems/EditNodeTaintDropdownMenuItem.d.ts +0 -0
- /package/{dist → lib}/components/DropdownMenuItems/index.d.ts +0 -0
- /package/{dist → lib}/components/Dropdowns/CronJobDropdown/index.d.ts +0 -0
- /package/{dist → lib}/components/Dropdowns/K8sDropdown/index.d.ts +0 -0
- /package/{dist → lib}/components/Dropdowns/PodDropdown/index.d.ts +0 -0
- /package/{dist → lib}/components/Dropdowns/ReplicasDropdown/index.d.ts +0 -0
- /package/{dist → lib}/components/Dropdowns/WorkloadDropdown/index.d.ts +0 -0
- /package/{dist → lib}/components/DurationTime/index.d.ts +0 -0
- /package/{dist → lib}/components/EditButton/index.d.ts +0 -0
- /package/{dist → lib}/components/EditField/index.d.ts +0 -0
- /package/{dist → lib}/components/EditMetadataForm/EditAnnotationForm.d.ts +0 -0
- /package/{dist → lib}/components/EditMetadataForm/EditLabelForm.d.ts +0 -0
- /package/{dist → lib}/components/EditMetadataForm/EditNodeTaintForm.d.ts +0 -0
- /package/{dist → lib}/components/EditMetadataForm/KeyValueTableForm.d.ts +0 -0
- /package/{dist → lib}/components/EditMetadataForm/LabelFormatPopover.d.ts +0 -0
- /package/{dist → lib}/components/EditMetadataForm/index.d.ts +0 -0
- /package/{dist → lib}/components/ErrorContent/index.d.ts +0 -0
- /package/{dist → lib}/components/EventsTable/EventsTable.d.ts +0 -0
- /package/{dist → lib}/components/EventsTable/index.d.ts +0 -0
- /package/{dist → lib}/components/Form/FormModal.d.ts +0 -0
- /package/{dist → lib}/components/Form/FormModeSegmentControl.d.ts +0 -0
- /package/{dist → lib}/components/Form/RefineFormContainer.d.ts +0 -0
- /package/{dist → lib}/components/Form/RefineFormContent.d.ts +0 -0
- /package/{dist → lib}/components/Form/RefineFormPage.d.ts +0 -0
- /package/{dist → lib}/components/Form/YamlForm.d.ts +0 -0
- /package/{dist → lib}/components/Form/YamlFormContainer.d.ts +0 -0
- /package/{dist → lib}/components/Form/index.d.ts +0 -0
- /package/{dist → lib}/components/Form/type.d.ts +0 -0
- /package/{dist → lib}/components/Form/useFieldsConfig.d.ts +0 -0
- /package/{dist → lib}/components/Form/useReactHookForm.d.ts +0 -0
- /package/{dist → lib}/components/Form/useRefineForm.d.ts +0 -0
- /package/{dist → lib}/components/Form/useYamlForm.d.ts +0 -0
- /package/{dist → lib}/components/FormErrorAlert/index.d.ts +0 -0
- /package/{dist → lib}/components/FormLayout/index.d.ts +0 -0
- /package/{dist → lib}/components/FormWidgets/KeyValueListWidget.d.ts +0 -0
- /package/{dist → lib}/components/FormWidgets/MetadataForm.d.ts +0 -0
- /package/{dist → lib}/components/FormWidgets/NameInputWidget.d.ts +0 -0
- /package/{dist → lib}/components/FormWidgets/NamespaceSelectWidget.d.ts +0 -0
- /package/{dist → lib}/components/FormWidgets/index.d.ts +0 -0
- /package/{dist → lib}/components/FormWidgets/widget.d.ts +0 -0
- /package/{dist → lib}/components/ImageNames/index.d.ts +0 -0
- /package/{dist → lib}/components/IngressRulesComponent/index.d.ts +0 -0
- /package/{dist → lib}/components/IngressRulesTable/IngressRulesTable.d.ts +0 -0
- /package/{dist → lib}/components/IngressRulesTable/index.d.ts +0 -0
- /package/{dist → lib}/components/InternalBaseTable/TableWidgets.d.ts +0 -0
- /package/{dist → lib}/components/InternalBaseTable/index.d.ts +0 -0
- /package/{dist → lib}/components/KeyValue/KeyValue.d.ts +0 -0
- /package/{dist → lib}/components/KeyValue/KeyValueAnnotation.d.ts +0 -0
- /package/{dist → lib}/components/KeyValue/KeyValueSecret.d.ts +0 -0
- /package/{dist → lib}/components/KeyValue/index.d.ts +0 -0
- /package/{dist → lib}/components/Layout/index.d.ts +0 -0
- /package/{dist → lib}/components/LinkFallback/index.d.ts +0 -0
- /package/{dist → lib}/components/ListPage/index.d.ts +0 -0
- /package/{dist → lib}/components/Menu/index.d.ts +0 -0
- /package/{dist → lib}/components/NamespacesFilter/index.d.ts +0 -0
- /package/{dist → lib}/components/NetworkPolicyRulesViewer/NetworkPolicyRulesViewer.d.ts +0 -0
- /package/{dist → lib}/components/NetworkPolicyRulesViewer/index.d.ts +0 -0
- /package/{dist → lib}/components/NodeTaintsTable/NodeTaintsTable.d.ts +0 -0
- /package/{dist → lib}/components/NodeTaintsTable/index.d.ts +0 -0
- /package/{dist → lib}/components/PVCDistributeStorage/index.d.ts +0 -0
- /package/{dist → lib}/components/PageShow/PageShow.d.ts +0 -0
- /package/{dist → lib}/components/PageShow/index.d.ts +0 -0
- /package/{dist → lib}/components/PodContainersTable/PodContainersTable.d.ts +0 -0
- /package/{dist → lib}/components/PodContainersTable/index.d.ts +0 -0
- /package/{dist → lib}/components/PodLog/index.d.ts +0 -0
- /package/{dist → lib}/components/PodSelectorTable/index.d.ts +0 -0
- /package/{dist → lib}/components/PortsTable/index.d.ts +0 -0
- /package/{dist → lib}/components/ReferenceLink/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceCRUD/ResourceCRUD.d.ts +0 -0
- /package/{dist → lib}/components/ResourceCRUD/create/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceCRUD/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceCRUD/list/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceCRUD/show/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceFiledDisplays.d.ts +0 -0
- /package/{dist → lib}/components/ResourceLink/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceSelect/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceTable/index.d.ts +0 -0
- /package/{dist → lib}/components/ResourceUsageBar/index.d.ts +0 -0
- /package/{dist → lib}/components/Separator/index.d.ts +0 -0
- /package/{dist → lib}/components/ServiceComponents/index.d.ts +0 -0
- /package/{dist → lib}/components/Shell/ShellToolbar.d.ts +0 -0
- /package/{dist → lib}/components/ShowContent/ShowContent.d.ts +0 -0
- /package/{dist → lib}/components/ShowContent/fields.d.ts +0 -0
- /package/{dist → lib}/components/ShowContent/groups.d.ts +0 -0
- /package/{dist → lib}/components/ShowContent/index.d.ts +0 -0
- /package/{dist → lib}/components/ShowContent/tabs.d.ts +0 -0
- /package/{dist → lib}/components/StateTag/StateTag.d.ts +0 -0
- /package/{dist → lib}/components/StateTag/index.d.ts +0 -0
- /package/{dist → lib}/components/Table/index.d.ts +0 -0
- /package/{dist → lib}/components/TableToolbar/index.d.ts +0 -0
- /package/{dist → lib}/components/Tabs/index.d.ts +0 -0
- /package/{dist → lib}/components/Tags/index.d.ts +0 -0
- /package/{dist → lib}/components/TextTags/index.d.ts +0 -0
- /package/{dist → lib}/components/Time/index.d.ts +0 -0
- /package/{dist → lib}/components/ValueDisplay/index.d.ts +0 -0
- /package/{dist → lib}/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +0 -0
- /package/{dist → lib}/components/WorkloadPodsTable/index.d.ts +0 -0
- /package/{dist → lib}/components/WorkloadReplicas/index.d.ts +0 -0
- /package/{dist → lib}/components/YamlEditor/MonacoYamlDiffEditor.d.ts +0 -0
- /package/{dist → lib}/components/YamlEditor/MonacoYamlEditor.d.ts +0 -0
- /package/{dist → lib}/components/YamlEditor/YamlEditorComponent.d.ts +0 -0
- /package/{dist → lib}/components/YamlEditor/index.d.ts +0 -0
- /package/{dist → lib}/components/YamlEditor/style.d.ts +0 -0
- /package/{dist → lib}/components/YamlEditor/yaml.worker.d.ts +0 -0
- /package/{dist → lib}/constants/auth.d.ts +0 -0
- /package/{dist → lib}/constants/index.d.ts +0 -0
- /package/{dist → lib}/constants/k8s.d.ts +0 -0
- /package/{dist → lib}/constants/state.d.ts +0 -0
- /package/{dist → lib}/contexts/component.d.ts +0 -0
- /package/{dist → lib}/contexts/configs.d.ts +0 -0
- /package/{dist → lib}/contexts/constants.d.ts +0 -0
- /package/{dist → lib}/contexts/global-store.d.ts +0 -0
- /package/{dist → lib}/contexts/index.d.ts +0 -0
- /package/{dist → lib}/hooks/index.d.ts +0 -0
- /package/{dist → lib}/hooks/useDeleteModal/index.d.ts +0 -0
- /package/{dist → lib}/hooks/useDeleteModal/useDeleteManyModal.d.ts +0 -0
- /package/{dist → lib}/hooks/useDeleteModal/useDeleteModal.d.ts +0 -0
- /package/{dist → lib}/hooks/useDeleteModal/useDeleteModalOnly.d.ts +0 -0
- /package/{dist → lib}/hooks/useDeleteModal/useFailedModal.d.ts +0 -0
- /package/{dist → lib}/hooks/useDownloadYAML.d.ts +0 -0
- /package/{dist → lib}/hooks/useEagleTable/columns.d.ts +0 -0
- /package/{dist → lib}/hooks/useEagleTable/index.d.ts +0 -0
- /package/{dist → lib}/hooks/useEagleTable/useEagleTable.d.ts +0 -0
- /package/{dist → lib}/hooks/useEdit.d.ts +0 -0
- /package/{dist → lib}/hooks/useGlobalStore.d.ts +0 -0
- /package/{dist → lib}/hooks/useK8sYamlEditor.d.ts +0 -0
- /package/{dist → lib}/hooks/useNamespaceRefineFilter.d.ts +0 -0
- /package/{dist → lib}/hooks/useOpenForm.d.ts +0 -0
- /package/{dist → lib}/hooks/usePathMap.d.ts +0 -0
- /package/{dist → lib}/hooks/useSchema.d.ts +0 -0
- /package/{dist → lib}/hooks/useSubmitForm.d.ts +0 -0
- /package/{dist → lib}/hooks/useTableData.d.ts +0 -0
- /package/{dist → lib}/i18n.d.ts +0 -0
- /package/{dist → lib}/index.d.ts +0 -0
- /package/{dist → lib}/locales/en-US/index.d.ts +0 -0
- /package/{dist → lib}/locales/index.d.ts +0 -0
- /package/{dist → lib}/locales/zh-CN/index.d.ts +0 -0
- /package/{dist → lib}/main.d.ts +0 -0
- /package/{dist → lib}/models/cronjob-model.d.ts +0 -0
- /package/{dist → lib}/models/daemonset-model.d.ts +0 -0
- /package/{dist → lib}/models/deployment-model.d.ts +0 -0
- /package/{dist → lib}/models/event-model.d.ts +0 -0
- /package/{dist → lib}/models/index.d.ts +0 -0
- /package/{dist → lib}/models/ingress-model.d.ts +0 -0
- /package/{dist → lib}/models/job-model.d.ts +0 -0
- /package/{dist → lib}/models/network-policy-model.d.ts +0 -0
- /package/{dist → lib}/models/node-model.d.ts +0 -0
- /package/{dist → lib}/models/persistent-volume-claim.d.ts +0 -0
- /package/{dist → lib}/models/persistent-volume.d.ts +0 -0
- /package/{dist → lib}/models/pod-metrics-model.d.ts +0 -0
- /package/{dist → lib}/models/pod-model.d.ts +0 -0
- /package/{dist → lib}/models/resource-model.d.ts +0 -0
- /package/{dist → lib}/models/service-model.d.ts +0 -0
- /package/{dist → lib}/models/statefulset-model.d.ts +0 -0
- /package/{dist → lib}/models/storage-class.d.ts +0 -0
- /package/{dist → lib}/models/types/index.d.ts +0 -0
- /package/{dist → lib}/models/types/metric.d.ts +0 -0
- /package/{dist → lib}/models/workload-base-model.d.ts +0 -0
- /package/{dist → lib}/models/workload-model.d.ts +0 -0
- /package/{dist → lib}/pages/configmaps/index.d.ts +0 -0
- /package/{dist → lib}/pages/cronjobs/create/index.d.ts +0 -0
- /package/{dist → lib}/pages/cronjobs/index.d.ts +0 -0
- /package/{dist → lib}/pages/cronjobs/list/index.d.ts +0 -0
- /package/{dist → lib}/pages/cronjobs/show/index.d.ts +0 -0
- /package/{dist → lib}/pages/daemonsets/create/index.d.ts +0 -0
- /package/{dist → lib}/pages/daemonsets/index.d.ts +0 -0
- /package/{dist → lib}/pages/daemonsets/list/index.d.ts +0 -0
- /package/{dist → lib}/pages/daemonsets/show/index.d.ts +0 -0
- /package/{dist → lib}/pages/deployments/index.d.ts +0 -0
- /package/{dist → lib}/pages/deployments/list/index.d.ts +0 -0
- /package/{dist → lib}/pages/deployments/show/index.d.ts +0 -0
- /package/{dist → lib}/pages/ingresses/index.d.ts +0 -0
- /package/{dist → lib}/pages/jobs/index.d.ts +0 -0
- /package/{dist → lib}/pages/networkPolicies/index.d.ts +0 -0
- /package/{dist → lib}/pages/nodes/index.d.ts +0 -0
- /package/{dist → lib}/pages/nodes/list/index.d.ts +0 -0
- /package/{dist → lib}/pages/nodes/show/index.d.ts +0 -0
- /package/{dist → lib}/pages/persistentvolumeclaims/index.d.ts +0 -0
- /package/{dist → lib}/pages/persistentvolumes/index.d.ts +0 -0
- /package/{dist → lib}/pages/pods/create/index.d.ts +0 -0
- /package/{dist → lib}/pages/pods/index.d.ts +0 -0
- /package/{dist → lib}/pages/pods/list/index.d.ts +0 -0
- /package/{dist → lib}/pages/pods/show/index.d.ts +0 -0
- /package/{dist → lib}/pages/secrets/index.d.ts +0 -0
- /package/{dist → lib}/pages/services/index.d.ts +0 -0
- /package/{dist → lib}/pages/statefulsets/index.d.ts +0 -0
- /package/{dist → lib}/pages/storageclasses/form/index.d.ts +0 -0
- /package/{dist → lib}/pages/storageclasses/index.d.ts +0 -0
- /package/{dist → lib}/plugins/index.d.ts +0 -0
- /package/{dist → lib}/plugins/model-plugin.d.ts +0 -0
- /package/{dist → lib}/plugins/relation-plugin.d.ts +0 -0
- /package/{dist → lib}/plugins/type.d.ts +0 -0
- /package/{dist → lib}/providers/index.d.ts +0 -0
- /package/{dist → lib}/providers/router-provider/index.d.ts +0 -0
- /package/{dist → lib}/styles/button.d.ts +0 -0
- /package/{dist → lib}/styles/modal.d.ts +0 -0
- /package/{dist → lib}/styles/tag.d.ts +0 -0
- /package/{dist → lib}/types/globalStore.d.ts +0 -0
- /package/{dist → lib}/types/index.d.ts +0 -0
- /package/{dist → lib}/types/resource.d.ts +0 -0
- /package/{dist → lib}/utils/addId.d.ts +0 -0
- /package/{dist → lib}/utils/download.d.ts +0 -0
- /package/{dist → lib}/utils/error.d.ts +0 -0
- /package/{dist → lib}/utils/form.d.ts +0 -0
- /package/{dist → lib}/utils/k8s.d.ts +0 -0
- /package/{dist → lib}/utils/labels.d.ts +0 -0
- /package/{dist → lib}/utils/match-selector.d.ts +0 -0
- /package/{dist → lib}/utils/object.d.ts +0 -0
- /package/{dist → lib}/utils/openapi.d.ts +0 -0
- /package/{dist → lib}/utils/schema-store.d.ts +0 -0
- /package/{dist → lib}/utils/schema.d.ts +0 -0
- /package/{dist → lib}/utils/selector.d.ts +0 -0
- /package/{dist → lib}/utils/shell.d.ts +0 -0
- /package/{dist → lib}/utils/storage.d.ts +0 -0
- /package/{dist → lib}/utils/string.d.ts +0 -0
- /package/{dist → lib}/utils/time.d.ts +0 -0
- /package/{dist → lib}/utils/unit.d.ts +0 -0
- /package/{dist → lib}/utils/validation.d.ts +0 -0
- /package/{dist → lib}/utils/yaml.d.ts +0 -0
package/dist/index-40deb620.js
DELETED
|
@@ -1,497 +0,0 @@
|
|
|
1
|
-
import { u as useTranslation, j as jsxRuntimeExports, c as cx_default, S as SocketStatus } from "./common-feae5742.js";
|
|
2
|
-
import { Icon, Typo, DropdownMenu, Tooltip, SearchInput, Alert, Link } from "@cloudtower/eagle";
|
|
3
|
-
import { CanvasAddon } from "@xterm/addon-canvas";
|
|
4
|
-
import { FitAddon } from "@xterm/addon-fit";
|
|
5
|
-
import { SearchAddon } from "@xterm/addon-search";
|
|
6
|
-
import { WebLinksAddon } from "@xterm/addon-web-links";
|
|
7
|
-
import { WebglAddon } from "@xterm/addon-webgl";
|
|
8
|
-
import { Terminal } from "@xterm/xterm";
|
|
9
|
-
import copyToClipboard from "copy-to-clipboard";
|
|
10
|
-
import { debounce } from "lodash-es";
|
|
11
|
-
import React__default, { useRef, useState, useMemo, useCallback, useEffect, useImperativeHandle } from "react";
|
|
12
|
-
import { Loading24GradientBlueIcon, FontSize16GrayIcon, FontSize16BlueIcon, LogCollection16GrayIcon, LogCollection16GradientBlueIcon, TrashBinDeletePermanently16GrayIcon, TrashBinDeletePermanently16BlueIcon } from "@cloudtower/icons-react";
|
|
13
|
-
const Connecting_r8rfff = "";
|
|
14
|
-
const LoadingStyle = "l1ur2ktd";
|
|
15
|
-
const Connecting = () => {
|
|
16
|
-
const {
|
|
17
|
-
t
|
|
18
|
-
} = useTranslation();
|
|
19
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
20
|
-
className: LoadingStyle,
|
|
21
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
|
|
22
|
-
src: Loading24GradientBlueIcon,
|
|
23
|
-
iconWidth: 24,
|
|
24
|
-
iconHeight: 24,
|
|
25
|
-
isRotate: true
|
|
26
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
27
|
-
className: Typo.Display.d2_bold_title,
|
|
28
|
-
children: t("dovetail.connecting")
|
|
29
|
-
})]
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
const ShellToolbar_ihg418 = "";
|
|
33
|
-
const ToolbarStyle$1 = "tzxa6d";
|
|
34
|
-
const ToolbarAreaStyle = "t1sxu3rr";
|
|
35
|
-
const IconWrapperStyle = "ix8ych8";
|
|
36
|
-
const IconStyle = "i58m6oo";
|
|
37
|
-
const DividerStyle = "d1t2oa87";
|
|
38
|
-
const TooltipStyle = "tuo8xdg";
|
|
39
|
-
function ShellToolbar(props) {
|
|
40
|
-
const {
|
|
41
|
-
className,
|
|
42
|
-
leftSlot,
|
|
43
|
-
operations = ["fontSize", "downloadLog", "clear"],
|
|
44
|
-
searchMatchedTotal,
|
|
45
|
-
onSetFontSize,
|
|
46
|
-
onSearchNext,
|
|
47
|
-
onSearchPre,
|
|
48
|
-
onDownloadLog,
|
|
49
|
-
onClear
|
|
50
|
-
} = props;
|
|
51
|
-
const {
|
|
52
|
-
t
|
|
53
|
-
} = useTranslation();
|
|
54
|
-
const fontSizeOptions = [12, 13, 14, 16, 20];
|
|
55
|
-
const operationMap = {
|
|
56
|
-
fontSize: /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownMenu, {
|
|
57
|
-
trigger: ["click"],
|
|
58
|
-
items: fontSizeOptions.map((size) => ({
|
|
59
|
-
key: `${size}`,
|
|
60
|
-
title: `${size}px`,
|
|
61
|
-
text: `${size}px`,
|
|
62
|
-
onClick: () => {
|
|
63
|
-
onSetFontSize == null ? void 0 : onSetFontSize(size);
|
|
64
|
-
}
|
|
65
|
-
})),
|
|
66
|
-
slotsElements: {
|
|
67
|
-
trigger: () => /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
|
|
68
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
69
|
-
className: TooltipStyle,
|
|
70
|
-
children: t("dovetail.font_size")
|
|
71
|
-
}),
|
|
72
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
73
|
-
style: {
|
|
74
|
-
display: "flex",
|
|
75
|
-
alignItems: "center"
|
|
76
|
-
},
|
|
77
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
|
|
78
|
-
className: IconStyle,
|
|
79
|
-
src: FontSize16GrayIcon,
|
|
80
|
-
hoverSrc: FontSize16BlueIcon
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
}),
|
|
86
|
-
downloadLog: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
|
|
87
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
88
|
-
className: TooltipStyle,
|
|
89
|
-
children: t("dovetail.download_shell_content")
|
|
90
|
-
}),
|
|
91
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
|
|
92
|
-
className: IconStyle,
|
|
93
|
-
src: LogCollection16GrayIcon,
|
|
94
|
-
hoverSrc: LogCollection16GradientBlueIcon,
|
|
95
|
-
onClick: onDownloadLog
|
|
96
|
-
})
|
|
97
|
-
}),
|
|
98
|
-
clear: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
|
|
99
|
-
title: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
100
|
-
className: TooltipStyle,
|
|
101
|
-
children: t("dovetail.clear_shell")
|
|
102
|
-
}),
|
|
103
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, {
|
|
104
|
-
className: IconStyle,
|
|
105
|
-
src: TrashBinDeletePermanently16GrayIcon,
|
|
106
|
-
hoverSrc: TrashBinDeletePermanently16BlueIcon,
|
|
107
|
-
onClick: onClear
|
|
108
|
-
})
|
|
109
|
-
})
|
|
110
|
-
};
|
|
111
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
112
|
-
className: cx_default(ToolbarStyle$1, className),
|
|
113
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
114
|
-
className: ToolbarAreaStyle,
|
|
115
|
-
children: leftSlot
|
|
116
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
117
|
-
className: ToolbarAreaStyle,
|
|
118
|
-
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(SearchInput, {
|
|
119
|
-
placeholder: t("dovetail.search"),
|
|
120
|
-
size: "small",
|
|
121
|
-
total: searchMatchedTotal,
|
|
122
|
-
onChange: (str) => {
|
|
123
|
-
onSearchNext(str);
|
|
124
|
-
},
|
|
125
|
-
onSearchNext: (str) => {
|
|
126
|
-
onSearchNext(str);
|
|
127
|
-
},
|
|
128
|
-
onSearchPrev: (str) => {
|
|
129
|
-
onSearchPre(str);
|
|
130
|
-
}
|
|
131
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
132
|
-
className: DividerStyle
|
|
133
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
134
|
-
className: IconWrapperStyle,
|
|
135
|
-
children: operations.map((operation) => typeof operation === "string" ? operationMap[operation] || null : operation)
|
|
136
|
-
})]
|
|
137
|
-
})]
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
const xterm = "";
|
|
141
|
-
const index_n9lket = "";
|
|
142
|
-
const ContainerStyle = "c1q5a2qi";
|
|
143
|
-
const ShellStyle = "sdz5fm1";
|
|
144
|
-
const ErrorAlertStyle = "ebp0h2e";
|
|
145
|
-
const ToolbarStyle = "tioilqy";
|
|
146
|
-
const Shell = React__default.forwardRef(function Shell2(props, ref) {
|
|
147
|
-
const {
|
|
148
|
-
className,
|
|
149
|
-
url,
|
|
150
|
-
protocols,
|
|
151
|
-
timeout = 1e4,
|
|
152
|
-
logFileName,
|
|
153
|
-
operations,
|
|
154
|
-
isHideToolbar,
|
|
155
|
-
toolbarLeftSlot,
|
|
156
|
-
shellOptions,
|
|
157
|
-
loadingElement,
|
|
158
|
-
encode,
|
|
159
|
-
decode,
|
|
160
|
-
onSocketStatusChange,
|
|
161
|
-
onTermInit,
|
|
162
|
-
onSocketInit,
|
|
163
|
-
children
|
|
164
|
-
} = props;
|
|
165
|
-
const terminalRef = useRef(null);
|
|
166
|
-
const termInstanceRef = useRef(null);
|
|
167
|
-
const fitAddonRef = useRef(null);
|
|
168
|
-
const searchAddonRef = useRef(null);
|
|
169
|
-
const socketRef = useRef(null);
|
|
170
|
-
const backlogRef = useRef([]);
|
|
171
|
-
const containerRef = useRef(null);
|
|
172
|
-
const [socketStatus, setSocketStatus] = useState(SocketStatus.Opening);
|
|
173
|
-
const [loading, setLoading] = useState(false);
|
|
174
|
-
const [error, setError] = useState(null);
|
|
175
|
-
const [searchMatchedTotal, setSearchMatchedTotal] = useState(0);
|
|
176
|
-
const {
|
|
177
|
-
t
|
|
178
|
-
} = useTranslation();
|
|
179
|
-
const searchOptions = useMemo(() => ({
|
|
180
|
-
decorations: {
|
|
181
|
-
activeMatchColorOverviewRuler: "#FEA008",
|
|
182
|
-
matchOverviewRuler: "#E07F00",
|
|
183
|
-
activeMatchBackground: "#FEA008",
|
|
184
|
-
matchBackground: "#E07F00"
|
|
185
|
-
}
|
|
186
|
-
}), []);
|
|
187
|
-
const reset = useCallback(() => {
|
|
188
|
-
var _a, _b;
|
|
189
|
-
(_a = termInstanceRef.current) == null ? void 0 : _a.clear();
|
|
190
|
-
(_b = termInstanceRef.current) == null ? void 0 : _b.reset();
|
|
191
|
-
}, []);
|
|
192
|
-
const send = useCallback((message, callback) => {
|
|
193
|
-
if (socketRef.current && socketRef.current.readyState === socketRef.current.OPEN) {
|
|
194
|
-
socketRef.current.send(message);
|
|
195
|
-
callback == null ? void 0 : callback();
|
|
196
|
-
} else {
|
|
197
|
-
backlogRef.current.push({
|
|
198
|
-
message,
|
|
199
|
-
callback
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
}, []);
|
|
203
|
-
const fit = useCallback(() => {
|
|
204
|
-
var _a;
|
|
205
|
-
if (!fitAddonRef.current)
|
|
206
|
-
return;
|
|
207
|
-
fitAddonRef.current.fit();
|
|
208
|
-
const {
|
|
209
|
-
rows,
|
|
210
|
-
cols
|
|
211
|
-
} = fitAddonRef.current.proposeDimensions() || {};
|
|
212
|
-
if (rows && cols) {
|
|
213
|
-
(_a = props.fit) == null ? void 0 : _a.call(props, {
|
|
214
|
-
rows,
|
|
215
|
-
cols
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
}, [encode, send, props.fit]);
|
|
219
|
-
const debouncedFit = useMemo(() => debounce(fit, 200), [fit]);
|
|
220
|
-
const flush = useCallback(() => {
|
|
221
|
-
const backlog = backlogRef.current.slice();
|
|
222
|
-
backlogRef.current = [];
|
|
223
|
-
for (const data of backlog) {
|
|
224
|
-
send(data.message, data.callback);
|
|
225
|
-
}
|
|
226
|
-
}, [send]);
|
|
227
|
-
const connect = useCallback(() => {
|
|
228
|
-
if (socketRef.current) {
|
|
229
|
-
socketRef.current.close();
|
|
230
|
-
socketRef.current = null;
|
|
231
|
-
}
|
|
232
|
-
if (url) {
|
|
233
|
-
let onSocketError = function() {
|
|
234
|
-
setLoading(false);
|
|
235
|
-
setError(true);
|
|
236
|
-
}, onSocketOpen = function() {
|
|
237
|
-
var _a;
|
|
238
|
-
(_a = props.onSocketOpen) == null ? void 0 : _a.call(props, socket);
|
|
239
|
-
clearTimeout(timer);
|
|
240
|
-
setSocketStatus(SocketStatus.Open);
|
|
241
|
-
fit();
|
|
242
|
-
flush();
|
|
243
|
-
setError(false);
|
|
244
|
-
setLoading(false);
|
|
245
|
-
}, onSocketClose = function() {
|
|
246
|
-
setLoading(false);
|
|
247
|
-
setError(true);
|
|
248
|
-
if (props.onSocketClose) {
|
|
249
|
-
props.onSocketClose(socket, termInstanceRef.current);
|
|
250
|
-
} else {
|
|
251
|
-
setSocketStatus(SocketStatus.Disconnected);
|
|
252
|
-
}
|
|
253
|
-
}, onSocketMessage = function(e) {
|
|
254
|
-
var _a;
|
|
255
|
-
if (props.onSocketMessage) {
|
|
256
|
-
props.onSocketMessage(e, socket, termInstanceRef.current);
|
|
257
|
-
} else {
|
|
258
|
-
const msg = (decode == null ? void 0 : decode(e.data)) || e.data;
|
|
259
|
-
(_a = termInstanceRef.current) == null ? void 0 : _a.write(msg);
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
setLoading(true);
|
|
263
|
-
setError(false);
|
|
264
|
-
const socket = new WebSocket(url, protocols);
|
|
265
|
-
const timer = setTimeout(() => {
|
|
266
|
-
setLoading(false);
|
|
267
|
-
socket.close();
|
|
268
|
-
}, timeout);
|
|
269
|
-
setSocketStatus(SocketStatus.Opening);
|
|
270
|
-
onSocketInit == null ? void 0 : onSocketInit(socket);
|
|
271
|
-
socket.addEventListener("open", onSocketOpen);
|
|
272
|
-
socket.addEventListener("message", onSocketMessage);
|
|
273
|
-
socket.addEventListener("close", onSocketClose);
|
|
274
|
-
socket.addEventListener("error", onSocketError);
|
|
275
|
-
socketRef.current = socket;
|
|
276
|
-
return function disconnect() {
|
|
277
|
-
if (socket) {
|
|
278
|
-
socket.close();
|
|
279
|
-
socket.removeEventListener("open", onSocketOpen);
|
|
280
|
-
socket.removeEventListener("message", onSocketMessage);
|
|
281
|
-
socket.removeEventListener("close", onSocketClose);
|
|
282
|
-
socket.removeEventListener("error", onSocketError);
|
|
283
|
-
socketRef.current = null;
|
|
284
|
-
}
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
}, [url, protocols, decode, props.onSocketClose, props.onSocketMessage, props.onSocketOpen, reset, flush, fit, onSocketInit, timeout]);
|
|
288
|
-
const setupTerminal = useCallback(() => {
|
|
289
|
-
if (terminalRef.current) {
|
|
290
|
-
let onKeyDown = function(event) {
|
|
291
|
-
if (event.ctrlKey && event.shiftKey && event.key === "C") {
|
|
292
|
-
event.preventDefault();
|
|
293
|
-
copyToClipboard(term.getSelection());
|
|
294
|
-
}
|
|
295
|
-
}, onResize = function() {
|
|
296
|
-
fit();
|
|
297
|
-
};
|
|
298
|
-
if (termInstanceRef.current) {
|
|
299
|
-
termInstanceRef.current.reset();
|
|
300
|
-
termInstanceRef.current.dispose();
|
|
301
|
-
}
|
|
302
|
-
const term = new Terminal({
|
|
303
|
-
cursorBlink: true,
|
|
304
|
-
cols: 150,
|
|
305
|
-
allowProposedApi: true,
|
|
306
|
-
fontSize: 12,
|
|
307
|
-
theme: {
|
|
308
|
-
background: "#00122E"
|
|
309
|
-
},
|
|
310
|
-
...shellOptions
|
|
311
|
-
});
|
|
312
|
-
let renderAddon = null;
|
|
313
|
-
try {
|
|
314
|
-
renderAddon = new WebglAddon();
|
|
315
|
-
} catch {
|
|
316
|
-
renderAddon = new CanvasAddon();
|
|
317
|
-
}
|
|
318
|
-
onTermInit == null ? void 0 : onTermInit(term);
|
|
319
|
-
term.loadAddon(fitAddonRef.current = new FitAddon());
|
|
320
|
-
term.loadAddon(searchAddonRef.current = new SearchAddon());
|
|
321
|
-
term.loadAddon(new WebLinksAddon());
|
|
322
|
-
term.loadAddon(renderAddon);
|
|
323
|
-
term.open(terminalRef.current);
|
|
324
|
-
fit();
|
|
325
|
-
flush();
|
|
326
|
-
document.addEventListener("keydown", onKeyDown);
|
|
327
|
-
window.addEventListener("resize", onResize);
|
|
328
|
-
searchAddonRef.current.onDidChangeResults(({
|
|
329
|
-
resultCount
|
|
330
|
-
}) => {
|
|
331
|
-
setSearchMatchedTotal(resultCount);
|
|
332
|
-
});
|
|
333
|
-
term.onData((input) => {
|
|
334
|
-
send(encode(input));
|
|
335
|
-
});
|
|
336
|
-
termInstanceRef.current = term;
|
|
337
|
-
return function destroy() {
|
|
338
|
-
document.removeEventListener("keydown", onKeyDown);
|
|
339
|
-
window.removeEventListener("resize", onResize);
|
|
340
|
-
termInstanceRef.current = null;
|
|
341
|
-
fitAddonRef.current = null;
|
|
342
|
-
searchAddonRef.current = null;
|
|
343
|
-
term.clear();
|
|
344
|
-
term.dispose();
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
}, [send, encode, onTermInit, fit, flush, shellOptions]);
|
|
348
|
-
const searchNext = useCallback((search) => {
|
|
349
|
-
var _a;
|
|
350
|
-
(_a = searchAddonRef.current) == null ? void 0 : _a.findNext(search || "", searchOptions);
|
|
351
|
-
}, [searchOptions]);
|
|
352
|
-
const searchPrevious = useCallback((search) => {
|
|
353
|
-
var _a;
|
|
354
|
-
(_a = searchAddonRef.current) == null ? void 0 : _a.findPrevious(search || "", searchOptions);
|
|
355
|
-
}, [searchOptions]);
|
|
356
|
-
const getAllTerminalContents = useCallback(() => {
|
|
357
|
-
if (!termInstanceRef.current)
|
|
358
|
-
return [];
|
|
359
|
-
const buffer = termInstanceRef.current.buffer.active;
|
|
360
|
-
const lines = [];
|
|
361
|
-
for (let i = 0; i < buffer.length; i++) {
|
|
362
|
-
const line = buffer.getLine(i);
|
|
363
|
-
if (line) {
|
|
364
|
-
lines.push(line.translateToString(true));
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
return lines;
|
|
368
|
-
}, []);
|
|
369
|
-
const clear = useCallback(() => {
|
|
370
|
-
var _a;
|
|
371
|
-
(_a = termInstanceRef.current) == null ? void 0 : _a.clear();
|
|
372
|
-
}, []);
|
|
373
|
-
const downloadContent = useCallback(() => {
|
|
374
|
-
const content = (getAllTerminalContents() || []).join("\n");
|
|
375
|
-
const blob = new Blob([content], {
|
|
376
|
-
type: "text/plain"
|
|
377
|
-
});
|
|
378
|
-
const url2 = window.URL.createObjectURL(blob);
|
|
379
|
-
const a = document.createElement("a");
|
|
380
|
-
a.href = url2;
|
|
381
|
-
a.download = `${logFileName || "term"}.log`;
|
|
382
|
-
document.body.appendChild(a);
|
|
383
|
-
a.click();
|
|
384
|
-
setTimeout(() => {
|
|
385
|
-
document.body.removeChild(a);
|
|
386
|
-
window.URL.revokeObjectURL(url2);
|
|
387
|
-
}, 0);
|
|
388
|
-
}, [getAllTerminalContents, logFileName]);
|
|
389
|
-
const setOptions = useCallback((options) => {
|
|
390
|
-
Object.entries(options).forEach(([key, value]) => {
|
|
391
|
-
if (termInstanceRef.current) {
|
|
392
|
-
termInstanceRef.current.options[key] = value;
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
fit();
|
|
396
|
-
}, [fit]);
|
|
397
|
-
const writeln = useCallback((data) => {
|
|
398
|
-
var _a;
|
|
399
|
-
(_a = termInstanceRef.current) == null ? void 0 : _a.writeln(data);
|
|
400
|
-
}, []);
|
|
401
|
-
const onClear = useCallback(() => {
|
|
402
|
-
var _a;
|
|
403
|
-
clear();
|
|
404
|
-
(_a = props.onClear) == null ? void 0 : _a.call(props);
|
|
405
|
-
}, [clear, props.onClear]);
|
|
406
|
-
useEffect(() => {
|
|
407
|
-
const destroy = setupTerminal();
|
|
408
|
-
return () => {
|
|
409
|
-
destroy == null ? void 0 : destroy();
|
|
410
|
-
};
|
|
411
|
-
}, []);
|
|
412
|
-
useEffect(() => {
|
|
413
|
-
const disconnect = connect();
|
|
414
|
-
return () => {
|
|
415
|
-
disconnect == null ? void 0 : disconnect();
|
|
416
|
-
};
|
|
417
|
-
}, [url, protocols]);
|
|
418
|
-
useEffect(() => {
|
|
419
|
-
onSocketStatusChange == null ? void 0 : onSocketStatusChange(socketStatus);
|
|
420
|
-
}, [socketStatus]);
|
|
421
|
-
useEffect(() => {
|
|
422
|
-
if (!containerRef.current)
|
|
423
|
-
return;
|
|
424
|
-
const resizeObserver = new ResizeObserver(() => {
|
|
425
|
-
debouncedFit();
|
|
426
|
-
});
|
|
427
|
-
resizeObserver.observe(containerRef.current);
|
|
428
|
-
return () => resizeObserver.disconnect();
|
|
429
|
-
}, [debouncedFit]);
|
|
430
|
-
useImperativeHandle(ref, () => ({
|
|
431
|
-
clear,
|
|
432
|
-
setSocketStatus,
|
|
433
|
-
fit,
|
|
434
|
-
send,
|
|
435
|
-
connect,
|
|
436
|
-
searchNext,
|
|
437
|
-
searchPrevious,
|
|
438
|
-
getAllTerminalContents,
|
|
439
|
-
setOptions,
|
|
440
|
-
setLoading,
|
|
441
|
-
setError,
|
|
442
|
-
writeln
|
|
443
|
-
}), [send, searchNext, searchPrevious, getAllTerminalContents, fit, clear, connect, setOptions, writeln]);
|
|
444
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
445
|
-
ref: containerRef,
|
|
446
|
-
className: ContainerStyle,
|
|
447
|
-
children: [!!error ? /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, {
|
|
448
|
-
style: {
|
|
449
|
-
margin: 8,
|
|
450
|
-
marginBottom: 4
|
|
451
|
-
},
|
|
452
|
-
message: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
|
|
453
|
-
className: ErrorAlertStyle,
|
|
454
|
-
children: [t("dovetail.disconnected"), /* @__PURE__ */ jsxRuntimeExports.jsx(Link, {
|
|
455
|
-
onClick: () => {
|
|
456
|
-
if (props.onReconnect) {
|
|
457
|
-
props.onReconnect();
|
|
458
|
-
} else {
|
|
459
|
-
connect();
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
children: t("dovetail.reconnect")
|
|
463
|
-
})]
|
|
464
|
-
}),
|
|
465
|
-
type: "error"
|
|
466
|
-
}) : null, isHideToolbar ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(ShellToolbar, {
|
|
467
|
-
className: ToolbarStyle,
|
|
468
|
-
leftSlot: toolbarLeftSlot,
|
|
469
|
-
searchMatchedTotal,
|
|
470
|
-
operations,
|
|
471
|
-
onSearchNext: searchNext,
|
|
472
|
-
onSearchPre: searchPrevious,
|
|
473
|
-
onClear,
|
|
474
|
-
onDownloadLog: downloadContent,
|
|
475
|
-
onSetFontSize: (fontSize) => {
|
|
476
|
-
setOptions({
|
|
477
|
-
fontSize
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
}), loading ? loadingElement || /* @__PURE__ */ jsxRuntimeExports.jsx(Connecting, {}) : null, /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
481
|
-
className: cx_default(ShellStyle, className),
|
|
482
|
-
style: {
|
|
483
|
-
display: loading ? "none" : "block"
|
|
484
|
-
},
|
|
485
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
486
|
-
ref: terminalRef,
|
|
487
|
-
style: {
|
|
488
|
-
height: "100%"
|
|
489
|
-
},
|
|
490
|
-
children
|
|
491
|
-
})
|
|
492
|
-
})]
|
|
493
|
-
});
|
|
494
|
-
});
|
|
495
|
-
export {
|
|
496
|
-
Shell as S
|
|
497
|
-
};
|