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>
|
<script>
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { Hosts, OpenConnection } from '../wailsjs/go/app/App';
|
import { Hosts, OpenConnection } from '../wailsjs/go/app/App';
|
||||||
|
import { Environment, WindowSetTitle } from '../wailsjs/runtime';
|
||||||
import BlankState from './components/blankstate.svelte';
|
import BlankState from './components/blankstate.svelte';
|
||||||
import ContextMenu from './components/contextmenu.svelte';
|
import ContextMenu from './components/contextmenu.svelte';
|
||||||
import AddressBar from './organisms/addressbar/index.svelte';
|
import AddressBar from './organisms/addressbar/index.svelte';
|
||||||
@ -32,14 +33,14 @@
|
|||||||
});
|
});
|
||||||
activeHostKey = hostKey;
|
activeHostKey = hostKey;
|
||||||
addressBarModalOpen = false;
|
addressBarModalOpen = false;
|
||||||
window.runtime.WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
||||||
}
|
}
|
||||||
|
|
||||||
busy.end();
|
busy.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
window.runtime.Environment().then(e => environment = e);
|
Environment().then(e => environment = e);
|
||||||
Hosts().then(h => hosts = h);
|
Hosts().then(h => hosts = h);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
import { createEventDispatcher } from 'svelte';
|
import { createEventDispatcher } from 'svelte';
|
||||||
import { DropCollection, DropDatabase, OpenCollection, OpenConnection, OpenDatabase } from '../../../wailsjs/go/app/App';
|
import { DropCollection, DropDatabase, OpenCollection, OpenConnection, OpenDatabase } from '../../../wailsjs/go/app/App';
|
||||||
import Grid from '../../components/grid.svelte';
|
import Grid from '../../components/grid.svelte';
|
||||||
|
import { WindowSetTitle } from '../../../wailsjs/runtime';
|
||||||
|
|
||||||
export let hosts = {};
|
export let hosts = {};
|
||||||
export let activeHostKey = '';
|
export let activeHostKey = '';
|
||||||
@ -32,7 +33,7 @@
|
|||||||
});
|
});
|
||||||
activeHostKey = hostKey;
|
activeHostKey = hostKey;
|
||||||
dispatch('connected', hostKey);
|
dispatch('connected', hostKey);
|
||||||
window.runtime.WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
WindowSetTitle(`${hosts[activeHostKey].name} - Mongodup`);
|
||||||
}
|
}
|
||||||
|
|
||||||
busy.end();
|
busy.end();
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount, tick } from 'svelte';
|
import { onMount, tick } from 'svelte';
|
||||||
import { Hosts } from '../../../wailsjs/go/app/App';
|
import { Hosts } from '../../../wailsjs/go/app/App';
|
||||||
|
import { Environment } from '../../../wailsjs/runtime';
|
||||||
import { input } from '../../actions';
|
import { input } from '../../actions';
|
||||||
import Modal from '../../components/modal.svelte';
|
import Modal from '../../components/modal.svelte';
|
||||||
import DatabaseList from './dblist.svelte';
|
import DatabaseList from './dblist.svelte';
|
||||||
@ -42,7 +43,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
window.runtime.Environment().then(e => environment = e);
|
Environment().then(e => environment = e);
|
||||||
Hosts().then(h => hosts = h);
|
Hosts().then(h => hosts = h);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user