|
|
|
@ -1,17 +1,14 @@
|
|
|
|
|
<script>
|
|
|
|
|
import logo from './assets/images/logo-universal.png'
|
|
|
|
|
import {Greet} from '../wailsjs/go/main/App.js'
|
|
|
|
|
import {GetStatus, Weed} from '../wailsjs/go/main/App.js'
|
|
|
|
|
import {StartServer} from '../wailsjs/go/main/App.js'
|
|
|
|
|
import TailwindCss from './TailwindCSS.svelte';
|
|
|
|
|
import servers from './servers.js';
|
|
|
|
|
import {BrowserOpenURL} from '../wailsjs/runtime/runtime.js'
|
|
|
|
|
// import {BrowserOpenURL} from '../wailsjs/runtime/runtime.js'
|
|
|
|
|
|
|
|
|
|
let resultText = "Ваше имя 👇"
|
|
|
|
|
let name
|
|
|
|
|
|
|
|
|
|
function greet() {
|
|
|
|
|
Greet(name).then(result => resultText = result)
|
|
|
|
|
}
|
|
|
|
|
let local = servers;
|
|
|
|
|
let cnt_pic = "0";
|
|
|
|
|
|
|
|
|
|
function start_server(server) {
|
|
|
|
|
let s = JSON.stringify(server)
|
|
|
|
@ -19,29 +16,70 @@
|
|
|
|
|
StartServer(s).then(result => {
|
|
|
|
|
resultText = result
|
|
|
|
|
console.log(resultText)
|
|
|
|
|
server.run = "running"
|
|
|
|
|
local = local;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function weed() {
|
|
|
|
|
// console.log("weed");
|
|
|
|
|
Weed().then(() => {
|
|
|
|
|
get_status()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function get_status(){
|
|
|
|
|
console.log("запрос статуса")
|
|
|
|
|
GetStatus().then((result) => {
|
|
|
|
|
console.log("result:", result)
|
|
|
|
|
cnt_pic = result;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get_status()
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<TailwindCss />
|
|
|
|
|
|
|
|
|
|
<main class="container mx-auto pt-4 mb-8">
|
|
|
|
|
<div class="container mx-auto pt-4 mb-8">
|
|
|
|
|
<h1 class="text-blue-200 text-2xl">СЕРВЕРА</h1>
|
|
|
|
|
{#each servers as server}
|
|
|
|
|
{#each local as server}
|
|
|
|
|
<div class="flex justify-between px-4">
|
|
|
|
|
<button
|
|
|
|
|
class="text-teal-400 hover:text-teal-200 hover:font-semibold cursor-pointer"
|
|
|
|
|
class="text-teal-600 hover:text-teal-200 hover:font-normal hover:underline hover:underline-offset-2 cursor-pointer"
|
|
|
|
|
on:click={ () => start_server(server)}
|
|
|
|
|
>
|
|
|
|
|
{server.name}
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<button class="text-neutral-300">
|
|
|
|
|
{server.run}
|
|
|
|
|
<span class:text-red-300={server.run === "running"}>
|
|
|
|
|
{server.run}
|
|
|
|
|
</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
{/each}
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<hr class="mb-2 mx-4 text-slate-600">
|
|
|
|
|
|
|
|
|
|
<div class="container mx-auto pt-4 mb-8">
|
|
|
|
|
<h1 class="text-blue-200 text-2xl">УТИЛИТЫ</h1>
|
|
|
|
|
<div class="flex justify-between px-4">
|
|
|
|
|
<button
|
|
|
|
|
class="text-teal-600 hover:text-teal-200 hover:font-normal hover:underline hover:underline-offset-2 cursor-pointer"
|
|
|
|
|
on:click={weed}
|
|
|
|
|
>
|
|
|
|
|
Загрузка в weed
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
<div class="text-neutral-300">
|
|
|
|
|
<span>
|
|
|
|
|
{cnt_pic}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
</style>
|
|
|
|
|