mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
Improvements to explorebar
This commit is contained in:
@ -90,6 +90,8 @@ export default {
|
||||
height: $titlebar-height;
|
||||
-webkit-app-region: drag;
|
||||
user-select: none;
|
||||
box-shadow: 0 0 1px 0px #000;
|
||||
z-index: 9999;
|
||||
|
||||
.titlebar-resizer{
|
||||
position: absolute;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-show="isSelected" class="workspace column columns">
|
||||
<DatabaseExploreBar :connection="connection" :is-selected="isSelected" />
|
||||
<WorkspaceExploreBar :connection="connection" :is-selected="isSelected" />
|
||||
<div class="workspace-tabs column">
|
||||
<pre>{{ JSON.stringify(workspace.structure, null, 3) }}</pre>
|
||||
</div>
|
||||
@ -10,12 +10,12 @@
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import Connection from '@/ipc-api/Connection';
|
||||
import DatabaseExploreBar from '@/components/DatabaseExploreBar';
|
||||
import WorkspaceExploreBar from '@/components/WorkspaceExploreBar';
|
||||
|
||||
export default {
|
||||
name: 'DatabaseWorkspace',
|
||||
name: 'Workspace',
|
||||
components: {
|
||||
DatabaseExploreBar
|
||||
WorkspaceExploreBar
|
||||
},
|
||||
props: {
|
||||
connection: Object
|
@ -30,7 +30,7 @@ import { mapActions } from 'vuex';
|
||||
import ModalAskCredentials from '@/components/ModalAskCredentials';
|
||||
|
||||
export default {
|
||||
name: 'DatabaseConnectPanel',
|
||||
name: 'WorkspaceConnectPanel',
|
||||
components: {
|
||||
ModalAskCredentials
|
||||
},
|
@ -22,26 +22,13 @@
|
||||
>exit_to_app</i>
|
||||
</span>
|
||||
</div>
|
||||
<DatabaseConnectPanel v-if="!workspace.connected" :connection="connection" />
|
||||
<WorkspaceConnectPanel v-if="!workspace.connected" :connection="connection" />
|
||||
<div class="workspace-explorebar-body">
|
||||
<div
|
||||
<WorkspaceExploreBarDatabase
|
||||
v-for="db of workspace.structure"
|
||||
:key="db.dbName"
|
||||
>
|
||||
<div class="database-name">
|
||||
<i class="material-icons md-18 mr-1">view_agenda</i>{{ db.dbName }}
|
||||
</div>
|
||||
<div class="d-block ml-4">
|
||||
<div
|
||||
v-for="table of db.tables"
|
||||
:key="table.TABLE_NAME"
|
||||
>
|
||||
<div class="table-name">
|
||||
<i class="material-icons md-18 mr-1">view_headline</i>{{ table.TABLE_NAME }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
:database="db"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -50,12 +37,14 @@
|
||||
<script>
|
||||
import { mapGetters, mapActions } from 'vuex';
|
||||
import _ from 'lodash';
|
||||
import DatabaseConnectPanel from '@/components/DatabaseConnectPanel';
|
||||
import WorkspaceConnectPanel from '@/components/WorkspaceConnectPanel';
|
||||
import WorkspaceExploreBarDatabase from '@/components/WorkspaceExploreBarDatabase';
|
||||
|
||||
export default {
|
||||
name: 'DatabaseExploreBar',
|
||||
name: 'WorkspaceExploreBar',
|
||||
components: {
|
||||
DatabaseConnectPanel
|
||||
WorkspaceConnectPanel,
|
||||
WorkspaceExploreBarDatabase
|
||||
},
|
||||
props: {
|
||||
connection: Object,
|
||||
@ -139,8 +128,6 @@ export default {
|
||||
|
||||
.workspace-explorebar{
|
||||
width: $explorebar-width;
|
||||
height: calc(100vh - #{$excluding-size});
|
||||
overflow: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
@ -151,14 +138,11 @@ export default {
|
||||
z-index: 8;
|
||||
flex: initial;
|
||||
position: relative;
|
||||
padding-top: 1.4rem;
|
||||
padding: 0;
|
||||
|
||||
.workspace-explorebar-header{
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
width: 100%;
|
||||
padding: .3rem;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: .6rem;
|
||||
@ -193,12 +177,9 @@ export default {
|
||||
|
||||
.workspace-explorebar-body{
|
||||
width: 100%;
|
||||
|
||||
.database-name,
|
||||
.table-name{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
height: calc((100vh - 30px) - #{$excluding-size});
|
||||
overflow: auto;
|
||||
padding: 0 .1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
57
src/renderer/components/WorkspaceExploreBarDatabase.vue
Normal file
57
src/renderer/components/WorkspaceExploreBarDatabase.vue
Normal file
@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<details class="accordion workspace-explorebar-database">
|
||||
<summary class="accordion-header database-name pb-0">
|
||||
<i class="icon material-icons md-18 mr-1">navigate_next</i>
|
||||
<i class="material-icons md-18 mr-1">view_agenda</i>
|
||||
<span>{{ database.dbName }}</span>
|
||||
</summary>
|
||||
<div class="accordion-body">
|
||||
<div class="database-bables">
|
||||
<ul class="menu menu-nav pt-0">
|
||||
<li
|
||||
v-for="table of database.tables"
|
||||
:key="table.TABLE_NAME"
|
||||
class="menu-item"
|
||||
>
|
||||
<a class="table-name">
|
||||
<i class="material-icons md-18 mr-1">grid_on</i>
|
||||
<span>{{ table.TABLE_NAME }}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'WorkspaceExploreBarDatabase',
|
||||
props: {
|
||||
database: Object
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.workspace-explorebar-database{
|
||||
.database-name,
|
||||
a.table-name{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: .1rem;
|
||||
cursor: pointer;
|
||||
|
||||
> span{
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
display: block;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.database-bables{
|
||||
margin-left: 1.2rem;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user