@mixd-id/web-scaffold 0.2.250801010 → 0.2.250801012
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/AccountIcon.md +16 -0
- package/docs/components/Ahref.md +35 -0
- package/docs/components/Alert.md +72 -0
- package/docs/components/ArrayList.md +39 -0
- package/docs/components/Article.md +28 -0
- package/docs/components/BarChart.md +81 -0
- package/docs/components/Block.md +23 -0
- package/docs/components/Box.md +15 -0
- package/docs/components/Button.md +68 -0
- package/docs/components/Card.md +67 -0
- package/docs/components/Carousel.md +70 -0
- package/docs/components/Cart.md +20 -0
- package/docs/components/CartIcon.md +29 -0
- package/docs/components/Chart.md +53 -0
- package/docs/components/ChartBar.md +34 -0
- package/docs/components/ChatTyping.md +21 -0
- package/docs/components/Checkbox.md +63 -0
- package/docs/components/CodeEditor.md +25 -0
- package/docs/components/CollapsiblePanel.md +41 -0
- package/docs/components/ColorPicker.md +52 -0
- package/docs/components/Confirm.md +62 -0
- package/docs/components/ContextMenu.md +76 -0
- package/docs/components/ContextMenuItem.md +29 -0
- package/docs/components/CopyToClipboard.md +43 -0
- package/docs/components/Countdown.md +47 -0
- package/docs/components/Datepicker.md +61 -0
- package/docs/components/Datetimepicker.md +57 -0
- package/docs/components/DayTimeRange.md +20 -0
- package/docs/components/Dropdown.md +65 -0
- package/docs/components/ErrorText.md +15 -0
- package/docs/components/FBLogin.md +21 -0
- package/docs/components/Flex.md +44 -0
- package/docs/components/GHeatMaps.md +16 -0
- package/docs/components/GSignIn.md +21 -0
- package/docs/components/Gmaps.md +16 -0
- package/docs/components/GmapsDirection.md +20 -0
- package/docs/components/Grid.md +36 -0
- package/docs/components/HTMLEditor.md +26 -0
- package/docs/components/IconMenu.md +20 -0
- package/docs/components/Image.md +78 -0
- package/docs/components/Link.md +33 -0
- package/docs/components/MultiDropdown.md +46 -0
- package/docs/components/Radio.md +55 -0
- package/docs/components/Slider.md +47 -0
- package/docs/components/Switch.md +43 -0
- package/docs/components/Table.md +31 -0
- package/docs/components/Tabs.md +65 -0
- package/docs/components/Text.md +30 -0
- package/docs/components/Textarea.md +66 -0
- package/docs/components/Textbox.md +97 -0
- package/docs/components/Timepicker.md +62 -0
- package/docs/components/Toast.md +59 -0
- package/docs/components/Uploader.md +51 -0
- package/docs/components/Video.md +54 -0
- package/package.json +65 -2
- package/docs/components/Dashboard.md +0 -56
- package/docs/components/Header2.md +0 -16
- package/log.txt +0 -7
- package/public/assets/dashboard/bar.png +0 -0
- package/public/assets/dashboard/doughnut.png +0 -0
- package/public/assets/dashboard/metric.png +0 -0
- package/public/assets/dashboard/pie.png +0 -0
- package/public/assets/dashboard/polar-area.png +0 -0
- package/public/assets/dashboard/virtual-table.png +0 -0
- package/public/static/dashboard/bar.png +0 -0
- package/public/static/dashboard/doughnut.png +0 -0
- package/public/static/dashboard/metric.png +0 -0
- package/public/static/dashboard/pie.png +0 -0
- package/public/static/dashboard/polar-area.png +0 -0
- package/public/static/dashboard/virtual-table.png +0 -0
- package/src/components/404.vue +0 -61
- package/src/components/AccountIcon.vue +0 -19
- package/src/components/Ahref.vue +0 -200
- package/src/components/Alert.vue +0 -257
- package/src/components/ArrayList.vue +0 -49
- package/src/components/Article.vue +0 -387
- package/src/components/Block.vue +0 -31
- package/src/components/Box.vue +0 -34
- package/src/components/Button.vue +0 -258
- package/src/components/Card.vue +0 -257
- package/src/components/Carousel.vue +0 -364
- package/src/components/Cart.vue +0 -192
- package/src/components/CartIcon.vue +0 -89
- package/src/components/Chart.vue +0 -485
- package/src/components/ChartBar.vue +0 -192
- package/src/components/ChatTyping.vue +0 -69
- package/src/components/Checkbox.vue +0 -200
- package/src/components/Checkout.vue +0 -373
- package/src/components/CheckoutDelivery.vue +0 -267
- package/src/components/CodeEditor.vue +0 -50
- package/src/components/CollapsiblePanel.vue +0 -70
- package/src/components/ColorPicker.vue +0 -165
- package/src/components/ColorPicker2.vue +0 -186
- package/src/components/ColorPicker3.vue +0 -100
- package/src/components/Confirm.vue +0 -180
- package/src/components/ContextMenu.vue +0 -265
- package/src/components/ContextMenuItem.vue +0 -53
- package/src/components/ConversationBuilder.vue +0 -161
- package/src/components/CopyToClipboard.vue +0 -34
- package/src/components/Countdown.vue +0 -264
- package/src/components/DGrid.vue +0 -21
- package/src/components/DGridItem.vue +0 -263
- package/src/components/Dashboard.vue +0 -243
- package/src/components/Dashboard2.vue +0 -118
- package/src/components/DashboardComponentSelector.vue +0 -96
- package/src/components/DashboardConfigs.vue +0 -202
- package/src/components/DataList.vue +0 -92
- package/src/components/Datepicker.vue +0 -399
- package/src/components/DayTimeRange.vue +0 -126
- package/src/components/Dropdown.vue +0 -224
- package/src/components/ErrorText.vue +0 -57
- package/src/components/FBLogin.vue +0 -194
- package/src/components/Feed.vue +0 -118
- package/src/components/Flex.vue +0 -44
- package/src/components/GHeatMaps.vue +0 -317
- package/src/components/GSignIn.vue +0 -166
- package/src/components/Gmaps.vue +0 -251
- package/src/components/GmapsDirection.vue +0 -191
- package/src/components/Grid.vue +0 -35
- package/src/components/HTMLEditor.vue +0 -588
- package/src/components/IconMenu.vue +0 -95
- package/src/components/IconMenu2.vue +0 -89
- package/src/components/IconPlus.vue +0 -89
- package/src/components/Image.vue +0 -263
- package/src/components/Image360.vue +0 -140
- package/src/components/ImageFullScreen.vue +0 -101
- package/src/components/ImagePreview.vue +0 -93
- package/src/components/ImageUploader.vue +0 -114
- package/src/components/ImportModal.vue +0 -260
- package/src/components/Link.vue +0 -95
- package/src/components/List.vue +0 -1381
- package/src/components/ListContextMenu.vue +0 -88
- package/src/components/ListItem.vue +0 -160
- package/src/components/ListPage1.vue +0 -1401
- package/src/components/ListPage1Filter.vue +0 -170
- package/src/components/ListView.vue +0 -961
- package/src/components/ListViewBarSummary.vue +0 -81
- package/src/components/ListViewLineSummary.vue +0 -75
- package/src/components/ListViewLiveBarSummary.vue +0 -52
- package/src/components/ListViewMapSummary.vue +0 -56
- package/src/components/ListViewSettings.vue +0 -514
- package/src/components/ListViewTableSummary.vue +0 -77
- package/src/components/LogViewerItem.vue +0 -116
- package/src/components/MarkdownEdit.vue +0 -128
- package/src/components/MarkdownPreview.vue +0 -102
- package/src/components/MenuItem1.vue +0 -36
- package/src/components/Modal.vue +0 -456
- package/src/components/MultiDropdown.vue +0 -124
- package/src/components/MultilineText.vue +0 -174
- package/src/components/OTPField.vue +0 -139
- package/src/components/ObjectTree.vue +0 -105
- package/src/components/PageBuilder.vue +0 -449
- package/src/components/Paragraph.vue +0 -40
- package/src/components/PresetSelectorFilterItem.vue +0 -203
- package/src/components/Radio.vue +0 -109
- package/src/components/SearchModal.vue +0 -153
- package/src/components/Slider.vue +0 -317
- package/src/components/SplitPane.vue +0 -129
- package/src/components/Svg.vue +0 -33
- package/src/components/SvgEditor.vue +0 -173
- package/src/components/Switch.vue +0 -101
- package/src/components/TabView.vue +0 -105
- package/src/components/Table.vue +0 -56
- package/src/components/TableView.vue +0 -200
- package/src/components/TableViewHead.vue +0 -159
- package/src/components/Tabs.vue +0 -131
- package/src/components/Test.vue +0 -23
- package/src/components/Testimonial.vue +0 -86
- package/src/components/Text.vue +0 -34
- package/src/components/TextBlock.vue +0 -50
- package/src/components/TextEditor.vue +0 -85
- package/src/components/TextWithTag.vue +0 -298
- package/src/components/Textarea.vue +0 -184
- package/src/components/Textbox.vue +0 -216
- package/src/components/Thumbnail.vue +0 -27
- package/src/components/Timepicker.vue +0 -125
- package/src/components/Toast.vue +0 -117
- package/src/components/TreeMenu.vue +0 -122
- package/src/components/TreeView.vue +0 -106
- package/src/components/TreeView2.vue +0 -38
- package/src/components/TreeViewItem.vue +0 -453
- package/src/components/TreeViewItem1.vue +0 -282
- package/src/components/TreeViewItem2.vue +0 -55
- package/src/components/Uploader.vue +0 -45
- package/src/components/Video.vue +0 -119
- package/src/components/VirtualGrid.vue +0 -297
- package/src/components/VirtualScroll.vue +0 -282
- package/src/components/VirtualTable.vue +0 -956
- package/src/components/YoutubeVideo.vue +0 -196
- package/src/configs/dashboard/bar.js +0 -10
- package/src/configs/dashboard/collection-1.js +0 -5
- package/src/configs/dashboard/data-table.js +0 -9
- package/src/configs/dashboard/doughnut.js +0 -7
- package/src/configs/dashboard/gheatmaps.js +0 -9
- package/src/configs/dashboard/grid-2.js +0 -34
- package/src/configs/dashboard/grid-3.js +0 -34
- package/src/configs/dashboard/grid-4.js +0 -34
- package/src/configs/dashboard/grid.js +0 -15
- package/src/configs/dashboard/metric.js +0 -10
- package/src/configs/dashboard/pie.js +0 -7
- package/src/configs/dashboard/polar-area.js +0 -7
- package/src/configs/dashboard/virtual-table.js +0 -9
- package/src/configs/icons-fa.json +0 -12
- package/src/configs/web-page-builder.js +0 -118
- package/src/defs/dashboard-preset.js +0 -22
- package/src/directives/intersect.js +0 -26
- package/src/hooks/device.js +0 -14
- package/src/index.css +0 -3
- package/src/index.js +0 -648
- package/src/middleware/http/trim-string.js +0 -20
- package/src/mixin/component.js +0 -306
- package/src/mixin/ready-state.js +0 -37
- package/src/stores/components.js +0 -36
- package/src/stores/datasource.js +0 -11
- package/src/themes/default/index.js +0 -303
- package/src/utils/dashboard.js +0 -140
- package/src/utils/event-bus.js +0 -8
- package/src/utils/helpers.cjs +0 -635
- package/src/utils/helpers.js +0 -635
- package/src/utils/helpers.mjs +0 -722
- package/src/utils/importer.js +0 -209
- package/src/utils/list.mjs +0 -1509
- package/src/utils/listpage1.js +0 -1507
- package/src/utils/listview.js +0 -1287
- package/src/utils/preset-selector.cjs +0 -1455
- package/src/utils/preset-selector.js +0 -1452
- package/src/utils/preset-selector.mjs +0 -234
- package/src/utils/queue.js +0 -63
- package/src/utils/selection.js +0 -43
- package/src/utils/web.js +0 -50
- package/src/utils/web.mjs +0 -120
- package/src/utils/wss.js +0 -296
- package/src/utils/wss.mjs +0 -285
- package/src/widgets/AhrefSetting.vue +0 -97
- package/src/widgets/ArticleSetting.vue +0 -457
- package/src/widgets/BackgroundColorSetting.vue +0 -153
- package/src/widgets/BackgroundSetting.vue +0 -132
- package/src/widgets/BlockSetting.vue +0 -49
- package/src/widgets/BorderColorSetting.vue +0 -57
- package/src/widgets/BorderSetting.vue +0 -201
- package/src/widgets/BotEditor/BotEditorActions.vue +0 -163
- package/src/widgets/BotEditor/BotEditorSettings.vue +0 -21
- package/src/widgets/BotEditor.vue +0 -248
- package/src/widgets/BoxSetting.vue +0 -53
- package/src/widgets/ButtonSetting.vue +0 -113
- package/src/widgets/CarouselSetting.vue +0 -181
- package/src/widgets/CartSetting.vue +0 -46
- package/src/widgets/CheckoutSetting.vue +0 -46
- package/src/widgets/CollapsiblePanelSetting.vue +0 -46
- package/src/widgets/ColumnSelector.vue +0 -104
- package/src/widgets/ComponentPropertyLabel.vue +0 -35
- package/src/widgets/ComponentPropertySelector.vue +0 -115
- package/src/widgets/ComponentSetting.vue +0 -2220
- package/src/widgets/ComponentSetting2.vue +0 -927
- package/src/widgets/ComponentSetting3.vue +0 -231
- package/src/widgets/ContactForm.vue +0 -193
- package/src/widgets/ContactFormSetting.vue +0 -395
- package/src/widgets/CountdownSetting.vue +0 -76
- package/src/widgets/Dashboard/BarChart.vue +0 -366
- package/src/widgets/Dashboard/BarChartSetting.vue +0 -317
- package/src/widgets/Dashboard/DataTable.vue +0 -125
- package/src/widgets/Dashboard/DataTableSetting.vue +0 -243
- package/src/widgets/Dashboard/DatasourceFilterSharing.vue +0 -93
- package/src/widgets/Dashboard/DatasourcePreview.vue +0 -93
- package/src/widgets/Dashboard/DatasourceSelector.vue +0 -122
- package/src/widgets/Dashboard/Doughnut.vue +0 -199
- package/src/widgets/Dashboard/DoughnutSetting.vue +0 -196
- package/src/widgets/Dashboard/GHeatMapsSetting.vue +0 -108
- package/src/widgets/Dashboard/InteractionEdit.vue +0 -228
- package/src/widgets/Dashboard/Metric.vue +0 -135
- package/src/widgets/Dashboard/MetricSetting.vue +0 -227
- package/src/widgets/Dashboard/Pie.vue +0 -188
- package/src/widgets/Dashboard/PieSetting.vue +0 -247
- package/src/widgets/Dashboard/PolarArea.vue +0 -201
- package/src/widgets/Dashboard/PolarAreaSetting.vue +0 -195
- package/src/widgets/Dashboard/SharingModal.vue +0 -115
- package/src/widgets/Dashboard/ViewSelector.vue +0 -183
- package/src/widgets/Dashboard/VirtualColumnEdit.vue +0 -97
- package/src/widgets/Dashboard/VirtualTableSetting.vue +0 -171
- package/src/widgets/Dashboard0.vue +0 -1856
- package/src/widgets/DataListSetting.vue +0 -102
- package/src/widgets/EffectSetting.vue +0 -94
- package/src/widgets/EmbeddedVideo.vue +0 -60
- package/src/widgets/EmbeddedVideoSetting.vue +0 -50
- package/src/widgets/FAQ.vue +0 -98
- package/src/widgets/FAQSetting.vue +0 -94
- package/src/widgets/FeatureList.vue +0 -131
- package/src/widgets/FeatureListSetting.vue +0 -233
- package/src/widgets/FiltersSetting.vue +0 -88
- package/src/widgets/FlexSetting.vue +0 -174
- package/src/widgets/GridSetting.vue +0 -165
- package/src/widgets/Header.vue +0 -15
- package/src/widgets/Header0.vue +0 -41
- package/src/widgets/Header0Setting.vue +0 -75
- package/src/widgets/Header2.vue +0 -65
- package/src/widgets/Header2Setting.vue +0 -193
- package/src/widgets/HeaderSetting.vue +0 -102
- package/src/widgets/IconList.vue +0 -51
- package/src/widgets/IconListSetting.vue +0 -188
- package/src/widgets/ImageSetting.vue +0 -119
- package/src/widgets/LayoutSetting.vue +0 -251
- package/src/widgets/LinkSetting.vue +0 -209
- package/src/widgets/LinkSettingModal.vue +0 -173
- package/src/widgets/LogViewer.vue +0 -85
- package/src/widgets/MarginPaddingSetting.vue +0 -58
- package/src/widgets/MarginSetting.vue +0 -142
- package/src/widgets/MenuEditor.vue +0 -256
- package/src/widgets/MenuItem1Setting.vue +0 -78
- package/src/widgets/ModalSetting.vue +0 -94
- package/src/widgets/MultiValueSetting.vue +0 -121
- package/src/widgets/MultiValueSetting2.vue +0 -147
- package/src/widgets/OGSettingModal.vue +0 -103
- package/src/widgets/PaddingSetting.vue +0 -142
- package/src/widgets/ParagraphSetting.vue +0 -89
- package/src/widgets/PositionSetting.vue +0 -209
- package/src/widgets/PresetBar.vue +0 -990
- package/src/widgets/PresetBarPivot.vue +0 -198
- package/src/widgets/PresetBarPivotColumnEdit.vue +0 -197
- package/src/widgets/PresetSelector.vue +0 -685
- package/src/widgets/Review.vue +0 -131
- package/src/widgets/ReviewSetting.vue +0 -201
- package/src/widgets/SearchModalSetting.vue +0 -70
- package/src/widgets/Share.vue +0 -164
- package/src/widgets/ShareSetting.vue +0 -99
- package/src/widgets/SizingSetting.vue +0 -306
- package/src/widgets/SpacingSetting.vue +0 -77
- package/src/widgets/StyleSetting.vue +0 -543
- package/src/widgets/StyleSetting2.vue +0 -90
- package/src/widgets/SvgSetting.vue +0 -133
- package/src/widgets/TableSetting.vue +0 -172
- package/src/widgets/TestimonialSetting.vue +0 -161
- package/src/widgets/TextBlockSetting.vue +0 -81
- package/src/widgets/ThumbnailSetting.vue +0 -49
- package/src/widgets/TransitionSetting.vue +0 -64
- package/src/widgets/TypographySetting.vue +0 -334
- package/src/widgets/UserActionBuilder/UserActionCondition.vue +0 -99
- package/src/widgets/UserActionBuilder/UserActionConsole.vue +0 -97
- package/src/widgets/UserActionBuilder/UserActionItem.vue +0 -273
- package/src/widgets/UserActionBuilder/UserActionOutput.vue +0 -152
- package/src/widgets/UserActionBuilder/UserActionOutputDelay.vue +0 -27
- package/src/widgets/UserActionBuilder/UserActionOutputLog.vue +0 -28
- package/src/widgets/UserActionBuilder/UserActionOutputReply.vue +0 -112
- package/src/widgets/UserActionBuilder/UserActionProps.vue +0 -213
- package/src/widgets/UserActionBuilder.vue +0 -314
- package/src/widgets/WebComponentSelector.vue +0 -205
- package/src/widgets/WebDatasourceSelector.vue +0 -153
- package/src/widgets/WebLayoutSelector.vue +0 -147
- package/src/widgets/WebPageBuilder.vue +0 -2161
- package/src/widgets/WebPageBuilder2.vue +0 -1091
- package/src/widgets/WebPageBuilder3.vue +0 -411
- package/src/widgets/WebPageBuilder4/BackgroundColorSetting.vue +0 -54
- package/src/widgets/WebPageBuilder4/BackgroundPositionSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/BackgroundRepeatSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BackgroundSizeSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BlurSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BorderColorSetting.vue +0 -64
- package/src/widgets/WebPageBuilder4/BorderRadiusSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/BorderSizeSetting.vue +0 -69
- package/src/widgets/WebPageBuilder4/BorderStyleSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/BoxShadowSetting.vue +0 -73
- package/src/widgets/WebPageBuilder4/ButtonSetting.vue +0 -65
- package/src/widgets/WebPageBuilder4/CarouselSetting.vue +0 -178
- package/src/widgets/WebPageBuilder4/DisplaySetting.vue +0 -76
- package/src/widgets/WebPageBuilder4/FlexAlignSetting.vue +0 -71
- package/src/widgets/WebPageBuilder4/FlexDirectionSetting.vue +0 -70
- package/src/widgets/WebPageBuilder4/FlexJustifySetting.vue +0 -74
- package/src/widgets/WebPageBuilder4/FlexPropertySetting.vue +0 -71
- package/src/widgets/WebPageBuilder4/FlexSetting.vue +0 -96
- package/src/widgets/WebPageBuilder4/FlexWrapSetting.vue +0 -69
- package/src/widgets/WebPageBuilder4/GapSetting.vue +0 -75
- package/src/widgets/WebPageBuilder4/GrayscaleSetting.vue +0 -68
- package/src/widgets/WebPageBuilder4/GridSetting.vue +0 -216
- package/src/widgets/WebPageBuilder4/HeightSetting.vue +0 -98
- package/src/widgets/WebPageBuilder4/ImageSetting.vue +0 -102
- package/src/widgets/WebPageBuilder4/MarginSetting.vue +0 -73
- package/src/widgets/WebPageBuilder4/MaxHeightSetting.vue +0 -82
- package/src/widgets/WebPageBuilder4/MaxWidthSetting.vue +0 -90
- package/src/widgets/WebPageBuilder4/MinHeightSetting.vue +0 -81
- package/src/widgets/WebPageBuilder4/MinWidthSetting.vue +0 -101
- package/src/widgets/WebPageBuilder4/MultiValueSetting.vue +0 -163
- package/src/widgets/WebPageBuilder4/OpacitySetting.vue +0 -77
- package/src/widgets/WebPageBuilder4/OverflowSetting.vue +0 -81
- package/src/widgets/WebPageBuilder4/PaddingSetting.vue +0 -57
- package/src/widgets/WebPageBuilder4/PositionSetting.vue +0 -191
- package/src/widgets/WebPageBuilder4/PropertySetting.vue +0 -176
- package/src/widgets/WebPageBuilder4/TextSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4/TreeView.vue +0 -46
- package/src/widgets/WebPageBuilder4/TreeViewItem.vue +0 -303
- package/src/widgets/WebPageBuilder4/WebPageComponentSelector.vue +0 -141
- package/src/widgets/WebPageBuilder4/WebPagePropertySelector.vue +0 -172
- package/src/widgets/WebPageBuilder4/WidthSetting.vue +0 -105
- package/src/widgets/WebPageBuilder4/ZIndexSetting.vue +0 -72
- package/src/widgets/WebPageBuilder4.vue +0 -798
- package/src/widgets/WebPagePreview.vue +0 -295
- package/src/widgets/WebPageSelector.vue +0 -173
- package/src/widgets/WebTemplateCreator.vue +0 -156
- package/src/widgets/YoutubeVideoSetting.vue +0 -68
- package/tailwind.config.js +0 -481
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="$style.comp">
|
|
3
|
-
<VirtualTable class="flex-1"
|
|
4
|
-
:columns="datasourceColumns"
|
|
5
|
-
@scroll-end="loadNext"
|
|
6
|
-
:items="items">
|
|
7
|
-
|
|
8
|
-
</VirtualTable>
|
|
9
|
-
</div>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script>
|
|
13
|
-
import {useEmitter} from "../../utils/event-bus";
|
|
14
|
-
import VirtualTable from "../../components/VirtualTable.vue";
|
|
15
|
-
|
|
16
|
-
export default{
|
|
17
|
-
components: {VirtualTable},
|
|
18
|
-
|
|
19
|
-
data(){
|
|
20
|
-
return {
|
|
21
|
-
value: null,
|
|
22
|
-
readyState: 1,
|
|
23
|
-
items: null,
|
|
24
|
-
hasNext: false
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
inject: [ 'getSrc', 'getViewedPreset', 'getQueryFilters', 'socket' ],
|
|
29
|
-
|
|
30
|
-
methods: {
|
|
31
|
-
|
|
32
|
-
load(){
|
|
33
|
-
const preset = this.getViewedPreset()
|
|
34
|
-
const {name, datasource} = preset
|
|
35
|
-
|
|
36
|
-
this.readyState = 2
|
|
37
|
-
this.socket.send(this.getSrc(), {
|
|
38
|
-
name,
|
|
39
|
-
views: [{
|
|
40
|
-
...this.$props,
|
|
41
|
-
type: 'DataTable'
|
|
42
|
-
}],
|
|
43
|
-
datasource: datasource.map(_datasource => {
|
|
44
|
-
return {
|
|
45
|
-
..._datasource,
|
|
46
|
-
filters: [
|
|
47
|
-
...(_datasource.filters ?? []),
|
|
48
|
-
...(this.getQueryFilters()[_datasource.uid] ?? [])
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
})
|
|
53
|
-
.then(_ => {
|
|
54
|
-
const { items, hasNext } = _[this.uid] ?? {}
|
|
55
|
-
this.items = items
|
|
56
|
-
this.hasNext = hasNext
|
|
57
|
-
})
|
|
58
|
-
.finally(_ => this.readyState = 1)
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
loadNext(){
|
|
62
|
-
if(!this.hasNext) return
|
|
63
|
-
|
|
64
|
-
const preset = this.getViewedPreset()
|
|
65
|
-
const {name, datasource} = preset
|
|
66
|
-
const afterItem = this.items[this.items.length - 1]
|
|
67
|
-
|
|
68
|
-
this.socket.send(this.getSrc(), {
|
|
69
|
-
name,
|
|
70
|
-
views: [{
|
|
71
|
-
...this.$props,
|
|
72
|
-
type: 'DataTable',
|
|
73
|
-
afterItem
|
|
74
|
-
}],
|
|
75
|
-
datasource: datasource.map(_datasource => {
|
|
76
|
-
return {
|
|
77
|
-
..._datasource,
|
|
78
|
-
filters: [
|
|
79
|
-
...(_datasource.filters ?? []),
|
|
80
|
-
...(this.getQueryFilters()[_datasource.uid] ?? [])
|
|
81
|
-
]
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
.then(_ => {
|
|
86
|
-
const { items, hasNext } = _[this.uid] ?? {}
|
|
87
|
-
this.items.push(...items)
|
|
88
|
-
this.hasNext = hasNext
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
mounted() {
|
|
95
|
-
this.load()
|
|
96
|
-
|
|
97
|
-
this.emitter = useEmitter()
|
|
98
|
-
this.emitter.on(`${this.uid}.load`, () => {
|
|
99
|
-
this.load()
|
|
100
|
-
})
|
|
101
|
-
this.emitter.on(`dashboard.load`, () => {
|
|
102
|
-
this.load()
|
|
103
|
-
})
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
props: {
|
|
107
|
-
|
|
108
|
-
datasourceColumns: Array,
|
|
109
|
-
datasourceUid: String,
|
|
110
|
-
label: String,
|
|
111
|
-
uid: String,
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
</script>
|
|
118
|
-
|
|
119
|
-
<style module>
|
|
120
|
-
|
|
121
|
-
.comp{
|
|
122
|
-
@apply min-h-[50vh] flex flex-col;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
</style>
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :class="$style.comp">
|
|
3
|
-
|
|
4
|
-
<div class="flex justify-center border-b-[1px] border-border-50" v-if="tabItems.length > 1">
|
|
5
|
-
<Tabs :items="tabItems" v-model="value.tabIndex" />
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
<div class="flex-1 overflow-y-auto flex flex-col">
|
|
9
|
-
<div v-if="value.tabIndex === 1" class="flex-1 flex flex-col gap-5 p-6">
|
|
10
|
-
|
|
11
|
-
<div class="flex flex-row items-center ">
|
|
12
|
-
<label class="flex-1">Active</label>
|
|
13
|
-
<Switch v-model="value.props.enabled" :readonly="readonly" />
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<div class="flex flex-col gap-1">
|
|
17
|
-
<label class="text-text-400">Label</label>
|
|
18
|
-
<Textbox v-model="value.props.label" maxlength="50" placeholder="Label" :readonly="readonly" />
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<div class="flex flex-row items-center">
|
|
22
|
-
<label class="flex-1">Datasource</label>
|
|
23
|
-
<div>
|
|
24
|
-
<Dropdown class="min-w-[150px]"
|
|
25
|
-
:readonly="readonly"
|
|
26
|
-
v-model="value.props.datasourceUid">
|
|
27
|
-
<option v-for="_datasource in datasource"
|
|
28
|
-
:value="_datasource.uid">
|
|
29
|
-
{{ _datasource.name }}
|
|
30
|
-
</option>
|
|
31
|
-
</Dropdown>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<div v-else-if="value.tabIndex === 2" class="flex-1 flex flex-col gap-5 p-6">
|
|
38
|
-
|
|
39
|
-
<div>
|
|
40
|
-
<Textbox placeholder="Search..." v-model="search">
|
|
41
|
-
<template #start>
|
|
42
|
-
<div class="pl-3">
|
|
43
|
-
<svg width="14" height="14" class="fill-text-300" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"/></svg>
|
|
44
|
-
</div>
|
|
45
|
-
</template>
|
|
46
|
-
</Textbox>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<VirtualGrid class="flex-1 border-[1px] border-border-50 rounded-xl"
|
|
50
|
-
container-class="divide-y divide-border-50"
|
|
51
|
-
:items="columns">
|
|
52
|
-
<template #item="{ item }">
|
|
53
|
-
<div class="flex-1 flex flex-row gap-2 items-center p-1 px-3 group">
|
|
54
|
-
<div>
|
|
55
|
-
<Checkbox v-model="item.visible"
|
|
56
|
-
default="true"
|
|
57
|
-
:disabled="readonly"
|
|
58
|
-
@change="$emit('change')" />
|
|
59
|
-
</div>
|
|
60
|
-
<Textbox v-model="item.label2" :placeholder="item.label" :readonly="readonly"
|
|
61
|
-
class="flex-1 border-none bg-transparent" :class="$style.columnTextbox"
|
|
62
|
-
item-class="p-1 px-0" />
|
|
63
|
-
<div class="hidden flex-col justify-center group-hover:flex">
|
|
64
|
-
<button type="button" @click="moveUp(item)">
|
|
65
|
-
<svg width="11" height="11" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M9.39 265.4l127.1-128C143.6 131.1 151.8 128 160 128s16.38 3.125 22.63 9.375l127.1 128c9.156 9.156 11.9 22.91 6.943 34.88S300.9 320 287.1 320H32.01c-12.94 0-24.62-7.781-29.58-19.75S.2333 274.5 9.39 265.4z"/></svg>
|
|
66
|
-
</button>
|
|
67
|
-
<button type="button" @click="moveDown(item)">
|
|
68
|
-
<svg width="11" height="11" class="fill-text-300 hover:fill-primary" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 246.6l-127.1 128C176.4 380.9 168.2 384 160 384s-16.38-3.125-22.63-9.375l-127.1-128C.2244 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75S319.8 237.5 310.6 246.6z"/></svg>
|
|
69
|
-
</button>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
</template>
|
|
73
|
-
</VirtualGrid>
|
|
74
|
-
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<div v-else-if="value.tabIndex === 3" class="flex-1 flex flex-col gap-5 p-6">
|
|
78
|
-
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
</div>
|
|
84
|
-
</template>
|
|
85
|
-
|
|
86
|
-
<script>
|
|
87
|
-
|
|
88
|
-
import WebPagePropertySelector from "../WebPageBuilder4/WebPagePropertySelector.vue";
|
|
89
|
-
import {defineAsyncComponent} from "vue";
|
|
90
|
-
import InteractionEdit from "./InteractionEdit.vue";
|
|
91
|
-
|
|
92
|
-
export default{
|
|
93
|
-
components: {
|
|
94
|
-
InteractionEdit,
|
|
95
|
-
HeightSetting: defineAsyncComponent(() => import('../WebPageBuilder4/HeightSetting.vue')),
|
|
96
|
-
WebPagePropertySelector
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
computed: {
|
|
100
|
-
|
|
101
|
-
interactions(){
|
|
102
|
-
if(!Array.isArray(this.value.props.interactions))
|
|
103
|
-
this.value.props.interactions = []
|
|
104
|
-
return this.value.props.interactions
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
selectedDatasource(){
|
|
108
|
-
return this.datasource.find(d => d.uid === this.value.props.datasourceUid)
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
definedProperties(){
|
|
112
|
-
const settings = []
|
|
113
|
-
|
|
114
|
-
for(let key in this.properties){
|
|
115
|
-
if(key in this.value.props){
|
|
116
|
-
settings.push(this.properties[key])
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return settings
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
tabItems(){
|
|
124
|
-
return [
|
|
125
|
-
{ text:'General', value:1 },
|
|
126
|
-
this.value.props.datasourceUid ? { text:'Columns', value:2 } : null,
|
|
127
|
-
this.value.props.datasourceUid ? { text:'Filters', value:3 } : null,
|
|
128
|
-
this.value.props.datasourceUid ? { text:'Sorts', value:4 } : null,
|
|
129
|
-
this.value.props.datasourceUid ? { text:'Pivot', value:5 } : null,
|
|
130
|
-
]
|
|
131
|
-
.filter(_ => _)
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
columns(){
|
|
135
|
-
const searches = this.search.toLowerCase().split(' ').filter(_ => _.length > 2)
|
|
136
|
-
return (this.value.props.datasourceColumns ?? []).filter(_ => {
|
|
137
|
-
return !_.key.startsWith('_') &&
|
|
138
|
-
(searches.length < 1 || searches.every(search => _.label.toLowerCase().includes(search)))
|
|
139
|
-
})
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
data(){
|
|
145
|
-
return {
|
|
146
|
-
properties: {
|
|
147
|
-
'height': { component:"HeightSetting", text:'Height', group:'Layout' }
|
|
148
|
-
},
|
|
149
|
-
search: ''
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
|
|
153
|
-
emits: [ 'change' ],
|
|
154
|
-
|
|
155
|
-
inject: [ 'uploadImage', 'viewTypes' ],
|
|
156
|
-
|
|
157
|
-
props: {
|
|
158
|
-
|
|
159
|
-
datasource: Object,
|
|
160
|
-
|
|
161
|
-
index: Number,
|
|
162
|
-
|
|
163
|
-
readonly: [ Boolean, Number ],
|
|
164
|
-
|
|
165
|
-
value: {
|
|
166
|
-
type: Object,
|
|
167
|
-
required: true
|
|
168
|
-
},
|
|
169
|
-
|
|
170
|
-
viewType: String,
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
methods: {
|
|
175
|
-
|
|
176
|
-
addInteraction(obj){
|
|
177
|
-
this.$util.push(this.interactions, obj)
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
applyDefault(){
|
|
181
|
-
if(!this.value.props.datasourceUid && this.datasource?.length === 1){
|
|
182
|
-
this.value.props.datasourceUid = this.datasource[0].uid
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
if(!this.value.tabIndex)
|
|
186
|
-
this.value.tabIndex = 1
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
generateColumns(){
|
|
190
|
-
this.value.props.datasourceColumns = (this.selectedDatasource.pivot?.enabled ?
|
|
191
|
-
this.selectedDatasource.pivot.columns :
|
|
192
|
-
this.selectedDatasource.columns)
|
|
193
|
-
.map((_, __) => ({
|
|
194
|
-
..._,
|
|
195
|
-
visible: __ < 10
|
|
196
|
-
}))
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
moveDown(item){
|
|
200
|
-
const index = this.value.props.datasourceColumns.indexOf(item)
|
|
201
|
-
if(index + 1 < this.value.props.datasourceColumns.length){
|
|
202
|
-
this.value.props.datasourceColumns.splice(index + 1, 0, this.value.props.datasourceColumns.splice(index, 1)[0])
|
|
203
|
-
this.$emit('change')
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
moveUp(item){
|
|
208
|
-
const index = this.value.props.datasourceColumns.indexOf(item)
|
|
209
|
-
if(index - 1 >= 0){
|
|
210
|
-
this.value.props.datasourceColumns.splice(index - 1, 0, this.value.props.datasourceColumns.splice(index, 1)[0])
|
|
211
|
-
this.$emit('change')
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
},
|
|
217
|
-
|
|
218
|
-
mounted() {
|
|
219
|
-
this.applyDefault()
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
watch: {
|
|
223
|
-
|
|
224
|
-
'value.props.datasourceUid'(to){
|
|
225
|
-
if(to){
|
|
226
|
-
this.generateColumns()
|
|
227
|
-
this.$emit('change')
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
</script>
|
|
236
|
-
|
|
237
|
-
<style module>
|
|
238
|
-
|
|
239
|
-
.comp{
|
|
240
|
-
@apply flex-1 flex flex-col;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
</style>
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Modal ref="modal"
|
|
3
|
-
width="330"
|
|
4
|
-
height="360">
|
|
5
|
-
<template v-slot:head>
|
|
6
|
-
<div class="relative p-6">
|
|
7
|
-
<h3>Assign This Filter For</h3>
|
|
8
|
-
<div class="absolute top-0 right-0 p-2">
|
|
9
|
-
<button type="button" class="p-2" @click="close">
|
|
10
|
-
<svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
11
|
-
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
12
|
-
</svg>
|
|
13
|
-
</button>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
<template v-slot:foot>
|
|
18
|
-
<div class="p-6" v-if="items?.length > 0 && !readonly">
|
|
19
|
-
<Button class="w-[80px]" @click="apply">OK</Button>
|
|
20
|
-
</div>
|
|
21
|
-
</template>
|
|
22
|
-
<div class="flex-1 p-6 flex">
|
|
23
|
-
|
|
24
|
-
<div v-if="items?.length > 0" class="flex flex-col gap-3">
|
|
25
|
-
<div v-for="item in items">
|
|
26
|
-
<Checkbox v-model="instance" :value="item.id" :disabled="readonly">
|
|
27
|
-
{{ item.name }}
|
|
28
|
-
</Checkbox>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
|
|
32
|
-
<div v-else class="flex-1 flex items-center justify-center">
|
|
33
|
-
<label class="text-text-300">No users shared</label>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
</div>
|
|
37
|
-
</Modal>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
|
|
42
|
-
export default{
|
|
43
|
-
|
|
44
|
-
inject: [ 'socketEmit2' ],
|
|
45
|
-
|
|
46
|
-
props: {
|
|
47
|
-
items: Array,
|
|
48
|
-
readonly: [ Number, Boolean ],
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
computed: {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
data(){
|
|
57
|
-
return {
|
|
58
|
-
instance: null,
|
|
59
|
-
callback: null
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
methods: {
|
|
64
|
-
|
|
65
|
-
apply(){
|
|
66
|
-
const instance = this.instance.map(_ => this.items.find(__ => __.id === _))
|
|
67
|
-
this.callback(instance)
|
|
68
|
-
this.close()
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
open(instance = [], callback){
|
|
72
|
-
this.instance = instance.map(_ => _.id)
|
|
73
|
-
this.callback = callback
|
|
74
|
-
this.$refs.modal.open()
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
close(){
|
|
78
|
-
this.$refs.modal.close()
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
</script>
|
|
86
|
-
|
|
87
|
-
<style module>
|
|
88
|
-
|
|
89
|
-
.comp{
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
</style>
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Modal ref="modal"
|
|
3
|
-
dismissable="true"
|
|
4
|
-
width="480"
|
|
5
|
-
height="600"
|
|
6
|
-
@dismiss="close">
|
|
7
|
-
<template v-slot:head>
|
|
8
|
-
<div class="relative p-6">
|
|
9
|
-
<h3>Data Preview</h3>
|
|
10
|
-
<div class="absolute top-0 right-0 p-2">
|
|
11
|
-
<button type="button" class="p-2" @click="close">
|
|
12
|
-
<svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
13
|
-
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
14
|
-
</svg>
|
|
15
|
-
</button>
|
|
16
|
-
</div>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
<div class="flex-1 p-6 flex flex-col">
|
|
20
|
-
|
|
21
|
-
<VirtualTable class="flex-1" :columns="columns" :items="items" />
|
|
22
|
-
|
|
23
|
-
</div>
|
|
24
|
-
</Modal>
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<script>
|
|
28
|
-
|
|
29
|
-
export default{
|
|
30
|
-
|
|
31
|
-
inject: [ 'alert', 'preview', 'socket' ],
|
|
32
|
-
|
|
33
|
-
props: {
|
|
34
|
-
src: String
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
computed: {
|
|
38
|
-
|
|
39
|
-
items(){
|
|
40
|
-
if(!this.res?.items || this.res.items.length < 1) return []
|
|
41
|
-
|
|
42
|
-
return Object.keys(this.res.items[0]).map(key => {
|
|
43
|
-
return {
|
|
44
|
-
key,
|
|
45
|
-
value: this.res.items[0][key]
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
data(){
|
|
53
|
-
return {
|
|
54
|
-
datasource: null,
|
|
55
|
-
res: null,
|
|
56
|
-
columns: [
|
|
57
|
-
{ key:"key", label:"Column", width:150 },
|
|
58
|
-
{ key:"value", label:"Sample", width:300 },
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
methods: {
|
|
64
|
-
|
|
65
|
-
close(){
|
|
66
|
-
this.$refs.modal.close()
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
load(){
|
|
70
|
-
this.preview(this.datasource)
|
|
71
|
-
.then(res => this.res = res)
|
|
72
|
-
.catch(err => this.alert(err))
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
open(datasource){
|
|
76
|
-
this.datasource = datasource
|
|
77
|
-
this.$refs.modal.open()
|
|
78
|
-
this.load()
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
</script>
|
|
86
|
-
|
|
87
|
-
<style module>
|
|
88
|
-
|
|
89
|
-
.comp{
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
</style>
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Modal ref="modal"
|
|
3
|
-
width="360"
|
|
4
|
-
height="420">
|
|
5
|
-
<template v-slot:head>
|
|
6
|
-
<div class="relative p-6 pb-0">
|
|
7
|
-
<h3>{{ $t('Select Datasource') }}</h3>
|
|
8
|
-
<div class="absolute top-0 right-0 p-2">
|
|
9
|
-
<button type="button" class="p-2" @click="close">
|
|
10
|
-
<svg width="24" height="24" viewBox="0 0 24 24" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg">
|
|
11
|
-
<path d="M6.53034 5.46965C6.23745 5.17676 5.76257 5.17676 5.46968 5.46965C5.17679 5.76255 5.17679 6.23742 5.46968 6.53031L10.9393 12L5.46967 17.4697C5.17678 17.7626 5.17678 18.2374 5.46967 18.5303C5.76256 18.8232 6.23744 18.8232 6.53033 18.5303L12 13.0606L17.4697 18.5303C17.7626 18.8232 18.2375 18.8232 18.5303 18.5303C18.8232 18.2374 18.8232 17.7626 18.5303 17.4697L13.0607 12L18.5303 6.53032C18.8232 6.23743 18.8232 5.76256 18.5303 5.46966C18.2374 5.17677 17.7626 5.17677 17.4697 5.46966L12 10.9393L6.53034 5.46965Z"/>
|
|
12
|
-
</svg>
|
|
13
|
-
</button>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
<template v-slot:foot>
|
|
18
|
-
<div class="p-6 flex justify-center border-t-[1px] border-border-50">
|
|
19
|
-
<router-link :to="listSrc" target="_blank" class="text-primary flex flex-row items-center">
|
|
20
|
-
Datasource Manager
|
|
21
|
-
<svg class="inline ml-2 fill-primary" width="11" height="11" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M392 320c-13.25 0-24 10.75-24 24v112c0 4.406-3.594 8-8 8h-304c-4.406 0-8-3.594-8-8v-304c0-4.406 3.594-8 8-8h112C181.3 144 192 133.3 192 120S181.3 96 168 96h-112C25.13 96 0 121.1 0 152v304C0 486.9 25.13 512 56 512h304c30.88 0 56-25.12 56-56v-112C416 330.8 405.3 320 392 320zM488 0H320c-13.25 0-24 10.75-24 24S306.8 48 320 48h110.1L183 295c-9.375 9.375-9.375 24.56 0 33.94C187.7 333.7 193.8 336 200 336s12.28-2.344 16.97-7.031L464 81.94V192c0 13.25 10.75 24 24 24S512 205.3 512 192V24C512 10.75 501.3 0 488 0z"/></svg>
|
|
22
|
-
</router-link>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
25
|
-
<div class="flex-1 p-6 flex">
|
|
26
|
-
|
|
27
|
-
<div v-if="datasources?.length > 0" class="flex-1 flex flex-col">
|
|
28
|
-
<div v-for="(datasource, idx) in sortedDatasource"
|
|
29
|
-
type="button"
|
|
30
|
-
:class="dashboardStyle.button"
|
|
31
|
-
class="flex flex-row items-start gap-2">
|
|
32
|
-
<button type="button" class="flex-1 text-left" @click="add(datasource)">{{ datasource.name }}</button>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div v-else class="flex-1 flex items-center justify-center">
|
|
37
|
-
<div>
|
|
38
|
-
<label class="text-text-300">No datasource</label>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
|
|
42
|
-
</div>
|
|
43
|
-
</Modal>
|
|
44
|
-
</template>
|
|
45
|
-
|
|
46
|
-
<script>
|
|
47
|
-
|
|
48
|
-
import Modal from "../../components/Modal.vue"
|
|
49
|
-
|
|
50
|
-
export default{
|
|
51
|
-
|
|
52
|
-
components: { Modal },
|
|
53
|
-
|
|
54
|
-
emits: [ 'add' ],
|
|
55
|
-
|
|
56
|
-
inject: [ 'alert', 'appStyle', 'confirm', 'dashboardStyle', 'socket' ],
|
|
57
|
-
|
|
58
|
-
props: {
|
|
59
|
-
|
|
60
|
-
listSrc: String,
|
|
61
|
-
|
|
62
|
-
src: String,
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
computed: {
|
|
67
|
-
|
|
68
|
-
sortedDatasource(){
|
|
69
|
-
return (this.datasources ?? []).sort((a, b) => a.name.localeCompare(b.name))
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
data(){
|
|
75
|
-
return {
|
|
76
|
-
instance: null,
|
|
77
|
-
datasources: null,
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
methods: {
|
|
82
|
-
|
|
83
|
-
add(item){
|
|
84
|
-
const newItem = JSON.parse(JSON.stringify(item))
|
|
85
|
-
this.close()
|
|
86
|
-
this.$emit('add', newItem)
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
load(){
|
|
90
|
-
this.socket.send(this.src, {})
|
|
91
|
-
.then(res => this.datasources = res.items)
|
|
92
|
-
.catch(err => this.alert(err))
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
open(){
|
|
96
|
-
this.load()
|
|
97
|
-
this.$refs.modal.open()
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
remove(datasource){
|
|
101
|
-
this.confirm(this.$t('Are you sure you want to remove this datasource?'), () => {
|
|
102
|
-
this.socket.send(this.removeSrc, { id: datasource.id })
|
|
103
|
-
.then(() => {
|
|
104
|
-
this.datasources = this.datasources.filter(item => item.id !== datasource.id)
|
|
105
|
-
})
|
|
106
|
-
.catch(err => this.alert(err))
|
|
107
|
-
})
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
close(){
|
|
111
|
-
this.$refs.modal.close()
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
</script>
|
|
119
|
-
|
|
120
|
-
<style module>
|
|
121
|
-
|
|
122
|
-
</style>
|