hc-busin-components 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/Actions/index.d.ts +20 -0
- package/dist/Actions/index.js +142 -0
- package/dist/Actions/index.less +9 -0
- package/dist/AuthComponents/authDivider.d.ts +15 -0
- package/dist/AuthComponents/authDivider.js +104 -0
- package/dist/AuthComponents/index.d.ts +4 -0
- package/dist/AuthComponents/index.js +14 -0
- package/dist/BasicFilesRead/images/back.png +0 -0
- package/dist/BasicFilesRead/images/excel.png +0 -0
- package/dist/BasicFilesRead/images/folder.png +0 -0
- package/dist/BasicFilesRead/images/image.png +0 -0
- package/dist/BasicFilesRead/images/jpeg.png +0 -0
- package/dist/BasicFilesRead/images/jpg.png +0 -0
- package/dist/BasicFilesRead/images/normal.png +0 -0
- package/dist/BasicFilesRead/images/png.png +0 -0
- package/dist/BasicFilesRead/images/tar.png +0 -0
- package/dist/BasicFilesRead/images/text.png +0 -0
- package/dist/BasicFilesRead/images/zip.png +0 -0
- package/dist/BasicFilesRead/index.d.ts +31 -0
- package/dist/BasicFilesRead/index.js +286 -0
- package/dist/BasicFilesRead/styles/index.d.ts +3 -0
- package/dist/BasicFilesRead/styles/index.js +9 -0
- package/dist/CombinTable/components/RenderContent.d.ts +9 -0
- package/dist/CombinTable/components/RenderContent.js +201 -0
- package/dist/CombinTable/hooks/useTableParams.d.ts +20 -0
- package/dist/CombinTable/hooks/useTableParams.js +75 -0
- package/dist/CombinTable/hooks/useTableState.d.ts +5 -0
- package/dist/CombinTable/hooks/useTableState.js +22 -0
- package/dist/CombinTable/index.d.ts +4 -0
- package/dist/CombinTable/index.js +225 -0
- package/dist/CombinTable/styles/index.d.ts +3 -0
- package/dist/CombinTable/styles/index.js +11 -0
- package/dist/CombinTable/types/index.d.ts +21 -0
- package/dist/CombinTable/types/index.js +1 -0
- package/dist/CombineSearch/components/Content.d.ts +13 -0
- package/dist/CombineSearch/components/Content.js +249 -0
- package/dist/CombineSearch/components/Tags.d.ts +14 -0
- package/dist/CombineSearch/components/Tags.js +115 -0
- package/dist/CombineSearch/hooks/useCombineState.d.ts +5 -0
- package/dist/CombineSearch/hooks/useCombineState.js +17 -0
- package/dist/CombineSearch/index.d.ts +4 -0
- package/dist/CombineSearch/index.js +168 -0
- package/dist/CombineSearch/style/edit.svg +1 -0
- package/dist/CombineSearch/style/index.d.ts +14 -0
- package/dist/CombineSearch/style/index.js +26 -0
- package/dist/CombineSearch/types/index.d.ts +46 -0
- package/dist/CombineSearch/types/index.js +0 -0
- package/dist/ComponentUninstalled/assets/comp-unintall-background.png +0 -0
- package/dist/ComponentUninstalled/assets/comp-unintall-bg.png +0 -0
- package/dist/ComponentUninstalled/index.d.ts +32 -0
- package/dist/ComponentUninstalled/index.js +164 -0
- package/dist/ComponentUninstalled/index.less +108 -0
- package/dist/ComponentUninstalled/locale.d.ts +14 -0
- package/dist/ComponentUninstalled/locale.js +21 -0
- package/dist/DataCountPopover/index.d.ts +23 -0
- package/dist/DataCountPopover/index.js +121 -0
- package/dist/DataCountPopover/index.less +62 -0
- package/dist/DateRangePicker/index.d.ts +38 -0
- package/dist/DateRangePicker/index.js +483 -0
- package/dist/DateRangePicker/index.less +196 -0
- package/dist/DeleteConfirm/index.d.ts +23 -0
- package/dist/DeleteConfirm/index.js +109 -0
- package/dist/DeleteConfirm/index.less +44 -0
- package/dist/DeleteConfirm/locale.d.ts +7 -0
- package/dist/DeleteConfirm/locale.js +7 -0
- package/dist/DisplayButton/index.d.ts +7 -0
- package/dist/DisplayButton/index.js +23 -0
- package/dist/FileRead/images/back.png +0 -0
- package/dist/FileRead/images/excel.png +0 -0
- package/dist/FileRead/images/folder.png +0 -0
- package/dist/FileRead/images/image.png +0 -0
- package/dist/FileRead/images/jpeg.png +0 -0
- package/dist/FileRead/images/jpg.png +0 -0
- package/dist/FileRead/images/normal.png +0 -0
- package/dist/FileRead/images/png.png +0 -0
- package/dist/FileRead/images/tar.png +0 -0
- package/dist/FileRead/images/text.png +0 -0
- package/dist/FileRead/images/zip.png +0 -0
- package/dist/FileRead/index.d.ts +31 -0
- package/dist/FileRead/index.js +417 -0
- package/dist/FileRead/styles/index.d.ts +3 -0
- package/dist/FileRead/styles/index.js +9 -0
- package/dist/Icon/iconfont.d.ts +1 -0
- package/dist/Icon/iconfont.js +1 -0
- package/dist/Icon/index.d.ts +10 -0
- package/dist/Icon/index.js +20 -0
- package/dist/Icon/index.less +11 -0
- package/dist/IconPopTips/index.d.ts +10 -0
- package/dist/IconPopTips/index.js +26 -0
- package/dist/IconPopTips/index.less +33 -0
- package/dist/IconText/index.d.ts +15 -0
- package/dist/IconText/index.js +19 -0
- package/dist/IconText/index.less +38 -0
- package/dist/LogCenter/assets/empty.png +0 -0
- package/dist/LogCenter/context.d.ts +24 -0
- package/dist/LogCenter/context.js +66 -0
- package/dist/LogCenter/history-log.d.ts +35 -0
- package/dist/LogCenter/history-log.js +1214 -0
- package/dist/LogCenter/index.d.ts +8 -0
- package/dist/LogCenter/index.js +130 -0
- package/dist/LogCenter/index.less +577 -0
- package/dist/LogCenter/locale.d.ts +3 -0
- package/dist/LogCenter/locale.js +81 -0
- package/dist/LogCenter/realtime-log.d.ts +35 -0
- package/dist/LogCenter/realtime-log.js +641 -0
- package/dist/LogCenter/select-with-all.d.ts +28 -0
- package/dist/LogCenter/select-with-all.js +337 -0
- package/dist/LogCenter/select-with-all.less +81 -0
- package/dist/LogCenter/services.d.ts +27 -0
- package/dist/LogCenter/services.js +93 -0
- package/dist/LogCenter/tools.d.ts +9 -0
- package/dist/LogCenter/tools.js +137 -0
- package/dist/LogCenter/types.d.ts +133 -0
- package/dist/LogCenter/types.js +1 -0
- package/dist/LogicalResourceFilter/index.d.ts +7 -0
- package/dist/LogicalResourceFilter/index.js +426 -0
- package/dist/LogicalResourceFilter/index.less +139 -0
- package/dist/LogicalResourceFilter/locale.d.ts +2 -0
- package/dist/LogicalResourceFilter/locale.js +10 -0
- package/dist/LogicalResourceFilter/types.d.ts +58 -0
- package/dist/LogicalResourceFilter/types.js +1 -0
- package/dist/MetadataCount/index.d.ts +16 -0
- package/dist/MetadataCount/index.js +97 -0
- package/dist/MetadataCount/index.less +40 -0
- package/dist/MetadataForm/index.d.ts +18 -0
- package/dist/MetadataForm/index.js +85 -0
- package/dist/MetadataForm/index.less +108 -0
- package/dist/MetadataForm/label.d.ts +13 -0
- package/dist/MetadataForm/label.js +447 -0
- package/dist/MetadataPopoverList/fetchArray.d.ts +3 -0
- package/dist/MetadataPopoverList/fetchArray.js +74 -0
- package/dist/MetadataPopoverList/index.d.ts +13 -0
- package/dist/MetadataPopoverList/index.js +98 -0
- package/dist/MetadataPopoverList/index.less +74 -0
- package/dist/MetadataTags/index.d.ts +17 -0
- package/dist/MetadataTags/index.js +109 -0
- package/dist/MetadataTags/index.less +26 -0
- package/dist/OverFlow/index.d.ts +4 -0
- package/dist/OverFlow/index.js +66 -0
- package/dist/OverFlow/types/index.d.ts +11 -0
- package/dist/OverFlow/types/index.js +1 -0
- package/dist/PageHeader/index.d.ts +16 -0
- package/dist/PageHeader/index.js +41 -0
- package/dist/PageHeader/index.less +89 -0
- package/dist/ResourceProgress/index.d.ts +6 -0
- package/dist/ResourceProgress/index.js +102 -0
- package/dist/ResourceProgress/index.less +86 -0
- package/dist/ResourceProgress/types/index.d.ts +15 -0
- package/dist/ResourceProgress/types/index.js +1 -0
- package/dist/Terminal/index.d.ts +44 -0
- package/dist/Terminal/index.js +390 -0
- package/dist/Terminal/index.less +39 -0
- package/dist/TextCopy/index.d.ts +21 -0
- package/dist/TextCopy/index.js +38 -0
- package/dist/TextCopy/index.less +51 -0
- package/dist/TextEllipsis/index.d.ts +18 -0
- package/dist/TextEllipsis/index.js +31 -0
- package/dist/TextEllipsis/index.less +3 -0
- package/dist/ThemeForm/index.d.ts +6 -0
- package/dist/ThemeForm/index.js +15 -0
- package/dist/ThemeForm/index.less +15 -0
- package/dist/ThemeSubmit/index.d.ts +16 -0
- package/dist/ThemeSubmit/index.js +60 -0
- package/dist/ThemeSubmit/index.less +30 -0
- package/dist/TooltipSpan/index.d.ts +6 -0
- package/dist/TooltipSpan/index.js +72 -0
- package/dist/UsageCycle/index.d.ts +12 -0
- package/dist/UsageCycle/index.js +71 -0
- package/dist/UsageCycle/index.less +56 -0
- package/dist/Yaml/CodeMirrorWrapper.d.ts +14 -0
- package/dist/Yaml/CodeMirrorWrapper.js +106 -0
- package/dist/Yaml/index.d.ts +6 -0
- package/dist/Yaml/index.js +470 -0
- package/dist/Yaml/index.less +190 -0
- package/dist/Yaml/types.d.ts +38 -0
- package/dist/Yaml/types.js +1 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +32 -0
- package/dist/metadata/locale.d.ts +52 -0
- package/dist/metadata/locale.js +69 -0
- package/dist/showMore/index.d.ts +6 -0
- package/dist/showMore/index.js +40 -0
- package/package.json +121 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var _excluded = ["children"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import { Form } from 'antd';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import "./index.less";
|
|
8
|
+
var ThemeForm = function ThemeForm(props) {
|
|
9
|
+
var children = props.children,
|
|
10
|
+
args = _objectWithoutProperties(props, _excluded);
|
|
11
|
+
return /*#__PURE__*/React.createElement(Form, _extends({
|
|
12
|
+
labelAlign: "left"
|
|
13
|
+
}, args), children);
|
|
14
|
+
};
|
|
15
|
+
export default ThemeForm;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormInstance } from 'antd';
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface Props {
|
|
5
|
+
forms?: FormInstance[];
|
|
6
|
+
cancelText?: string;
|
|
7
|
+
okText?: string;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
onOk?: (values: Record<string, any>) => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
hiddenCancel?: boolean;
|
|
12
|
+
hiddenOk?: boolean;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Submit: (props: Props) => React.JSX.Element;
|
|
16
|
+
export default Submit;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { Button, message, Spin } from 'antd';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import "./index.less";
|
|
10
|
+
var Submit = function Submit(props) {
|
|
11
|
+
var okText = props.okText,
|
|
12
|
+
onCancel = props.onCancel,
|
|
13
|
+
onOk = props.onOk,
|
|
14
|
+
cancelText = props.cancelText,
|
|
15
|
+
children = props.children,
|
|
16
|
+
hiddenCancel = props.hiddenCancel,
|
|
17
|
+
hiddenOk = props.hiddenOk,
|
|
18
|
+
loading = props.loading,
|
|
19
|
+
forms = props.forms;
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: "submitBtnBox"
|
|
22
|
+
}, !!hiddenOk ? null : /*#__PURE__*/React.createElement(Button, {
|
|
23
|
+
loading: loading,
|
|
24
|
+
onClick: function onClick() {
|
|
25
|
+
if (forms && forms.length) {
|
|
26
|
+
var results = forms.map(function (item) {
|
|
27
|
+
return item.validateFields().catch(function () {
|
|
28
|
+
return Promise.reject('请检查表单是否填写完整');
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
Promise.all(results).then(function (response) {
|
|
32
|
+
var values = response.reduce(function (pre, cur) {
|
|
33
|
+
return _objectSpread(_objectSpread({}, pre), cur);
|
|
34
|
+
}, {});
|
|
35
|
+
console.log(values);
|
|
36
|
+
if (onOk) {
|
|
37
|
+
onOk(values);
|
|
38
|
+
}
|
|
39
|
+
}).catch(function () {
|
|
40
|
+
message.warning('请检查表单是否填写完整');
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (onOk) {
|
|
45
|
+
onOk({});
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
type: "primary"
|
|
49
|
+
}, okText || '确认'), !!hiddenCancel ? null : /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
loading: loading,
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
if (onCancel) {
|
|
53
|
+
onCancel();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}, cancelText || '取消'), children ? /*#__PURE__*/React.createElement(Spin, {
|
|
57
|
+
spinning: !!loading
|
|
58
|
+
}, children) : null);
|
|
59
|
+
};
|
|
60
|
+
export default Submit;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
.submitBtnBox {
|
|
3
|
+
z-index: 999;
|
|
4
|
+
background-color: #fff !important;
|
|
5
|
+
border-top: 1px solid #dedede;
|
|
6
|
+
bottom: 0;
|
|
7
|
+
padding-left: 20px;
|
|
8
|
+
transform: translateX(-20px);
|
|
9
|
+
padding-bottom: 12px;
|
|
10
|
+
padding-top: 20px;
|
|
11
|
+
position: fixed;
|
|
12
|
+
width: 100%;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: start;
|
|
16
|
+
gap: 10px;
|
|
17
|
+
border-image-source: linear-gradient(
|
|
18
|
+
90deg,
|
|
19
|
+
rgba(255, 255, 255, 0) 0%,
|
|
20
|
+
#d2d2d2 10%,
|
|
21
|
+
#d2d2d2 25%,
|
|
22
|
+
#d2d2d2 75%,
|
|
23
|
+
rgba(255, 255, 255, 0) 90%
|
|
24
|
+
);
|
|
25
|
+
border-image-slice: 1;
|
|
26
|
+
}
|
|
27
|
+
.basic-mr10 {
|
|
28
|
+
margin-right: 10px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
9
|
+
import { Tooltip } from 'antd';
|
|
10
|
+
import { createStyles } from 'antd-style';
|
|
11
|
+
import React, { useEffect, useId, useState } from 'react';
|
|
12
|
+
var TooltipSpanStyle = createStyles(function (_ref) {
|
|
13
|
+
var prefixCls = _ref.prefixCls,
|
|
14
|
+
token = _ref.token,
|
|
15
|
+
css = _ref.css;
|
|
16
|
+
return {
|
|
17
|
+
span: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-width: 180px;\n display: inline-block;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n color: #595959;\n font-size: 12px;\n height: 22px;\n line-height: 22px;\n "])))
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
var TooltipTag = function TooltipTag(props) {
|
|
21
|
+
var _useState = useState(false),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
showTooltip = _useState2[0],
|
|
24
|
+
setShowTooltip = _useState2[1];
|
|
25
|
+
var _TooltipSpanStyle = TooltipSpanStyle(),
|
|
26
|
+
styles = _TooltipSpanStyle.styles,
|
|
27
|
+
prefixCls = _TooltipSpanStyle.prefixCls;
|
|
28
|
+
var content = props.content;
|
|
29
|
+
var tagId = useId();
|
|
30
|
+
var dom = document.getElementById("tagItemId".concat(tagId));
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
if (dom) {
|
|
33
|
+
var cb = function cb() {
|
|
34
|
+
var scrollWidth = dom.scrollWidth,
|
|
35
|
+
clientWidth = dom.clientWidth;
|
|
36
|
+
console.log(scrollWidth, clientWidth);
|
|
37
|
+
if (scrollWidth > clientWidth) {
|
|
38
|
+
setShowTooltip(true);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var observer = new ResizeObserver(cb);
|
|
42
|
+
observer.observe(dom);
|
|
43
|
+
return function () {
|
|
44
|
+
observer.disconnect();
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}, [dom]);
|
|
48
|
+
if (showTooltip) {
|
|
49
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
50
|
+
style: {
|
|
51
|
+
fontSize: '12px',
|
|
52
|
+
color: 'black'
|
|
53
|
+
},
|
|
54
|
+
color: "#fff",
|
|
55
|
+
overlayInnerStyle: {
|
|
56
|
+
color: 'rgba(0, 0, 0, 0.65)',
|
|
57
|
+
fontSize: '12px'
|
|
58
|
+
},
|
|
59
|
+
placement: "bottom",
|
|
60
|
+
trigger: 'hover',
|
|
61
|
+
title: content
|
|
62
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
63
|
+
className: styles.span,
|
|
64
|
+
id: "tagItemId".concat(tagId)
|
|
65
|
+
}, content));
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
68
|
+
className: styles.span,
|
|
69
|
+
id: "tagItemId".concat(tagId)
|
|
70
|
+
}, content);
|
|
71
|
+
};
|
|
72
|
+
export default TooltipTag;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface UsageCycleProps {
|
|
3
|
+
color?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
usage?: number;
|
|
6
|
+
consumption?: number;
|
|
7
|
+
total?: number;
|
|
8
|
+
percent?: number;
|
|
9
|
+
style?: React.CSSProperties;
|
|
10
|
+
}
|
|
11
|
+
declare const UsageCycle: React.FC<UsageCycleProps>;
|
|
12
|
+
export default UsageCycle;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Gauge } from '@ant-design/plots';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var UsageCycle = function UsageCycle(_ref) {
|
|
4
|
+
var _ref$color = _ref.color,
|
|
5
|
+
color = _ref$color === void 0 ? '#006269' : _ref$color,
|
|
6
|
+
_ref$title = _ref.title,
|
|
7
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
|
8
|
+
_ref$usage = _ref.usage,
|
|
9
|
+
usage = _ref$usage === void 0 ? 0 : _ref$usage,
|
|
10
|
+
_ref$consumption = _ref.consumption,
|
|
11
|
+
consumption = _ref$consumption === void 0 ? 0 : _ref$consumption,
|
|
12
|
+
_ref$total = _ref.total,
|
|
13
|
+
total = _ref$total === void 0 ? 1 : _ref$total,
|
|
14
|
+
_ref$percent = _ref.percent,
|
|
15
|
+
percent = _ref$percent === void 0 ? 0 : _ref$percent,
|
|
16
|
+
style = _ref.style;
|
|
17
|
+
var hex2Rgba = function hex2Rgba(bgColor) {
|
|
18
|
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
19
|
+
var color = bgColor.slice(1); // 去掉'#'号
|
|
20
|
+
var rgba = [parseInt('0x' + color.slice(0, 2)), parseInt('0x' + color.slice(2, 4)), parseInt('0x' + color.slice(4, 6)), alpha];
|
|
21
|
+
return "rgba(".concat(rgba.toString(), ")");
|
|
22
|
+
};
|
|
23
|
+
var getHtml = function getHtml(container, view, datum) {
|
|
24
|
+
var percent = total ? (datum.percent * 100).toFixed(2) + '%' : '--';
|
|
25
|
+
return '<div style="color:#333;">' + '<p style="font-size: 20px; font-weight: 500; margin: 0">' + percent + '</p>' + '<p style="font-size: 14px; font-weight: 400; margin: 0; margin-top: 4px">' + title + '</p>' + '</div>';
|
|
26
|
+
};
|
|
27
|
+
var createConfig = {
|
|
28
|
+
percent: percent,
|
|
29
|
+
type: 'meter',
|
|
30
|
+
startAngle: Math.PI,
|
|
31
|
+
endAngle: Math.PI / 180,
|
|
32
|
+
innerRadius: 0.75,
|
|
33
|
+
range: {
|
|
34
|
+
ticks: [0, total ? usage / total : 0, total ? consumption / total : 0, 1],
|
|
35
|
+
width: 10,
|
|
36
|
+
color: [hex2Rgba(color, 1), hex2Rgba(color, 0.5), hex2Rgba(color, 0.1)]
|
|
37
|
+
},
|
|
38
|
+
indicator: {
|
|
39
|
+
pointer: {
|
|
40
|
+
style: {
|
|
41
|
+
opacity: 0
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
pin: {
|
|
45
|
+
style: {
|
|
46
|
+
opacity: 0
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
axis: {
|
|
51
|
+
label: null,
|
|
52
|
+
subTickLine: {
|
|
53
|
+
count: 10,
|
|
54
|
+
style: {
|
|
55
|
+
stroke: '#E0E7FF',
|
|
56
|
+
fillOpacity: 1
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
statistic: {
|
|
61
|
+
content: {
|
|
62
|
+
offsetY: -5,
|
|
63
|
+
customHtml: getHtml
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
style: style
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Gauge, createConfig));
|
|
70
|
+
};
|
|
71
|
+
export default UsageCycle;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.resource-progress-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
|
|
6
|
+
&.resource-horizontal {
|
|
7
|
+
flex: 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.resource-progress {
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: 2px;
|
|
13
|
+
flex: 1;
|
|
14
|
+
|
|
15
|
+
.unit {
|
|
16
|
+
flex: 1;
|
|
17
|
+
height: 8px;
|
|
18
|
+
border-radius: 4px;
|
|
19
|
+
transition: all 0.3s;
|
|
20
|
+
|
|
21
|
+
&.unit-active {
|
|
22
|
+
opacity: 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.unit-percent {
|
|
27
|
+
flex: 1;
|
|
28
|
+
display: flex;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
border-radius: 4px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.resource-progress-unit {
|
|
35
|
+
min-width: 48px;
|
|
36
|
+
text-align: right;
|
|
37
|
+
font-size: 14px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.resource-vertical {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 4px;
|
|
44
|
+
min-width: 80px;
|
|
45
|
+
|
|
46
|
+
.resource-text {
|
|
47
|
+
color: rgba(0, 0, 0, 0.45);
|
|
48
|
+
font-size: 12px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
span {
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
color: rgba(0, 0, 0, 0.85);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CodeMirrorWrapperProps {
|
|
3
|
+
content: string;
|
|
4
|
+
options: {
|
|
5
|
+
mode: string;
|
|
6
|
+
height?: string | number;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
};
|
|
10
|
+
onBeforeChange?: (editor: unknown, data: unknown, value: string) => void;
|
|
11
|
+
onChange?: (editor: unknown, data: unknown, value: string) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const CodeMirrorWrapper: React.FC<CodeMirrorWrapperProps>;
|
|
14
|
+
export default CodeMirrorWrapper;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { javascript } from '@codemirror/lang-javascript';
|
|
2
|
+
import { yaml } from '@codemirror/lang-yaml';
|
|
3
|
+
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
|
|
4
|
+
import { EditorView } from '@codemirror/view';
|
|
5
|
+
import { tags as t } from '@lezer/highlight';
|
|
6
|
+
import CodeMirror from '@uiw/react-codemirror';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
var yamlHighlight = HighlightStyle.define([{
|
|
9
|
+
tag: [t.tagName, t.propertyName, t.attributeName],
|
|
10
|
+
color: '#ffd700'
|
|
11
|
+
}, {
|
|
12
|
+
tag: t.string,
|
|
13
|
+
color: '#ce9178'
|
|
14
|
+
}, {
|
|
15
|
+
tag: t.number,
|
|
16
|
+
color: '#ce9178'
|
|
17
|
+
}, {
|
|
18
|
+
tag: t.atom,
|
|
19
|
+
color: '#ce9178'
|
|
20
|
+
}, {
|
|
21
|
+
tag: t.comment,
|
|
22
|
+
color: '#6a9955'
|
|
23
|
+
}, {
|
|
24
|
+
tag: t.keyword,
|
|
25
|
+
color: '#ffd700'
|
|
26
|
+
}, {
|
|
27
|
+
tag: t.operator,
|
|
28
|
+
color: '#f8f8f2'
|
|
29
|
+
}, {
|
|
30
|
+
tag: t.variableName,
|
|
31
|
+
color: '#ffd700'
|
|
32
|
+
}, {
|
|
33
|
+
tag: t.typeName,
|
|
34
|
+
color: '#ffd700'
|
|
35
|
+
}]);
|
|
36
|
+
var darkTheme = EditorView.theme({
|
|
37
|
+
'&': {
|
|
38
|
+
backgroundColor: '#1e1e1e',
|
|
39
|
+
color: '#f8f8f2',
|
|
40
|
+
fontFamily: 'Menlo, Consolas, monospace'
|
|
41
|
+
},
|
|
42
|
+
'.cm-editor': {
|
|
43
|
+
backgroundColor: '#1e1e1e',
|
|
44
|
+
fontFamily: 'Menlo, Consolas, monospace',
|
|
45
|
+
outline: 'none !important'
|
|
46
|
+
},
|
|
47
|
+
'.cm-scroller': {
|
|
48
|
+
backgroundColor: '#1e1e1e',
|
|
49
|
+
outline: 'none !important'
|
|
50
|
+
},
|
|
51
|
+
'.cm-content': {
|
|
52
|
+
backgroundColor: '#1e1e1e',
|
|
53
|
+
fontFamily: 'Menlo, Consolas, monospace',
|
|
54
|
+
padding: 0,
|
|
55
|
+
outline: 'none !important'
|
|
56
|
+
},
|
|
57
|
+
'.cm-gutters': {
|
|
58
|
+
backgroundColor: '#1e1e1e',
|
|
59
|
+
color: '#bfbfbf',
|
|
60
|
+
border: 'none',
|
|
61
|
+
fontFamily: 'Menlo, Consolas, monospace'
|
|
62
|
+
},
|
|
63
|
+
'.cm-activeLineGutter': {
|
|
64
|
+
backgroundColor: '#1e1e1e'
|
|
65
|
+
},
|
|
66
|
+
'.cm-activeLine': {
|
|
67
|
+
backgroundColor: '#1e1e1e'
|
|
68
|
+
},
|
|
69
|
+
'.cm-cursor': {
|
|
70
|
+
borderLeft: '1px solid #f8f8f2'
|
|
71
|
+
},
|
|
72
|
+
'.cm-lineNumbers': {
|
|
73
|
+
minWidth: '27px'
|
|
74
|
+
},
|
|
75
|
+
'.cm-line': {
|
|
76
|
+
padding: '2px 8px',
|
|
77
|
+
lineHeight: '1.3'
|
|
78
|
+
},
|
|
79
|
+
'&:focus-visible': {
|
|
80
|
+
outline: 'none !important'
|
|
81
|
+
},
|
|
82
|
+
'&.cm-focused': {
|
|
83
|
+
outline: 'none !important'
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
var CodeMirrorWrapper = function CodeMirrorWrapper(_ref) {
|
|
87
|
+
var content = _ref.content,
|
|
88
|
+
options = _ref.options,
|
|
89
|
+
onBeforeChange = _ref.onBeforeChange,
|
|
90
|
+
_onChange = _ref.onChange;
|
|
91
|
+
var extensions = [options.mode === 'yaml' ? yaml() : javascript({
|
|
92
|
+
jsx: true
|
|
93
|
+
}), EditorView.lineWrapping, darkTheme, syntaxHighlighting(yamlHighlight)];
|
|
94
|
+
return /*#__PURE__*/React.createElement(CodeMirror, {
|
|
95
|
+
value: content,
|
|
96
|
+
height: "100%",
|
|
97
|
+
extensions: extensions,
|
|
98
|
+
onChange: function onChange(value) {
|
|
99
|
+
onBeforeChange === null || onBeforeChange === void 0 || onBeforeChange(null, null, value);
|
|
100
|
+
_onChange === null || _onChange === void 0 || _onChange(null, null, value);
|
|
101
|
+
},
|
|
102
|
+
readOnly: options.readOnly,
|
|
103
|
+
placeholder: options.placeholder
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
export default CodeMirrorWrapper;
|