Replacing old ui, list population needs moved to app
This commit is contained in:
parent
3fe2b3df6d
commit
d9dbd2d29b
@ -4,10 +4,10 @@
|
|||||||
import Loading from './Loading.svelte'
|
import Loading from './Loading.svelte'
|
||||||
import {CheckPrerequisites} from '../wailsjs/go/main/App.js'
|
import {CheckPrerequisites} from '../wailsjs/go/main/App.js'
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import { loading, testPage, } from './global'
|
import { loading, testPage, currentPage } from './global'
|
||||||
import { slide } from 'svelte/transition'
|
import { slide } from 'svelte/transition'
|
||||||
import Navbar from './Navbar.svelte'
|
import Navbar from './Navbar.svelte'
|
||||||
import Testpage from './Testpage.svelte'
|
import Instancepage from './Instancepage.svelte'
|
||||||
import { set_attributes, set_style } from 'svelte/internal';
|
import { set_attributes, set_style } from 'svelte/internal';
|
||||||
|
|
||||||
let width: int = 10
|
let width: int = 10
|
||||||
@ -32,21 +32,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<body class="body" id="body">
|
<body class="body" id="body">
|
||||||
<!--<img alt="Wails logo" id="logo" src="{logo}">-->
|
<!--<img alt="Wails logo" id="logo" src="{logo}">-->
|
||||||
{#if $testPage}
|
|
||||||
<div>
|
|
||||||
<Testpage />
|
|
||||||
</div>
|
|
||||||
{:else}
|
|
||||||
{#if $loading}
|
{#if $loading}
|
||||||
<div transition:slide="{{duration:100}}" class="central">
|
<div transition:slide="{{duration:100}}" class="central">
|
||||||
<Loading />
|
<Loading />
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else if $currentPage == 1}
|
||||||
|
<div transition:slide="{{duration:100}}" class="central">
|
||||||
|
<Instancepage />
|
||||||
|
</div>
|
||||||
|
{:else if $currentPage == 2}
|
||||||
<div transition:slide="{{duration:100}}" class="central">
|
<div transition:slide="{{duration:100}}" class="central">
|
||||||
<Instances />
|
<Instances />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
|
||||||
</body>
|
</body>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {LaunchInstance} from '../wailsjs/go/main/InstanceManager';
|
|
||||||
import {instances, loading, navMargin} from './global'
|
import {instances, loading, navMargin} from './global'
|
||||||
|
import {InstallVanilla, LaunchInstance, GetInstances, InstallForge, InstallQuilt, InstallFabric, CheckUpdate} from '../wailsjs/go/main/InstanceManager.js'
|
||||||
|
import {GetVersions} from '../wailsjs/go/main/App.js'
|
||||||
|
import {onMount} from 'svelte'
|
||||||
var testArray = ["test","test2","test3"];
|
var testArray = ["test","test2","test3"];
|
||||||
|
|
||||||
let pack: string = "";
|
let pack: string = "";
|
||||||
@ -8,6 +10,8 @@ import {instances, loading, navMargin} from './global'
|
|||||||
let radio: string = "";
|
let radio: string = "";
|
||||||
let marginScale: string= $navMargin + "rem";
|
let marginScale: string= $navMargin + "rem";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function launchclick(event) {
|
function launchclick(event) {
|
||||||
$loading = true
|
$loading = true
|
||||||
LaunchInstance(radio).then(() => {
|
LaunchInstance(radio).then(() => {
|
||||||
@ -40,6 +44,7 @@ import {instances, loading, navMargin} from './global'
|
|||||||
<button class="launch-button" on:click={launchclick}>Launch {radio}</button>
|
<button class="launch-button" on:click={launchclick}>Launch {radio}</button>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
@ -5,7 +5,7 @@
|
|||||||
import {GetQuiltVersions} from '../wailsjs/go/main/Quilt.js'
|
import {GetQuiltVersions} from '../wailsjs/go/main/Quilt.js'
|
||||||
import {GetForgeVersions} from '../wailsjs/go/main/Forge.js'
|
import {GetForgeVersions} from '../wailsjs/go/main/Forge.js'
|
||||||
import {onMount} from 'svelte'
|
import {onMount} from 'svelte'
|
||||||
import {loading, addingInstance, instances} from './global'
|
import {loading, addingInstance, instances, currentPage} from './global'
|
||||||
import {slide} from 'svelte/transition'
|
import {slide} from 'svelte/transition'
|
||||||
|
|
||||||
let modpacks: string[] = []
|
let modpacks: string[] = []
|
||||||
@ -114,14 +114,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
<select bind:value={instance} name="pack">Select a Modpack:
|
|
||||||
{#each $instances as instance}
|
|
||||||
<option value={instance}>{instance}</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
||||||
<button on:click={onclick}>Launch</button>
|
|
||||||
<br/>
|
<br/>
|
||||||
{#if $addingInstance}
|
|
||||||
<div transition:slide="{{duration:300}}">
|
<div transition:slide="{{duration:300}}">
|
||||||
<select id="pack" on:change={onchange} bind:value={pack} name="pack">Select a Modpack:
|
<select id="pack" on:change={onchange} bind:value={pack} name="pack">Select a Modpack:
|
||||||
{#each modpacks as pack}
|
{#each modpacks as pack}
|
||||||
@ -163,9 +156,6 @@
|
|||||||
<button on:click={install}>Install</button>
|
<button on:click={install}>Install</button>
|
||||||
<button on:click={() => {$addingInstance = false}}>Cancel</button>
|
<button on:click={() => {$addingInstance = false}}>Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
|
||||||
<button on:click={() => {$addingInstance = true}}>Add Instance</button>
|
|
||||||
{/if}
|
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" src="https://kit.fontawesome.com/172593a6a5.js" crossorigin="anonymous">
|
<script lang="ts" src="https://kit.fontawesome.com/172593a6a5.js" crossorigin="anonymous">
|
||||||
import { main } from '../wailsjs/go/models';
|
import { main } from '../wailsjs/go/models';
|
||||||
import {addingInstance, testPage, navMargin} from './global'
|
import {addingInstance, testPage, navMargin, currentPage} from './global'
|
||||||
|
|
||||||
function extend(){
|
function extend(){
|
||||||
$navMargin = 17;
|
$navMargin = 17;
|
||||||
@ -24,7 +24,7 @@ function unextend(){
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#" class="nav-link" on:click={() => {$addingInstance = false}}>
|
<a href="#" class="nav-link" on:click={() => {$currentPage = 1}}>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon" viewBox="0 0 576 512"><path d="M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon" viewBox="0 0 576 512"><path d="M287.9 0c9.2 0 17.6 5.2 21.6 13.5l68.6 141.3 153.2 22.6c9 1.3 16.5 7.6 19.3 16.3s.5 18.1-5.9 24.5L433.6 328.4l26.2 155.6c1.5 9-2.2 18.1-9.7 23.5s-17.3 6-25.3 1.7l-137-73.2L151 509.1c-8.1 4.3-17.9 3.7-25.3-1.7s-11.2-14.5-9.7-23.5l26.2-155.6L31.1 218.2c-6.5-6.4-8.7-15.9-5.9-24.5s10.3-14.9 19.3-16.3l153.2-22.6L266.3 13.5C270.4 5.2 278.7 0 287.9 0zm0 79L235.4 187.2c-3.5 7.1-10.2 12.1-18.1 13.3L99 217.9 184.9 303c5.5 5.5 8.1 13.3 6.8 21L171.4 443.7l105.2-56.2c7.1-3.8 15.6-3.8 22.6 0l105.2 56.2L384.2 324.1c-1.3-7.7 1.2-15.5 6.8-21l85.9-85.1L358.6 200.5c-7.8-1.2-14.6-6.1-18.1-13.3L287.9 79z"/></svg>
|
||||||
|
|
||||||
<span class="link-text">Instances</span>
|
<span class="link-text">Instances</span>
|
||||||
@ -40,7 +40,7 @@ function unextend(){
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#" class="nav-link" on:click={() => {$addingInstance = true}}>
|
<a href="#" class="nav-link" on:click={() => {$currentPage = 2}}>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon" viewBox="0 0 448 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"/></svg>
|
||||||
|
|
||||||
<span class="link-text">New Instance</span>
|
<span class="link-text">New Instance</span>
|
||||||
@ -48,7 +48,7 @@ function unextend(){
|
|||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#" class="nav-link" on:click={() => {$testPage = !$testPage}}>
|
<a href="#" class="nav-link" on:click={() => {$currentPage = 3}}>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon" viewBox="0 0 640 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M175 389.4c-9.8 16-15 34.3-15 53.1c-10 3.5-20.8 5.5-32 5.5c-53 0-96-43-96-96L32 64C14.3 64 0 49.7 0 32S14.3 0 32 0L96 0l64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 245.9-49 79.6zM96 64l0 96 64 0 0-96L96 64zM352 0L480 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 150.9L629.7 406.2c6.7 10.9 10.3 23.5 10.3 36.4c0 38.3-31.1 69.4-69.4 69.4l-309.2 0c-38.3 0-69.4-31.1-69.4-69.4c0-12.8 3.6-25.4 10.3-36.4L320 214.9 320 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0zm32 64l0 160c0 5.9-1.6 11.7-4.7 16.8L330.5 320l171 0-48.8-79.2c-3.1-5-4.7-10.8-4.7-16.8l0-160-64 0z"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="nav-icon" viewBox="0 0 640 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M175 389.4c-9.8 16-15 34.3-15 53.1c-10 3.5-20.8 5.5-32 5.5c-53 0-96-43-96-96L32 64C14.3 64 0 49.7 0 32S14.3 0 32 0L96 0l64 0 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 245.9-49 79.6zM96 64l0 96 64 0 0-96L96 64zM352 0L480 0l32 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l0 150.9L629.7 406.2c6.7 10.9 10.3 23.5 10.3 36.4c0 38.3-31.1 69.4-69.4 69.4l-309.2 0c-38.3 0-69.4-31.1-69.4-69.4c0-12.8 3.6-25.4 10.3-36.4L320 214.9 320 64c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0zm32 64l0 160c0 5.9-1.6 11.7-4.7 16.8L330.5 320l171 0-48.8-79.2c-3.1-5-4.7-10.8-4.7-16.8l0-160-64 0z"/></svg>
|
||||||
|
|
||||||
<span class="link-text">Testing Page</span>
|
<span class="link-text">Testing Page</span>
|
||||||
|
@ -3,4 +3,5 @@ export const loading = writable(true)
|
|||||||
export const addingInstance = writable(false)
|
export const addingInstance = writable(false)
|
||||||
export const testPage = writable(false)
|
export const testPage = writable(false)
|
||||||
export const instances = writable([])
|
export const instances = writable([])
|
||||||
export const navMargin = writable(3)
|
export const navMargin = writable(3)
|
||||||
|
export const currentPage = writable(1)
|
Loading…
Reference in New Issue
Block a user