@cloudcare/guance-front-tools 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.
Files changed (216) hide show
  1. package/.prettierignore +3 -0
  2. package/.prettierrc +6 -0
  3. package/LICENSE +21 -0
  4. package/README.md +31 -0
  5. package/cli.js +16 -0
  6. package/lib/cjs/generated/browserSessionReplay.d.ts +703 -0
  7. package/lib/cjs/generated/browserSessionReplay.js +6 -0
  8. package/lib/cjs/generated/dashboardCharts.d.ts +1372 -0
  9. package/lib/cjs/generated/dashboardCharts.js +6 -0
  10. package/lib/cjs/generated/mobileSessionReplay.d.ts +653 -0
  11. package/lib/cjs/generated/mobileSessionReplay.js +6 -0
  12. package/lib/cjs/generated/sessionReplay.d.ts +1190 -0
  13. package/lib/cjs/generated/sessionReplay.js +6 -0
  14. package/lib/cjs/src/dashboard-charts.d.ts +1 -0
  15. package/lib/cjs/src/dashboard-charts.js +17 -0
  16. package/lib/cjs/src/index.d.ts +2 -0
  17. package/lib/cjs/src/index.js +18 -0
  18. package/lib/cjs/src/session-replay-browser.d.ts +58 -0
  19. package/lib/cjs/src/session-replay-browser.js +69 -0
  20. package/lib/cjs/src/session-replay-mobile.d.ts +30 -0
  21. package/lib/cjs/src/session-replay-mobile.js +42 -0
  22. package/lib/cjs/src/session-replay.d.ts +30 -0
  23. package/lib/cjs/src/session-replay.js +49 -0
  24. package/lib/esm/generated/browserSessionReplay.d.ts +703 -0
  25. package/lib/esm/generated/browserSessionReplay.js +5 -0
  26. package/lib/esm/generated/dashboardCharts.d.ts +1372 -0
  27. package/lib/esm/generated/dashboardCharts.js +5 -0
  28. package/lib/esm/generated/mobileSessionReplay.d.ts +653 -0
  29. package/lib/esm/generated/mobileSessionReplay.js +5 -0
  30. package/lib/esm/generated/sessionReplay.d.ts +1190 -0
  31. package/lib/esm/generated/sessionReplay.js +5 -0
  32. package/lib/esm/src/dashboard-charts.d.ts +1 -0
  33. package/lib/esm/src/dashboard-charts.js +1 -0
  34. package/lib/esm/src/index.d.ts +2 -0
  35. package/lib/esm/src/index.js +2 -0
  36. package/lib/esm/src/session-replay-browser.d.ts +58 -0
  37. package/lib/esm/src/session-replay-browser.js +52 -0
  38. package/lib/esm/src/session-replay-mobile.d.ts +30 -0
  39. package/lib/esm/src/session-replay-mobile.js +25 -0
  40. package/lib/esm/src/session-replay.d.ts +30 -0
  41. package/lib/esm/src/session-replay.js +24 -0
  42. package/lib/example/grafana-dashboard.json +2205 -0
  43. package/lib/example/guance-covert-test.json +629 -0
  44. package/lib/example/guance-dashboard-1.json +672 -0
  45. package/lib/example/guance-dashboard.json +2841 -0
  46. package/lib/scripts/grafana-covert-to-guance.d.ts +1 -0
  47. package/lib/scripts/grafana-covert-to-guance.js +367 -0
  48. package/lib/scripts/grafana-covert-to-guance.ts +374 -0
  49. package/lib/scripts/grafana-dashbord.d.ts +2220 -0
  50. package/lib/scripts/grafana-dashbord.js +1 -0
  51. package/lib/scripts/grafana-dashbord.ts +2427 -0
  52. package/lib/src/dashboard-charts.ts +1 -0
  53. package/lib/src/index.ts +2 -0
  54. package/lib/src/session-replay-browser.ts +98 -0
  55. package/lib/src/session-replay-mobile.ts +54 -0
  56. package/lib/src/session-replay.ts +61 -0
  57. package/package.json +45 -0
  58. package/samples/dashboard/dashboard.json +2842 -0
  59. package/samples/dashboard/promql-dashboard.json +2175 -0
  60. package/samples/session-replay/mobile/record/full-snapshot-record.json +51 -0
  61. package/samples/session-replay/mobile/record/has-focus-record.json +7 -0
  62. package/samples/session-replay/mobile/record/incremental-snapshot-record.json +74 -0
  63. package/samples/session-replay/mobile/record/metadata-record.json +8 -0
  64. package/samples/session-replay/mobile/record/view-end-record.json +4 -0
  65. package/samples/session-replay/mobile/segment/segment.json +110 -0
  66. package/schemas/charts/chart-schema.json +73 -0
  67. package/schemas/charts/common/common-chart-types-schema.json +37 -0
  68. package/schemas/charts/common/common-vars-item-schema.json +117 -0
  69. package/schemas/charts/common/common-vars-schema.json +10 -0
  70. package/schemas/charts/dashboard-schema.json +73 -0
  71. package/schemas/charts/query/queries-schema.json +10 -0
  72. package/schemas/charts/query/query-item-schema.json +42 -0
  73. package/schemas/charts/settings/_common-settings-connect-null-schema.json +7 -0
  74. package/schemas/charts/settings/_common-settings-gradual-color-schema.json +72 -0
  75. package/schemas/charts/settings/_common-settings-groupby-schema.json +22 -0
  76. package/schemas/charts/settings/_common-settings-legend-position-schema.json +14 -0
  77. package/schemas/charts/settings/_common-settings-legend-values-schema.json +19 -0
  78. package/schemas/charts/settings/_common-settings-open-stack-schema.json +8 -0
  79. package/schemas/charts/settings/_common-settings-show-label-schema.json +8 -0
  80. package/schemas/charts/settings/_common-settings-show-line-schema.json +8 -0
  81. package/schemas/charts/settings/_common-settings-stack-content-schema.json +12 -0
  82. package/schemas/charts/settings/_common-settings-stack-type-schema.json +11 -0
  83. package/schemas/charts/settings/chart-alarm-settings-schema.json +48 -0
  84. package/schemas/charts/settings/chart-bar-settings-schema.json +69 -0
  85. package/schemas/charts/settings/chart-chinamap-settings-schema.json +102 -0
  86. package/schemas/charts/settings/chart-funnel-settings-schema.json +34 -0
  87. package/schemas/charts/settings/chart-gauge-settings-schema.json +65 -0
  88. package/schemas/charts/settings/chart-heatmap-settings-schema.json +50 -0
  89. package/schemas/charts/settings/chart-hexgon-settings-schema.json +90 -0
  90. package/schemas/charts/settings/chart-histogram-settings-schema.json +47 -0
  91. package/schemas/charts/settings/chart-iframe-settings-schema.json +24 -0
  92. package/schemas/charts/settings/chart-log-settings-schema.json +84 -0
  93. package/schemas/charts/settings/chart-object-settings-schema.json +52 -0
  94. package/schemas/charts/settings/chart-picture-settings-schema.json +46 -0
  95. package/schemas/charts/settings/chart-pie-settings-schema.json +90 -0
  96. package/schemas/charts/settings/chart-sankey-settings-schema.json +34 -0
  97. package/schemas/charts/settings/chart-scatter-bubble-settings-schema.json +31 -0
  98. package/schemas/charts/settings/chart-sequence-settings-schema.json +76 -0
  99. package/schemas/charts/settings/chart-singlestat-settings-schema.json +163 -0
  100. package/schemas/charts/settings/chart-table-settings-schema.json +184 -0
  101. package/schemas/charts/settings/chart-text-settings-schema.json +20 -0
  102. package/schemas/charts/settings/chart-toplist-settings-schema.json +117 -0
  103. package/schemas/charts/settings/chart-topology-settings-schema.json +71 -0
  104. package/schemas/charts/settings/chart-treemap-settings-schema.json +66 -0
  105. package/schemas/charts/settings/chart-worldmap-settings-schema.json +102 -0
  106. package/schemas/charts/settings/common-settings-schema.json +82 -0
  107. package/schemas/charts/settings/settings-alias-schema.json +47 -0
  108. package/schemas/charts/settings/settings-chart-type-schema.json +27 -0
  109. package/schemas/charts/settings/settings-colors-schema.json +46 -0
  110. package/schemas/charts/settings/settings-compare-schema.json +58 -0
  111. package/schemas/charts/settings/settings-fixed-time-schema.json +49 -0
  112. package/schemas/charts/settings/settings-levels-schema.json +33 -0
  113. package/schemas/charts/settings/settings-schema.json +79 -0
  114. package/schemas/charts/settings/settings-time-schema.json +47 -0
  115. package/schemas/charts/settings/settings-unit-items-schema.json +226 -0
  116. package/schemas/charts/settings/settings-units-schema.json +60 -0
  117. package/schemas/dashboard-schema.json +5 -0
  118. package/schemas/session-replay/browser/attribute-mutation-schema.json +21 -0
  119. package/schemas/session-replay/browser/attributes-schema.json +10 -0
  120. package/schemas/session-replay/browser/cdata-node-schema.json +19 -0
  121. package/schemas/session-replay/browser/creation-reason-schema.json +17 -0
  122. package/schemas/session-replay/browser/document-fragment-node-schema.json +35 -0
  123. package/schemas/session-replay/browser/document-node-schema.json +30 -0
  124. package/schemas/session-replay/browser/document-type-node-schema.json +28 -0
  125. package/schemas/session-replay/browser/element-node-schema.json +33 -0
  126. package/schemas/session-replay/browser/frustration-record-schema.json +49 -0
  127. package/schemas/session-replay/browser/full-snapshot-record-schema.json +26 -0
  128. package/schemas/session-replay/browser/incremental-data-schema.json +36 -0
  129. package/schemas/session-replay/browser/incremental-snapshot-record-schema.json +29 -0
  130. package/schemas/session-replay/browser/input-data-schema.json +27 -0
  131. package/schemas/session-replay/browser/input-state-schema.json +27 -0
  132. package/schemas/session-replay/browser/media-interaction-data-schema.json +23 -0
  133. package/schemas/session-replay/browser/media-interaction-schema.json +20 -0
  134. package/schemas/session-replay/browser/mouse-interaction-data-schema.json +23 -0
  135. package/schemas/session-replay/browser/mouse-interaction-schema.json +47 -0
  136. package/schemas/session-replay/browser/mouse-move-data-schema.json +23 -0
  137. package/schemas/session-replay/browser/mouse-position-schema.json +26 -0
  138. package/schemas/session-replay/browser/mutation-data-schema.json +23 -0
  139. package/schemas/session-replay/browser/mutation-payload-schema.json +42 -0
  140. package/schemas/session-replay/browser/node-added-mutation-schema.json +41 -0
  141. package/schemas/session-replay/browser/node-removed-mutation-schema.json +18 -0
  142. package/schemas/session-replay/browser/node-schema.json +28 -0
  143. package/schemas/session-replay/browser/record-schema.json +30 -0
  144. package/schemas/session-replay/browser/scroll-data-schema.json +23 -0
  145. package/schemas/session-replay/browser/scroll-position-schema.json +22 -0
  146. package/schemas/session-replay/browser/segment-metadata-schema.json +28 -0
  147. package/schemas/session-replay/browser/segment-schema.json +25 -0
  148. package/schemas/session-replay/browser/serialized-node-schema.json +15 -0
  149. package/schemas/session-replay/browser/serialized-node-with-id-schema.json +21 -0
  150. package/schemas/session-replay/browser/stylesheet-rule-add-schema.json +28 -0
  151. package/schemas/session-replay/browser/stylesheet-rule-data-schema.json +23 -0
  152. package/schemas/session-replay/browser/stylesheet-rule-delete-schema.json +24 -0
  153. package/schemas/session-replay/browser/stylesheet-rule-schema.json +29 -0
  154. package/schemas/session-replay/browser/stylesheet-schema.json +30 -0
  155. package/schemas/session-replay/browser/text-mutation-schema.json +27 -0
  156. package/schemas/session-replay/browser/text-node-schema.json +23 -0
  157. package/schemas/session-replay/common/_common-record-schema.json +14 -0
  158. package/schemas/session-replay/common/_common-segment-metadata-schema.json +30 -0
  159. package/schemas/session-replay/common/_slot-supported-common-record-schema.json +21 -0
  160. package/schemas/session-replay/common/focus-record-schema.json +34 -0
  161. package/schemas/session-replay/common/meta-record-schema.json +42 -0
  162. package/schemas/session-replay/common/pointer-interaction-data-schema.json +23 -0
  163. package/schemas/session-replay/common/pointer-interaction-schema.json +34 -0
  164. package/schemas/session-replay/common/segment-context-schema.json +46 -0
  165. package/schemas/session-replay/common/view-end-record-schema.json +23 -0
  166. package/schemas/session-replay/common/viewport-resize-data-schema.json +23 -0
  167. package/schemas/session-replay/common/viewport-resize-dimension-schema.json +18 -0
  168. package/schemas/session-replay/common/visual-viewport-record-schema.json +50 -0
  169. package/schemas/session-replay/full-snapshot-record-schema.json +14 -0
  170. package/schemas/session-replay/incremental-data-schema.json +14 -0
  171. package/schemas/session-replay/incremental-snapshot-record-schema.json +14 -0
  172. package/schemas/session-replay/mobile/_common-shape-wireframe-schema.json +22 -0
  173. package/schemas/session-replay/mobile/_common-shape-wireframe-update-schema.json +22 -0
  174. package/schemas/session-replay/mobile/_common-wireframe-schema.json +38 -0
  175. package/schemas/session-replay/mobile/_common-wireframe-update-schema.json +38 -0
  176. package/schemas/session-replay/mobile/full-snapshot-record-schema.json +38 -0
  177. package/schemas/session-replay/mobile/image-wireframe-schema.json +43 -0
  178. package/schemas/session-replay/mobile/image-wireframe-update-schema.json +43 -0
  179. package/schemas/session-replay/mobile/incremental-data-schema.json +21 -0
  180. package/schemas/session-replay/mobile/incremental-snapshot-record-schema.json +26 -0
  181. package/schemas/session-replay/mobile/mutation-data-schema.json +23 -0
  182. package/schemas/session-replay/mobile/mutation-payload-schema.json +55 -0
  183. package/schemas/session-replay/mobile/placeholder-wireframe-schema.json +28 -0
  184. package/schemas/session-replay/mobile/placeholder-wireframe-update-schema.json +28 -0
  185. package/schemas/session-replay/mobile/record-schema.json +27 -0
  186. package/schemas/session-replay/mobile/segment-metadata-schema.json +25 -0
  187. package/schemas/session-replay/mobile/segment-schema.json +25 -0
  188. package/schemas/session-replay/mobile/shape-border-schema.json +25 -0
  189. package/schemas/session-replay/mobile/shape-style-schema.json +29 -0
  190. package/schemas/session-replay/mobile/shape-wireframe-schema.json +23 -0
  191. package/schemas/session-replay/mobile/shape-wireframe-update-schema.json +23 -0
  192. package/schemas/session-replay/mobile/text-position-schema.json +57 -0
  193. package/schemas/session-replay/mobile/text-style-schema.json +31 -0
  194. package/schemas/session-replay/mobile/text-wireframe-schema.json +34 -0
  195. package/schemas/session-replay/mobile/text-wireframe-update-schema.json +34 -0
  196. package/schemas/session-replay/mobile/touch-data-schema.json +51 -0
  197. package/schemas/session-replay/mobile/webview-wireframe-schema.json +33 -0
  198. package/schemas/session-replay/mobile/webview-wireframe-update-schema.json +33 -0
  199. package/schemas/session-replay/mobile/wireframe-clip-schema.json +29 -0
  200. package/schemas/session-replay/mobile/wireframe-schema.json +24 -0
  201. package/schemas/session-replay/mobile/wireframe-update-mutation-schema.json +24 -0
  202. package/schemas/session-replay/mutation-data-schema.json +14 -0
  203. package/schemas/session-replay/mutation-payload-schema.json +14 -0
  204. package/schemas/session-replay/record-schema.json +14 -0
  205. package/schemas/session-replay/segment-metadata-schema.json +14 -0
  206. package/schemas/session-replay/segment-schema.json +15 -0
  207. package/schemas/session-replay-browser-schema.json +5 -0
  208. package/schemas/session-replay-mobile-schema.json +5 -0
  209. package/schemas/session-replay-schema.json +33 -0
  210. package/scripts/generate.mjs +96 -0
  211. package/scripts/utils.mjs +16 -0
  212. package/scripts/validate.mjs +144 -0
  213. package/tsconfig.cjs.json +7 -0
  214. package/tsconfig.esm.json +7 -0
  215. package/tsconfig.json +13 -0
  216. package/tsconfig.script.json +15 -0
