@dovetail-v2/refine 0.1.4 → 0.1.5-alpha.1
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-4060eeb6.js → MonacoYamlDiffEditor-c5547070.js} +1 -1
- package/dist/{index-9767c246.js → index-152e54ea.js} +16500 -2346
- package/dist/refine.js +213 -207
- package/dist/refine.umd.cjs +16226 -2072
- package/dist/style.css +232 -3
- package/lib/src/components/Form/useYamlForm.d.ts +2 -3
- package/lib/src/components/PodDropdown/index.d.ts +9 -0
- package/lib/src/components/PodShellModal/PodShell.d.ts +18 -0
- package/lib/src/components/PodShellModal/index.d.ts +10 -0
- package/lib/src/components/Shell/ShellToolbar.d.ts +16 -0
- package/lib/src/components/Shell/index.d.ts +74 -0
- package/lib/src/components/YamlEditor/MonacoYamlEditor.d.ts +1 -1
- package/lib/src/components/YamlEditor/YamlEditorComponent.d.ts +1 -1
- package/lib/src/components/index.d.ts +3 -0
- package/lib/src/hooks/useSchema.d.ts +7 -0
- package/lib/src/i18n.d.ts +9 -0
- package/lib/src/locales/en-US/index.d.ts +2 -0
- package/lib/src/locales/zh-CN/index.d.ts +7 -0
- package/lib/src/styles/modal.d.ts +1 -0
- package/lib/src/utils/openapi.d.ts +6 -11
- package/lib/src/utils/shell.d.ts +16 -0
- package/package.json +14 -5
package/dist/style.css
CHANGED
|
@@ -1508,6 +1508,236 @@
|
|
|
1508
1508
|
.e1cjl2b8{border-radius:8px;border:1px solid rgba(211,218,235,0.60);}.e1cjl2b8 .monaco-editor,.e1cjl2b8 .monaco-scrollable-element,.e1cjl2b8 .overflow-guard > .margin{border-radius:8px;}
|
|
1509
1509
|
.w1akirqw{height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
1510
1510
|
.t30srnq{line-height:32px !important;}
|
|
1511
|
+
.tzxa6d{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;height:32px;}
|
|
1512
|
+
.t1sxu3rr{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
|
1513
|
+
.ix8ych8{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:16px;}
|
|
1514
|
+
.i58m6oo{cursor:pointer;}
|
|
1515
|
+
.d1t2oa87{width:1px;height:100%;background:rgba(172,186,211,0.60);margin:0 16px;}
|
|
1516
|
+
.tuo8xdg{white-space:nowrap;}
|
|
1517
|
+
/**
|
|
1518
|
+
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
|
|
1519
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
1520
|
+
* https://github.com/chjj/term.js
|
|
1521
|
+
* @license MIT
|
|
1522
|
+
*
|
|
1523
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1524
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
1525
|
+
* in the Software without restriction, including without limitation the rights
|
|
1526
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1527
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
1528
|
+
* furnished to do so, subject to the following conditions:
|
|
1529
|
+
*
|
|
1530
|
+
* The above copyright notice and this permission notice shall be included in
|
|
1531
|
+
* all copies or substantial portions of the Software.
|
|
1532
|
+
*
|
|
1533
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1534
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1535
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1536
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1537
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1538
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
1539
|
+
* THE SOFTWARE.
|
|
1540
|
+
*
|
|
1541
|
+
* Originally forked from (with the author's permission):
|
|
1542
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
1543
|
+
* http://bellard.org/jslinux/
|
|
1544
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
1545
|
+
* The original design remains. The terminal itself
|
|
1546
|
+
* has been extended to include xterm CSI codes, among
|
|
1547
|
+
* other features.
|
|
1548
|
+
*/
|
|
1549
|
+
|
|
1550
|
+
/**
|
|
1551
|
+
* Default styles for xterm.js
|
|
1552
|
+
*/
|
|
1553
|
+
|
|
1554
|
+
.xterm {
|
|
1555
|
+
cursor: text;
|
|
1556
|
+
position: relative;
|
|
1557
|
+
user-select: none;
|
|
1558
|
+
-ms-user-select: none;
|
|
1559
|
+
-webkit-user-select: none;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
.xterm.focus,
|
|
1563
|
+
.xterm:focus {
|
|
1564
|
+
outline: none;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
.xterm .xterm-helpers {
|
|
1568
|
+
position: absolute;
|
|
1569
|
+
top: 0;
|
|
1570
|
+
/**
|
|
1571
|
+
* The z-index of the helpers must be higher than the canvases in order for
|
|
1572
|
+
* IMEs to appear on top.
|
|
1573
|
+
*/
|
|
1574
|
+
z-index: 5;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
.xterm .xterm-helper-textarea {
|
|
1578
|
+
padding: 0;
|
|
1579
|
+
border: 0;
|
|
1580
|
+
margin: 0;
|
|
1581
|
+
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
|
|
1582
|
+
position: absolute;
|
|
1583
|
+
opacity: 0;
|
|
1584
|
+
left: -9999em;
|
|
1585
|
+
top: 0;
|
|
1586
|
+
width: 0;
|
|
1587
|
+
height: 0;
|
|
1588
|
+
z-index: -5;
|
|
1589
|
+
/** Prevent wrapping so the IME appears against the textarea at the correct position */
|
|
1590
|
+
white-space: nowrap;
|
|
1591
|
+
overflow: hidden;
|
|
1592
|
+
resize: none;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
.xterm .composition-view {
|
|
1596
|
+
/* TODO: Composition position got messed up somewhere */
|
|
1597
|
+
background: #000;
|
|
1598
|
+
color: #FFF;
|
|
1599
|
+
display: none;
|
|
1600
|
+
position: absolute;
|
|
1601
|
+
white-space: nowrap;
|
|
1602
|
+
z-index: 1;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
.xterm .composition-view.active {
|
|
1606
|
+
display: block;
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
.xterm .xterm-viewport {
|
|
1610
|
+
/* On OS X this is required in order for the scroll bar to appear fully opaque */
|
|
1611
|
+
background-color: #000;
|
|
1612
|
+
overflow-y: scroll;
|
|
1613
|
+
cursor: default;
|
|
1614
|
+
position: absolute;
|
|
1615
|
+
right: 0;
|
|
1616
|
+
left: 0;
|
|
1617
|
+
top: 0;
|
|
1618
|
+
bottom: 0;
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
.xterm .xterm-screen {
|
|
1622
|
+
position: relative;
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
.xterm .xterm-screen canvas {
|
|
1626
|
+
position: absolute;
|
|
1627
|
+
left: 0;
|
|
1628
|
+
top: 0;
|
|
1629
|
+
}
|
|
1630
|
+
|
|
1631
|
+
.xterm .xterm-scroll-area {
|
|
1632
|
+
visibility: hidden;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
.xterm-char-measure-element {
|
|
1636
|
+
display: inline-block;
|
|
1637
|
+
visibility: hidden;
|
|
1638
|
+
position: absolute;
|
|
1639
|
+
top: 0;
|
|
1640
|
+
left: -9999em;
|
|
1641
|
+
line-height: normal;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
.xterm.enable-mouse-events {
|
|
1645
|
+
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
|
|
1646
|
+
cursor: default;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
.xterm.xterm-cursor-pointer,
|
|
1650
|
+
.xterm .xterm-cursor-pointer {
|
|
1651
|
+
cursor: pointer;
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
.xterm.column-select.focus {
|
|
1655
|
+
/* Column selection mode */
|
|
1656
|
+
cursor: crosshair;
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
.xterm .xterm-accessibility:not(.debug),
|
|
1660
|
+
.xterm .xterm-message {
|
|
1661
|
+
position: absolute;
|
|
1662
|
+
left: 0;
|
|
1663
|
+
top: 0;
|
|
1664
|
+
bottom: 0;
|
|
1665
|
+
right: 0;
|
|
1666
|
+
z-index: 10;
|
|
1667
|
+
color: transparent;
|
|
1668
|
+
pointer-events: none;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
.xterm .xterm-accessibility-tree:not(.debug) *::selection {
|
|
1672
|
+
color: transparent;
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
.xterm .xterm-accessibility-tree {
|
|
1676
|
+
user-select: text;
|
|
1677
|
+
white-space: pre;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
.xterm .live-region {
|
|
1681
|
+
position: absolute;
|
|
1682
|
+
left: -9999px;
|
|
1683
|
+
width: 1px;
|
|
1684
|
+
height: 1px;
|
|
1685
|
+
overflow: hidden;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
.xterm-dim {
|
|
1689
|
+
/* Dim should not apply to background, so the opacity of the foreground color is applied
|
|
1690
|
+
* explicitly in the generated class and reset to 1 here */
|
|
1691
|
+
opacity: 1 !important;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
.xterm-underline-1 { text-decoration: underline; }
|
|
1695
|
+
.xterm-underline-2 { text-decoration: double underline; }
|
|
1696
|
+
.xterm-underline-3 { text-decoration: wavy underline; }
|
|
1697
|
+
.xterm-underline-4 { text-decoration: dotted underline; }
|
|
1698
|
+
.xterm-underline-5 { text-decoration: dashed underline; }
|
|
1699
|
+
|
|
1700
|
+
.xterm-overline {
|
|
1701
|
+
text-decoration: overline;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
|
|
1705
|
+
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
|
|
1706
|
+
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
|
|
1707
|
+
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
|
|
1708
|
+
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
|
|
1709
|
+
|
|
1710
|
+
.xterm-strikethrough {
|
|
1711
|
+
text-decoration: line-through;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
.xterm-screen .xterm-decoration-container .xterm-decoration {
|
|
1715
|
+
z-index: 6;
|
|
1716
|
+
position: absolute;
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
|
|
1720
|
+
z-index: 7;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
.xterm-decoration-overview-ruler {
|
|
1724
|
+
z-index: 8;
|
|
1725
|
+
position: absolute;
|
|
1726
|
+
top: 0;
|
|
1727
|
+
right: 0;
|
|
1728
|
+
pointer-events: none;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
.xterm-decoration-top {
|
|
1732
|
+
z-index: 2;
|
|
1733
|
+
position: relative;
|
|
1734
|
+
}
|
|
1735
|
+
.c1q5a2qi{height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
1736
|
+
.sdz5fm1{-webkit-flex:1;-ms-flex:1;flex:1;min-height:0;padding:8px;background:#00122E;}
|
|
1737
|
+
.lbp0h2e{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:8px;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;width:100%;color:#2C385299;background:#F2F5FA;}
|
|
1738
|
+
.eioilqy{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}
|
|
1739
|
+
.trlau0c{margin:4px 8px;}
|
|
1740
|
+
.fq4465w.ant-modal.fullscreen .ant-modal-header{padding:60px 128px 32px 128px;}.fq4465w.ant-modal.fullscreen .ant-modal-body{padding:0 128px;}.fq4465w.ant-modal.fullscreen .ant-modal-footer .footer-content{margin:0 128px;}
|
|
1511
1741
|
.sj0ggy.ant-select{-webkit-align-self:flex-start;-ms-flex-item-align:start;align-self:flex-start;min-width:276px;max-width:100%;}.sj0ggy.ant-select .ant-select-selector{display:block;overflow:hidden;padding-right:32px;white-space:nowrap;}.sj0ggy.ant-select .ant-select-selector > span:nth-child(-n + 8):not(.ant-select-selection-search){display:inline-block;max-width:var(--tag-max-width);margin-right:4px;}.sj0ggy.ant-select .ant-select-selection-search{display:none;}.sj0ggy.ant-select .zoom-leave{opacity:0;position:absolute;}
|
|
1512
1742
|
.d1eo8uqs{border-radius:6px;}
|
|
1513
1743
|
.s64gojc.s64gojc.ant-input-affix-wrapper{border:unset;border-bottom:1px solid rgba(211,218,235,.6);border-radius:unset;box-shadow:unset;outline:unset;padding:5px 18px;}.s64gojc.s64gojc.ant-input-affix-wrapper:hover,.s64gojc.s64gojc.ant-input-affix-wrapper:focus{box-shadow:unset;outline:unset;}
|
|
@@ -1530,9 +1760,8 @@
|
|
|
1530
1760
|
|
|
1531
1761
|
.e1guqlj2{-webkit-flex:1;-ms-flex:1;flex:1;height:100%;margin-bottom:16px;}
|
|
1532
1762
|
.f1nltbcu{margin-bottom:16px;}
|
|
1533
|
-
.
|
|
1534
|
-
.
|
|
1535
|
-
.exjt4uc{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:4px;}
|
|
1763
|
+
.m1qgcca6 .ant-modal-header{max-width:648px;width:100%;padding:60px 0 32px 0 !important;margin:auto;}.m1qgcca6 .ant-modal-body{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;width:100%;padding:0 4px !important;margin:auto;}.m1qgcca6 .ant-modal-footer .footer-content{max-width:648px;width:100%;margin:auto !important;}.m1qgcca6 .f1nltbcu{max-width:648px;width:100%;margin-left:auto;margin-right:auto;}
|
|
1764
|
+
.e1tl3wq2{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:4px;}
|
|
1536
1765
|
.c1pvtlkp{width:100%;}
|
|
1537
1766
|
.wfg6u6g{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.wfg6u6g .usage-text{width:50px;text-align:right;}.wfg6u6g .usage-bar{height:12px;width:100px;position:relative;border-radius:2px;}.wfg6u6g .request-anchor{position:absolute;left:10%;top:-3px;height:18px;width:2px;background:#777;z-index:9;}.wfg6u6g .usage-fill-bar{position:absolute;left:0;top:0;height:100%;background:rgba(0,128,255,0.6);z-index:7;}.wfg6u6g .request-bar{position:absolute;left:0;top:0;height:100%;background:#d8deeb;z-index:5;}.wfg6u6g .request-to-limit-bar{position:absolute;right:0;top:0;height:100%;background:#d8deeb;z-index:5;}.wfg6u6g .request-to-limit-bar.no-limit{background:linear-gradient(to right,#d8deeb 50%,#d8deeb 50%);background-size:4px 100%;}.wfg6u6g .request-to-limit-bar.no-limit.exceed-request{background:linear-gradient(to right,#d8deeb 50%,rgba(0,128,255,0.6) 50%);background-size:4px 100%;}
|
|
1538
1767
|
.mdppgn0.ant-menu{background:#edf0f7;padding:8px;}.mdppgn0.ant-menu .ant-menu-item-selected{background:linear-gradient(90deg,#0080ff,#005ed1);border-radius:6px;box-shadow:0 1px 2px rgba(184,192,204,0.6);color:#fff;}.mdppgn0.ant-menu .ant-menu-item-selected a:hover{color:#fff;}.mdppgn0.ant-menu .ant-menu-item:not(.ant-menu-item-selected):hover{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0.6));border-radius:6px;box-shadow:0 0 4px rgba(235,239,245,0.6),0 8px 16px rgba(129,138,153,0.18);}
|
|
@@ -5,9 +5,8 @@ import { JSONSchema7 } from 'json-schema';
|
|
|
5
5
|
import { Unstructured } from 'k8s-api-provider';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { type YamlEditorHandle, type YamlEditorProps } from 'src/components/YamlEditor';
|
|
8
|
-
type EditorProps =
|
|
8
|
+
type EditorProps = YamlEditorProps & {
|
|
9
9
|
ref: React.RefObject<YamlEditorHandle>;
|
|
10
|
-
schema: JSONSchema7 | null;
|
|
11
10
|
};
|
|
12
11
|
export type UseFormProps<TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables extends object = object, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError> = UseFormPropsCore<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError> & {
|
|
13
12
|
submitOnEnter?: boolean;
|
|
@@ -32,7 +31,7 @@ export type UseFormReturnType<TQueryFnData extends BaseRecord = BaseRecord, TErr
|
|
|
32
31
|
onClick: () => void;
|
|
33
32
|
};
|
|
34
33
|
editorProps: EditorProps;
|
|
35
|
-
|
|
34
|
+
schemas: JSONSchema7[] | null;
|
|
36
35
|
isLoadingSchema: boolean;
|
|
37
36
|
loadSchemaError: Error | null;
|
|
38
37
|
fetchSchema: () => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PodModel } from '../../models';
|
|
3
|
+
import { DropdownSize } from '../K8sDropdown';
|
|
4
|
+
type Props<Model extends PodModel> = {
|
|
5
|
+
record: Model;
|
|
6
|
+
size?: DropdownSize;
|
|
7
|
+
};
|
|
8
|
+
export declare function PodDropdown<Model extends PodModel>(props: React.PropsWithChildren<Props<Model>>): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SocketStatus } from 'src/components/Shell';
|
|
3
|
+
import '@xterm/xterm/css/xterm.css';
|
|
4
|
+
import { PodModel } from 'src/models/pod-model';
|
|
5
|
+
export declare enum OS {
|
|
6
|
+
Linux = "linux",
|
|
7
|
+
Windows = "windows"
|
|
8
|
+
}
|
|
9
|
+
interface PodShellProps {
|
|
10
|
+
pod: PodModel;
|
|
11
|
+
basePath: string;
|
|
12
|
+
onSocketStatusChange?: (socketStatus: SocketStatus) => void;
|
|
13
|
+
}
|
|
14
|
+
interface PodShellHandler {
|
|
15
|
+
getAllTerminalContents: () => string[];
|
|
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 };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type OperationType = ('fontSize' | 'downloadLog' | 'clear');
|
|
3
|
+
export interface ShellToolbarProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
leftSlot?: React.ReactNode;
|
|
6
|
+
operations?: (OperationType | React.ReactNode)[];
|
|
7
|
+
searchMatchedTotal: number;
|
|
8
|
+
onSearchNext: (search: string) => void;
|
|
9
|
+
onSearchPre: (search: string) => void;
|
|
10
|
+
onSetFontSize?: (size: number) => void;
|
|
11
|
+
onDownFontSize?: () => void;
|
|
12
|
+
onDownloadLog?: () => void;
|
|
13
|
+
onClear?: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare function ShellToolbar(props: ShellToolbarProps): JSX.Element;
|
|
16
|
+
export default ShellToolbar;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Terminal } from '@xterm/xterm';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ShellToolbarProps } from './ShellToolbar';
|
|
4
|
+
import '@xterm/xterm/css/xterm.css';
|
|
5
|
+
export declare enum SocketStatus {
|
|
6
|
+
Opening = "Opening",
|
|
7
|
+
Open = "Open",
|
|
8
|
+
Disconnected = "Disconnected"
|
|
9
|
+
}
|
|
10
|
+
export type ShellProps = React.PropsWithChildren<{
|
|
11
|
+
url: string;
|
|
12
|
+
protocols?: string;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
logFileName?: string;
|
|
16
|
+
isHideToolbar?: boolean;
|
|
17
|
+
toolbarLeftSlot?: React.ReactNode;
|
|
18
|
+
operations?: ShellToolbarProps['operations'];
|
|
19
|
+
shellOptions?: Record<string, unknown>;
|
|
20
|
+
loadingElement?: React.ReactNode;
|
|
21
|
+
encode: (input: string) => string | ArrayBufferLike | Blob | ArrayBufferView;
|
|
22
|
+
decode?: (output: string | ArrayBufferLike | Blob | ArrayBufferView) => string | ArrayBuffer;
|
|
23
|
+
fit?: (layout: {
|
|
24
|
+
rows: number;
|
|
25
|
+
cols: number;
|
|
26
|
+
}) => void;
|
|
27
|
+
onReconnect?: () => void;
|
|
28
|
+
onSocketInit?: (socket: WebSocket) => void;
|
|
29
|
+
onTermInit?: (term: Terminal) => void;
|
|
30
|
+
onSocketMessage?: (e: MessageEvent, socket: WebSocket, term: Terminal | null) => void;
|
|
31
|
+
onSocketOpen?: (socket: WebSocket) => void;
|
|
32
|
+
onSocketClose?: (socket: WebSocket, term: Terminal | null) => void;
|
|
33
|
+
onSocketStatusChange?: (socketStatus: SocketStatus) => void;
|
|
34
|
+
}>;
|
|
35
|
+
export interface ShellHandler {
|
|
36
|
+
clear: () => void;
|
|
37
|
+
send: (data: string | ArrayBufferLike | Blob | ArrayBufferView, callback?: () => void) => void;
|
|
38
|
+
connect: () => void;
|
|
39
|
+
fit: () => void;
|
|
40
|
+
getAllTerminalContents: () => string[];
|
|
41
|
+
setSocketStatus: React.Dispatch<React.SetStateAction<SocketStatus>>;
|
|
42
|
+
searchNext: (search: string) => void;
|
|
43
|
+
searchPrevious: (search: string) => void;
|
|
44
|
+
setOptions: (options: Record<string, unknown>) => void;
|
|
45
|
+
setLoading: (loading: boolean) => void;
|
|
46
|
+
setError: (error: unknown) => void;
|
|
47
|
+
}
|
|
48
|
+
export declare const Shell: React.ForwardRefExoticComponent<{
|
|
49
|
+
url: string;
|
|
50
|
+
protocols?: string | undefined;
|
|
51
|
+
timeout?: number | undefined;
|
|
52
|
+
className?: string | undefined;
|
|
53
|
+
logFileName?: string | undefined;
|
|
54
|
+
isHideToolbar?: boolean | undefined;
|
|
55
|
+
toolbarLeftSlot?: React.ReactNode;
|
|
56
|
+
operations?: ShellToolbarProps['operations'];
|
|
57
|
+
shellOptions?: Record<string, unknown> | undefined;
|
|
58
|
+
loadingElement?: React.ReactNode;
|
|
59
|
+
encode: (input: string) => string | ArrayBufferLike | Blob | ArrayBufferView;
|
|
60
|
+
decode?: ((output: string | ArrayBufferLike | Blob | ArrayBufferView) => string | ArrayBuffer) | undefined;
|
|
61
|
+
fit?: ((layout: {
|
|
62
|
+
rows: number;
|
|
63
|
+
cols: number;
|
|
64
|
+
}) => void) | undefined;
|
|
65
|
+
onReconnect?: (() => void) | undefined;
|
|
66
|
+
onSocketInit?: ((socket: WebSocket) => void) | undefined;
|
|
67
|
+
onTermInit?: ((term: Terminal) => void) | undefined;
|
|
68
|
+
onSocketMessage?: ((e: MessageEvent, socket: WebSocket, term: Terminal | null) => void) | undefined;
|
|
69
|
+
onSocketOpen?: ((socket: WebSocket) => void) | undefined;
|
|
70
|
+
onSocketClose?: ((socket: WebSocket, term: Terminal | null) => void) | undefined;
|
|
71
|
+
onSocketStatusChange?: ((socketStatus: SocketStatus) => void) | undefined;
|
|
72
|
+
} & {
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
} & React.RefAttributes<ShellHandler>>;
|
|
@@ -12,7 +12,7 @@ type Props = {
|
|
|
12
12
|
onEditorCreate?: (editor: monaco.editor.IStandaloneCodeEditor) => void;
|
|
13
13
|
onBlur?: () => void;
|
|
14
14
|
getInstance?: (ins: monaco.editor.IStandaloneCodeEditor) => void;
|
|
15
|
-
|
|
15
|
+
schemas?: JSONSchema7[] | null;
|
|
16
16
|
readOnly?: boolean;
|
|
17
17
|
};
|
|
18
18
|
declare const MonacoYamlEditor: React.FC<Props>;
|
|
@@ -7,6 +7,7 @@ export * from './FormLayout';
|
|
|
7
7
|
export * from './PodContainersTable';
|
|
8
8
|
export * from './WorkloadDropdown';
|
|
9
9
|
export * from './ReplicasDropdown';
|
|
10
|
+
export * from './PodDropdown';
|
|
10
11
|
export * from './CreateButton';
|
|
11
12
|
export * from './ImageNames';
|
|
12
13
|
export * from './ResourceCRUD';
|
|
@@ -42,3 +43,5 @@ export * from './ResourceFiledDisplays';
|
|
|
42
43
|
export * from './Tabs';
|
|
43
44
|
export * as ValueDisplay from './ValueDisplay';
|
|
44
45
|
export * from './ResourceSelect';
|
|
46
|
+
export * from './Shell';
|
|
47
|
+
export * from './PodShellModal';
|
|
@@ -10,5 +10,12 @@ type UseSchemaResult = {
|
|
|
10
10
|
error: Error | null;
|
|
11
11
|
fetchSchema: () => void;
|
|
12
12
|
};
|
|
13
|
+
export declare function useApiGroupSchema(apiGroups: string[]): {
|
|
14
|
+
fetchSchema: () => Promise<void>;
|
|
15
|
+
schemas: JSONSchema7[] | null;
|
|
16
|
+
schemasMap: Record<string, JSONSchema7[]>;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
error: Error | null;
|
|
19
|
+
};
|
|
13
20
|
export declare function useSchema(options?: UseSchemaOptions): UseSchemaResult;
|
|
14
21
|
export {};
|
package/lib/src/i18n.d.ts
CHANGED
|
@@ -172,6 +172,8 @@ export declare const resources: {
|
|
|
172
172
|
pv_phase_released: string;
|
|
173
173
|
pv_phase_failed: string;
|
|
174
174
|
pv_phase_pending: string;
|
|
175
|
+
exec_pod: string;
|
|
176
|
+
search: string;
|
|
175
177
|
};
|
|
176
178
|
};
|
|
177
179
|
'zh-CN': {
|
|
@@ -346,6 +348,13 @@ export declare const resources: {
|
|
|
346
348
|
pv_phase_released: string;
|
|
347
349
|
pv_phase_failed: string;
|
|
348
350
|
pv_phase_pending: string;
|
|
351
|
+
font_size: string;
|
|
352
|
+
download_shell_content: string;
|
|
353
|
+
clear_shell: string;
|
|
354
|
+
disconnected: string;
|
|
355
|
+
connecting: string;
|
|
356
|
+
reconnect: string;
|
|
357
|
+
search: string;
|
|
349
358
|
};
|
|
350
359
|
};
|
|
351
360
|
};
|
|
@@ -170,6 +170,13 @@ declare const _default: {
|
|
|
170
170
|
pv_phase_released: string;
|
|
171
171
|
pv_phase_failed: string;
|
|
172
172
|
pv_phase_pending: string;
|
|
173
|
+
font_size: string;
|
|
174
|
+
download_shell_content: string;
|
|
175
|
+
clear_shell: string;
|
|
176
|
+
disconnected: string;
|
|
177
|
+
connecting: string;
|
|
178
|
+
reconnect: string;
|
|
179
|
+
search: string;
|
|
173
180
|
};
|
|
174
181
|
};
|
|
175
182
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FullscreenModalStyle: import("@linaria/core").LinariaClassName;
|
|
@@ -29,17 +29,12 @@ interface OpenAPIResponse {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
declare class K8sOpenAPI {
|
|
32
|
-
resourceBasePath
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
private resourceBasePath;
|
|
33
|
+
private apiVersion;
|
|
34
|
+
private schemas;
|
|
35
35
|
constructor(resourceBasePath: string);
|
|
36
|
-
fetch(): Promise<OpenAPIResponse>;
|
|
37
|
-
findSchema(kind: string):
|
|
38
|
-
|
|
39
|
-
group: string;
|
|
40
|
-
kind: string;
|
|
41
|
-
version: string;
|
|
42
|
-
}[];
|
|
43
|
-
}) | undefined>;
|
|
36
|
+
fetch(): Promise<Array<OpenAPIResponse['components']['schemas'][string]> | null>;
|
|
37
|
+
findSchema(kind: string): JSONSchema7 | undefined;
|
|
38
|
+
private processSchemas;
|
|
44
39
|
}
|
|
45
40
|
export default K8sOpenAPI;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
3
|
+
export type QueryParams = {
|
|
4
|
+
[key: string]: string | string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const stdin: (characters: string) => Buffer;
|
|
7
|
+
export declare function addParam(url: string, key: string, val: string | string[]): string;
|
|
8
|
+
export declare function addParams(url: string, params: QueryParams): string;
|
|
9
|
+
declare enum Alphabet {
|
|
10
|
+
NORMAL = "normal",
|
|
11
|
+
URL = "url"
|
|
12
|
+
}
|
|
13
|
+
export declare function base64Encode(str: string, alphabet?: Alphabet): string;
|
|
14
|
+
export declare function base64DecodeToBuffer(str: string): Buffer;
|
|
15
|
+
export declare function base64Decode(str: string): string;
|
|
16
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -10,14 +10,23 @@
|
|
|
10
10
|
"module": "./dist/refine.js",
|
|
11
11
|
"types": "./lib/src/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@cloudtower/eagle": "^0.
|
|
14
|
-
"@cloudtower/icons-react": "^0.
|
|
13
|
+
"@cloudtower/eagle": "^0.31.7",
|
|
14
|
+
"@cloudtower/icons-react": "^0.31.7",
|
|
15
15
|
"@patternfly/react-core": "^5.1.1",
|
|
16
16
|
"@patternfly/react-log-viewer": "^5.0.0",
|
|
17
17
|
"@refinedev/core": "^4.47.2",
|
|
18
18
|
"@refinedev/inferencer": "^4.5.20",
|
|
19
19
|
"@refinedev/react-hook-form": "^4.8.14",
|
|
20
|
+
"@xterm/addon-attach": "^0.11.0",
|
|
21
|
+
"@xterm/addon-canvas": "^0.7.0",
|
|
22
|
+
"@xterm/addon-fit": "^0.10.0",
|
|
23
|
+
"@xterm/addon-search": "^0.15.0",
|
|
24
|
+
"@xterm/addon-web-links": "^0.11.0",
|
|
25
|
+
"@xterm/addon-webgl": "^0.18.0",
|
|
26
|
+
"@xterm/xterm": "^5.5.0",
|
|
20
27
|
"antd": "4.5.0",
|
|
28
|
+
"buffer": "^6.0.3",
|
|
29
|
+
"copy-to-clipboard": "^3.3.3",
|
|
21
30
|
"dayjs": "^1.11.10",
|
|
22
31
|
"i18next": "^23.2.3",
|
|
23
32
|
"js-yaml": "^4.1.0",
|
|
@@ -69,8 +78,8 @@
|
|
|
69
78
|
"vite-plugin-commonjs": "^0.10.0"
|
|
70
79
|
},
|
|
71
80
|
"peerDependencies": {
|
|
72
|
-
"@cloudtower/eagle": "^0.
|
|
73
|
-
"@cloudtower/icons-react": "^0.
|
|
81
|
+
"@cloudtower/eagle": "^0.31.7",
|
|
82
|
+
"@cloudtower/icons-react": "^0.31.7",
|
|
74
83
|
"@refinedev/core": "^4.47.2",
|
|
75
84
|
"antd": "4.5.0",
|
|
76
85
|
"i18next": "^23.2.3",
|