@doreamonjs/page-detail 0.0.0 → 1.10.26

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/CHANGELOG.md ADDED
@@ -0,0 +1,77 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [1.10.26](https://github.com/doreamonjs/doreamon/compare/v1.10.25...v1.10.26) (2023-11-29)
7
+
8
+ **Note:** Version bump only for package @doreamonjs/page-detail
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.8.11](https://github.com/doreamonjs/doreamon/compare/v1.8.10...v1.8.11) (2023-07-17)
15
+
16
+ **Note:** Version bump only for package @doreamonjs/page-login
17
+
18
+ ## [1.8.10](https://github.com/doreamonjs/doreamon/compare/v1.8.9...v1.8.10) (2023-07-17)
19
+
20
+ **Note:** Version bump only for package @doreamonjs/page-login
21
+
22
+ ## [1.2.13](https://github.com/doreamonjs/doreamon/compare/v1.2.12...v1.2.13) (2022-11-14)
23
+
24
+ **Note:** Version bump only for package @doreamonjs/page-login
25
+
26
+ ## [1.2.5](https://github.com/doreamonjs/doreamon/compare/v1.2.4...v1.2.5) (2022-10-17)
27
+
28
+ **Note:** Version bump only for package @doreamonjs/page-login
29
+
30
+ ## [1.1.36](https://github.com/doreamonjs/doreamon/compare/v1.1.35...v1.1.36) (2022-10-10)
31
+
32
+ **Note:** Version bump only for package @doreamonjs/page-login
33
+
34
+ ## [1.1.35](https://github.com/doreamonjs/doreamon/compare/v1.1.34...v1.1.35) (2022-10-10)
35
+
36
+ **Note:** Version bump only for package @doreamonjs/page-login
37
+
38
+ ## [1.1.34](https://github.com/doreamonjs/doreamon/compare/v1.1.33...v1.1.34) (2022-10-10)
39
+
40
+ **Note:** Version bump only for package @doreamonjs/page-login
41
+
42
+ ## [1.1.33](https://github.com/doreamonjs/doreamon/compare/v1.1.32...v1.1.33) (2022-10-10)
43
+
44
+ **Note:** Version bump only for package @doreamonjs/page-login
45
+
46
+ ## [1.1.32](https://github.com/doreamonjs/doreamon/compare/v1.1.31...v1.1.32) (2022-10-10)
47
+
48
+ **Note:** Version bump only for package @doreamonjs/page-login
49
+
50
+ ## [1.1.31](https://github.com/doreamonjs/doreamon/compare/v1.1.30...v1.1.31) (2022-10-10)
51
+
52
+ **Note:** Version bump only for package @doreamonjs/page-login
53
+
54
+ ## [1.1.28](https://github.com/doreamonjs/doreamon/compare/v1.1.27...v1.1.28) (2022-09-29)
55
+
56
+ **Note:** Version bump only for package @doreamonjs/page-login
57
+
58
+ ## [1.1.22](https://github.com/doreamonjs/doreamon/compare/v1.1.21...v1.1.22) (2022-09-16)
59
+
60
+ ### Bug Fixes
61
+
62
+ - The inferred type of 'default' cannot be named without a reference to '@doreamonjs/application/node_modules/@types/react' ([4b54b09](https://github.com/doreamonjs/doreamon/commit/4b54b09cd8035fcb3185e0c8c378459b511f48ac))
63
+
64
+ ## [1.1.17](https://github.com/doreamonjs/doreamon/compare/v1.1.16...v1.1.17) (2022-09-13)
65
+
66
+ ### Bug Fixes
67
+
68
+ - **page-login:** style in css module ([ab86400](https://github.com/doreamonjs/doreamon/commit/ab86400318360ad8e78f5595f05a5a1cebfa3335))
69
+
70
+ ## [1.1.16](https://github.com/doreamonjs/doreamon/compare/v1.1.15...v1.1.16) (2022-09-12)
71
+
72
+ **Note:** Version bump only for package @doreamonjs/page-login
73
+
74
+ # Change Log
75
+
76
+ All notable changes to this project will be documented in this file. See
77
+ [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Eason
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/lib/index.d.ts CHANGED
@@ -1,16 +1,62 @@
1
- import { FunctionComponent } from 'react';
2
- import { PageProps } from '@doreamonjs/page-creator';
3
- import { TabItem } from '@doreamonjs/components';
1
+ import { FunctionComponent, CSSProperties } from 'react';
4
2
  import { InformationItem } from '@doreamonjs/components/lib/Card/Information';
5
3
  import './index.less';
6
- export interface DetailPageProps extends PageProps {
7
- column?: string;
8
- infos: DInformationItem[][];
9
- tabs?: DTabItem[];
4
+ export interface DetailPageProps {
5
+ style?: CSSProperties;
6
+ headerStyle?: CSSProperties;
7
+ bodyStyle?: CSSProperties;
8
+ className?: string;
9
+ attributes: Attributes;
10
+ datasets: Datasets;
11
+ onActionTrigger(action: {
12
+ key: string;
13
+ namespace?: string;
14
+ }, data?: {
15
+ values: object;
16
+ value?: any;
17
+ index?: number;
18
+ origin?: any;
19
+ initialValue?: any;
20
+ }): void;
21
+ onReset: () => void;
22
+ onRefresh: () => void;
23
+ }
24
+ interface Attributes {
25
+ actions: any[];
26
+ detail: {
27
+ basis: DetailBasis;
28
+ modules: DetailModules;
29
+ };
30
+ }
31
+ interface Datasets {
32
+ table?: any[];
33
+ values?: any;
34
+ }
35
+ export interface DetailBasis {
36
+ items: InfoItem[][];
37
+ column?: number;
38
+ }
39
+ export interface InfoItem {
40
+ key: string;
41
+ label: string;
42
+ value?: string | JSX.Element | ((value: any, context: any) => string | JSX.Element);
43
+ span?: number;
44
+ rollout?: string;
45
+ }
46
+ export interface DetailModules {
47
+ tabs: TabItem[];
48
+ defaultTab?: string;
49
+ }
50
+ export interface TabItem {
51
+ key: string;
52
+ title: string;
53
+ icon?: string;
54
+ disabled?: boolean;
55
+ render(values: any, index: number, context: any): JSX.Element;
56
+ rollout?: string;
10
57
  }
11
58
  export interface DInformationItem extends InformationItem {
12
59
  rollout?: string;
13
- type?: 'text' | 'datetime' | 'link' | '';
14
60
  }
15
61
  export interface DTabItem extends Omit<TabItem, 'render'> {
16
62
  render(values: any, index: number, context: any): JSX.Element;
package/lib/index.js CHANGED
@@ -1,72 +1,22 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.DetailPage = void 0;
4
- const tslib_1 = require("tslib");
5
- const react_1 = tslib_1.__importDefault(require("react"));
6
- const doreamon_1 = tslib_1.__importDefault(require("@zodash/doreamon"));
7
+ const react_1 = __importDefault(require("react"));
8
+ const doreamon_1 = __importDefault(require("@zodash/doreamon"));
7
9
  const components_1 = require("@doreamonjs/components");
8
10
  const antd_1 = require("antd");
9
11
  require("./index.less");
10
12
  const componentName = 'doreamonjs-design-page-detail';
11
13
  const DetailPage = (props) => {
12
- var _a, _b, _c, _d, _e;
14
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
13
15
  const values = (_b = (_a = props === null || props === void 0 ? void 0 : props.datasets) === null || _a === void 0 ? void 0 : _a.values) !== null && _b !== void 0 ? _b : {};
14
16
  const title = (_d = (_c = values === null || values === void 0 ? void 0 : values.title) !== null && _c !== void 0 ? _c : values === null || values === void 0 ? void 0 : values.name) !== null && _d !== void 0 ? _d : '-';
15
- const details = [
16
- [
17
- { key: 'id', label: '环境 ID' },
18
- { key: 'version', label: 'Version' },
19
- ],
20
- [{ key: 'owner.nickname', label: '负责人' }],
21
- [
22
- { key: 'publish_url', label: '发布地址' },
23
- {
24
- key: 'visit_url',
25
- label: '访问地址',
26
- value: v => (react_1.default.createElement("a", { href: v, target: "_blank" }, v)),
27
- },
28
- ],
29
- [
30
- {
31
- key: 'is_cloud_native',
32
- label: '云原生',
33
- value: (_, vs) => (!vs.is_host ? '是' : '否'),
34
- },
35
- ],
36
- !values.is_host && [
37
- {
38
- key: 'instance_name',
39
- label: '云原生实例',
40
- value: v => (react_1.default.createElement("a", { href: `https://k8s.idp.thinkingdata.cn/#/service/te/${v}?namespace=te`, target: "_blank" }, v)),
41
- },
42
- ],
43
- !values.is_host && [
44
- { key: 'image_name', label: '镜像名称' },
45
- { key: 'image_tag', label: '镜像标签' },
46
- ],
47
- !values.is_host && [{ key: 'snap_name', label: '快照' }],
48
- [
49
- {
50
- key: 'description',
51
- label: '描述',
52
- value: v => react_1.default.createElement("pre", null, v !== null && v !== void 0 ? v : '-'),
53
- },
54
- ],
55
- [
56
- {
57
- key: 'created_at',
58
- label: '创建时间',
59
- value: v => doreamon_1.default.date(v).format('YYYY-MM-DD HH:mm:ss'),
60
- },
61
- {
62
- key: 'updated_at',
63
- label: '更新时间',
64
- value: v => doreamon_1.default.date(v).format('YYYY-MM-DD HH:mm:ss'),
65
- },
66
- ],
67
- ];
68
- const defaultTab = 'tasks';
69
- const tabs = props.tabs.map((tab, index) => {
17
+ const details = (_e = props.attributes.detail.basis) === null || _e === void 0 ? void 0 : _e.items;
18
+ const defaultTab = (_f = props.attributes.detail.modules) === null || _f === void 0 ? void 0 : _f.defaultTab;
19
+ const tabs = (_h = (_g = props.attributes.detail.modules) === null || _g === void 0 ? void 0 : _g.tabs) === null || _h === void 0 ? void 0 : _h.map((tab, index) => {
70
20
  return {
71
21
  ...tab,
72
22
  render: !tab.render ? undefined : () => {
@@ -74,7 +24,8 @@ const DetailPage = (props) => {
74
24
  },
75
25
  };
76
26
  });
77
- if (+((_e = doreamon_1.default.dom.router.getQuery()) === null || _e === void 0 ? void 0 : _e.id) !== (values === null || values === void 0 ? void 0 : values.id)) {
27
+ console.log('tabs:', tabs, props.attributes.detail);
28
+ if (+((_j = doreamon_1.default.dom.router.getQuery()) === null || _j === void 0 ? void 0 : _j.id) !== (values === null || values === void 0 ? void 0 : values.id)) {
78
29
  return (react_1.default.createElement("div", { style: {
79
30
  width: '100%',
80
31
  height: '500px',
@@ -93,4 +44,3 @@ const DetailPage = (props) => {
93
44
  };
94
45
  exports.DetailPage = DetailPage;
95
46
  exports.default = exports.DetailPage;
96
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doreamonjs/page-detail",
3
- "version": "0.0.0",
3
+ "version": "1.10.26",
4
4
  "description": "detail page",
5
5
  "keywords": [
6
6
  "doreamonjs",
@@ -71,8 +71,7 @@
71
71
  "@znode/fs": "^1.0.2"
72
72
  },
73
73
  "dependencies": {
74
- "@doreamonjs/components": "^1.10.21",
75
- "@doreamonjs/page-creator": "^1.10.21",
74
+ "@doreamonjs/components": "^1.10.26",
76
75
  "@zodash/doreamon": "^1.1.5",
77
76
  "antd": "4.18.9",
78
77
  "react-monaco-editor": "^0.50.1",
@@ -80,5 +79,6 @@
80
79
  "xterm": "^4.19.0",
81
80
  "xterm-addon-attach": "^0.6.0",
82
81
  "xterm-addon-fit": "^0.5.0"
83
- }
82
+ },
83
+ "gitHead": "fcc1816234645cd4025d6f0eec98383e3f57537a"
84
84
  }
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;;AAAA,0DAA4D;AAC5D,wEAAwC;AAGxC,uDAA4D;AAE5D,+BAAgC;AAEhC,wBAAsB;AAGtB,MAAM,aAAa,GAAG,+BAA+B,CAAC;AAoB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