refactor, go work

This commit is contained in:
ctengiz
2024-03-25 11:30:06 +03:00
parent e78ff14861
commit 1f62906e95
47 changed files with 40 additions and 241 deletions

21
app/frontend/main.js Normal file
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;
});