mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-06 18:18:53 +08:00
add start guid
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
<button
|
<button
|
||||||
v-if="$store.state.tabs.length > 0"
|
v-if="$store.state.tabs.length > 0"
|
||||||
class="primary"
|
class="primary"
|
||||||
:disabled="!$store.state.currentTab.isUnsaved"
|
:disabled="$store.state.currentTab && !$store.state.currentTab.isUnsaved"
|
||||||
@click="saveQuery"
|
@click="saveQuery"
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
@@ -23,6 +23,9 @@ import { nanoid } from 'nanoid'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MainMenu',
|
name: 'MainMenu',
|
||||||
|
created () {
|
||||||
|
this.$root.$on('createNewQuery', this.createNewQuery)
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
createNewQuery () {
|
createNewQuery () {
|
||||||
const tab = {
|
const tab = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div id="tabs-container">
|
||||||
<div id="tabs__header">
|
<div id="tabs__header" v-if="tabs.length > 0">
|
||||||
<div
|
<div
|
||||||
v-for="(tab, index) in tabs"
|
v-for="(tab, index) in tabs"
|
||||||
:key="tab.id"
|
:key="tab.id"
|
||||||
@@ -36,6 +36,11 @@
|
|||||||
:init-name="tab.name"
|
:init-name="tab.name"
|
||||||
:tab-index="index"
|
:tab-index="index"
|
||||||
/>
|
/>
|
||||||
|
<div v-if="tabs.length === 0" id="start-guid">
|
||||||
|
<span class="link" @click="$root.$emit('createNewQuery')">Create</span>
|
||||||
|
a new query from scratch or open the one from
|
||||||
|
<router-link class="link" to="/my-queries">My queries</router-link>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -70,6 +75,10 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
#tabs-container {
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
#tabs__header {
|
#tabs__header {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -129,4 +138,18 @@ export default {
|
|||||||
fill: var(--color-text-base);
|
fill: var(--color-text-base);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
#start-guid {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
color: var(--color-text-base);
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.link {
|
||||||
|
color: var(--color-accent);
|
||||||
|
text-decoration: none;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
:before="{ size: 20, max: 30 }"
|
:before="{ size: 20, max: 30 }"
|
||||||
:after="{ size: 80, max: 100 }"
|
:after="{ size: 80, max: 100 }"
|
||||||
>
|
>
|
||||||
<div slot="left-pane">
|
<template #left-pane>
|
||||||
<schema />
|
<schema />
|
||||||
</div>
|
</template>
|
||||||
<div slot="right-pane">
|
<template #right-pane>
|
||||||
<tabs />
|
<tabs />
|
||||||
</div>
|
</template>
|
||||||
</splitpanes>
|
</splitpanes>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user