cob-cli 2.25.0 → 2.26.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 (215) hide show
  1. package/bin/cob-cli.js +3 -1
  2. package/bin/handleAutoComplete.js +1 -4
  3. package/lib/commands/customize.js +213 -66
  4. package/package.json +3 -2
  5. package/.vscode/launch.json +0 -106
  6. package/customizations/backend.email.js +0 -10
  7. package/customizations/backend.js +0 -14
  8. package/customizations/backend.updateField.js +0 -11
  9. package/customizations/backend.vuepress.js +0 -35
  10. package/customizations/dashboard.dash.js +0 -14
  11. package/customizations/dashboard.js +0 -14
  12. package/customizations/dashboard.simple.js +0 -12
  13. package/customizations/dashboard.vue.empty.js +0 -12
  14. package/customizations/dashboard.vue.grid.js +0 -10
  15. package/customizations/dashboard.vue.js +0 -14
  16. package/customizations/dashboard.vue.menuAndGrid.js +0 -10
  17. package/customizations/frontend.common.js +0 -16
  18. package/customizations/frontend.easy.js +0 -16
  19. package/customizations/frontend.formatList.currency.js +0 -17
  20. package/customizations/frontend.formatList.js +0 -13
  21. package/customizations/frontend.js +0 -14
  22. package/customizations/importer.js +0 -10
  23. package/customizations/keywords.audit.js +0 -18
  24. package/customizations/keywords.calc.js +0 -18
  25. package/customizations/keywords.image.js +0 -16
  26. package/customizations/keywords.js +0 -17
  27. package/customizations/keywords.kibana.js +0 -16
  28. package/customizations/keywords.log.js +0 -18
  29. package/customizations/keywords.styleResults.js +0 -18
  30. package/templates/backend/vuepress/integrationm/actions/getVuePressDoc.groovy +0 -74
  31. package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarConfig.groovy +0 -42
  32. package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarRootElements.groovy +0 -17
  33. package/templates/backend/vuepress/others/vuepress/definition_contents_v234.json +0 -619
  34. package/templates/backend/vuepress/others/vuepress/nginx/README.md +0 -28
  35. package/templates/backend/vuepress/others/vuepress/package-lock.json +0 -29656
  36. package/templates/backend/vuepress/others/vuepress/package.json +0 -24
  37. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/DescriptVideo.vue +0 -22
  38. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/Graph.vue +0 -124
  39. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/ReadingTime.vue +0 -26
  40. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/References.vue +0 -228
  41. package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue +0 -77
  42. package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.js +0 -101
  43. package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.json +0 -31
  44. package/templates/backend/vuepress/others/vuepress/src/.vuepress/enhanceApp.js +0 -14
  45. package/templates/backend/vuepress/others/vuepress/src/.vuepress/nav/getNavTranslated.js +0 -52
  46. package/templates/backend/vuepress/others/vuepress/src/.vuepress/plugins/References.js +0 -96
  47. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/Logo-Cult-of-Bits-400x400-1.png +0 -0
  48. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/favicon-cob.png +0 -0
  49. package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/logo.png +0 -0
  50. package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/index.styl +0 -39
  51. package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/palette.styl +0 -17
  52. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/LICENSE +0 -21
  53. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/README.md +0 -11
  54. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/AlgoliaSearchBox.vue +0 -172
  55. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownLink.vue +0 -252
  56. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownTransition.vue +0 -33
  57. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Home.vue +0 -134
  58. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLink.vue +0 -98
  59. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue +0 -165
  60. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Navbar.vue +0 -140
  61. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Page.vue +0 -31
  62. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue +0 -119
  63. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageNav.vue +0 -163
  64. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Sidebar.vue +0 -64
  65. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue +0 -40
  66. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue +0 -144
  67. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue +0 -140
  68. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue +0 -114
  69. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue +0 -44
  70. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeBlock.vue +0 -41
  71. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeGroup.vue +0 -120
  72. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/index.js +0 -59
  73. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/404.vue +0 -30
  74. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/Layout.vue +0 -151
  75. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/noopModule.js +0 -1
  76. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/package.json +0 -44
  77. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/arrow.styl +0 -22
  78. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/code.styl +0 -137
  79. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/config.styl +0 -1
  80. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/custom-blocks.styl +0 -44
  81. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/index.styl +0 -202
  82. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/mobile.styl +0 -37
  83. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/toc.styl +0 -3
  84. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/wrapper.styl +0 -10
  85. package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/util/index.js +0 -244
  86. package/templates/dashboards/cob-dashboard-html/demoDashboard.html +0 -18
  87. package/templates/dashboards/cob-dashboard-vue/package-lock.json +0 -25020
  88. package/templates/dashboards/cob-dashboard-vue/package.json +0 -21
  89. package/templates/dashboards/cob-dashboard-vue/src/App.vue +0 -26
  90. package/templates/dashboards/cob-dashboard-vue/src/dashboard.html +0 -31
  91. package/templates/dashboards/cob-dashboard-vue/src/main.js +0 -12
  92. package/templates/dashboards/cob-dashboard-vue/src/plugins/cobUiVueComponents.js +0 -6
  93. package/templates/dashboards/cob-dashboard-vue/src/plugins/vuetify.js +0 -9
  94. package/templates/dashboards/cob-dashboard-vue/vue.config.js +0 -104
  95. package/templates/dashboards/dash/dist/css/app.7b16c01a.css +0 -11
  96. package/templates/dashboards/dash/dist/dashboard.html +0 -25
  97. package/templates/dashboards/dash/dist/fonts/fa-brands-400.a78ffbbe.ttf +0 -0
  98. package/templates/dashboards/dash/dist/fonts/fa-brands-400.cd2b4095.woff2 +0 -0
  99. package/templates/dashboards/dash/dist/fonts/fa-regular-400.b1a1bebb.ttf +0 -0
  100. package/templates/dashboards/dash/dist/fonts/fa-regular-400.e8a1ba41.woff2 +0 -0
  101. package/templates/dashboards/dash/dist/fonts/fa-solid-900.55b416a8.woff2 +0 -0
  102. package/templates/dashboards/dash/dist/fonts/fa-solid-900.73820155.ttf +0 -0
  103. package/templates/dashboards/dash/dist/fonts/fa-v4compatibility.0d6f5f18.ttf +0 -0
  104. package/templates/dashboards/dash/dist/fonts/fa-v4compatibility.786e6b33.woff2 +0 -0
  105. package/templates/dashboards/dash/dist/js/app.13b950c8.js +0 -199
  106. package/templates/dashboards/dash/dist/js/app.13b950c8.js.map +0 -1
  107. package/templates/dashboards/dash/package-lock.json +0 -22646
  108. package/templates/dashboards/dash/package.json +0 -27
  109. package/templates/dashboards/dash/src/App.vue +0 -124
  110. package/templates/dashboards/dash/src/assets/css/all.min.css +0 -6
  111. package/templates/dashboards/dash/src/assets/webfonts/fa-brands-400.ttf +0 -0
  112. package/templates/dashboards/dash/src/assets/webfonts/fa-brands-400.woff2 +0 -0
  113. package/templates/dashboards/dash/src/assets/webfonts/fa-regular-400.ttf +0 -0
  114. package/templates/dashboards/dash/src/assets/webfonts/fa-regular-400.woff2 +0 -0
  115. package/templates/dashboards/dash/src/assets/webfonts/fa-solid-900.ttf +0 -0
  116. package/templates/dashboards/dash/src/assets/webfonts/fa-solid-900.woff2 +0 -0
  117. package/templates/dashboards/dash/src/assets/webfonts/fa-v4compatibility.ttf +0 -0
  118. package/templates/dashboards/dash/src/assets/webfonts/fa-v4compatibility.woff2 +0 -0
  119. package/templates/dashboards/dash/src/collector.js +0 -222
  120. package/templates/dashboards/dash/src/components/Attention.vue +0 -30
  121. package/templates/dashboards/dash/src/components/Board.vue +0 -35
  122. package/templates/dashboards/dash/src/components/Calendar.vue +0 -422
  123. package/templates/dashboards/dash/src/components/Dashboard.vue +0 -27
  124. package/templates/dashboards/dash/src/components/Filter.vue +0 -68
  125. package/templates/dashboards/dash/src/components/Kibana.vue +0 -138
  126. package/templates/dashboards/dash/src/components/Label.vue +0 -15
  127. package/templates/dashboards/dash/src/components/Menu.vue +0 -44
  128. package/templates/dashboards/dash/src/components/Totals.vue +0 -49
  129. package/templates/dashboards/dash/src/components/TotalsValue.vue +0 -59
  130. package/templates/dashboards/dash/src/components/shared/Instance.vue +0 -64
  131. package/templates/dashboards/dash/src/components/shared/Waiting.vue +0 -25
  132. package/templates/dashboards/dash/src/dashboard.html +0 -39
  133. package/templates/dashboards/dash/src/definition_dashboard_v0.json +0 -924
  134. package/templates/dashboards/dash/src/definition_dashboard_v1.json +0 -1
  135. package/templates/dashboards/dash/src/input.css +0 -9
  136. package/templates/dashboards/dash/src/main.js +0 -11
  137. package/templates/dashboards/dash/src/model/ComponentStatePersistence.js +0 -66
  138. package/templates/dashboards/dash/src/output.css +0 -314245
  139. package/templates/dashboards/dash/src/test_collector.js +0 -3719
  140. package/templates/dashboards/dash/src/utils/EsInstanceUtils.js +0 -8
  141. package/templates/dashboards/dash/tailwind.config.js +0 -12
  142. package/templates/dashboards/dash/vue.config.js +0 -104
  143. package/templates/frontend/common/templates/frontend/common/css/_dualColumn.css +0 -46
  144. package/templates/frontend/common/templates/frontend/common/css/_global.css +0 -19
  145. package/templates/frontend/common/templates/frontend/common/css/_hidden.css +0 -13
  146. package/templates/frontend/common/templates/frontend/common/css/_history.css +0 -13
  147. package/templates/frontend/common/templates/frontend/common/css/_mobile.css +0 -125
  148. package/templates/frontend/common/templates/frontend/common/css/customizations.__MERGE__.css +0 -5
  149. package/templates/frontend/common/templates/frontend/common/js/cob/_disable_save_onSubdetail.js +0 -11
  150. package/templates/frontend/common/templates/frontend/common/js/cob/_group_references.js +0 -22
  151. package/templates/frontend/common/templates/frontend/common/js/cob/_show_hidden.js +0 -35
  152. package/templates/frontend/common/templates/frontend/common/js/customizations2.__MERGE__.js +0 -3
  153. package/templates/frontend/common/templates/frontend/common/package.json +0 -3
  154. package/templates/frontend/easy/css/_easy/googlefonts.css +0 -360
  155. package/templates/frontend/easy/css/_easy/vuetify.cob-scoped.css +0 -10488
  156. package/templates/frontend/easy/js/_easy/lib/axios.min.js +0 -9
  157. package/templates/frontend/easy/js/_easy/lib/marked.min.js +0 -6
  158. package/templates/frontend/easy/js/_easy/lib/vue.js +0 -11912
  159. package/templates/frontend/easy/js/_easy/lib/vue.min.js +0 -6
  160. package/templates/frontend/easy/js/_easy/lib/vuetify.min.js +0 -6
  161. package/templates/frontend/easy/js/customizations2.__MERGE__.js +0 -22
  162. package/templates/frontend/easy/webapp/.browserslistrc +0 -2
  163. package/templates/frontend/easy/webapp/.eslintrc.js +0 -17
  164. package/templates/frontend/easy/webapp/README.md +0 -60
  165. package/templates/frontend/easy/webapp/babel.config.js +0 -5
  166. package/templates/frontend/easy/webapp/dist/css/app.a4fb91f8.css +0 -1
  167. package/templates/frontend/easy/webapp/dist/dashboard.html +0 -13
  168. package/templates/frontend/easy/webapp/dist/js/app.63a57dcd.js +0 -2
  169. package/templates/frontend/easy/webapp/dist/js/app.63a57dcd.js.map +0 -1
  170. package/templates/frontend/easy/webapp/package-lock.json +0 -32986
  171. package/templates/frontend/easy/webapp/package.json +0 -32
  172. package/templates/frontend/easy/webapp/postcss.config.js +0 -5
  173. package/templates/frontend/easy/webapp/public/dashboard.html +0 -13
  174. package/templates/frontend/easy/webapp/src/App.vue +0 -181
  175. package/templates/frontend/easy/webapp/src/assets/logo.png +0 -0
  176. package/templates/frontend/easy/webapp/src/components/HelloWorld.vue +0 -59
  177. package/templates/frontend/easy/webapp/src/components/PermBuilder.vue +0 -163
  178. package/templates/frontend/easy/webapp/src/components/PlanExecutor.vue +0 -225
  179. package/templates/frontend/easy/webapp/src/components/ProductPermBuilder.vue +0 -95
  180. package/templates/frontend/easy/webapp/src/components/RmDefinitionChooser.vue +0 -59
  181. package/templates/frontend/easy/webapp/src/components/RmDomainChooser.vue +0 -60
  182. package/templates/frontend/easy/webapp/src/components/RoleBuilder.vue +0 -73
  183. package/templates/frontend/easy/webapp/src/main.js +0 -19
  184. package/templates/frontend/easy/webapp/src/perm-templates.js +0 -189
  185. package/templates/frontend/easy/webapp/src/perms.js +0 -197
  186. package/templates/frontend/easy/webapp/vue.config.js +0 -66
  187. package/templates/frontend/formatList/currency/css/_format_currency.css +0 -11
  188. package/templates/frontend/formatList/currency/css/customizations.__MERGE__.css +0 -1
  189. package/templates/frontend/formatList/currency/js/cob/_format_currency.js +0 -11
  190. package/templates/frontend/formatList/currency/js/customizations2.__MERGE__.js +0 -1
  191. package/templates/frontend/formatList/currency/package.json +0 -3
  192. package/templates/gitignore +0 -14
  193. package/templates/keywords/audit/backend/scripts/_audit.groovy +0 -78
  194. package/templates/keywords/audit/frontend/js/cob/_audit.js +0 -24
  195. package/templates/keywords/audit/frontend/js/customizations2.__MERGE__.js +0 -1
  196. package/templates/keywords/audit/package.json +0 -3
  197. package/templates/keywords/calc/backend/scripts/_calc.groovy +0 -151
  198. package/templates/keywords/calc/frontend/js/cob/_calc.js +0 -193
  199. package/templates/keywords/calc/frontend/js/customizations2.__MERGE__.js +0 -1
  200. package/templates/keywords/calc/package.json +0 -3
  201. package/templates/keywords/image/frontend/js/cob/_image.js +0 -30
  202. package/templates/keywords/image/frontend/js/customizations2.__MERGE__.js +0 -1
  203. package/templates/keywords/image/package.json +0 -3
  204. package/templates/keywords/kibana/frontend/js/cob/_kibana.js +0 -58
  205. package/templates/keywords/kibana/frontend/js/customizations2.__MERGE__.js +0 -1
  206. package/templates/keywords/kibana/package.json +0 -3
  207. package/templates/keywords/log/backend/scripts/_log.groovy +0 -95
  208. package/templates/keywords/log/frontend/css/_log.css +0 -5
  209. package/templates/keywords/log/frontend/css/customizations.__MERGE__.css +0 -1
  210. package/templates/keywords/log/package.json +0 -3
  211. package/templates/keywords/styleResults/frontend/css/_styleResults.css +0 -86
  212. package/templates/keywords/styleResults/frontend/css/customizations.__MERGE__.css +0 -1
  213. package/templates/keywords/styleResults/frontend/js/cob/_styleResults.js +0 -38
  214. package/templates/keywords/styleResults/frontend/js/customizations2.__MERGE__.js +0 -1
  215. package/templates/keywords/styleResults/package.json +0 -3
