chore: merge v1 into v2 for the last time

This commit is contained in:
FabianLars
2024-02-03 20:16:36 +01:00
parent 2643a4c331
commit 14f5961569
72 changed files with 1681 additions and 4863 deletions
@@ -1,44 +0,0 @@
<script lang="ts">
import WebSocket from "@tauri-apps/plugin-websocket";
import { onMount } from "svelte";
let ws;
let response = "";
let message = "";
onMount(async () => {
ws = await WebSocket.connect("ws://127.0.0.1:8080")
.then((r) => {
_updateResponse("Connected");
return r;
})
.catch(_updateResponse);
ws.addListener(_updateResponse);
});
function _updateResponse(returnValue) {
response +=
(typeof returnValue === "string"
? returnValue
: JSON.stringify(returnValue)) + "<br>";
}
function send() {
ws.send(message)
.then(() => _updateResponse("Message sent"))
.catch(_updateResponse);
}
function disconnect() {
ws.disconnect()
.then(() => _updateResponse("Disconnected"))
.catch(_updateResponse);
}
</script>
<div>
<input bind:value={message} />
<button on:click={send}>Send</button>
<button on:click={disconnect}>Disconnect</button>
</div>
<div>{@html response}</div>