From 426d2069c07d59da55804e2b1952ac1423432c82 Mon Sep 17 00:00:00 2001 From: github action Date: Sat, 5 Oct 2024 10:30:16 +0000 Subject: [PATCH 1/4] update Zerotier version:1.14.1 --- changelog_dev.md | 2 +- update_arm64_dev.json | 2 +- update_arm_dev.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog_dev.md b/changelog_dev.md index 72f5ba6..a6e0e5c 100644 --- a/changelog_dev.md +++ b/changelog_dev.md @@ -1 +1 @@ -更新工作流 +update Zerotier version:1.14.1 diff --git a/update_arm64_dev.json b/update_arm64_dev.json index 57611dc..0f89ca5 100644 --- a/update_arm64_dev.json +++ b/update_arm64_dev.json @@ -1 +1 @@ -{"version":"1.14.1","versionCode":10449,"zipUrl":"https://github.com/powerAn2020/ZeroTierForKSU/actions/runs/11190203396/artifacts/2018513466","changelog":"https://raw.githubusercontent.com/powerAn2020/ZeroTierOneForKSU/dev/changelog_dev.md"} +{"version":"1.14.1","versionCode":10450,"zipUrl":"https://github.com/powerAn2020/ZeroTierForKSU/actions/runs/11192497951/artifacts/2018959261","changelog":"https://raw.githubusercontent.com/powerAn2020/ZeroTierOneForKSU/dev/changelog_dev.md"} diff --git a/update_arm_dev.json b/update_arm_dev.json index cf5145a..0a6f2a5 100644 --- a/update_arm_dev.json +++ b/update_arm_dev.json @@ -1 +1 @@ -{"version":"1.14.1","versionCode":10449,"zipUrl":"","changelog":"https://raw.githubusercontent.com/powerAn2020/ZeroTierOneForKSU/dev/changelog_dev.md"} +{"version":"1.14.1","versionCode":10450,"zipUrl":"","changelog":"https://raw.githubusercontent.com/powerAn2020/ZeroTierOneForKSU/dev/changelog_dev.md"} From 1c54b2b85d23c61a033d1c679b3ead84ead4e182 Mon Sep 17 00:00:00 2001 From: powerAn <25736019+powerAn2020@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:11:53 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D9993=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=B7=AF=E7=94=B1=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=94=99=E4=BD=8D=E5=88=A0=E9=99=A4=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=BD=91=E7=BB=9C=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=B9=E7=AA=97=E4=B8=8D=E8=83=BD=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 7 +- api.sh | 3 +- ui-src/package.json | 2 +- ui-src/src/App.vue | 39 ++++++----- ui-src/src/Center.vue | 26 ++++---- ui-src/src/NetworkDetail.vue | 118 ++++++++++++++++++++-------------- ui-src/src/locales/en-US.json | 3 +- ui-src/src/locales/zh-CN.json | 7 +- 8 files changed, 117 insertions(+), 88 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 278e575..35441ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,9 +29,11 @@ jobs: latest_version=$(wget --no-check-certificate -qO- "https://api.github.com/repos/stunnel/static-curl/releases" | grep "tag_name" | grep -oE "[0-9.]*" | head -1) module_latest_version=$(wget --no-check-certificate -qO- "https://api.github.com/repos/powerAn2020/ZeroTierOneForKSU/releases" | grep "tag_name" | grep -oE "[0-9.]*" | head -1) zerotier_latest_version=$(wget --no-check-certificate -qO- "https://api.github.com/repos/zerotier/ZeroTierOne/releases" | grep "tag_name" | grep -oE "[0-9.]*" | head -1) - if [ "$zerotier_latest_version" = "$module_latest_version" -a "${{github.event_name }}" = "schedule"]; then + zerotier_version=$(cat zerotier_version) + if [ "$zerotier_latest_version" = "$zerotier_version" -a "${{github.event_name }}" = "schedule"]; then exit 0 fi + echo ${zerotier_latest_version}>zerotier_version echo "VERSION=$zerotier_latest_version" >> $GITHUB_ENV download_link="https://github.com/stunnel/static-curl/releases/download/${latest_version}/curl-linux-aarch64-musl-${latest_version}.tar.xz" echo ${download_link} @@ -84,7 +86,7 @@ jobs: echo "${{ env.VERSION }}" > zerotier_version git add zerotier_version fi - git add module.prop update_arm64.json update_arm.json changelog.md + git add module.prop update_arm64.json update_arm.json changelog.md zerotier_version git commit -m "update config" echo "COMMIT=1" >> $GITHUB_ENV else @@ -108,7 +110,6 @@ jobs: make -j $(nproc) ZT_STATIC=1 ZT_DEBUG=0 CC=arm-none-linux-gnueabihf-gcc CXX=arm-none-linux-gnueabihf-g++ LDFLAGS="-s" cp -rf zerotier-one ../zerotier-one-arm - - name: Build UI run: | cd ui-src diff --git a/api.sh b/api.sh index 93bb8d1..c134001 100644 --- a/api.sh +++ b/api.sh @@ -124,7 +124,7 @@ local_peer() { local_firewall() { if [ "$1" = "A" ]; then touch ${ZTPATH}/ALLOW_9993 - elif [ "$1" != "D" ]; then + elif [ "$1" = "D" ]; then rm ${ZTPATH}/ALLOW_9993 else echo "only [A,D]" @@ -243,6 +243,7 @@ local) local_peer ;; firewall) + shift local_firewall $1 ;; router) diff --git a/ui-src/package.json b/ui-src/package.json index 847bf39..8a60da5 100644 --- a/ui-src/package.json +++ b/ui-src/package.json @@ -9,7 +9,7 @@ "devbuild": "vite build", "postinstall": "patch-package", "predevbuild": "if exist %cd%\\dist.zip del %cd%\\dist.zip", - "postdevbuild": "7z u dist.zip ./dist/* & adb -s 192.168.10.155:46005 push %cd%\\dist.zip /sdcard/Download/dist/" + "postdevbuild": "7z u dist.zip ./dist/* & adb -s 192.168.100.96:34567 push %cd%\\dist.zip /sdcard/Download/dist/" }, "dependencies": { "buffer": "^6.0.3", diff --git a/ui-src/src/App.vue b/ui-src/src/App.vue index 0dc6a93..b6a2ede 100644 --- a/ui-src/src/App.vue +++ b/ui-src/src/App.vue @@ -4,15 +4,17 @@ @@ -22,8 +24,8 @@
- {{t('common.dash')}} - {{t('common.peers')}} + {{ t('common.dash') }} + {{ t('common.peers') }} - {{t('common.network')}} + {{ t('common.network') }} - {{t('common.setting')}} + {{ t('common.setting') }} - + @@ -51,7 +53,7 @@ // import { ref, watch } from 'vue'; // import { useRouter } from 'vue-router'; import { execCmd } from './tools' -import { vantLocales, useI18n , i18n} from './locales'; // 导入所有翻译信息 +import { vantLocales, useI18n, i18n } from './locales'; // 导入所有翻译信息 const { t, locale } = useI18n(); const router = useRouter() @@ -72,7 +74,7 @@ const language = [ ] // 切换语言 const switchLocale = (language) => { - debugger + // Vant basic vantLocales(language) // Business component @@ -106,7 +108,7 @@ const initTheme = () => { } } const initI18n = () => { - debugger + const cacheLocale = localStorage.getItem('ZerotierForKSU.locale') if (typeof cacheLocale != "undefined" && cacheLocale != null) { i18n.global.locale = cacheLocale @@ -158,11 +160,16 @@ initI18n() background-color: #f7f8fa; --van-dialog-background: #f7f8fa; } + * { - -webkit-touch-callout:none; /*系统默认菜单被禁用*/ - -webkit-user-select:none; /*webkit浏览器*/ - -moz-user-select:none;/*火狐*/ - -ms-user-select:none; /*IE10*/ - user-select:none; + -webkit-touch-callout: none; + /*系统默认菜单被禁用*/ + -webkit-user-select: none; + /*webkit浏览器*/ + -moz-user-select: none; + /*火狐*/ + -ms-user-select: none; + /*IE10*/ + user-select: none; } diff --git a/ui-src/src/Center.vue b/ui-src/src/Center.vue index 1e20bce..6c1dbdf 100644 --- a/ui-src/src/Center.vue +++ b/ui-src/src/Center.vue @@ -1,7 +1,7 @@ @@ -9,44 +9,42 @@ // import { ref } from 'vue'; // import { useRoute, useRouter } from 'vue-router' import { MODDIR, execCmdWithCallback, execCmdWithErrno } from './tools' -import { useI18n } from './locales'; // 导入所有翻译信息 +import { useI18n } from './locales'; // 导入所有翻译信息 const { t } = useI18n(); const router = useRouter() const route = useRoute() -const show=ref(false); +const show = ref(false); const init = () => { execCmdWithErrno(`sh ${MODDIR}/api.sh apiToken show`).then(v => { console.info(`v:${v}`) if (v == 0) { router.push('/center/network') } else { - show.value=true; + show.value = true; // showDialog({ message: '未配置apiToken,先去设置页添加一个吧' }); } }) } init() -const beforeClose = (action) => { - new Promise((resolve) => { +const newAdd = (index) => { + showConfirmDialog({ + message: + t('network.ask_new_network'), + }).then(() => { setTimeout(() => { execCmdWithCallback({ cmd: `sh ${MODDIR}/api.sh central network add`, onSuccess: (data) => { showToast(t('network.operation_success')); + window.location.reload(); }, onError: (data) => { showToast(t('network.operation_fail') + data); } }) - resolve(true); }, 50); - }); -} -const newAdd = (index) => { - showConfirmDialog({ - message: - t('network.ask_new_network'), - beforeClose + }).catch(() => { + resolve(true); }) } defineExpose({ newAdd }); diff --git a/ui-src/src/NetworkDetail.vue b/ui-src/src/NetworkDetail.vue index 5ce8a9a..55b9874 100644 --- a/ui-src/src/NetworkDetail.vue +++ b/ui-src/src/NetworkDetail.vue @@ -1,13 +1,14 @@ - - + + + input-align="right" :label="t('networkDetail.multicastLimit')" placeholder="32" type="digit" is-link + @blur="updateNetwork(5)" /> @@ -150,7 +156,8 @@ - +