From 842793ff794d2f96de8e6d614f2a571d5f4c87d7 Mon Sep 17 00:00:00 2001 From: yutent Date: Mon, 11 Sep 2023 14:30:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E6=96=B0=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E4=B8=8A=E6=AD=BB=E5=BE=AA=E7=8E=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 3 ++- usr/lib/hosts-switch/hosts-switch.py | 4 ++++ usr/lib/hosts-switch/webapp/components/sidebar.js | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 2faf87c..5e4d368 100755 --- a/build.sh +++ b/build.sh @@ -4,7 +4,7 @@ if [ -d unpack ]; then sudo rm -rf unpack fi -version="3.0.2" +version="3.0.3" mkdir -p unpack/DEBIAN @@ -26,6 +26,7 @@ sed -i "s/{{size}}/${_size}/" DEBIAN/control sed -i "s/{{version}}/${version}/" DEBIAN/control cd .. +sudo chown -R root:root unpack/ dpkg-deb -b unpack/ "hosts-switch-${version}.deb" sudo rm -rf unpack \ No newline at end of file diff --git a/usr/lib/hosts-switch/hosts-switch.py b/usr/lib/hosts-switch/hosts-switch.py index 9a9f594..eb32937 100755 --- a/usr/lib/hosts-switch/hosts-switch.py +++ b/usr/lib/hosts-switch/hosts-switch.py @@ -13,8 +13,12 @@ APP_ID = 'fun.wkit.hosts-switch' __dir__ = os.path.dirname(os.path.realpath(__file__)) web_root = os.path.join(__dir__, './webapp') +home_dir = os.getenv('HOME'), +config_dir = os.path.join(os.getenv('HOME'), '.config/hosts-switch'), +if not os.path.isdir(config_dir): + os.mkdir(config_dir) class Application(Gtk.Application): diff --git a/usr/lib/hosts-switch/webapp/components/sidebar.js b/usr/lib/hosts-switch/webapp/components/sidebar.js index ba8654c..08783af 100644 --- a/usr/lib/hosts-switch/webapp/components/sidebar.js +++ b/usr/lib/hosts-switch/webapp/components/sidebar.js @@ -101,7 +101,7 @@ class Sidebar extends Component { toggleDomain(ev, name) { let { HOST_DATA, records } = this.$store - name = name || ev.currentTarget.dataset.name + name = name ?? ev.currentTarget.dataset.name this.$store.activeDomain = name this.$store.records = records = (HOST_DATA[name] || []).sort((a, b) =>