@dovetail-v2/refine 0.2.4-alpha.0 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/TableToolbar/index.d.ts +1 -1
- package/{dist → lib}/components/index.d.ts +1 -0
- package/{dist → lib}/types/resource.d.ts +1 -1
- 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/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}/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
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SocketStatus } from 'src/components/Shell
|
|
2
|
+
import { SocketStatus } from 'src/components/Shell';
|
|
3
|
+
import '@xterm/xterm/css/xterm.css';
|
|
3
4
|
import { PodModel } from 'src/models/pod-model';
|
|
4
5
|
export declare enum OS {
|
|
5
6
|
Linux = "linux",
|
|
6
7
|
Windows = "windows"
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
interface PodShellProps {
|
|
9
10
|
pod: PodModel;
|
|
10
11
|
basePath: string;
|
|
11
12
|
onSocketStatusChange?: (socketStatus: SocketStatus) => void;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
interface PodShellHandler {
|
|
14
15
|
getAllTerminalContents: () => string[];
|
|
15
16
|
}
|
|
16
17
|
export declare const PodShell: React.ForwardRefExoticComponent<PodShellProps & React.RefAttributes<PodShellHandler>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SocketStatus } from 'src/components/Shell';
|
|
3
|
+
import { PodModel } from 'src/models';
|
|
4
|
+
import { PodShell } from './PodShell';
|
|
5
|
+
interface PodShellModalProps {
|
|
6
|
+
pod: PodModel;
|
|
7
|
+
onSocketStatusChange?: (socketStatus: SocketStatus) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function PodShellModal(props: PodShellModalProps): JSX.Element;
|
|
10
|
+
export { PodShell };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Terminal } from '@xterm/xterm';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { SocketStatus } from './common';
|
|
4
3
|
import { ShellToolbarProps } from './ShellToolbar';
|
|
5
4
|
import '@xterm/xterm/css/xterm.css';
|
|
5
|
+
export declare enum SocketStatus {
|
|
6
|
+
Opening = "Opening",
|
|
7
|
+
Open = "Open",
|
|
8
|
+
Disconnected = "Disconnected"
|
|
9
|
+
}
|
|
6
10
|
export type ShellProps = React.PropsWithChildren<{
|
|
7
11
|
url: string;
|
|
8
12
|
protocols?: string;
|
|
@@ -46,6 +46,7 @@ export * from './ResourceFiledDisplays';
|
|
|
46
46
|
export * from './Tabs';
|
|
47
47
|
export * as ValueDisplay from './ValueDisplay';
|
|
48
48
|
export * from './ResourceSelect';
|
|
49
|
+
export * from './Shell';
|
|
49
50
|
export * from './PodShellModal';
|
|
50
51
|
export * from './ResourceTable';
|
|
51
52
|
export * from './ErrorContent';
|
|
@@ -166,7 +166,7 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
|
|
|
166
166
|
/** 是否隐藏创建功能 */
|
|
167
167
|
hideCreate?: boolean;
|
|
168
168
|
/** 资源的描述信息 */
|
|
169
|
-
description?:
|
|
169
|
+
description?: React.ReactNode;
|
|
170
170
|
/** 父级资源名称,用于建立资源层级关系。在 Dovetail2 中用不到这个 */
|
|
171
171
|
parent?: string;
|
|
172
172
|
/** 格式化数据参数,目前暂未完全实现,可能会删除 */
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"lib"
|
|
8
8
|
],
|
|
9
|
-
"main": "./dist/refine.
|
|
9
|
+
"main": "./dist/refine.umd.js",
|
|
10
10
|
"module": "./dist/refine.js",
|
|
11
|
-
"types": "./
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@cloudtower/eagle": "^0.32.50",
|
|
14
14
|
"@cloudtower/icons-react": "^0.32.50",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"scripts": {
|
|
98
98
|
"dev": "refine dev",
|
|
99
99
|
"dev:test": "VITE_IS_TEST=true refine dev",
|
|
100
|
-
"build": "
|
|
100
|
+
"build": "tsc --emitDeclarationOnly && vite build",
|
|
101
101
|
"preview": "refine start",
|
|
102
102
|
"refine": "refine",
|
|
103
103
|
"unit-test": "jest",
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const common = require("./common-1eb43414.cjs");
|
|
4
|
-
const monaco = require("monaco-editor");
|
|
5
|
-
const React = require("react");
|
|
6
|
-
function _interopNamespaceDefault(e) {
|
|
7
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
-
if (e) {
|
|
9
|
-
for (const k in e) {
|
|
10
|
-
if (k !== "default") {
|
|
11
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: () => e[k]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
const monaco__namespace = /* @__PURE__ */ _interopNamespaceDefault(monaco);
|
|
23
|
-
const MonacoYamlDiffEditor = (props) => {
|
|
24
|
-
const ref = React.useRef(null);
|
|
25
|
-
const { origin, modified, id, height } = props;
|
|
26
|
-
React.useEffect(() => {
|
|
27
|
-
const originalUri = id ? monaco__namespace.Uri.parse(`${id}_original.yaml`) : void 0;
|
|
28
|
-
const modifiedUri = id ? monaco__namespace.Uri.parse(`${id}_modified.yaml`) : void 0;
|
|
29
|
-
const originalModel = monaco__namespace.editor.createModel(origin, "yaml", originalUri);
|
|
30
|
-
const modifiedModel = monaco__namespace.editor.createModel(modified, "yaml", modifiedUri);
|
|
31
|
-
const diffEditor = monaco__namespace.editor.createDiffEditor(ref.current, {
|
|
32
|
-
renderSideBySide: true,
|
|
33
|
-
originalEditable: false,
|
|
34
|
-
readOnly: true,
|
|
35
|
-
ignoreTrimWhitespace: false,
|
|
36
|
-
scrollBeyondLastLine: false
|
|
37
|
-
});
|
|
38
|
-
diffEditor.setModel({
|
|
39
|
-
original: originalModel,
|
|
40
|
-
modified: modifiedModel
|
|
41
|
-
});
|
|
42
|
-
return () => {
|
|
43
|
-
diffEditor.dispose();
|
|
44
|
-
originalModel.dispose();
|
|
45
|
-
modifiedModel.dispose();
|
|
46
|
-
};
|
|
47
|
-
}, [modified, origin, id]);
|
|
48
|
-
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
49
|
-
"div",
|
|
50
|
-
{
|
|
51
|
-
ref,
|
|
52
|
-
style: {
|
|
53
|
-
width: "100%",
|
|
54
|
-
height: height || "500px"
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
);
|
|
58
|
-
};
|
|
59
|
-
exports.default = MonacoYamlDiffEditor;
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const common = require("./common-1eb43414.cjs");
|
|
4
|
-
const monaco = require("monaco-editor");
|
|
5
|
-
const monacoYaml = require("monaco-yaml");
|
|
6
|
-
const React = require("react");
|
|
7
|
-
const ReactDOM = require("react-dom");
|
|
8
|
-
const refine = require("./index-ee8ac828.cjs");
|
|
9
|
-
require("dayjs");
|
|
10
|
-
require("i18next");
|
|
11
|
-
require("@refinedev/core");
|
|
12
|
-
require("qs");
|
|
13
|
-
require("react-router-dom");
|
|
14
|
-
require("@cloudtower/eagle");
|
|
15
|
-
require("@cloudtower/icons-react");
|
|
16
|
-
require("lodash-es");
|
|
17
|
-
require("js-yaml");
|
|
18
|
-
require("usehooks-ts");
|
|
19
|
-
require("k8s-api-provider");
|
|
20
|
-
require("@patternfly/react-log-viewer");
|
|
21
|
-
require("react-hook-form");
|
|
22
|
-
require("sunflower-antd");
|
|
23
|
-
require("antd");
|
|
24
|
-
function _interopNamespaceDefault(e) {
|
|
25
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
26
|
-
if (e) {
|
|
27
|
-
for (const k in e) {
|
|
28
|
-
if (k !== "default") {
|
|
29
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
30
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: () => e[k]
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
n.default = e;
|
|
38
|
-
return Object.freeze(n);
|
|
39
|
-
}
|
|
40
|
-
const monaco__namespace = /* @__PURE__ */ _interopNamespaceDefault(monaco);
|
|
41
|
-
const MonacoYamlEditor = (props) => {
|
|
42
|
-
const ref = React.useRef(null);
|
|
43
|
-
const instanceRef = React.useRef({
|
|
44
|
-
editor: null
|
|
45
|
-
});
|
|
46
|
-
const {
|
|
47
|
-
defaultValue,
|
|
48
|
-
id,
|
|
49
|
-
height,
|
|
50
|
-
readOnly,
|
|
51
|
-
schemas,
|
|
52
|
-
isScrollOnFocus,
|
|
53
|
-
onChange,
|
|
54
|
-
onValidate,
|
|
55
|
-
getInstance,
|
|
56
|
-
onEditorCreate,
|
|
57
|
-
onBlur
|
|
58
|
-
} = props;
|
|
59
|
-
const uri = id ? monaco__namespace.Uri.parse(`${id}.yaml`) : void 0;
|
|
60
|
-
React.useEffect(() => {
|
|
61
|
-
if (!window._MonacoSchemaMap) {
|
|
62
|
-
window._MonacoSchemaMap = /* @__PURE__ */ new Map();
|
|
63
|
-
}
|
|
64
|
-
window._MonacoSchemaMap.set(id || "", {
|
|
65
|
-
// Id of the first schema
|
|
66
|
-
uri: String(uri),
|
|
67
|
-
// Associate with our model
|
|
68
|
-
fileMatch: [String(uri)],
|
|
69
|
-
schema: {
|
|
70
|
-
oneOf: schemas || [{ type: "object" }]
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const finalSchemas = [...window._MonacoSchemaMap.values()];
|
|
74
|
-
monacoYaml.setDiagnosticsOptions({
|
|
75
|
-
enableSchemaRequest: false,
|
|
76
|
-
validate: true,
|
|
77
|
-
format: true,
|
|
78
|
-
isKubernetes: true,
|
|
79
|
-
schemas: finalSchemas
|
|
80
|
-
});
|
|
81
|
-
const model = monaco__namespace.editor.createModel(defaultValue, "yaml", uri);
|
|
82
|
-
const editor = monaco__namespace.editor.create(ref.current, {
|
|
83
|
-
automaticLayout: true,
|
|
84
|
-
scrollBeyondLastLine: false,
|
|
85
|
-
model,
|
|
86
|
-
scrollbar: {
|
|
87
|
-
handleMouseWheel: !isScrollOnFocus,
|
|
88
|
-
alwaysConsumeMouseWheel: false
|
|
89
|
-
// https://github.com/microsoft/monaco-editor/issues/2007
|
|
90
|
-
},
|
|
91
|
-
tabSize: 2,
|
|
92
|
-
lineNumbersMinChars: 7,
|
|
93
|
-
readOnly,
|
|
94
|
-
autoIndent: {}.VITE_IS_TEST ? "none" : "advanced",
|
|
95
|
-
theme: "vs"
|
|
96
|
-
});
|
|
97
|
-
instanceRef.current.editor = editor;
|
|
98
|
-
getInstance == null ? void 0 : getInstance(editor);
|
|
99
|
-
onEditorCreate == null ? void 0 : onEditorCreate(editor);
|
|
100
|
-
return () => {
|
|
101
|
-
instanceRef.current.editor = null;
|
|
102
|
-
window._MonacoSchemaMap.delete(id || "");
|
|
103
|
-
model.dispose();
|
|
104
|
-
editor.dispose();
|
|
105
|
-
};
|
|
106
|
-
}, [id, schemas, readOnly, isScrollOnFocus, getInstance]);
|
|
107
|
-
React.useEffect(() => {
|
|
108
|
-
const editor = instanceRef.current.editor;
|
|
109
|
-
if (editor) {
|
|
110
|
-
const stop = editor.onDidChangeModelContent(() => {
|
|
111
|
-
ReactDOM.unstable_batchedUpdates(() => {
|
|
112
|
-
onChange == null ? void 0 : onChange(editor.getValue());
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
return () => {
|
|
116
|
-
stop.dispose();
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
}, [onChange]);
|
|
120
|
-
React.useEffect(() => {
|
|
121
|
-
const editor = instanceRef.current.editor;
|
|
122
|
-
if (editor) {
|
|
123
|
-
const stop = monaco__namespace.editor.onDidChangeMarkers((uri2) => {
|
|
124
|
-
var _a;
|
|
125
|
-
const model = (_a = instanceRef.current.editor) == null ? void 0 : _a.getModel();
|
|
126
|
-
const currentEditorUri = model == null ? void 0 : model.uri;
|
|
127
|
-
if (model && uri2.toString() === (currentEditorUri == null ? void 0 : currentEditorUri.toString())) {
|
|
128
|
-
const marks = monaco__namespace.editor.getModelMarkers({
|
|
129
|
-
owner: "yaml",
|
|
130
|
-
resource: currentEditorUri
|
|
131
|
-
});
|
|
132
|
-
const yamlMarks = marks.filter((m) => m.source === "YAML");
|
|
133
|
-
const schemaMarks = marks.filter((m) => m.source !== "YAML");
|
|
134
|
-
const yamlValid = yamlMarks.length === 0;
|
|
135
|
-
const schemaValid = schemaMarks.length === 0;
|
|
136
|
-
onValidate == null ? void 0 : onValidate(yamlValid, schemaValid);
|
|
137
|
-
if (marks.some((mark) => {
|
|
138
|
-
var _a2;
|
|
139
|
-
return (_a2 = mark.source) == null ? void 0 : _a2.includes("yaml-schema");
|
|
140
|
-
})) {
|
|
141
|
-
monaco__namespace.editor.setModelMarkers(
|
|
142
|
-
model,
|
|
143
|
-
"yaml",
|
|
144
|
-
marks.map((mark) => ({ ...mark, source: "", resource: {} }))
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
return () => {
|
|
150
|
-
stop.dispose();
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}, [onValidate]);
|
|
154
|
-
React.useEffect(() => {
|
|
155
|
-
const editor = instanceRef.current.editor;
|
|
156
|
-
if (editor) {
|
|
157
|
-
const stop = editor.onDidBlurEditorWidget(() => {
|
|
158
|
-
ReactDOM.unstable_batchedUpdates(() => {
|
|
159
|
-
onBlur == null ? void 0 : onBlur();
|
|
160
|
-
});
|
|
161
|
-
});
|
|
162
|
-
return () => {
|
|
163
|
-
stop.dispose();
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}, [onBlur]);
|
|
167
|
-
React.useEffect(() => {
|
|
168
|
-
const editor = instanceRef.current.editor;
|
|
169
|
-
const stops = [];
|
|
170
|
-
if (editor && isScrollOnFocus) {
|
|
171
|
-
stops.push(
|
|
172
|
-
editor.onDidFocusEditorWidget(() => {
|
|
173
|
-
editor.updateOptions({
|
|
174
|
-
scrollbar: {
|
|
175
|
-
handleMouseWheel: true
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
})
|
|
179
|
-
);
|
|
180
|
-
stops.push(
|
|
181
|
-
editor.onDidBlurEditorWidget(() => {
|
|
182
|
-
editor.updateOptions({
|
|
183
|
-
scrollbar: {
|
|
184
|
-
handleMouseWheel: false
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
})
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
return () => {
|
|
191
|
-
stops.forEach((stop) => stop.dispose());
|
|
192
|
-
};
|
|
193
|
-
}, [isScrollOnFocus]);
|
|
194
|
-
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
195
|
-
"div",
|
|
196
|
-
{
|
|
197
|
-
ref,
|
|
198
|
-
className: common.cx_default(refine.YamlEditorStyle, props.className),
|
|
199
|
-
style: {
|
|
200
|
-
width: "100%",
|
|
201
|
-
height: height || "500px"
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
};
|
|
206
|
-
exports.default = MonacoYamlEditor;
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const common = require("./common-1eb43414.cjs");
|
|
4
|
-
const eagle = require("@cloudtower/eagle");
|
|
5
|
-
const React = require("react");
|
|
6
|
-
const index = require("./index-31874f77.cjs");
|
|
7
|
-
const buffer = require("buffer");
|
|
8
|
-
require("@xterm/addon-canvas");
|
|
9
|
-
require("@xterm/addon-fit");
|
|
10
|
-
require("@xterm/addon-search");
|
|
11
|
-
require("@xterm/addon-web-links");
|
|
12
|
-
require("@xterm/addon-webgl");
|
|
13
|
-
require("@xterm/xterm");
|
|
14
|
-
require("copy-to-clipboard");
|
|
15
|
-
require("lodash-es");
|
|
16
|
-
require("@cloudtower/icons-react");
|
|
17
|
-
function addParam(url, key, val) {
|
|
18
|
-
let out = url + (url.includes("?") ? "&" : "?");
|
|
19
|
-
if (!Array.isArray(val)) {
|
|
20
|
-
val = [val];
|
|
21
|
-
}
|
|
22
|
-
out += val.map((v) => {
|
|
23
|
-
if (v === null) {
|
|
24
|
-
return `${encodeURIComponent(key)}`;
|
|
25
|
-
} else {
|
|
26
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(v)}`;
|
|
27
|
-
}
|
|
28
|
-
}).join("&");
|
|
29
|
-
return out;
|
|
30
|
-
}
|
|
31
|
-
function addParams(url, params) {
|
|
32
|
-
if (params && typeof params === "object") {
|
|
33
|
-
Object.keys(params).forEach((key) => {
|
|
34
|
-
url = addParam(url, key, params[key]);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
return url;
|
|
38
|
-
}
|
|
39
|
-
function base64Encode(str, alphabet = "normal") {
|
|
40
|
-
let buf;
|
|
41
|
-
if (str === null || typeof str === "undefined") {
|
|
42
|
-
return str;
|
|
43
|
-
}
|
|
44
|
-
if (typeof buffer.Buffer.from === "function" && buffer.Buffer.from !== Uint8Array.from) {
|
|
45
|
-
buf = buffer.Buffer.from(str);
|
|
46
|
-
} else {
|
|
47
|
-
buf = new buffer.Buffer(str);
|
|
48
|
-
}
|
|
49
|
-
if (alphabet === "url") {
|
|
50
|
-
const m = {
|
|
51
|
-
"+": "-",
|
|
52
|
-
"/": "_"
|
|
53
|
-
};
|
|
54
|
-
return buf.toString("base64").replace(/[+/]|=+$/g, (char) => m[char] || "");
|
|
55
|
-
}
|
|
56
|
-
return buf.toString("base64");
|
|
57
|
-
}
|
|
58
|
-
function base64DecodeToBuffer(str) {
|
|
59
|
-
if (str === null || typeof str === "undefined") {
|
|
60
|
-
return str;
|
|
61
|
-
}
|
|
62
|
-
if (typeof buffer.Buffer.from === "function" && buffer.Buffer.from !== Uint8Array.from) {
|
|
63
|
-
return buffer.Buffer.from(str, "base64");
|
|
64
|
-
} else {
|
|
65
|
-
return new buffer.Buffer(str, "base64");
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function base64Decode(str) {
|
|
69
|
-
return !str ? str : base64DecodeToBuffer(str.replace(/[-_]/g, (char) => char === "-" ? "+" : "/")).toString();
|
|
70
|
-
}
|
|
71
|
-
var OS = /* @__PURE__ */ ((OS2) => {
|
|
72
|
-
OS2["Linux"] = "linux";
|
|
73
|
-
OS2["Windows"] = "windows";
|
|
74
|
-
return OS2;
|
|
75
|
-
})(OS || {});
|
|
76
|
-
const BACKUP_SHELLS = [
|
|
77
|
-
"windows",
|
|
78
|
-
"linux"
|
|
79
|
-
/* Linux */
|
|
80
|
-
];
|
|
81
|
-
const COMMANDS = {
|
|
82
|
-
[
|
|
83
|
-
"linux"
|
|
84
|
-
/* Linux */
|
|
85
|
-
]: [
|
|
86
|
-
"/bin/sh",
|
|
87
|
-
"-c",
|
|
88
|
-
'TERM=xterm-256color; export TERM; [ -x /bin/bash ] && ([ -x /usr/bin/script ] && /usr/bin/script -q -c "/bin/bash" /dev/null || exec /bin/bash) || exec /bin/sh'
|
|
89
|
-
],
|
|
90
|
-
[
|
|
91
|
-
"windows"
|
|
92
|
-
/* Windows */
|
|
93
|
-
]: ["cmd"]
|
|
94
|
-
};
|
|
95
|
-
const PodShell = React.forwardRef(
|
|
96
|
-
function PodShell2(props, ref) {
|
|
97
|
-
const { pod, basePath, onSocketStatusChange } = props;
|
|
98
|
-
const id = pod.id;
|
|
99
|
-
const [namespace, name] = React.useMemo(() => id.split("/"), [id]);
|
|
100
|
-
const shellRef = React.useRef(null);
|
|
101
|
-
const errorMsgRef = React.useRef("");
|
|
102
|
-
const [osIndex, setOsIndex] = React.useState(0);
|
|
103
|
-
const [container, setContainer] = React.useState("");
|
|
104
|
-
const containers = React.useMemo(() => {
|
|
105
|
-
var _a, _b;
|
|
106
|
-
return (((_a = pod == null ? void 0 : pod._rawYaml.status) == null ? void 0 : _a.containerStatuses) || []).concat(((_b = pod == null ? void 0 : pod._rawYaml.status) == null ? void 0 : _b.initContainerStatuses) || []).map((containerStatus) => containerStatus.name);
|
|
107
|
-
}, [pod]);
|
|
108
|
-
const url = React.useMemo(() => {
|
|
109
|
-
const os = BACKUP_SHELLS[osIndex];
|
|
110
|
-
const protocol = location.protocol.includes("https") ? "wss" : "ws";
|
|
111
|
-
const url2 = container && os ? addParams(
|
|
112
|
-
`${protocol}://${location.host}${basePath}/api/v1/namespaces/${namespace}/pods/${name}/exec`,
|
|
113
|
-
{
|
|
114
|
-
container,
|
|
115
|
-
stdout: "true",
|
|
116
|
-
stdin: "true",
|
|
117
|
-
stderr: "true",
|
|
118
|
-
tty: "true",
|
|
119
|
-
command: COMMANDS[
|
|
120
|
-
os || "linux"
|
|
121
|
-
/* Linux */
|
|
122
|
-
]
|
|
123
|
-
}
|
|
124
|
-
) : "";
|
|
125
|
-
return url2;
|
|
126
|
-
}, [container, name, namespace, osIndex, basePath]);
|
|
127
|
-
const onSocketClose = React.useCallback(
|
|
128
|
-
(socket, term) => {
|
|
129
|
-
var _a, _b;
|
|
130
|
-
if (errorMsgRef.current) {
|
|
131
|
-
if (osIndex + 1 < BACKUP_SHELLS.length) {
|
|
132
|
-
setOsIndex(osIndex + 1);
|
|
133
|
-
} else {
|
|
134
|
-
term == null ? void 0 : term.writeln(`\x1B[38;2;255;82;82m${errorMsgRef.current}`);
|
|
135
|
-
(_a = shellRef.current) == null ? void 0 : _a.setSocketStatus(common.SocketStatus.Disconnected);
|
|
136
|
-
errorMsgRef.current = "";
|
|
137
|
-
}
|
|
138
|
-
} else {
|
|
139
|
-
(_b = shellRef.current) == null ? void 0 : _b.setSocketStatus(common.SocketStatus.Disconnected);
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
[osIndex]
|
|
143
|
-
);
|
|
144
|
-
const onSocketMessage = React.useCallback(
|
|
145
|
-
(e, socket, term) => {
|
|
146
|
-
const type = e.data.substr(0, 1);
|
|
147
|
-
const msg = base64Decode(e.data.substr(1));
|
|
148
|
-
if (`${type}` === "1") {
|
|
149
|
-
term == null ? void 0 : term.write(msg);
|
|
150
|
-
} else {
|
|
151
|
-
if (`${type}` === "3") {
|
|
152
|
-
errorMsgRef.current = msg;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
[]
|
|
157
|
-
);
|
|
158
|
-
const fit = React.useCallback(({ rows, cols }) => {
|
|
159
|
-
var _a;
|
|
160
|
-
const message = `${"4"}${base64Encode(
|
|
161
|
-
JSON.stringify({
|
|
162
|
-
Width: Math.floor(cols),
|
|
163
|
-
Height: Math.floor(rows)
|
|
164
|
-
})
|
|
165
|
-
)}`;
|
|
166
|
-
(_a = shellRef.current) == null ? void 0 : _a.send(message);
|
|
167
|
-
}, []);
|
|
168
|
-
const encode = React.useCallback((input) => `${"0"}${base64Encode(input)}`, []);
|
|
169
|
-
React.useEffect(() => {
|
|
170
|
-
if (!container && containers.length) {
|
|
171
|
-
setContainer(containers[0]);
|
|
172
|
-
}
|
|
173
|
-
}, [containers, container]);
|
|
174
|
-
React.useImperativeHandle(
|
|
175
|
-
ref,
|
|
176
|
-
() => ({
|
|
177
|
-
getAllTerminalContents: () => {
|
|
178
|
-
var _a;
|
|
179
|
-
return ((_a = shellRef.current) == null ? void 0 : _a.getAllTerminalContents()) || [];
|
|
180
|
-
}
|
|
181
|
-
}),
|
|
182
|
-
[]
|
|
183
|
-
);
|
|
184
|
-
return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
185
|
-
index.Shell,
|
|
186
|
-
{
|
|
187
|
-
ref: shellRef,
|
|
188
|
-
url,
|
|
189
|
-
protocols: "base64.channel.k8s.io",
|
|
190
|
-
encode,
|
|
191
|
-
fit,
|
|
192
|
-
toolbarLeftSlot: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
|
|
193
|
-
eagle.Select,
|
|
194
|
-
{
|
|
195
|
-
input: {
|
|
196
|
-
value: container,
|
|
197
|
-
onChange(value) {
|
|
198
|
-
setContainer(value);
|
|
199
|
-
}
|
|
200
|
-
},
|
|
201
|
-
style: {
|
|
202
|
-
width: "256px"
|
|
203
|
-
},
|
|
204
|
-
size: "small",
|
|
205
|
-
children: containers.map((containerName) => /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.AntdOption, { value: containerName, label: containerName, children: containerName }, containerName))
|
|
206
|
-
}
|
|
207
|
-
),
|
|
208
|
-
onSocketMessage,
|
|
209
|
-
onSocketClose,
|
|
210
|
-
onSocketStatusChange
|
|
211
|
-
}
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
);
|
|
215
|
-
exports.OS = OS;
|
|
216
|
-
exports.PodShell = PodShell;
|