Closed Sznymo closed 1 month ago
Ok I already see where the error is after moving to heat from the end of the page, the code does not crash . But I have a question, in the old version I could use the files in the folder. in the new version I can not. how to fix it ?
you need to set the root path of the folder, so WebUI will look for requested HTTP files in that folder.
I already did it thank you :) , but it makes me wonder why the older version didn't need to be set up
window.setFileHandler() do (filename: string) -> string:
var config: JsonNode = fromJson(readFile("""config.json"""))
var lang: JsonNode = parseJson(readFile(getCurrentDir() / "data" / "lang" / config["language"].getstr & ".json"))
case filename
of "/installed_mods.html":
return site(installed_mods(lang))
of "/index.html":
return site(index(lang))
of "/options.html":
return site(options(lang))
of "/version_game.html":
return site(version_game(lang,"stable"))
of "/online_mods_list.html":
return site(online_mods_list(lang))
of "/filebrowsersite.html":
return site(filebrowsersite(lang,config["game_dir"].getstr),false)
of "/setup_wizard.html":
return site(setup_wizard(lang),false)
else:
if fileExists(getCurrentDir() / filename):
return readFile(getCurrentDir() / filename)
The latest version of webui installed by " nimble install webui@#main", shuts down after a few seconds giving something like this in the console![zrzut_ekranu_20240714_003635](https://github.com/user-attachments/assets/45ac303f-eb2f-4405-884f-3f89b78b8bc4)