From 1037185a6a5802a023f097d9c379c2ead9f37167 Mon Sep 17 00:00:00 2001 From: lana-k Date: Wed, 4 Nov 2020 19:13:27 +0100 Subject: [PATCH] add predefined queries --- public/queries.json | 47 +++++++ src/assets/images/info.svg | 3 + src/components/CheckBox.vue | 5 - src/components/MainMenu.vue | 130 ++++++++++++++++--- src/components/SqlTable.vue | 23 ++-- src/components/{TabContent.vue => Tab.vue} | 15 ++- src/components/Tabs.vue | 10 +- src/components/svg/delete.vue | 2 +- src/components/svg/rename.vue | 2 +- src/store/index.js | 35 +++-- src/views/MainView.vue | 30 ++++- src/views/MyQueries.vue | 144 ++++++++++++++++----- 12 files changed, 359 insertions(+), 87 deletions(-) create mode 100644 public/queries.json create mode 100644 src/assets/images/info.svg rename src/components/{TabContent.vue => Tab.vue} (93%) diff --git a/public/queries.json b/public/queries.json new file mode 100644 index 0000000..8d47aab --- /dev/null +++ b/public/queries.json @@ -0,0 +1,47 @@ +{ + "query": "select * from invoices", + "chart": { + "data": [ + { + "type": "scatter", + "mode": "lines", + "x": null, + "xsrc": "InvoiceId", + "meta": { + "columnNames": { + "x": "InvoiceId", + "y": "Total" + } + }, + "y": null, + "ysrc": "Total" + } + ], + "layout": { + "xaxis": { + "range": [ + 1, + 412 + ], + "autorange": true, + "type": "linear" + }, + "yaxis": { + "range": [ + -0.39166666666666683, + 27.241666666666667 + ], + "autorange": true, + "type": "linear" + }, + "autosize": true, + "mapbox": { + "style": "open-street-map" + } + }, + "frames": [] + }, + "name": "Invoices", + "id": "ieZfcITwDUTADwOmQlYyL", + "createdAt": "2020-11-03T14:17:49.524Z" +} \ No newline at end of file diff --git a/src/assets/images/info.svg b/src/assets/images/info.svg new file mode 100644 index 0000000..201f843 --- /dev/null +++ b/src/assets/images/info.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/CheckBox.vue b/src/components/CheckBox.vue index 9df17b9..8252d43 100644 --- a/src/components/CheckBox.vue +++ b/src/components/CheckBox.vue @@ -35,11 +35,6 @@ export default { checked: this.init } }, - watch: { - checked () { - this.$emit('change', this.checked) - } - }, methods: { onClick () { this.checked = !this.checked diff --git a/src/components/MainMenu.vue b/src/components/MainMenu.vue index 98d12d4..b8c69c7 100644 --- a/src/components/MainMenu.vue +++ b/src/components/MainMenu.vue @@ -8,21 +8,70 @@ + + + +
+ Save query + +
+
+
+ + Note: Predefined queries can't be edited. + That's why your modifications will be saved as a new query. Enter the name for it. +
+ +
+
+ + +
+