mirror of
https://github.com/garraflavatra/rolens.git
synced 2024-12-01 13:20:54 +00:00
Call window.runtime methods via Wails JS
This commit is contained in:
parent
f7c8f9b807
commit
8d9c163d3b
@ -1,6 +1,7 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { Hosts, OpenConnection } from '../wailsjs/go/app/App';
|
||||
import { Environment, WindowSetTitle } from '../wailsjs/runtime';
|
||||
import BlankState from './components/blankstate.svelte';
|
||||
import ContextMenu from './components/contextmenu.svelte';
|
||||
import AddressBar from './organisms/addressbar/index.svelte';
|
||||
@ -32,14 +33,14 @@
|
||||
});
|
||||
activeHostKey = hostKey;
|
||||
addressBarModalOpen = false;
|
||||
window.runtime.WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
||||
WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
||||
}
|
||||
|
||||
busy.end();
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
window.runtime.Environment().then(e => environment = e);
|
||||
Environment().then(e => environment = e);
|
||||
Hosts().then(h => hosts = h);
|
||||
});
|
||||
</script>
|
||||
|
@ -3,6 +3,7 @@
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { DropCollection, DropDatabase, OpenCollection, OpenConnection, OpenDatabase } from '../../../wailsjs/go/app/App';
|
||||
import Grid from '../../components/grid.svelte';
|
||||
import { WindowSetTitle } from '../../../wailsjs/runtime';
|
||||
|
||||
export let hosts = {};
|
||||
export let activeHostKey = '';
|
||||
@ -32,7 +33,7 @@
|
||||
});
|
||||
activeHostKey = hostKey;
|
||||
dispatch('connected', hostKey);
|
||||
window.runtime.WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
||||
WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
||||
}
|
||||
|
||||
busy.end();
|
||||
|
@ -1,6 +1,7 @@
|
||||
<script>
|
||||
import { onMount, tick } from 'svelte';
|
||||
import { Hosts } from '../../../wailsjs/go/app/App';
|
||||
import { Environment } from '../../../wailsjs/runtime';
|
||||
import { input } from '../../actions';
|
||||
import Modal from '../../components/modal.svelte';
|
||||
import DatabaseList from './dblist.svelte';
|
||||
@ -42,7 +43,7 @@
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
window.runtime.Environment().then(e => environment = e);
|
||||
Environment().then(e => environment = e);
|
||||
Hosts().then(h => hosts = h);
|
||||
});
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user