mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 03:46:00 +00:00
D&D screen
This commit is contained in:
55
packages/web/src/DragAndDropFileTarget.svelte
Normal file
55
packages/web/src/DragAndDropFileTarget.svelte
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import _ from 'lodash';
|
||||||
|
import FontIcon from './icons/FontIcon.svelte';
|
||||||
|
|
||||||
|
import { extensions } from './stores';
|
||||||
|
|
||||||
|
import getElectron from './utility/getElectron';
|
||||||
|
|
||||||
|
const electron = getElectron();
|
||||||
|
$: fileTypeNames = _.compact([
|
||||||
|
...$extensions.fileFormats.filter(x => x.readerFunc).map(x => x.name),
|
||||||
|
electron ? 'SQL' : null,
|
||||||
|
]);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="target">
|
||||||
|
<div>
|
||||||
|
<div class="icon">
|
||||||
|
<FontIcon icon="icon cloud-upload" />
|
||||||
|
</div>
|
||||||
|
<div class="title">Drop the files to upload to DbGate</div>
|
||||||
|
<div class="info">Supported file types: {fileTypeNames.join(', ')}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.target {
|
||||||
|
position: fixed;
|
||||||
|
display: flex;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: var(--theme-bg-selected);
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
.icon {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
font-size: 50px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
.title {
|
||||||
|
font-size: 30px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
import CurrentDropDownMenu from './modals/CurrentDropDownMenu.svelte';
|
import CurrentDropDownMenu from './modals/CurrentDropDownMenu.svelte';
|
||||||
import StatusBar from './widgets/StatusBar.svelte';
|
import StatusBar from './widgets/StatusBar.svelte';
|
||||||
import ModalLayer from './modals/ModalLayer.svelte';
|
import ModalLayer from './modals/ModalLayer.svelte';
|
||||||
|
import DragAndDropFileTarget from './DragAndDropFileTarget.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class={`${$currentTheme} root`}>
|
<div class={`${$currentTheme} root`}>
|
||||||
@@ -49,6 +50,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<CurrentDropDownMenu />
|
<CurrentDropDownMenu />
|
||||||
<ModalLayer />
|
<ModalLayer />
|
||||||
|
<!-- <DragAndDropFileTarget /> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user