Instance switching in good ui
This commit is contained in:
parent
bd787bdfa2
commit
af6ff50cfd
@ -1,16 +1,18 @@
|
||||
<script lang="ts">
|
||||
//import {LaunchInstance} from 'wailsjs/go/main/InstanceManager';
|
||||
import {LaunchInstance} from '../wailsjs/go/main/InstanceManager';
|
||||
import {instances, loading} from './global'
|
||||
var testArray = ["test","test2","test3"];
|
||||
|
||||
let pack;
|
||||
let pack: string;
|
||||
let instance: string
|
||||
let radio: string
|
||||
|
||||
//function launchclick(event) {
|
||||
// $loading = true
|
||||
// LaunchInstance(pack).then(() => {
|
||||
// $loading = false
|
||||
// })
|
||||
//}
|
||||
function launchclick(event) {
|
||||
$loading = true
|
||||
LaunchInstance(radio).then(() => {
|
||||
$loading = false
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@ -18,12 +20,12 @@ import {instances, loading} from './global'
|
||||
<main>
|
||||
<div class="container">
|
||||
<div class="tile-group">
|
||||
{#each $instances as i}
|
||||
{#each $instances as instance}
|
||||
<div class="input-container">
|
||||
<input id={i} type="radio" name="radio" on:click={pack = instances[i]}>
|
||||
<input id={instance} bind:group={radio} type="radio" name="radio" value={instance}>
|
||||
<div class="radio-tile">
|
||||
<!--icon goes here later-->
|
||||
<label for={i}>{i}</label>
|
||||
<label for={instance}>{instance}</label>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
@ -31,7 +33,7 @@ import {instances, loading} from './global'
|
||||
</div>
|
||||
</div>
|
||||
<div class="options-container">
|
||||
<button class="launch-button">{pack}</button>
|
||||
<button class="launch-button" on:click={launchclick}>{radio}</button>
|
||||
</div>
|
||||
</main>
|
||||
<style>
|
||||
|
Loading…
Reference in New Issue
Block a user