@@ -0,0 +1,51 @@
1
+ {
2
+ "timestamp": 1657618587157,
3
+ "type": 10,
4
+ "data": {
5
+ "wireframes": [
6
+ {
7
+ "id": 1,
8
+ "x": 10,
9
+ "y": 10,
10
+ "width": 20,
11
+ "height": 30,
12
+ "type": "text",
13
+ "text": "Test",
14
+ "textStyle": {
15
+ "family": "Arial",
16
+ "size": 20,
17
+ "type": "sans-serif",
18
+ "color": "#FF000000"
19
+ }
20
+ },
21
+ {
22
+ "id": 2,
23
+ "x": 10,
24
+ "y": 10,
25
+ "width": 20,
26
+ "height": 30,
27
+ "type": "image",
28
+ "base64": "base64Mock",
29
+ "resourceId": "resourceIdMock",
30
+ "mimeType": "image/jpeg"
31
+ },
32
+ {
33
+ "id": 3,
34
+ "x": 10,
35
+ "y": 10,
36
+ "width": 20,
37
+ "height": 30,
38
+ "type": "image"
39
+ },
40
+ {
41
+ "id": 4,
42
+ "x": 10,
43
+ "y": 10,
44
+ "width": 20,
45
+ "height": 30,
46
+ "type": "image",
47
+ "isEmpty": true
48
+ }
49
+ ]
50
+ }
51
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "timestamp": 1657629228278,
3
+ "type": 6,
4
+ "data": {
5
+ "has_focus": true
6
+ }
7
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "timestamp": 1657620232337,
3
+ "type": 11,
4
+ "data": {
5
+ "source": 0,
6
+ "adds": [
7
+ {
8
+ "previousId": 10,
9
+ "wireframe": {
10
+ "id": 11,
11
+ "x": 10,
12
+ "y": 10,
13
+ "width": 20,
14
+ "height": 30,
15
+ "type": "text",
16
+ "text": "Test",
17
+ "textStyle": {
18
+ "family": "Arial",
19
+ "size": 20,
20
+ "type": "sans-serif",
21
+ "color": "#FF000000"
22
+ }
23
+ }
24
+ },
25
+ {
26
+ "previousId": 11,
27
+ "wireframe": {
28
+ "id": 14,
29
+ "x": 10,
30
+ "y": 10,
31
+ "width": 20,
32
+ "height": 30,
33
+ "type": "image"
34
+ }
35
+ }
36
+ ],
37
+ "removes": [
38
+ {
39
+ "id": 9
40
+ }
41
+ ],
42
+ "updates": [
43
+ {
44
+ "id": 3,
45
+ "text": "New text",
46
+ "type": "text",
47
+ "textStyle": {
48
+ "family": "Arial",
49
+ "size": 20,
50
+ "type": "sans-serif",
51
+ "color": "#FF0000"
52
+ }
53
+ },
54
+ {
55
+ "id": 4,
56
+ "type": "shape",
57
+ "x": 0,
58
+ "y": 10
59
+ },
60
+ {
61
+ "id": 12,
62
+ "type": "image",
63
+ "base64": "base64Mock",
64
+ "resourceId": "resourceIdMock",
65
+ "mimeType": "image/jpeg"
66
+ },
67
+ {
68
+ "id": 12,
69
+ "type": "image",
70
+ "isEmpty": true
71
+ }
72
+ ]
73
+ }
74
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "timestamp": 1657629228274,
3
+ "type": 4,
4
+ "data": {
5
+ "width": 600,
6
+ "height": 800
7
+ }
8
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "timestamp": 1657629228280,
3
+ "type": 7
4
+ }
@@ -0,0 +1,110 @@
1
+ {
2
+ "application": {
3
+ "id": "c8b3b434-0a55-413f-a391-8e3b7e7131a8"
4
+ },
5
+ "session": {
6
+ "id": "c09e525c-5971-49c4-8b51-531ba99765cf"
7
+ },
8
+ "view": {
9
+ "id": "b27c7927-bf1e-4168-8d56-d5f191741ba4"
10
+ },
11
+ "source": "android",
12
+ "start": 1657629228285,
13
+ "end": 1657629238285,
14
+ "has_full_snapshot_record": true,
15
+ "records_count": 2,
16
+ "creation_reason": "init",
17
+ "index_in_view": 1,
18
+ "records": [
19
+ {
20
+ "timestamp": 1657629228218,
21
+ "type": 10,
22
+ "data": {
23
+ "wireframes": [
24
+ {
25
+ "id": 1,
26
+ "x": 10,
27
+ "y": 10,
28
+ "width": 20,
29
+ "height": 30,
30
+ "type": "shape"
31
+ },
32
+ {
33
+ "id": 2,
34
+ "x": 10,
35
+ "y": 10,
36
+ "width": 20,
37
+ "height": 30,
38
+ "type": "text",
39
+ "text": "Test",
40
+ "textStyle": {
41
+ "family": "Arial",
42
+ "size": 20,
43
+ "type": "sans-serif",
44
+ "color": "#FF000000"
45
+ }
46
+ },
47
+ {
48
+ "id": 3,
49
+ "x": 40,
50
+ "y": 50,
51
+ "width": 20,
52
+ "height": 30,
53
+ "type": "shape"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "timestamp": 1657629228273,
60
+ "type": 11,
61
+ "data": {
62
+ "source": 0,
63
+ "adds": [
64
+ {
65
+ "previousId": 2,
66
+ "wireframe": {
67
+ "id": 12,
68
+ "x": 10,
69
+ "y": 10,
70
+ "width": 20,
71
+ "height": 30,
72
+ "type": "text",
73
+ "text": "Test",
74
+ "textStyle": {
75
+ "family": "Arial",
76
+ "size": 20,
77
+ "type": "sans-serif",
78
+ "color": "#FF000000"
79
+ }
80
+ }
81
+ }
82
+ ],
83
+ "removes": [
84
+ {
85
+ "id": 3
86
+ }
87
+ ],
88
+ "updates": [
89
+ {
90
+ "id": 2,
91
+ "text": "New text",
92
+ "type": "text",
93
+ "textStyle": {
94
+ "family": "Arial",
95
+ "size": 20,
96
+ "type": "sans-serif",
97
+ "color": "#FF0000"
98
+ }
99
+ },
100
+ {
101
+ "id": 1,
102
+ "type": "shape",
103
+ "x": 0,
104
+ "y": 10
105
+ }
106
+ ]
107
+ }
108
+ }
109
+ ]
110
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/chart-schema.json",
4
+ "type": "object",
5
+ "description": "图表完整结构",
6
+ "title": "ChartData",
7
+ "required": [
8
+ "extend",
9
+ "name",
10
+ "pos",
11
+ "type",
12
+ "queries"
13
+ ],
14
+ "properties": {
15
+ "extend": {
16
+ "type": "object",
17
+ "additionalProperties": true,
18
+ "properties": {
19
+ "settings": {
20
+ "$ref": "settings/settings-schema.json"
21
+ }
22
+ }
23
+ },
24
+ "group": {
25
+ "type": "object",
26
+ "properties": {
27
+ "name": {
28
+ "type": "string",
29
+ "description": "分组名称"
30
+ }
31
+ }
32
+ },
33
+ "name": {
34
+ "type": "string",
35
+ "description": "图表名称"
36
+ },
37
+ "pos": {
38
+ "description": "图表位置信息",
39
+ "type": "object",
40
+ "required": [
41
+ "h",
42
+ "w",
43
+ "x",
44
+ "y"
45
+ ],
46
+ "properties": {
47
+ "h": {
48
+ "description": "图表高度,每行的高度默认为10像素,比如 h 为12, 则实际高度为 12 * 10",
49
+ "type": "integer"
50
+ },
51
+ "w": {
52
+ "type": "integer",
53
+ "description": "图表宽度,栅格系统的最大列数为 24, 比如 w为12,则显示宽度则为容器宽度的 1/2 倍 "
54
+ },
55
+ "x": {
56
+ "type": "integer",
57
+ "description": "图表距离容器的水平距离,栅格系统的最大列数为 24, 比如 x为12,则图表距离容器左边的水平距离为容器宽度 1/2 倍 "
58
+ },
59
+ "y": {
60
+ "type": "integer",
61
+ "description": "图表距离容器垂直距离,每行的高度默认为10像素,比如 y为12, 则实际高度为 12 * 10"
62
+ }
63
+ }
64
+ },
65
+ "type": {
66
+ "description": "图表类型",
67
+ "$ref": "common/common-chart-types-schema.json"
68
+ },
69
+ "queries": {
70
+ "$ref": "query/queries-schema.json"
71
+ }
72
+ }
73
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/common/common-chart-types-schema.json",
4
+ "type": "string",
5
+ "title": "ChartType",
6
+ "description": "支持图表类型枚举",
7
+ "enum": [
8
+ "group",
9
+ "sequence",
10
+ "singlestat",
11
+ "pie",
12
+ "bar",
13
+ "histogram",
14
+ "slo",
15
+ "toplist",
16
+ "gauge",
17
+ "scatter",
18
+ "bubble",
19
+ "table",
20
+ "treemap",
21
+ "funnel",
22
+ "chinamap",
23
+ "worldmap",
24
+ "hexgon",
25
+ "heatmap",
26
+ "topology",
27
+ "sankey",
28
+ "log",
29
+ "object",
30
+ "alarm",
31
+ "text",
32
+ "video",
33
+ "picture",
34
+ "command",
35
+ "iframe"
36
+ ]
37
+ }
@@ -0,0 +1,117 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/common/common-vars-item-schema.json",
4
+ "title": "chartVarsItem",
5
+ "description": "图表视图变量完整结构",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "properties": {
9
+ "definition": {
10
+ "type": "object",
11
+ "properties": {
12
+ "tag": {
13
+ "type": "string",
14
+ "description": "定义 type 为 metrc 类型对应的指标 tag"
15
+ },
16
+ "field": {
17
+ "type": "string",
18
+ "description": "定义 type 为 metrc,object,custom_object, logging, tracing,rum,securit 类型对应的 field"
19
+ },
20
+ "value": {
21
+ "type": "string",
22
+ "description": "定义 type 为 dql,promql,custom_object类型对应的 dql、promql,或者以‘,’号分割的自定义字符串数据"
23
+ },
24
+ "metric": {
25
+ "type": "string",
26
+ "description": "1.type 为 metric 对应指标集 2. type 为 logging,rum 对应 source。"
27
+ },
28
+ "object": {
29
+ "type": "string",
30
+ "description": "type 为 object, custom_object 对应对象 source"
31
+ },
32
+ "defaultVal": {
33
+ "description": "视图变量默认填充值",
34
+ "type": "object",
35
+ "properties": {
36
+ "label": {
37
+ "type": "string",
38
+ "description": "默认填充值 label,如果没有则和 value 保持一致"
39
+ },
40
+ "value": {
41
+ "type": "string",
42
+ "description": "默认填充值 value"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ },
48
+ "type": {
49
+ "description": "视图变量查询类型,对应关系分别为 QUERY:【DQL】,PROMQL_QUERY:【PROMQL】,TAG:【指标】,FIELD:【基础对象】,FIELD:【自定义对象】,LOGGING:【日志】,TRACING:【应用性能】,RUM:【用户访问】,SECURITY:【安全巡检】,CUSTOM_LIST:【自定义】",
50
+ "type": "string",
51
+ "enum": [
52
+ "QUERY",
53
+ "PROMQL_QUERY",
54
+ "FIELD",
55
+ "TAG",
56
+ "LOGGING",
57
+ "TRACING",
58
+ "RUM",
59
+ "SECURITY",
60
+ "CUSTOM_LIST"
61
+ ]
62
+ },
63
+ "code": {
64
+ "type": "string",
65
+ "description": "需要被替换的变量名"
66
+ },
67
+ "datasource": {
68
+ "type": "string",
69
+ "enum": [
70
+ "dataflux",
71
+ "ftinfluxdb",
72
+ "custom",
73
+ "object",
74
+ "custom_object"
75
+ ],
76
+ "description": "对应关系分别为 dataflux:【DQL】,dataflux:【PROMQL】,ftinfluxdb:【指标】,object:【基础对象】,custom_object:【自定义对象】,dataflux:【日志】,dataflux:【应用性能】,dataflux:【用户访问】,dataflux:【安全巡检】,custom:【自定义】"
77
+ },
78
+ "name": {
79
+ "type": "string",
80
+ "description": "视图变量显示名称"
81
+ },
82
+ "seq": {
83
+ "type": "integer",
84
+ "description": "当前项视图变量在列表中的顺序",
85
+ "examples": [
86
+ 0,
87
+ 1,
88
+ 2
89
+ ]
90
+ },
91
+ "hide": {
92
+ "type": "integer",
93
+ "description": "是否隐藏该项视图变量",
94
+ "enum": [
95
+ 0,
96
+ 1
97
+ ]
98
+ },
99
+ "multiple": {
100
+ "type": "boolean",
101
+ "description": "设置视图变量是否能多选",
102
+ "default": true
103
+ },
104
+ "includeStar": {
105
+ "type": "boolean",
106
+ "description": "设置视图变量列出值是否包含 * "
107
+ },
108
+ "valueSort": {
109
+ "type": "string",
110
+ "description": "列出值排序",
111
+ "enum": [
112
+ "asc",
113
+ "desc"
114
+ ]
115
+ }
116
+ }
117
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/common/common-vars-schema.json",
4
+ "type": "array",
5
+ "title": "chartVarsSettings",
6
+ "description": "图表视图变量列表结构",
7
+ "items": {
8
+ "$ref": "common-vars-item-schema.json"
9
+ }
10
+ }
@@ -0,0 +1,73 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/dashboard-schema.json",
4
+ "type": "object",
5
+ "title": "DashboardData",
6
+ "description": "观测云仪表板完整结构",
7
+ "additionalProperties": true,
8
+ "properties": {
9
+ "title": {
10
+ "type": "string",
11
+ "description": "仪表板标题"
12
+ },
13
+ "main": {
14
+ "type": "object",
15
+ "description": "仪表板图表结构",
16
+ "properties": {
17
+ "vars": {
18
+ "$ref": "common/common-vars-schema.json"
19
+ },
20
+ "charts": {
21
+ "type": "array",
22
+ "description": "图表合集配置",
23
+ "items": {
24
+ "$ref": "chart-schema.json"
25
+ }
26
+ },
27
+ "groups": {
28
+ "type": "array",
29
+ "description": "分组配置",
30
+ "items": {
31
+ "type": "object",
32
+ "properties": {
33
+ "name": {
34
+ "type": "string",
35
+ "description": "图表分组名称"
36
+ },
37
+ "extend": {
38
+ "type": "object",
39
+ "description": "分组的额外配置,比如背景颜色",
40
+ "properties": {
41
+ "bgColor": {
42
+ "type": "string",
43
+ "description": "分组块的背景颜色"
44
+ }
45
+ }
46
+ }
47
+ }
48
+ }
49
+ },
50
+ "type": {
51
+ "type": "string",
52
+ "description": "固定字段",
53
+ "const": "template"
54
+ }
55
+ }
56
+ },
57
+ "dashboardExtend": {
58
+ "description": "仪表板额外配置信息",
59
+ "type": "object",
60
+ "additionalProperties": true,
61
+ "properties": {
62
+ "groupUnfoldStatus": {
63
+ "type": "object",
64
+ "description": "分组是否收起打开配置信息,图表名称为 key, value 为 boolean。 false 为关闭,true 为打开",
65
+ "additionalProperties": {
66
+ "type": "boolean",
67
+ "description": "图表名称"
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/query/queries-schema.json",
4
+ "type": "array",
5
+ "title": "ChartQueries",
6
+ "description": "图表查询语句列表结构",
7
+ "items": {
8
+ "$ref": "query-item-schema.json"
9
+ }
10
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/query/query-item-schema.json",
4
+ "type": "object",
5
+ "description": "图表查询语句结构",
6
+ "title": "ChartQueryItem",
7
+ "properties": {
8
+ "type": {
9
+ "description": "冗余字段,图表类型",
10
+ "$ref": "../common/common-chart-types-schema.json"
11
+ },
12
+ "datasource": {
13
+ "type": "string",
14
+ "description": "冗余字段,固定值",
15
+ "const": "dataflux"
16
+ },
17
+ "qtype": {
18
+ "type": "string",
19
+ "description": "查询语句类型,目前支持 dql 以及promql",
20
+ "enum": [
21
+ "dql",
22
+ "promql"
23
+ ]
24
+ },
25
+ "query": {
26
+ "type": "object",
27
+ "description": "查询语句的额外信息",
28
+ "additionalProperties": true,
29
+ "properties": {
30
+ "q": {
31
+ "type": "string",
32
+ "description": "图表查询语句,可以是 dql语句,也可以是 promql 语句"
33
+ },
34
+ "code": {
35
+ "type": "string",
36
+ "description": "查询语句的唯一标识,由单个大写英文字母构成"
37
+ }
38
+ }
39
+ }
40
+ },
41
+ "additionalProperties": true
42
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "charts/settings/_common-settings-connect-null-schema.json",
4
+ "title": "CommonChartConnectNullSettings",
5
+ "type": "boolean",
6
+ "default": true
7
+ }