mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 15:33:57 +00:00
new query button
This commit is contained in:
@@ -28,15 +28,6 @@
|
|||||||
|
|
||||||
$: currentThemeType = $currentThemeDefinition?.themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light';
|
$: currentThemeType = $currentThemeDefinition?.themeType == 'dark' ? 'theme-type-dark' : 'theme-type-light';
|
||||||
|
|
||||||
let domTabs;
|
|
||||||
|
|
||||||
function handleTabsWheel(e) {
|
|
||||||
if (!e.shiftKey) {
|
|
||||||
e.preventDefault();
|
|
||||||
domTabs.scrollBy({ top: 0, left: e.deltaY < 0 ? -150 : 150, behavior: 'smooth' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$: themeStyle = `<style id="themePlugin">${$currentThemeDefinition?.themeCss}</style>`;
|
$: themeStyle = `<style id="themePlugin">${$currentThemeDefinition?.themeCss}</style>`;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -67,7 +58,7 @@
|
|||||||
<WidgetContainer />
|
<WidgetContainer />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="tabs" on:wheel={handleTabsWheel} bind:this={domTabs}>
|
<div class="tabs">
|
||||||
<TabsPanel />
|
<TabsPanel />
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -134,7 +125,6 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
.tabs {
|
.tabs {
|
||||||
display: flex;
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: var(--dim-header-top);
|
top: var(--dim-header-top);
|
||||||
left: var(--dim-content-left);
|
left: var(--dim-content-left);
|
||||||
@@ -142,8 +132,6 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
background-color: var(--theme-bg-1);
|
background-color: var(--theme-bg-1);
|
||||||
border-top: 1px solid var(--theme-border);
|
border-top: 1px solid var(--theme-border);
|
||||||
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
}
|
||||||
.tabs::-webkit-scrollbar {
|
.tabs::-webkit-scrollbar {
|
||||||
height: 7px;
|
height: 7px;
|
||||||
|
|||||||
@@ -141,6 +141,7 @@
|
|||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import FavoriteModal from '../modals/FavoriteModal.svelte';
|
import FavoriteModal from '../modals/FavoriteModal.svelte';
|
||||||
import { showModal } from '../modals/modalTools';
|
import { showModal } from '../modals/modalTools';
|
||||||
|
import newQuery from '../query/newQuery';
|
||||||
|
|
||||||
import { currentDatabase, getActiveTab, getOpenedTabs, openedTabs, activeTabId, getActiveTabId } from '../stores';
|
import { currentDatabase, getActiveTab, getOpenedTabs, openedTabs, activeTabId, getActiveTabId } from '../stores';
|
||||||
import tabs from '../tabs';
|
import tabs from '../tabs';
|
||||||
@@ -307,8 +308,19 @@
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let domTabs;
|
||||||
|
|
||||||
|
function handleTabsWheel(e) {
|
||||||
|
if (!e.shiftKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
domTabs.scrollBy({ top: 0, left: e.deltaY < 0 ? -150 : 150, behavior: 'smooth' });
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div class="root">
|
||||||
|
<div class="tabs" on:wheel={handleTabsWheel} bind:this={domTabs}>
|
||||||
{#each groupedTabs as tabGroup}
|
{#each groupedTabs as tabGroup}
|
||||||
<div class="db-wrapper">
|
<div class="db-wrapper">
|
||||||
<div
|
<div
|
||||||
@@ -320,7 +332,9 @@
|
|||||||
use:contextMenu={getDatabaseContextMenu(tabGroup.tabs)}
|
use:contextMenu={getDatabaseContextMenu(tabGroup.tabs)}
|
||||||
style={$connectionColorFactory(
|
style={$connectionColorFactory(
|
||||||
tabGroup.tabs[0].props,
|
tabGroup.tabs[0].props,
|
||||||
(draggingDbGroup ? tabGroup.grpid == draggingDbGroupTarget?.grpid : tabGroup.tabDbKey == currentDbKey) ? 2 : 3
|
(draggingDbGroup ? tabGroup.grpid == draggingDbGroupTarget?.grpid : tabGroup.tabDbKey == currentDbKey)
|
||||||
|
? 2
|
||||||
|
: 3
|
||||||
)}
|
)}
|
||||||
draggable={true}
|
draggable={true}
|
||||||
on:dragstart={e => {
|
on:dragstart={e => {
|
||||||
@@ -394,8 +408,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
|
</div>
|
||||||
|
<div class="add-icon" on:click={() => newQuery({})} title="New query"><FontIcon icon="icon add" /></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.root {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
.add-icon {
|
||||||
|
position: absolute;
|
||||||
|
right: 5px;
|
||||||
|
font-size: 20pt;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: var(--theme-font-2);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.add-icon:hover {
|
||||||
|
color: var(--theme-font-1);
|
||||||
|
}
|
||||||
|
.tabs {
|
||||||
|
height: var(--dim-tabs-panel-height);
|
||||||
|
display: flex;
|
||||||
|
overflow-x: auto;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 35px;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
.db-group {
|
.db-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -428,6 +476,7 @@
|
|||||||
}
|
}
|
||||||
.file-tab-item {
|
.file-tab-item {
|
||||||
border-right: 1px solid var(--theme-border);
|
border-right: 1px solid var(--theme-border);
|
||||||
|
border-bottom: 2px solid var(--theme-border);
|
||||||
padding-left: 15px;
|
padding-left: 15px;
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user