diff --git a/main.js b/main.js index 1358051..ab771de 100644 --- a/main.js +++ b/main.js @@ -1,136 +1,97 @@ +"ui"; + storage = storages.create("mower-ng helper"); wx = storage.get("wx", 10); wy = storage.get("wy", 10); http_proto = storage.get("http_proto", "http"); -host = storage.get("host", "127.0.0.1:58000"); +host = storage.get("host", "127.0.0.1"); +port = storage.get("port", "58000"); -rawInput( - "连接地址(要写http://或https://,不写token)", - `${http_proto}://${host}`, - (url) => { - [http_proto, host] = url.split("://"); - storage.put("http_proto", http_proto); - storage.put("host", host); - } -); +function save_config() { + http_proto = ui.proto.getText(); + host = ui.host.getText(); + port = ui.port.getText(); + storage.put("http_proto", http_proto); + storage.put("host", host); + storage.put("port", port); +} -w = floaty.rawWindow( - - - - - - +w = null; + +ui.layout( + + + + + + - - + + + + + + + + + + + + + +