From da445f2402792e4dda22ba185ba9b6870db4642e Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 6 Sep 2023 12:18:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BE=93=E5=85=A5=E6=B3=95?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F;=20=E5=A2=9E=E5=8A=A0=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/lib/hosts-switch/hosts-switch.py | 3 ++- usr/lib/hosts-switch/webapp/app.js | 2 +- usr/lib/hosts-switch/webapp/components/home.js | 5 ++++- usr/lib/hosts-switch/webapp/utils/index.js | 2 -- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/usr/lib/hosts-switch/hosts-switch.py b/usr/lib/hosts-switch/hosts-switch.py index 93e0d0a..a006579 100755 --- a/usr/lib/hosts-switch/hosts-switch.py +++ b/usr/lib/hosts-switch/hosts-switch.py @@ -6,7 +6,8 @@ gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk, GLib, Gio, GObject, GdkPixbuf -from webengine.gtk3 import WebEngine, create_setting, create_hmr_server +from we.gtk3 import WebEngine, create_setting, create_hmr_server +# from webengine.gtk3 import WebEngine, create_setting, create_hmr_server from _window import Window APP_ID = 'fun.wkit.hosts-switch' diff --git a/usr/lib/hosts-switch/webapp/app.js b/usr/lib/hosts-switch/webapp/app.js index 7ff2e36..925c1b6 100644 --- a/usr/lib/hosts-switch/webapp/app.js +++ b/usr/lib/hosts-switch/webapp/app.js @@ -34,7 +34,7 @@ createApp({ } }, render() { - return html` ` + return html` ` } }) .use(store) diff --git a/usr/lib/hosts-switch/webapp/components/home.js b/usr/lib/hosts-switch/webapp/components/home.js index 75c442e..a30d54f 100644 --- a/usr/lib/hosts-switch/webapp/components/home.js +++ b/usr/lib/hosts-switch/webapp/components/home.js @@ -99,7 +99,7 @@ class Home extends Component { async mounted() { window.foo = this - + native.proxy.enable('http://127.0.0.1:8888') let writable = await checkPermission() if (writable) { @@ -113,6 +113,9 @@ class Home extends Component { } addRecord() { + location.href = 'https://www.ipaddress.my/' + return + if (this.$store.activeDomain) { this.$store.records.push({ record: '', diff --git a/usr/lib/hosts-switch/webapp/utils/index.js b/usr/lib/hosts-switch/webapp/utils/index.js index ceb8c1e..bb362d9 100644 --- a/usr/lib/hosts-switch/webapp/utils/index.js +++ b/usr/lib/hosts-switch/webapp/utils/index.js @@ -6,8 +6,6 @@ import { nextTick } from 'wkit' -await native.init() - const APP_CONFIG_DIR = `${native.env.CONFIG_DIR}/hosts-switch` const HOST_FILE = `${APP_CONFIG_DIR}/host.cache` const LOCK_FILE = `${APP_CONFIG_DIR}/lock`