@@ -1,222 +0,0 @@
1
- import * as dashFunctions from '@cob/dashboard-info';
2
-
3
- const clone = (obj) => JSON.parse(JSON.stringify(obj))
4
-
5
- function collect(bucket, source) {
6
- const sourceName = source.fieldDefinition.name
7
- const children = source.fields
8
- const bucketKeys = Object.keys(bucket);
9
- if (bucketKeys.indexOf(sourceName) >= 0) {
10
- //Means that found one key in current source
11
- if (Array.isArray(bucket[sourceName])) {
12
- // Means type of value to collect is array
13
- if (bucket[sourceName].length === 0 || bucket[sourceName][0]["Mark"] === "JUST COPY") {
14
- //Means the bucket template only specify to get the raw elements that match (empty array in bucket template or having first element signaled that it was originally an empty array)
15
- source["Mark"] = "JUST COPY" // Signal it was an empty array
16
- source[sourceName] = source.value // Add extra field with original name of the source
17
- bucket[sourceName].push(source) // Add to bucket collector
18
- } else {
19
- //Means the bucket specifies a template for the array elements
20
- let initialBucketCopy
21
- if (typeof bucket[sourceName][0].Initial_Template == "undefined") {
22
- //Means it's the initial bucket (because it doesn't have the Initial_Template field copy)
23
- initialBucketCopy = clone(bucket[sourceName][0]) // Clone the bucket template
24
- initialBucketCopy.Initial_Template = clone(initialBucketCopy) // Save a copy of the bucket template as template for additional items
25
- bucket[sourceName].shift() // remove original empty bucket template from collection
26
- } else {
27
- // Means it's additional source matches
28
- initialBucketCopy = clone(bucket[sourceName][0].Initial_Template) // we use a copy of the previously copied template
29
- }
30
- initialBucketCopy.instanceId = bucket.instanceId //needed to build $file url
31
- children.reduce(collect, initialBucketCopy) // collect values from the children
32
- initialBucketCopy[sourceName] = source.value // Add extra field with original name of the source
33
- bucket[sourceName].push(initialBucketCopy) // Add to bucket collector
34
- }
35
- } else {
36
- // Means it's not an array and we can collect the final value
37
- if (source.value && source.fieldDefinition.description && source.fieldDefinition.description.indexOf("$file") >= 0) {
38
- bucket[sourceName] = "/recordm/recordm/instances/" + bucket.instanceId + "/files/" + source.fieldDefinition.id + "/" + source.value
39
- } else {
40
- bucket[sourceName] = source.value;
41
- }
42
- }
43
- } else if (children.length > 0) {
44
- // Means it didn't find a match. Continue looking in the children
45
- for (source of children) {
46
- source.fields.reduce(collect, bucket);
47
- }
48
- }
49
- return bucket;
50
- }
51
-
52
- function parseDashboard(raw_dashboard, userInfo) {
53
- let dash = {
54
- "Name": "",
55
- "DashboardCustomize": [{
56
- "Grid": "",
57
- "Width": "",
58
- "DashboardClasses": "",
59
- "Image": "",
60
- "GroupAccess": [{}]
61
- }],
62
- "Board": [{
63
- "BoardCustomize": [{
64
- "BoardClasses": "",
65
- "Image": ""
66
- }],
67
- "Component": []
68
- }],
69
- };
70
-
71
- dash.instanceId = "" + raw_dashboard.id //needed to build $file url
72
- raw_dashboard.fields.reduce(collect, dash);
73
-
74
- const ComponentsTemplates = {
75
- "Label": {
76
- "LabelCustomize": [{
77
- "LabelClasses": "",
78
- "Image": ""
79
- }],
80
- "Label": "",
81
- },
82
- "Menu": {
83
- "MenuCustomize": [{
84
- "MenuClasses": ""
85
- }],
86
- "Text": [{
87
- "Link": "",
88
- "TextCustomize": [{
89
- "TextClasses": "",
90
- "Icon": "",
91
- "TextAttention": "",
92
- "GroupVisibility": [{}]
93
- }],
94
- }],
95
- },
96
- "Totals": {
97
- "TotalsCustomize": [{
98
- "TotalsClasses": "",
99
- "InputVarTotals": [{}],
100
- }],
101
- "Line": [{
102
- "LineCustomize": [{
103
- "LineClasses": "",
104
- "TitleClasses": "",
105
- }],
106
- "Value": [{
107
- "ValueCustomize": [{
108
- "ValueClasses": "",
109
- "View": "",
110
- "ValueAttention": "",
111
- "ValueAttentionClasses": "",
112
- "Unit": "",
113
- }],
114
- "Style Value": "",
115
- "Arg": [{}]
116
- }]
117
- }],
118
- },
119
- "Kibana": {
120
- "KibanaCustomize": [{
121
- "KibanaClasses": "",
122
- "OutputVarKibana": "",
123
- "InputVarKibana": [{}],
124
- "InputQueryKibana": ""
125
- }],
126
- "ShareLink": "",
127
- },
128
- "Filter": {
129
- "FilterCustomize": [{
130
- "FilterClasses": "",
131
- "Placeholder": ""
132
- }],
133
- "OutputVarFilter": "",
134
- },
135
- "Calendar": {
136
- "CalendarCustomize": [{
137
- "CalendarClasses": "",
138
- "InputVarCalendar": [{}],
139
- "OutputVarCalendar": "",
140
- "MaxVisibleDayEvents": "",
141
- "AllowCreateInstances":"",
142
- "CreateDefinition":"",
143
- "EventViews":""
144
- }],
145
- "Events": [{
146
- "Definition": "",
147
- "DateStartEventField": "",
148
- "DateEndEventField": "",
149
- "DescriptionEventField": "",
150
- "StateEventField": "",
151
- "EventsQuery": "",
152
- }],
153
- }
154
- }
155
-
156
- for( let board of dash["Board"]) {
157
- let componentsList = clone([])
158
- for( let component of board["Component"]) {
159
- if(component["Component"] == null) continue
160
- let componentTemplate = clone(ComponentsTemplates[component["Component"]])
161
- componentTemplate.instanceId = "" + raw_dashboard.id //needed to $build file url
162
- component.fields.reduce(collect, componentTemplate)
163
- componentTemplate["Component"] = component.Component
164
- // Assign the field identifier as the componentId
165
- componentTemplate.id = component.id
166
- componentsList.push(componentTemplate)
167
- }
168
- board["Component"] = componentsList
169
- }
170
-
171
-
172
- // remove all 'Initial_Templates' and 'instanceId' added for processing
173
- dash = JSON.parse(JSON.stringify(dash, (k, v) => (k === 'Initial_Template' || k === 'instanceId') ? undefined : v))
174
- dash.vars = {} //Available to every components in component.vars
175
-
176
- // Add extra info to structure
177
- dash["Board"].forEach(b => b.Component.forEach(c => {
178
- // Add user info for permission evaluations
179
- c.userInfo = userInfo
180
- c.vars = dash.vars
181
-
182
- if (c.Component === "Menu") {
183
- c.Text.forEach(t => {
184
- // If Attention is configured for this menu line then add attention status as user check
185
- if (t["TextCustomize"][0]["TextAttention"]) {
186
- t["TextCustomize"][0].AttentionInfo = dashFunctions.instancesList("Dashboard-Attention", "name.raw:" + t["TextCustomize"][0]["TextAttention"], 1, 0, {validity: 30})
187
- }
188
- })
189
- } else if (c.Component === "Totals") {
190
- c.Line.forEach(l => {
191
- l.Value = l.Value.map(v => {
192
- if (v.Arg[2] && (v.Arg[2] + "").startsWith("{")) {
193
- v.Arg[2] = JSON.parse(v.Arg[2])
194
- }
195
- // If Attention is configured for this value line then add attention status as user check
196
- if (v["ValueCustomize"][0]["ValueAttention"]) {
197
- v["ValueCustomize"][0].AttentionInfo = dashFunctions.instancesList("Dashboard-Attention", "name.raw:" + v["ValueCustomize"][0]["ValueAttention"], 1, 0, {validity: 10})
198
- }
199
-
200
- if (v.Value === 'Label') {
201
- v.dash_info = {value: v.Arg[0].Arg, state: "ready"}
202
- } else if (v.Value === 'link') {
203
- v.dash_info = {value: v.Arg[1].Arg, href: v.Arg[0].Arg, state: "ready", isLink: true}
204
- } else {
205
- // add dash-info values in Totals
206
- v.dash_info = dashFunctions[v.Value].apply(this, v['Arg'].map( a =>
207
- a['Arg'].replace(/__USERNAME__/g,c.userInfo.username)
208
- )) // Return DashInfo, which is used by the component
209
- }
210
- return v
211
- })
212
- })
213
- } else if (c.Component === "Kibana") {
214
- if (c["KibanaCustomize"][0]["InputQueryKibana"] !== null) {
215
- c["KibanaCustomize"][0]["InputQueryKibana"] = c["KibanaCustomize"][0]["InputQueryKibana"].replaceAll("__USERNAME__", c.userInfo.username)
216
- }
217
- }
218
- }))
219
- return dash
220
- }
221
-
222
- export {parseDashboard, clone, collect}
@@ -1,30 +0,0 @@
1
- <template>
2
- <i v-if="attentionClasses" :class="attentionClasses" style="line-height: inherit;"></i>
3
- </template>
4
-
5
- <script>
6
- export default {
7
- props: {
8
- attentionInfo: Object,
9
- classes: String
10
- },
11
- computed: {
12
- inputClasses() { return this.classes || "fa-solid fa-circle pr-1 animate-pulse text-lg align-middle" },
13
- attentionClasses() {
14
- let attentionInfo = this.attentionInfo
15
- if(attentionInfo && attentionInfo.value && attentionInfo.value[0]) {
16
- let severity = attentionInfo.value[0].severity && attentionInfo.value[0].severity[0] || 0
17
- if (severity === 0) return ""
18
-
19
- let baseColor = severity > 0 ? "lime" : "red"
20
- let severityAbs = Math.abs(severity)
21
- let colorIntensity = severityAbs > 4 ? 500 : severityAbs * 100
22
- let valenceColor = baseColor + (colorIntensity ? "-" + colorIntensity: "")
23
- return this.inputClasses + " " + "text-" + valenceColor
24
- } else {
25
- return ""
26
- }
27
- }
28
- }
29
- }
30
- </script>
@@ -1,35 +0,0 @@
1
- <template>
2
- <div :class="classes" :style="image" >
3
- <template v-for="(item, i) in components">
4
- <Label v-if="item['Component'] === 'Label'" :component="item" :key="i" />
5
- <Menu v-if="item['Component'] === 'Menu'" :component="item" :key="i" :userInfo="userInfo"/>
6
- <Totals v-if="item['Component'] === 'Totals'" :component="item" :key="i" :userInfo="userInfo"/>
7
- <Kibana v-if="item['Component'] === 'Kibana'" :component="item" :key="i" :userInfo="userInfo"/>
8
- <Filtro v-if="item['Component'] === 'Filter'" :component="item" :key="i" :userInfo="userInfo"/>
9
- <Calendar v-if="item['Component'] === 'Calendar'" :component="item" :key="i" :userInfo="userInfo"/>
10
- </template>
11
- </div>
12
- </template>
13
-
14
- <script>
15
- import Label from './Label.vue'
16
- import Menu from './Menu.vue'
17
- import Totals from './Totals.vue'
18
- import Kibana from './Kibana.vue'
19
- import Filtro from './Filter.vue'
20
- import Calendar from './Calendar.vue'
21
-
22
- export default {
23
- components: { Label, Menu, Totals, Kibana, Filtro, Calendar },
24
- props: {
25
- board: Object,
26
- userInfo: Object,
27
- },
28
- computed: {
29
- options() { return this.board['BoardCustomize'][0] },
30
- components() { return this.board['Component'] },
31
- classes() { return this.options['BoardClasses'] || "col-span-12 md:col-span-4 rounded-md border border-gray-300 bg-white bg-opacity-70 p-4 m-1" },
32
- image() { return this.options['Image'] ? "background-image: url(" + this.options['Image'] + ");" : "" }
33
- }
34
- }
35
- </script>