removed splash, plugins load info

This commit is contained in:
Jan Prochazka 2021-05-19 19:36:12 +02:00
parent f0ea35d576
commit c4491050cd
4 changed files with 26 additions and 30 deletions

View File

@ -19,7 +19,6 @@ const store = new Store();
// Keep a global reference of the window object, if you don't, the window will // Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected. // be closed automatically when the JavaScript object is garbage collected.
let mainWindow; let mainWindow;
let splashWindow;
let mainMenu; let mainMenu;
log.transports.file.level = 'debug'; log.transports.file.level = 'debug';
@ -29,14 +28,6 @@ autoUpdater.logger = log;
let commands = {}; let commands = {};
function hideSplash() {
if (splashWindow) {
splashWindow.destroy();
splashWindow = null;
}
mainWindow.show();
}
function commandItem(id) { function commandItem(id) {
const command = commands[id]; const command = commands[id];
return { return {
@ -156,7 +147,6 @@ function createWindow() {
title: 'DbGate', title: 'DbGate',
...bounds, ...bounds,
icon: os.platform() == 'win32' ? 'icon.ico' : path.resolve(__dirname, '../icon.png'), icon: os.platform() == 'win32' ? 'icon.ico' : path.resolve(__dirname, '../icon.png'),
show: false,
webPreferences: { webPreferences: {
nodeIntegration: true, nodeIntegration: true,
enableRemoteModule: true, enableRemoteModule: true,
@ -175,7 +165,7 @@ function createWindow() {
slashes: true, slashes: true,
}); });
mainWindow.webContents.on('did-finish-load', function () { mainWindow.webContents.on('did-finish-load', function () {
hideSplash(); // hideSplash();
}); });
mainWindow.on('close', () => { mainWindow.on('close', () => {
store.set('winBounds', mainWindow.getBounds()); store.set('winBounds', mainWindow.getBounds());
@ -186,20 +176,6 @@ function createWindow() {
} }
} }
splashWindow = new BrowserWindow({
width: 300,
height: 120,
transparent: true,
frame: false,
});
splashWindow.loadURL(
url.format({
pathname: path.join(__dirname, '../packages/web/build/splash.html'),
protocol: 'file:',
slashes: true,
})
);
if (process.env.ELECTRON_START_URL) { if (process.env.ELECTRON_START_URL) {
loadMainWindow(); loadMainWindow();
} else { } else {

View File

@ -7,6 +7,7 @@
import PluginsProvider from './plugins/PluginsProvider.svelte'; import PluginsProvider from './plugins/PluginsProvider.svelte';
import Screen from './Screen.svelte'; import Screen from './Screen.svelte';
import { loadingPluginStore } from './stores';
import { setAppLoaded } from './utility/appLoadManager'; import { setAppLoaded } from './utility/appLoadManager';
import axiosInstance from './utility/axiosInstance'; import axiosInstance from './utility/axiosInstance';
import ErrorHandler from './utility/ErrorHandler.svelte'; import ErrorHandler from './utility/ErrorHandler.svelte';
@ -42,9 +43,12 @@
{#if loaded} {#if loaded}
<PluginsProvider /> <PluginsProvider />
{#if $loadingPluginStore?.loaded}
<OpenTabsOnStartup /> <OpenTabsOnStartup />
<Screen /> <Screen />
{:else}
<LoadingInfo message={`Loading plugin ${$loadingPluginStore.loadingPackageName}`} wrapper />
{/if}
{:else} {:else}
<LoadingInfo message="Starting DbGate API..." wrapper /> <LoadingInfo message="Starting DbGate ..." wrapper />
{/if} {/if}

View File

@ -8,6 +8,10 @@
for (const installed of installedPlugins || []) { for (const installed of installedPlugins || []) {
if (!_.keys(pluginsDict).includes(installed.name)) { if (!_.keys(pluginsDict).includes(installed.name)) {
console.log('Loading module', installed.name); console.log('Loading module', installed.name);
loadingPluginStore.set({
loaded: false,
loadingPackageName: installed.name,
});
const resp = await axiosInstance.request({ const resp = await axiosInstance.request({
method: 'get', method: 'get',
url: 'plugins/script', url: 'plugins/script',
@ -22,6 +26,12 @@
newPlugins[installed.name] = moduleContent; newPlugins[installed.name] = moduleContent;
} }
} }
if (installedPlugins) {
loadingPluginStore.set({
loaded: true,
loadingPackageName: null,
});
}
return newPlugins; return newPlugins;
} }
@ -43,11 +53,12 @@
}; };
return extensions; return extensions;
} }
</script> </script>
<script lang="ts"> <script lang="ts">
import _ from 'lodash'; import _ from 'lodash';
import { extensions } from '../stores'; import { extensions, loadingPluginStore } from '../stores';
import axiosInstance from '../utility/axiosInstance'; import axiosInstance from '../utility/axiosInstance';
import { useInstalledPlugins } from '../utility/metadataLoaders'; import { useInstalledPlugins } from '../utility/metadataLoaders';
import { buildFileFormats } from './fileformats'; import { buildFileFormats } from './fileformats';
@ -73,4 +84,5 @@
.filter(x => x.content); .filter(x => x.content);
$: $extensions = buildExtensions(plugins); $: $extensions = buildExtensions(plugins);
</script> </script>

View File

@ -59,6 +59,10 @@ export const nullStore = readable(null, () => {});
export const currentArchive = writable('default'); export const currentArchive = writable('default');
export const isFileDragActive = writable(false); export const isFileDragActive = writable(false);
export const selectedCellsCallback = writable(null); export const selectedCellsCallback = writable(null);
export const loadingPluginStore = writable({
loaded: false,
loadingPackageName: null,
});
export const currentThemeDefinition = derived([currentTheme, extensions], ([$currentTheme, $extensions]) => export const currentThemeDefinition = derived([currentTheme, extensions], ([$currentTheme, $extensions]) =>
$extensions.themes.find(x => x.className == $currentTheme) $extensions.themes.find(x => x.className == $currentTheme)