mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 22:16:00 +00:00
perspective loading indicator
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
<div class="lds-spinner">
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
<div />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.lds-spinner {
|
||||
color: official;
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
.lds-spinner div {
|
||||
transform-origin: 40px 40px;
|
||||
animation: lds-spinner 1.2s linear infinite;
|
||||
}
|
||||
.lds-spinner div:after {
|
||||
content: ' ';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
left: 37px;
|
||||
width: 6px;
|
||||
height: 18px;
|
||||
border-radius: 20%;
|
||||
background: var(--theme-font-2);
|
||||
}
|
||||
.lds-spinner div:nth-child(1) {
|
||||
transform: rotate(0deg);
|
||||
animation-delay: -1.1s;
|
||||
}
|
||||
.lds-spinner div:nth-child(2) {
|
||||
transform: rotate(30deg);
|
||||
animation-delay: -1s;
|
||||
}
|
||||
.lds-spinner div:nth-child(3) {
|
||||
transform: rotate(60deg);
|
||||
animation-delay: -0.9s;
|
||||
}
|
||||
.lds-spinner div:nth-child(4) {
|
||||
transform: rotate(90deg);
|
||||
animation-delay: -0.8s;
|
||||
}
|
||||
.lds-spinner div:nth-child(5) {
|
||||
transform: rotate(120deg);
|
||||
animation-delay: -0.7s;
|
||||
}
|
||||
.lds-spinner div:nth-child(6) {
|
||||
transform: rotate(150deg);
|
||||
animation-delay: -0.6s;
|
||||
}
|
||||
.lds-spinner div:nth-child(7) {
|
||||
transform: rotate(180deg);
|
||||
animation-delay: -0.5s;
|
||||
}
|
||||
.lds-spinner div:nth-child(8) {
|
||||
transform: rotate(210deg);
|
||||
animation-delay: -0.4s;
|
||||
}
|
||||
.lds-spinner div:nth-child(9) {
|
||||
transform: rotate(240deg);
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
.lds-spinner div:nth-child(10) {
|
||||
transform: rotate(270deg);
|
||||
animation-delay: -0.2s;
|
||||
}
|
||||
.lds-spinner div:nth-child(11) {
|
||||
transform: rotate(300deg);
|
||||
animation-delay: -0.1s;
|
||||
}
|
||||
.lds-spinner div:nth-child(12) {
|
||||
transform: rotate(330deg);
|
||||
animation-delay: 0s;
|
||||
}
|
||||
@keyframes lds-spinner {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -27,6 +27,7 @@
|
||||
import { openJsonDocument } from '../tabs/JsonTab.svelte';
|
||||
import PerspectiveCell from './PerspectiveCell.svelte';
|
||||
import DataGridCell from '../datagrid/DataGridCell.svelte';
|
||||
import PerspectiveLoadingIndicator from './PerspectiveLoadingIndicator.svelte';
|
||||
|
||||
const dbg = debug('dbgate:PerspectivaTable');
|
||||
export const activator = createActivator('PerspectiveTable', true);
|
||||
@@ -38,6 +39,7 @@
|
||||
let dataRows;
|
||||
let domWrapper;
|
||||
let errorMessage;
|
||||
let isLoading = false;
|
||||
|
||||
async function loadLevelData(node: PerspectiveTreeNode, parentRows: any[], counts) {
|
||||
dbg('load level data', counts);
|
||||
@@ -103,6 +105,7 @@
|
||||
// console.log('LOADING', node);
|
||||
if (!node) return;
|
||||
const rows = [];
|
||||
isLoading = true;
|
||||
try {
|
||||
await loadLevelData(node, rows, counts);
|
||||
dataRows = rows;
|
||||
@@ -113,6 +116,7 @@
|
||||
errorMessage = err.message;
|
||||
dataRows = null;
|
||||
}
|
||||
isLoading = false;
|
||||
// console.log('DISPLAY ROWS', rows);
|
||||
// const rows = await node.loadLevelData();
|
||||
// for (const child of node.childNodes) {
|
||||
@@ -228,6 +232,12 @@
|
||||
)}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
{#if isLoading}
|
||||
<div class="loader">
|
||||
<PerspectiveLoadingIndicator />
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@@ -293,4 +303,10 @@
|
||||
th {
|
||||
border: 1px solid;
|
||||
} */
|
||||
|
||||
.loader {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user