@mixd-id/web-scaffold 0.2.240706 → 0.2.250801010
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/docs/components/Dashboard.md +56 -0
- package/log.txt +7 -0
- package/package.json +27 -19
- package/src/components/404.vue +61 -0
- package/src/components/AccountIcon.vue +19 -0
- package/src/components/Ahref.vue +1 -1
- package/src/components/Alert.vue +4 -13
- package/src/components/ArrayList.vue +49 -0
- package/src/components/Article.vue +24 -30
- package/src/components/Button.vue +83 -169
- package/src/components/Card.vue +257 -0
- package/src/components/Carousel.vue +61 -60
- package/src/components/Cart.vue +192 -0
- package/src/components/CartIcon.vue +89 -0
- package/src/components/ChartBar.vue +2 -3
- package/src/components/Checkbox.vue +20 -11
- package/src/components/Checkout.vue +373 -0
- package/src/components/CheckoutDelivery.vue +267 -0
- package/src/components/CodeEditor.vue +5 -16
- package/src/components/CollapsiblePanel.vue +70 -0
- package/src/components/ColorPicker.vue +12 -5
- package/src/components/ColorPicker2.vue +41 -19
- package/src/components/ColorPicker3.vue +100 -0
- package/src/components/Confirm.vue +9 -7
- package/src/components/ContextMenu.vue +122 -206
- package/src/components/ContextMenuItem.vue +53 -0
- package/src/components/Dashboard.vue +243 -0
- package/src/components/Dashboard2.vue +118 -0
- package/src/components/DashboardComponentSelector.vue +96 -0
- package/src/components/DashboardConfigs.vue +202 -0
- package/src/components/Datepicker.vue +102 -41
- package/src/components/DayTimeRange.vue +3 -2
- package/src/components/Dropdown.vue +7 -4
- package/src/components/Flex.vue +14 -40
- package/src/components/GHeatMaps.vue +2 -2
- package/src/components/Grid.vue +6 -6
- package/src/components/HTMLEditor.vue +27 -14
- package/src/components/Image.vue +62 -108
- package/src/components/ImagePreview.vue +14 -4
- package/src/components/ImageUploader.vue +114 -0
- package/src/components/ImportModal.vue +3 -3
- package/src/components/Link.vue +62 -6
- package/src/components/List.vue +528 -403
- package/src/components/ListContextMenu.vue +88 -0
- package/src/components/ListItem.vue +6 -4
- package/src/components/ListPage1.vue +14 -15
- package/src/components/ListView.vue +5 -6
- package/src/components/ListViewSettings.vue +2 -2
- package/src/components/LogViewerItem.vue +1 -1
- package/src/components/MarkdownEdit.vue +128 -0
- package/src/components/MarkdownPreview.vue +102 -0
- package/src/components/MenuItem1.vue +36 -0
- package/src/components/Modal.vue +95 -43
- package/src/components/MultiDropdown.vue +124 -0
- package/src/components/MultilineText.vue +1 -4
- package/src/components/OTPField.vue +40 -26
- package/src/components/ObjectTree.vue +1 -1
- package/src/components/PageBuilder.vue +3 -3
- package/src/components/Paragraph.vue +1 -2
- package/src/components/PresetSelectorFilterItem.vue +107 -95
- package/src/components/Radio.vue +1 -1
- package/src/components/SearchModal.vue +153 -0
- package/src/components/Slider.vue +1 -1
- package/src/components/Svg.vue +1 -1
- package/src/components/SvgEditor.vue +173 -0
- package/src/components/Switch.vue +4 -5
- package/src/components/Table.vue +2 -2
- package/src/components/TableView.vue +2 -3
- package/src/components/TableViewHead.vue +2 -2
- package/src/components/Tabs.vue +1 -1
- package/src/components/Testimonial.vue +2 -2
- package/src/components/Text.vue +7 -22
- package/src/components/TextEditor.vue +3 -3
- package/src/components/TextWithTag.vue +61 -30
- package/src/components/Textarea.vue +16 -22
- package/src/components/Textbox.vue +9 -19
- package/src/components/Timepicker.vue +25 -15
- package/src/components/Toast.vue +5 -3
- package/src/components/TreeMenu.vue +122 -0
- package/src/components/TreeView.vue +15 -10
- package/src/components/TreeView2.vue +38 -0
- package/src/components/TreeViewItem.vue +58 -29
- package/src/components/TreeViewItem2.vue +55 -0
- package/src/components/Uploader.vue +45 -0
- package/src/components/Video.vue +119 -0
- package/src/components/VirtualGrid.vue +24 -7
- package/src/components/VirtualTable.vue +363 -128
- package/src/configs/dashboard/data-table.js +9 -0
- package/src/configs/web-page-builder.js +118 -0
- package/src/directives/intersect.js +26 -0
- package/src/hooks/device.js +14 -0
- package/src/index.js +62 -107
- package/src/mixin/component.js +151 -67
- package/src/themes/default/index.js +118 -159
- package/src/utils/dashboard.js +22 -962
- package/src/utils/helpers.cjs +635 -0
- package/src/utils/helpers.js +91 -60
- package/src/utils/helpers.mjs +245 -12
- package/src/utils/importer.js +22 -3
- package/src/utils/list.mjs +1509 -0
- package/src/utils/preset-selector.cjs +1455 -0
- package/src/utils/preset-selector.js +489 -95
- package/src/utils/preset-selector.mjs +59 -20
- package/src/utils/queue.js +63 -0
- package/src/utils/web.mjs +120 -0
- package/src/utils/wss.js +38 -36
- package/src/utils/wss.mjs +24 -19
- package/src/widgets/AhrefSetting.vue +16 -13
- package/src/widgets/ArticleSetting.vue +15 -27
- package/src/widgets/BackgroundColorSetting.vue +153 -0
- package/src/widgets/BorderColorSetting.vue +57 -0
- package/src/widgets/BotEditor/BotEditorActions.vue +3 -2
- package/src/widgets/BotEditor/BotEditorSettings.vue +21 -0
- package/src/widgets/BotEditor.vue +35 -15
- package/src/widgets/ButtonSetting.vue +12 -13
- package/src/widgets/CarouselSetting.vue +33 -45
- package/src/widgets/CartSetting.vue +46 -0
- package/src/widgets/CheckoutSetting.vue +46 -0
- package/src/widgets/CollapsiblePanelSetting.vue +46 -0
- package/src/widgets/ColumnSelector.vue +29 -5
- package/src/widgets/ComponentSetting.vue +1 -1
- package/src/widgets/ComponentSetting2.vue +145 -236
- package/src/widgets/ComponentSetting3.vue +1 -1
- package/src/widgets/ContactForm.vue +3 -3
- package/src/widgets/ContactFormSetting.vue +41 -30
- package/src/widgets/Dashboard/BarChart.vue +47 -11
- package/src/widgets/Dashboard/BarChartSetting.vue +1 -1
- package/src/widgets/Dashboard/DataTable.vue +125 -0
- package/src/widgets/Dashboard/DataTableSetting.vue +243 -0
- package/src/widgets/Dashboard/DatasourceSelector.vue +1 -1
- package/src/widgets/Dashboard/Doughnut.vue +49 -7
- package/src/widgets/Dashboard/DoughnutSetting.vue +2 -2
- package/src/widgets/Dashboard/Metric.vue +78 -19
- package/src/widgets/Dashboard/MetricSetting.vue +81 -28
- package/src/widgets/Dashboard/Pie.vue +55 -6
- package/src/widgets/Dashboard/PieSetting.vue +1 -1
- package/src/widgets/Dashboard/PolarArea.vue +49 -7
- package/src/widgets/Dashboard/PolarAreaSetting.vue +1 -1
- package/src/widgets/Dashboard/SharingModal.vue +4 -5
- package/src/widgets/Dashboard/ViewSelector.vue +2 -2
- package/src/widgets/Dashboard/VirtualTableSetting.vue +121 -184
- package/src/widgets/{Dashboard.vue → Dashboard0.vue} +426 -343
- package/src/widgets/EmbeddedVideoSetting.vue +7 -5
- package/src/widgets/FAQ.vue +16 -3
- package/src/widgets/FAQSetting.vue +53 -47
- package/src/widgets/FeatureList.vue +3 -0
- package/src/widgets/FeatureListSetting.vue +112 -102
- package/src/widgets/FlexSetting.vue +83 -106
- package/src/widgets/GridSetting.vue +71 -196
- package/src/widgets/Header2.vue +34 -71
- package/src/widgets/Header2Setting.vue +95 -179
- package/src/widgets/HeaderSetting.vue +16 -18
- package/src/widgets/IconListSetting.vue +69 -65
- package/src/widgets/ImageSetting.vue +33 -60
- package/src/widgets/LinkSetting.vue +60 -37
- package/src/widgets/LinkSettingModal.vue +173 -0
- package/src/widgets/LogViewer.vue +1 -1
- package/src/widgets/MarginSetting.vue +2 -2
- package/src/widgets/MenuEditor.vue +1 -1
- package/src/widgets/MenuItem1Setting.vue +78 -0
- package/src/widgets/ModalSetting.vue +42 -44
- package/src/widgets/MultiValueSetting.vue +2 -2
- package/src/widgets/MultiValueSetting2.vue +78 -45
- package/src/widgets/OGSettingModal.vue +103 -0
- package/src/widgets/PaddingSetting.vue +2 -2
- package/src/widgets/ParagraphSetting.vue +16 -13
- package/src/widgets/PositionSetting.vue +209 -0
- package/src/widgets/PresetBar.vue +359 -210
- package/src/widgets/PresetBarPivot.vue +31 -19
- package/src/widgets/PresetSelector.vue +29 -17
- package/src/widgets/SearchModalSetting.vue +70 -0
- package/src/widgets/Share.vue +1 -2
- package/src/widgets/ShareSetting.vue +67 -60
- package/src/widgets/StyleSetting.vue +365 -150
- package/src/widgets/TestimonialSetting.vue +97 -88
- package/src/widgets/TextBlockSetting.vue +16 -13
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +30 -10
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +2 -2
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +64 -87
- package/src/widgets/UserActionBuilder/UserActionProps.vue +3 -3
- package/src/widgets/UserActionBuilder.vue +4 -16
- package/src/widgets/WebComponentSelector.vue +15 -11
- package/src/widgets/WebLayoutSelector.vue +41 -270
- package/src/widgets/WebPageBuilder.vue +1019 -707
- package/src/widgets/WebPageBuilder2.vue +7 -7
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -8
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +63 -7
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +3 -3
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +1 -10
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +2 -2
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -7
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +1 -7
- package/src/widgets/WebPageBuilder4.vue +289 -575
- package/src/widgets/WebPageSelector.vue +1 -1
- package/src/widgets/YoutubeVideoSetting.vue +16 -13
- package/tailwind.config.js +3 -35
- package/docs/schema/user-action.json +0 -266
- package/src/App.vue +0 -25
- package/src/components/SearchButton.vue +0 -57
- package/src/entry-client.js +0 -27
- package/src/entry-server.js +0 -73
- package/src/events/event.js +0 -2
- package/src/main.js +0 -29
- package/src/mixin/website.js +0 -121
- package/src/router.js +0 -57
- package/src/widgets/MobileMenu.vue +0 -182
- package/src/widgets/WebPageBuilder4/ActionSetting.vue +0 -158
- package/src/widgets/WebPageBuilder4/ColorSetting.vue +0 -63
- package/src/widgets/WebPageBuilder4/DataSetting.vue +0 -92
- package/src/widgets/WebPageBuilder4/FontSizeSetting.vue +0 -76
- package/src/widgets/WebPageBuilder4/LinkSetting.vue +0 -68
- package/src/widgets/WebPageBuilder4/MobileMenuSetting.vue +0 -106
- package/src/widgets/WebPageBuilder4/Setting.vue +0 -73
- package/src/widgets/WebPageBuilder4/StyleSetting.vue +0 -77
- package/src/widgets/WebPageBuilder4/SvgSetting.vue +0 -207
- package/src/widgets/WebPageBuilder4/TextTransformSetting.vue +0 -70
- package/src/widgets/WebPageBuilder4/WebPageDataEdit.vue +0 -121
- package/test.json +0 -22
- /package/src/widgets/{Header1.vue → Header0.vue} +0 -0
- /package/src/widgets/{Header1Setting.vue → Header0Setting.vue} +0 -0
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
20
|
|
|
21
|
-
import {Doughnut} from 'vue-chartjs'
|
|
21
|
+
import { Doughnut } from 'vue-chartjs'
|
|
22
|
+
import Chart from 'chart.js/auto'
|
|
22
23
|
import {color} from "chart.js/helpers";
|
|
23
24
|
import {strVars} from "../../utils/helpers.mjs";
|
|
24
|
-
import {
|
|
25
|
+
import {useEmitter} from "../../utils/event-bus";
|
|
25
26
|
|
|
26
27
|
export default{
|
|
27
28
|
|
|
@@ -92,14 +93,43 @@ export default{
|
|
|
92
93
|
'#FFCE54',
|
|
93
94
|
'#ED5565',
|
|
94
95
|
'#EC87C0'
|
|
95
|
-
]
|
|
96
|
+
],
|
|
97
|
+
readyState: 1,
|
|
98
|
+
value: null,
|
|
96
99
|
}
|
|
97
100
|
},
|
|
98
101
|
|
|
99
|
-
inject: [ 'selectPreset' ],
|
|
102
|
+
inject: [ 'getSrc', 'getViewedPreset', 'getQueryFilters', 'selectPreset', 'socket' ],
|
|
100
103
|
|
|
101
104
|
methods: {
|
|
102
105
|
|
|
106
|
+
load(){
|
|
107
|
+
const preset = this.getViewedPreset()
|
|
108
|
+
const {name, datasource} = preset
|
|
109
|
+
|
|
110
|
+
this.readyState = 2
|
|
111
|
+
this.socket.send(this.getSrc(), {
|
|
112
|
+
name,
|
|
113
|
+
views: [{
|
|
114
|
+
...this.$props,
|
|
115
|
+
type: 'Doughnut'
|
|
116
|
+
}],
|
|
117
|
+
datasource: datasource.map(_datasource => {
|
|
118
|
+
return {
|
|
119
|
+
..._datasource,
|
|
120
|
+
filters: [
|
|
121
|
+
...(_datasource.filters ?? []),
|
|
122
|
+
...(this.getQueryFilters()[_datasource.uid] ?? [])
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
.then(_ => {
|
|
128
|
+
this.value = _[this.uid]
|
|
129
|
+
})
|
|
130
|
+
.finally(_ => this.readyState = 1)
|
|
131
|
+
},
|
|
132
|
+
|
|
103
133
|
onClick(e, segments){
|
|
104
134
|
|
|
105
135
|
const clickInteractions = (this.interactions ?? []).filter(_ => _.event === 'click')
|
|
@@ -134,15 +164,27 @@ export default{
|
|
|
134
164
|
|
|
135
165
|
},
|
|
136
166
|
|
|
137
|
-
|
|
167
|
+
mounted() {
|
|
168
|
+
this.load()
|
|
169
|
+
|
|
170
|
+
this.emitter = useEmitter()
|
|
171
|
+
this.emitter.on(`${this.uid}.load`, () => {
|
|
172
|
+
this.load()
|
|
173
|
+
})
|
|
174
|
+
this.emitter.on(`dashboard.load`, () => {
|
|
175
|
+
this.load()
|
|
176
|
+
})
|
|
177
|
+
},
|
|
138
178
|
|
|
139
179
|
props: {
|
|
140
180
|
|
|
141
181
|
label: String,
|
|
142
182
|
|
|
143
|
-
value: Object,
|
|
144
|
-
|
|
145
183
|
column: String,
|
|
184
|
+
columnModifier: String,
|
|
185
|
+
|
|
186
|
+
rows: String,
|
|
187
|
+
rowsModifier: String,
|
|
146
188
|
|
|
147
189
|
datasourceUid: String,
|
|
148
190
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<Dropdown class="min-w-[150px]"
|
|
12
12
|
:readonly="readonly"
|
|
13
13
|
v-model="value.props.datasourceUid"
|
|
14
|
-
@change="delete value.props.columns;">
|
|
14
|
+
@change="delete value.props.columns; $emit('change')">
|
|
15
15
|
<option disabled selected>Select Datasource</option>
|
|
16
16
|
<option v-for="obj in datasource"
|
|
17
17
|
:value="obj.uid">
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
<div class="mt-1">
|
|
96
96
|
<ListItem :items="interactions"
|
|
97
97
|
class="rounded-xl"
|
|
98
|
-
container-class="flex flex-col divide-y divide-
|
|
98
|
+
container-class="flex flex-col divide-y divide-border-50"
|
|
99
99
|
@reorder="(from, to) => { interactions.splice(to, 0, interactions.splice(from, 1)[0]); }">
|
|
100
100
|
<template v-slot="{ item, index }">
|
|
101
101
|
<div class="flex flex-row items-center gap-3 px-3">
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="$style.comp">
|
|
2
|
+
<div :class="$style.comp" v-if="metric">
|
|
3
3
|
<label class="text-text-400 text-ellipsis overflow-hidden whitespace-nowrap">{{ label }}</label>
|
|
4
|
-
<div class="flex flex-row gap-2">
|
|
5
|
-
<h1 v-if="readyState === 1" class="text-ellipsis overflow-hidden whitespace-nowrap" :class="column2Enabled ? '' : 'text-green-600'">
|
|
6
|
-
{{
|
|
4
|
+
<div class="flex flex-row items-end gap-2">
|
|
5
|
+
<h1 v-if="readyState === 1" class="text-5xl text-ellipsis overflow-hidden whitespace-nowrap" :class="column2Enabled ? '' : 'text-green-600'">
|
|
6
|
+
{{ metric.value }}
|
|
7
7
|
</h1>
|
|
8
8
|
<h1 v-else class="text-ellipsis overflow-hidden whitespace-nowrap text-text-300">
|
|
9
9
|
Loading...
|
|
10
10
|
</h1>
|
|
11
11
|
|
|
12
|
-
<div class="flex flex-col"
|
|
13
|
-
<div class="
|
|
14
|
-
|
|
12
|
+
<div class="flex flex-col">
|
|
13
|
+
<div class=" text-ellipsis whitespace-nowrap overflow-hidden"
|
|
14
|
+
:class="showPercentage ? '' : 'text-green-600'">
|
|
15
|
+
{{ metric.comparedValue }}
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="text-sm text-ellipsis whitespace-nowrap overflow-hidden"
|
|
19
|
+
:class="metric.comparedPercent <= 50 ? 'text-red-600' : 'text-green-600'">
|
|
20
|
+
{{ metric.comparedPercent }}%
|
|
21
|
+
</div>
|
|
15
22
|
</div>
|
|
16
23
|
</div>
|
|
17
24
|
</div>
|
|
@@ -19,32 +26,48 @@
|
|
|
19
26
|
|
|
20
27
|
<script>
|
|
21
28
|
|
|
22
|
-
import
|
|
29
|
+
import dayjs from "dayjs";
|
|
23
30
|
|
|
24
31
|
export default{
|
|
25
32
|
|
|
26
33
|
computed: {
|
|
27
34
|
|
|
28
35
|
cValue(){
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
36
|
+
if(!this.column) return 'N/A'
|
|
37
|
+
const column = this.datasource?.columns.find(_ => _.key === this.column)
|
|
38
|
+
return this.getValue(this.value?.value, column)
|
|
32
39
|
},
|
|
33
40
|
|
|
34
41
|
ccValue(){
|
|
35
42
|
if(!this.column2Enabled) return
|
|
43
|
+
if(!this.value?.comparedValue) return
|
|
44
|
+
|
|
45
|
+
const column = this.datasource?.columns.find(_ => _.key === this.column2)
|
|
46
|
+
return this.getValue(this.value?.comparedValue, column)
|
|
47
|
+
},
|
|
36
48
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
49
|
+
datasource(){
|
|
50
|
+
const preset = this.getViewedPreset()
|
|
51
|
+
if(preset){
|
|
52
|
+
return preset.datasource.find(_ => _.uid === this.datasourceUid)
|
|
53
|
+
}
|
|
40
54
|
}
|
|
41
55
|
|
|
42
56
|
},
|
|
43
57
|
|
|
44
|
-
|
|
58
|
+
data(){
|
|
59
|
+
return {
|
|
60
|
+
metric: null,
|
|
61
|
+
readyState: 1,
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
inject: [ 'getController', 'getViewedPreset', 'getQueryFilters', 'socket' ],
|
|
45
66
|
|
|
46
67
|
props: {
|
|
47
68
|
|
|
69
|
+
label: String,
|
|
70
|
+
|
|
48
71
|
column: String,
|
|
49
72
|
columnModifier: String,
|
|
50
73
|
|
|
@@ -54,12 +77,48 @@ export default{
|
|
|
54
77
|
|
|
55
78
|
datasourceUid: String,
|
|
56
79
|
|
|
57
|
-
|
|
80
|
+
showPercentage: [ Number, Boolean ],
|
|
81
|
+
|
|
82
|
+
uid: String
|
|
83
|
+
|
|
84
|
+
},
|
|
58
85
|
|
|
59
|
-
|
|
86
|
+
methods: {
|
|
60
87
|
|
|
61
|
-
|
|
88
|
+
getValue(val, column){
|
|
89
|
+
let value
|
|
90
|
+
|
|
91
|
+
switch(column?.type){
|
|
92
|
+
|
|
93
|
+
case 'date':
|
|
94
|
+
value = dayjs(val).format('D MMM')
|
|
95
|
+
break
|
|
96
|
+
|
|
97
|
+
default:
|
|
98
|
+
value = parseFloat(val)
|
|
99
|
+
value = isNaN(value) ?
|
|
100
|
+
'N/A' :
|
|
101
|
+
value.toLocaleString()
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return value
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
load(){
|
|
108
|
+
|
|
109
|
+
this.readyState = 2
|
|
110
|
+
this.socket.send(`${this.getController()}.load-metric`, {})
|
|
111
|
+
.then(metric => {
|
|
112
|
+
this.metric = metric
|
|
113
|
+
})
|
|
114
|
+
.finally(_ => this.readyState = 1)
|
|
115
|
+
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
},
|
|
62
119
|
|
|
120
|
+
mounted() {
|
|
121
|
+
this.load()
|
|
63
122
|
}
|
|
64
123
|
|
|
65
124
|
}
|
|
@@ -69,7 +128,7 @@ export default{
|
|
|
69
128
|
<style module>
|
|
70
129
|
|
|
71
130
|
.comp{
|
|
72
|
-
@apply border-[1px] border-
|
|
131
|
+
@apply border-[1px] border-border-50 bg-base-500 rounded-xl overflow-hidden;
|
|
73
132
|
@apply p-3 flex flex-col gap-1;
|
|
74
133
|
}
|
|
75
134
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-col gap-
|
|
2
|
+
<div class="flex flex-col gap-8 p-6">
|
|
3
3
|
|
|
4
|
-
<div class="flex flex-row items-center">
|
|
4
|
+
<div class="flex flex-row items-center" @click="log(value)">
|
|
5
5
|
<label class="flex-1">Active</label>
|
|
6
6
|
<Switch v-model="value.props.enabled" :readonly="readonly" @change="$emit('change')" />
|
|
7
7
|
</div>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<Dropdown class="min-w-[150px]"
|
|
16
16
|
:readonly="readonly"
|
|
17
17
|
v-model="value.props.datasourceUid"
|
|
18
|
-
@change="delete value.props.columns">
|
|
18
|
+
@change="delete value.props.columns;$emit('change')">
|
|
19
19
|
<option v-for="obj in datasource"
|
|
20
20
|
:value="obj.uid">
|
|
21
21
|
{{ obj.name }}
|
|
@@ -28,25 +28,13 @@
|
|
|
28
28
|
<Textbox v-model="value.props.label"
|
|
29
29
|
maxlength="30"
|
|
30
30
|
placeholder="Label"
|
|
31
|
-
:readonly="readonly"
|
|
32
|
-
@keyup.enter="$emit('change')"
|
|
33
|
-
@blur="$emit('change')" />
|
|
31
|
+
:readonly="readonly" />
|
|
34
32
|
</div>
|
|
35
33
|
|
|
36
|
-
<div v-if="value.props.datasourceUid" class="flex flex-col gap-
|
|
34
|
+
<div v-if="value.props.datasourceUid" class="flex flex-col gap-8">
|
|
37
35
|
<div class="flex flex-col gap-1">
|
|
38
36
|
<label class="flex-1">Column</label>
|
|
39
37
|
<div class="flex flex-row gap-2">
|
|
40
|
-
<Dropdown class="min-w-[150px] flex-1"
|
|
41
|
-
:readonly="readonly"
|
|
42
|
-
v-model="value.props.column"
|
|
43
|
-
@change="$emit('change')">
|
|
44
|
-
<option v-for="column in selectedDatasourceColumns"
|
|
45
|
-
:value="column.key">
|
|
46
|
-
{{ selectedDatasource.pivot?.enabled ? column.key : column.label }}
|
|
47
|
-
</option>
|
|
48
|
-
</Dropdown>
|
|
49
|
-
|
|
50
38
|
<Dropdown class="w-[125px]"
|
|
51
39
|
:readonly="readonly"
|
|
52
40
|
v-model="value.props.columnModifier"
|
|
@@ -60,6 +48,16 @@
|
|
|
60
48
|
<option value="first">First</option>
|
|
61
49
|
<option value="last">Last</option>
|
|
62
50
|
</Dropdown>
|
|
51
|
+
|
|
52
|
+
<Dropdown class="min-w-[150px] flex-1"
|
|
53
|
+
:readonly="readonly"
|
|
54
|
+
v-model="value.props.column"
|
|
55
|
+
@change="$emit('change')">
|
|
56
|
+
<option v-for="column in selectedDatasourceColumns"
|
|
57
|
+
:value="column.key">
|
|
58
|
+
{{ selectedDatasource.pivot?.enabled ? column.key : column.label }}
|
|
59
|
+
</option>
|
|
60
|
+
</Dropdown>
|
|
63
61
|
</div>
|
|
64
62
|
</div>
|
|
65
63
|
|
|
@@ -70,16 +68,6 @@
|
|
|
70
68
|
</Checkbox>
|
|
71
69
|
</div>
|
|
72
70
|
<div class="flex flex-row gap-2">
|
|
73
|
-
<Dropdown class="min-w-[150px] flex-1"
|
|
74
|
-
:readonly="readonly || !value.props.column2Enabled"
|
|
75
|
-
v-model="value.props.column2"
|
|
76
|
-
@change="$emit('change')">
|
|
77
|
-
<option v-for="column in selectedDatasourceColumns"
|
|
78
|
-
:value="column.key">
|
|
79
|
-
{{ selectedDatasource.pivot?.enabled ? column.key : column.label }}
|
|
80
|
-
</option>
|
|
81
|
-
</Dropdown>
|
|
82
|
-
|
|
83
71
|
<Dropdown class="w-[125px]"
|
|
84
72
|
:readonly="readonly || !value.props.column2Enabled"
|
|
85
73
|
v-model="value.props.column2Modifier"
|
|
@@ -93,6 +81,32 @@
|
|
|
93
81
|
<option value="first">First</option>
|
|
94
82
|
<option value="last">Last</option>
|
|
95
83
|
</Dropdown>
|
|
84
|
+
|
|
85
|
+
<Dropdown class="min-w-[150px] flex-1"
|
|
86
|
+
:readonly="readonly || !value.props.column2Enabled"
|
|
87
|
+
v-model="value.props.column2"
|
|
88
|
+
@change="$emit('change')">
|
|
89
|
+
<option v-for="column in selectedDatasourceColumns"
|
|
90
|
+
:value="column.key">
|
|
91
|
+
{{ selectedDatasource.pivot?.enabled ? column.key : column.label }}
|
|
92
|
+
</option>
|
|
93
|
+
</Dropdown>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<div class="flex flex-col gap-2" v-if="canShowPercentage">
|
|
98
|
+
<div>
|
|
99
|
+
<Checkbox v-model="value.props.showPercentage" :disabled="readonly">
|
|
100
|
+
Show Percentage
|
|
101
|
+
</Checkbox>
|
|
102
|
+
</div>
|
|
103
|
+
<div class="flex flex-row gap-2">
|
|
104
|
+
<Dropdown class="w-full"
|
|
105
|
+
:readonly="readonly || !value.props.column2Enabled"
|
|
106
|
+
v-model="value.props.showPercentageOpt"
|
|
107
|
+
@change="$emit('change')">
|
|
108
|
+
<option v-for="arr in showPercentageOptValues" :value="arr[0]">{{ arr[1] }}</option>
|
|
109
|
+
</Dropdown>
|
|
96
110
|
</div>
|
|
97
111
|
</div>
|
|
98
112
|
|
|
@@ -113,8 +127,47 @@ export default{
|
|
|
113
127
|
|
|
114
128
|
computed: {
|
|
115
129
|
|
|
130
|
+
column1(){
|
|
131
|
+
if(!this.value || !this.value.props.column) return
|
|
132
|
+
return this.selectedDatasource.columns.find(_ => _.key === this.value.props.column)
|
|
133
|
+
},
|
|
134
|
+
|
|
135
|
+
column2(){
|
|
136
|
+
if(!this.value || !this.value.props.column2) return
|
|
137
|
+
return this.selectedDatasource.columns.find(_ => _.key === this.value.props.column2)
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
canShowPercentage(){
|
|
141
|
+
return this.column1 && this.column2 && this.column1.type === this.column2.type
|
|
142
|
+
},
|
|
143
|
+
|
|
116
144
|
selectedDatasource(){
|
|
117
|
-
return this.datasource.find(d => d.uid === this.value.props.datasourceUid)
|
|
145
|
+
//return this.datasource.find(d => d.uid === this.value.props.datasourceUid)
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
showPercentageOptValues(){
|
|
149
|
+
if(!this.canShowPercentage) return
|
|
150
|
+
|
|
151
|
+
switch(this.column1.type){
|
|
152
|
+
|
|
153
|
+
case 'date':
|
|
154
|
+
return [
|
|
155
|
+
[ 'day', 'Day' ],
|
|
156
|
+
[ 'hour', 'Hour' ],
|
|
157
|
+
[ 'minute', 'Minute' ],
|
|
158
|
+
[ 'month', 'Month' ],
|
|
159
|
+
[ 'week', 'Week' ],
|
|
160
|
+
[ 'year', 'Year' ],
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
case 'number':
|
|
164
|
+
default:
|
|
165
|
+
return [
|
|
166
|
+
[ 'percentage', 'Percentage' ],
|
|
167
|
+
[ 'number', 'Number' ],
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
}
|
|
118
171
|
},
|
|
119
172
|
|
|
120
173
|
selectedDatasourceColumns(){
|
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
<script>
|
|
20
20
|
|
|
21
|
-
import {Pie} from 'vue-chartjs'
|
|
22
|
-
import
|
|
21
|
+
import { Pie } from 'vue-chartjs'
|
|
22
|
+
import Chart from 'chart.js/auto'
|
|
23
|
+
import { color } from 'chart.js/helpers'
|
|
23
24
|
import {strVars} from "../../utils/helpers.mjs";
|
|
24
|
-
import {
|
|
25
|
+
import {useEmitter} from "../../utils/event-bus";
|
|
25
26
|
|
|
26
27
|
export default{
|
|
27
28
|
|
|
@@ -78,10 +79,44 @@ export default{
|
|
|
78
79
|
|
|
79
80
|
},
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
data(){
|
|
83
|
+
return {
|
|
84
|
+
readyState: 1,
|
|
85
|
+
value: null,
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
inject: [ 'getSrc', 'getViewedPreset', 'getQueryFilters', 'selectPreset', 'socket' ],
|
|
82
90
|
|
|
83
91
|
methods: {
|
|
84
92
|
|
|
93
|
+
load(){
|
|
94
|
+
const preset = this.getViewedPreset()
|
|
95
|
+
const {name, datasource} = preset
|
|
96
|
+
|
|
97
|
+
this.readyState = 2
|
|
98
|
+
this.socket.send(this.getSrc(), {
|
|
99
|
+
name,
|
|
100
|
+
views: [{
|
|
101
|
+
...this.$props,
|
|
102
|
+
type: 'Pie'
|
|
103
|
+
}],
|
|
104
|
+
datasource: datasource.map(_datasource => {
|
|
105
|
+
return {
|
|
106
|
+
..._datasource,
|
|
107
|
+
filters: [
|
|
108
|
+
...(_datasource.filters ?? []),
|
|
109
|
+
...(this.getQueryFilters()[_datasource.uid] ?? [])
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
.then(_ => {
|
|
115
|
+
this.value = _[this.uid]
|
|
116
|
+
})
|
|
117
|
+
.finally(_ => this.readyState = 1)
|
|
118
|
+
},
|
|
119
|
+
|
|
85
120
|
onClick(e, segments){
|
|
86
121
|
|
|
87
122
|
const clickInteractions = (this.interactions ?? []).filter(_ => _.event === 'click')
|
|
@@ -116,7 +151,17 @@ export default{
|
|
|
116
151
|
|
|
117
152
|
},
|
|
118
153
|
|
|
119
|
-
|
|
154
|
+
mounted() {
|
|
155
|
+
this.load()
|
|
156
|
+
|
|
157
|
+
this.emitter = useEmitter()
|
|
158
|
+
this.emitter.on(`${this.uid}.load`, () => {
|
|
159
|
+
this.load()
|
|
160
|
+
})
|
|
161
|
+
this.emitter.on(`dashboard.load`, () => {
|
|
162
|
+
this.load()
|
|
163
|
+
})
|
|
164
|
+
},
|
|
120
165
|
|
|
121
166
|
props: {
|
|
122
167
|
|
|
@@ -124,7 +169,11 @@ export default{
|
|
|
124
169
|
|
|
125
170
|
value: Object,
|
|
126
171
|
|
|
127
|
-
column:
|
|
172
|
+
column: String,
|
|
173
|
+
columnModifier: String,
|
|
174
|
+
|
|
175
|
+
rows: String,
|
|
176
|
+
rowsModifier: String,
|
|
128
177
|
|
|
129
178
|
datasourceUid: String,
|
|
130
179
|
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
<div class="mt-1">
|
|
137
137
|
<ListItem :items="interactions"
|
|
138
138
|
class="rounded-xl"
|
|
139
|
-
container-class="flex flex-col divide-y divide-
|
|
139
|
+
container-class="flex flex-col divide-y divide-border-50"
|
|
140
140
|
@reorder="(from, to) => { interactions.splice(to, 0, interactions.splice(from, 1)[0]); }">
|
|
141
141
|
<template v-slot="{ item, index }">
|
|
142
142
|
<div class="flex flex-row items-center gap-3 px-3">
|
|
@@ -16,10 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
<script>
|
|
18
18
|
|
|
19
|
-
import {PolarArea} from 'vue-chartjs'
|
|
20
|
-
import
|
|
19
|
+
import { PolarArea } from 'vue-chartjs'
|
|
20
|
+
import Chart from 'chart.js/auto'
|
|
21
|
+
import { color } from 'chart.js/helpers'
|
|
21
22
|
import {strVars} from "../../utils/helpers.mjs";
|
|
22
|
-
import {
|
|
23
|
+
import {useEmitter} from "../../utils/event-bus";
|
|
23
24
|
|
|
24
25
|
export default{
|
|
25
26
|
|
|
@@ -95,13 +96,42 @@ export default{
|
|
|
95
96
|
'#ED5565',
|
|
96
97
|
'#EC87C0'
|
|
97
98
|
],
|
|
99
|
+
readyState: 1,
|
|
100
|
+
value: null,
|
|
98
101
|
}
|
|
99
102
|
},
|
|
100
103
|
|
|
101
|
-
inject: [ 'selectPreset' ],
|
|
104
|
+
inject: [ 'getSrc', 'getViewedPreset', 'getQueryFilters', 'selectPreset', 'socket' ],
|
|
102
105
|
|
|
103
106
|
methods: {
|
|
104
107
|
|
|
108
|
+
load(){
|
|
109
|
+
const preset = this.getViewedPreset()
|
|
110
|
+
const {name, datasource} = preset
|
|
111
|
+
|
|
112
|
+
this.readyState = 2
|
|
113
|
+
this.socket.send(this.getSrc(), {
|
|
114
|
+
name,
|
|
115
|
+
views: [{
|
|
116
|
+
...this.$props,
|
|
117
|
+
type: 'PolarArea'
|
|
118
|
+
}],
|
|
119
|
+
datasource: datasource.map(_datasource => {
|
|
120
|
+
return {
|
|
121
|
+
..._datasource,
|
|
122
|
+
filters: [
|
|
123
|
+
...(_datasource.filters ?? []),
|
|
124
|
+
...(this.getQueryFilters()[_datasource.uid] ?? [])
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
.then(_ => {
|
|
130
|
+
this.value = _[this.uid]
|
|
131
|
+
})
|
|
132
|
+
.finally(_ => this.readyState = 1)
|
|
133
|
+
},
|
|
134
|
+
|
|
105
135
|
onClick(e, segments){
|
|
106
136
|
|
|
107
137
|
const clickInteractions = (this.interactions ?? []).filter(_ => _.event === 'click')
|
|
@@ -136,15 +166,27 @@ export default{
|
|
|
136
166
|
|
|
137
167
|
},
|
|
138
168
|
|
|
139
|
-
|
|
169
|
+
mounted() {
|
|
170
|
+
this.load()
|
|
171
|
+
|
|
172
|
+
this.emitter = useEmitter()
|
|
173
|
+
this.emitter.on(`${this.uid}.load`, () => {
|
|
174
|
+
this.load()
|
|
175
|
+
})
|
|
176
|
+
this.emitter.on(`dashboard.load`, () => {
|
|
177
|
+
this.load()
|
|
178
|
+
})
|
|
179
|
+
},
|
|
140
180
|
|
|
141
181
|
props: {
|
|
142
182
|
|
|
143
183
|
label: String,
|
|
144
184
|
|
|
145
|
-
value: Object,
|
|
146
|
-
|
|
147
185
|
column: String,
|
|
186
|
+
columnModifier: String,
|
|
187
|
+
|
|
188
|
+
rows: String,
|
|
189
|
+
rowsModifier: String,
|
|
148
190
|
|
|
149
191
|
datasourceUid: String,
|
|
150
192
|
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
<div class="mt-1">
|
|
95
95
|
<ListItem :items="interactions"
|
|
96
96
|
class="rounded-xl"
|
|
97
|
-
container-class="flex flex-col divide-y divide-
|
|
97
|
+
container-class="flex flex-col divide-y divide-border-50"
|
|
98
98
|
@reorder="(from, to) => { interactions.splice(to, 0, interactions.splice(from, 1)[0]); }">
|
|
99
99
|
<template v-slot="{ item, index }">
|
|
100
100
|
<div class="flex flex-row items-center gap-3 px-3">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div class="flex-1 p-6 flex flex-col">
|
|
33
33
|
|
|
34
34
|
<div v-if="items?.length > 0">
|
|
35
|
-
<div v-for="item in items" :class="
|
|
35
|
+
<div v-for="item in items" :class="appStyle.menuItem" @click="select(item)">
|
|
36
36
|
<slot name="item" :item="item">
|
|
37
37
|
<div>{{ item.name }}</div>
|
|
38
38
|
</slot>
|
|
@@ -55,7 +55,7 @@ export default{
|
|
|
55
55
|
|
|
56
56
|
emits: [ 'select' ],
|
|
57
57
|
|
|
58
|
-
inject: [ 'socket', 'toast' ],
|
|
58
|
+
inject: [ 'appStyle', 'socket', 'toast' ],
|
|
59
59
|
|
|
60
60
|
name: 'SharingModal',
|
|
61
61
|
|
|
@@ -108,9 +108,8 @@ export default{
|
|
|
108
108
|
|
|
109
109
|
<style module>
|
|
110
110
|
|
|
111
|
-
.
|
|
112
|
-
|
|
113
|
-
@apply hover:border-primary-300 hover:bg-primary-100;
|
|
111
|
+
.comp{
|
|
112
|
+
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
</style>
|
|
@@ -101,7 +101,7 @@ export default{
|
|
|
101
101
|
{ type:"Pie", name:"Pie", group:"components", import: () => import('../../configs/dashboard/pie.js'), thumbnailUrl:"/static/dashboard/pie.png" },
|
|
102
102
|
{ type:"Doughnut", name:"Doughnut", group:"components", import: () => import('../../configs/dashboard/doughnut.js'), thumbnailUrl:"/static/dashboard/doughnut.png" },
|
|
103
103
|
{ type:"PolarArea", name:"Polar Area", group:"components", import: () => import('../../configs/dashboard/polar-area.js'), thumbnailUrl:"/static/dashboard/polar-area.png" },
|
|
104
|
-
{ type:"
|
|
104
|
+
{ type:"DataTable", name:"DataTable", group:"components", import: () => import('../../configs/dashboard/data-table.js'), thumbnailUrl:"/static/dashboard/virtual-table.png" },
|
|
105
105
|
{ type:"Metric", name:"Metric", group:"components", import: () => import('../../configs/dashboard/metric.js'), thumbnailUrl:"/static/dashboard/metric.png" },
|
|
106
106
|
{ type:"BarChart", name:"Bar Chart", group:"components", import: () => import('../../configs/dashboard/bar.js'), thumbnailUrl:"/static/dashboard/bar.png" },
|
|
107
107
|
{ type:"GHeatMaps", name:"Heat Map", group:"components", import: () => import('../../configs/dashboard/gheatmaps.js'), thumbnailUrl:"/static/dashboard/gheatmaps.png" },
|
|
@@ -176,7 +176,7 @@ export default{
|
|
|
176
176
|
|
|
177
177
|
.button{
|
|
178
178
|
@apply flex flex-col gap-2 items-center rounded-xl p-3;
|
|
179
|
-
@apply hover:bg-text-50 border-[1px] border-transparent hover:border-
|
|
179
|
+
@apply hover:bg-text-50 border-[1px] border-transparent hover:border-border-200;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
|