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,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './iconfont.js';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface IconProps extends React.SVGAttributes<SVGSVGElement> {
|
|
5
|
+
/** 图标名称,对应 iconfont symbol id */
|
|
6
|
+
name?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const Icon: React.FC<IconProps>;
|
|
10
|
+
export default Icon;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var _excluded = ["name", "className"];
|
|
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 React from 'react';
|
|
6
|
+
import "./iconfont.js";
|
|
7
|
+
import "./index.less";
|
|
8
|
+
var Icon = function Icon(_ref) {
|
|
9
|
+
var name = _ref.name,
|
|
10
|
+
className = _ref.className,
|
|
11
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
13
|
+
className: ['hc-icon', className].filter(Boolean).join(' '),
|
|
14
|
+
"aria-hidden": "true"
|
|
15
|
+
}, rest), /*#__PURE__*/React.createElement("use", {
|
|
16
|
+
xlinkHref: "#".concat(name),
|
|
17
|
+
"aria-hidden": "true"
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
export default Icon;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TooltipProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface IconPopTipsProps {
|
|
5
|
+
title: string;
|
|
6
|
+
iconName?: string;
|
|
7
|
+
placement?: TooltipProps['placement'];
|
|
8
|
+
}
|
|
9
|
+
declare const IconPopTips: React.FC<IconPopTipsProps>;
|
|
10
|
+
export default IconPopTips;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Tooltip } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Icon from "../Icon";
|
|
4
|
+
import "./index.less";
|
|
5
|
+
var IconPopTips = function IconPopTips(_ref) {
|
|
6
|
+
var title = _ref.title,
|
|
7
|
+
_ref$iconName = _ref.iconName,
|
|
8
|
+
iconName = _ref$iconName === void 0 ? 'v35_Help' : _ref$iconName,
|
|
9
|
+
_ref$placement = _ref.placement,
|
|
10
|
+
placement = _ref$placement === void 0 ? 'topRight' : _ref$placement;
|
|
11
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
12
|
+
title: title,
|
|
13
|
+
placement: placement,
|
|
14
|
+
arrow: {
|
|
15
|
+
pointAtCenter: true
|
|
16
|
+
},
|
|
17
|
+
classNames: {
|
|
18
|
+
root: 'hc-icon-pop-tips-tooltip'
|
|
19
|
+
}
|
|
20
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
21
|
+
className: "hc-icon-pop-tips-icon"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
23
|
+
name: iconName
|
|
24
|
+
})));
|
|
25
|
+
};
|
|
26
|
+
export default IconPopTips;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.hc-icon-pop-tips-icon {
|
|
2
|
+
padding-left: 4px;
|
|
3
|
+
.hc-icon {
|
|
4
|
+
font-size: 16px;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// antd 5:箭头颜色由根节点 CSS 变量控制(见 tooltip style: getArrowStyle(..., 'var(--antd-arrow-background-color)'))
|
|
10
|
+
.ant-tooltip.hc-icon-pop-tips-tooltip {
|
|
11
|
+
--antd-arrow-background-color: #fff;
|
|
12
|
+
|
|
13
|
+
.ant-tooltip-inner {
|
|
14
|
+
max-height: 360px;
|
|
15
|
+
padding: 8px 16px;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
color: rgba(0, 0, 0, 0.65);
|
|
18
|
+
line-height: 1.55;
|
|
19
|
+
background-color: #fff;
|
|
20
|
+
box-shadow: 0 1px 10px 0 rgba(40, 105, 246, 0.2);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ant-tooltip-arrow {
|
|
24
|
+
&::before {
|
|
25
|
+
background: #fff;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// antd 仍注入的占位节点,避免露出默认深色
|
|
30
|
+
.ant-tooltip-arrow-content {
|
|
31
|
+
background: transparent;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface IconTextProps {
|
|
4
|
+
/**
|
|
5
|
+
* 状态点颜色
|
|
6
|
+
* success | danger | disable | warning | default
|
|
7
|
+
*/
|
|
8
|
+
state?: string;
|
|
9
|
+
/** iconfont 图标名称 */
|
|
10
|
+
icon?: string;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const IconText: React.FC<IconTextProps>;
|
|
15
|
+
export default IconText;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Icon from "../Icon";
|
|
3
|
+
import "./index.less";
|
|
4
|
+
var IconText = function IconText(_ref) {
|
|
5
|
+
var state = _ref.state,
|
|
6
|
+
icon = _ref.icon,
|
|
7
|
+
children = _ref.children,
|
|
8
|
+
className = _ref.className;
|
|
9
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
10
|
+
className: ['hc-icon-text', className].filter(Boolean).join(' ')
|
|
11
|
+
}, state ? /*#__PURE__*/React.createElement("span", {
|
|
12
|
+
className: "".concat(state, " point")
|
|
13
|
+
}) : null, icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
14
|
+
name: icon
|
|
15
|
+
}) : null, /*#__PURE__*/React.createElement("span", {
|
|
16
|
+
className: "text"
|
|
17
|
+
}, children));
|
|
18
|
+
};
|
|
19
|
+
export default IconText;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.hc-icon-text {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
|
|
5
|
+
.point {
|
|
6
|
+
width: 8px;
|
|
7
|
+
height: 8px;
|
|
8
|
+
border-radius: 100%;
|
|
9
|
+
|
|
10
|
+
&.success {
|
|
11
|
+
background: #52c41a;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&.danger {
|
|
15
|
+
background: #ff4d4f;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.warning {
|
|
19
|
+
background: #faad14;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.disable {
|
|
23
|
+
background: #ccc;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.default {
|
|
27
|
+
background: #2f54eb;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
span {
|
|
32
|
+
line-height: 100%;
|
|
33
|
+
|
|
34
|
+
&.text {
|
|
35
|
+
margin-left: 5px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type LogCenterServices } from './services';
|
|
3
|
+
import type { LogCenterLocale, LogCenterRequest, LogCenterStorage } from './types';
|
|
4
|
+
export interface LogCenterContextValue {
|
|
5
|
+
request: LogCenterRequest;
|
|
6
|
+
services: LogCenterServices;
|
|
7
|
+
storage: Required<LogCenterStorage>;
|
|
8
|
+
locale: LogCenterLocale;
|
|
9
|
+
}
|
|
10
|
+
export declare const LogCenterContext: React.Context<LogCenterContextValue | null>;
|
|
11
|
+
export declare function useLogCenterContext(): LogCenterContextValue;
|
|
12
|
+
export declare function useLogCenterLocale(): {
|
|
13
|
+
log: any;
|
|
14
|
+
common: any;
|
|
15
|
+
compInstalled: any;
|
|
16
|
+
history: any;
|
|
17
|
+
};
|
|
18
|
+
export interface LogCenterProviderProps {
|
|
19
|
+
request: LogCenterRequest;
|
|
20
|
+
storage?: LogCenterStorage;
|
|
21
|
+
locale?: LogCenterLocale;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const LogCenterProvider: React.FC<LogCenterProviderProps>;
|
|
@@ -0,0 +1,66 @@
|
|
|
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 { ConfigProvider } from 'antd';
|
|
8
|
+
import React, { createContext, useContext, useMemo } from 'react';
|
|
9
|
+
import { createLogCenterServices } from "./services";
|
|
10
|
+
import { logCenterLocaleZhCN } from "./locale";
|
|
11
|
+
var defaultStorage = {
|
|
12
|
+
getSession: function getSession(key, returnStr) {
|
|
13
|
+
var value = window.sessionStorage.getItem(key) || '';
|
|
14
|
+
if (returnStr) return value;
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(value);
|
|
17
|
+
} catch (_unused) {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
getLocal: function getLocal(key) {
|
|
22
|
+
var value = window.localStorage.getItem(key) || '';
|
|
23
|
+
try {
|
|
24
|
+
return JSON.parse(value);
|
|
25
|
+
} catch (_unused2) {
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export var LogCenterContext = /*#__PURE__*/createContext(null);
|
|
31
|
+
export function useLogCenterContext() {
|
|
32
|
+
var ctx = useContext(LogCenterContext);
|
|
33
|
+
if (!ctx) {
|
|
34
|
+
throw new Error('LogCenter subcomponents must be used within LogCenter');
|
|
35
|
+
}
|
|
36
|
+
return ctx;
|
|
37
|
+
}
|
|
38
|
+
export function useLogCenterLocale() {
|
|
39
|
+
var _useContext, _ref, _ctxLocale$history;
|
|
40
|
+
var antdLocale = (_useContext = useContext(ConfigProvider.ConfigContext)) === null || _useContext === void 0 ? void 0 : _useContext.locale;
|
|
41
|
+
var _useLogCenterContext = useLogCenterContext(),
|
|
42
|
+
ctxLocale = _useLogCenterContext.locale;
|
|
43
|
+
return {
|
|
44
|
+
log: _objectSpread(_objectSpread(_objectSpread({}, logCenterLocaleZhCN.log), ctxLocale.log), antdLocale === null || antdLocale === void 0 ? void 0 : antdLocale.log),
|
|
45
|
+
common: _objectSpread(_objectSpread(_objectSpread({}, logCenterLocaleZhCN.common), ctxLocale.common), antdLocale === null || antdLocale === void 0 ? void 0 : antdLocale.common),
|
|
46
|
+
compInstalled: _objectSpread(_objectSpread(_objectSpread({}, logCenterLocaleZhCN.compInstalled), ctxLocale.compInstalled), antdLocale === null || antdLocale === void 0 ? void 0 : antdLocale.compInstalled),
|
|
47
|
+
history: (_ref = (_ctxLocale$history = ctxLocale.history) !== null && _ctxLocale$history !== void 0 ? _ctxLocale$history : antdLocale === null || antdLocale === void 0 ? void 0 : antdLocale.history) !== null && _ref !== void 0 ? _ref : logCenterLocaleZhCN.history
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export var LogCenterProvider = function LogCenterProvider(_ref2) {
|
|
51
|
+
var request = _ref2.request,
|
|
52
|
+
storage = _ref2.storage,
|
|
53
|
+
locale = _ref2.locale,
|
|
54
|
+
children = _ref2.children;
|
|
55
|
+
var value = useMemo(function () {
|
|
56
|
+
return {
|
|
57
|
+
request: request,
|
|
58
|
+
services: createLogCenterServices(request),
|
|
59
|
+
storage: _objectSpread(_objectSpread({}, defaultStorage), storage),
|
|
60
|
+
locale: _objectSpread(_objectSpread({}, logCenterLocaleZhCN), locale)
|
|
61
|
+
};
|
|
62
|
+
}, [request, storage, locale]);
|
|
63
|
+
return /*#__PURE__*/React.createElement(LogCenterContext.Provider, {
|
|
64
|
+
value: value
|
|
65
|
+
}, children);
|
|
66
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface IProps {
|
|
4
|
+
/**
|
|
5
|
+
* 日志类型:stdoutLog(标准日志) | filesLog(日志文件)| componentLog(组件日志)
|
|
6
|
+
*/
|
|
7
|
+
type: string;
|
|
8
|
+
/**
|
|
9
|
+
* 所属空间:cluster (集群空间) | project(项目空间) | system(后台平台)
|
|
10
|
+
*/
|
|
11
|
+
space: string;
|
|
12
|
+
/**
|
|
13
|
+
* 集群ID
|
|
14
|
+
*/
|
|
15
|
+
clusterId: string;
|
|
16
|
+
/**
|
|
17
|
+
* 检索分析跳转方法
|
|
18
|
+
*/
|
|
19
|
+
toSearchAnalysis?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* 是否全屏及方法
|
|
22
|
+
*/
|
|
23
|
+
isFullScreen: boolean;
|
|
24
|
+
onFullScreen: (e: any) => void;
|
|
25
|
+
/**
|
|
26
|
+
* 是否嵌入页面,如组件详情页的
|
|
27
|
+
*/
|
|
28
|
+
isEmbed: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 嵌入页面的传参
|
|
31
|
+
*/
|
|
32
|
+
embedParams: any;
|
|
33
|
+
}
|
|
34
|
+
declare function HistoryLog(props: IProps): React.JSX.Element;
|
|
35
|
+
export default HistoryLog;
|