UI part of the project

This commit is contained in:
Ertan Caliskan
2024-03-24 21:11:32 +01:00
parent 9a46865055
commit 1e0e7ed738
45 changed files with 3332 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import {Greet} from "./bindings/main/BotService.js";
import {Events} from "@wailsio/runtime";
const resultElement = document.getElementById('result');
const timeElement = document.getElementById('time');
window.doGreet = () => {
let name = document.getElementById('name').value;
if (!name) {
name = 'anonymous';
}
Greet(name).then((result) => {
resultElement.innerText = result;
}).catch((err) => {
console.log(err);
});
}
Events.On('time', (time) => {
timeElement.innerText = time.data;
});