Skip to content

Commit

Permalink
Merge pull request #30 from powerAn2020/dev
Browse files Browse the repository at this point in the history
BUG修复
  • Loading branch information
powerAn2020 authored Oct 15, 2024
2 parents 6bdbbe9 + 79dc5f6 commit 2ea7bde
Show file tree
Hide file tree
Showing 13 changed files with 123 additions and 92 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ updates:
directory: "/ui-src" # Location of package manifests
schedule:
interval: "weekly"
target-branch: "dev"
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: release
on:
workflow_dispatch:
schedule:
- cron: '35 9 * * 1'
- cron: '40 7 * * 2'
# push:

permissions:
Expand All @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

基于KSU WEBUI实现的Zertier客户端,同时支持部分zerotier服务端功能。
Magisk需要搭配[5ec1cff/KsuWebUIStandalone](https://github.com/5ec1cff/KsuWebUIStandalone)使用
自1.14.0之后KSU版本需要在`11928`以上才能正常使用UI,或者使用[5ec1cff/KsuWebUIStandalone](https://github.com/5ec1cff/KsuWebUIStandalone)

## BUG

Expand Down
3 changes: 2 additions & 1 deletion api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down Expand Up @@ -243,6 +243,7 @@ local)
local_peer
;;
firewall)
shift
local_firewall $1
;;
router)
Expand Down
2 changes: 1 addition & 1 deletion changelog_dev.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
更新工作流
修复9993端口操作失败的问题,修复路由管理错位删除的问题,修复网络管理页面弹窗不能关闭的问题
2 changes: 1 addition & 1 deletion ui-src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
39 changes: 23 additions & 16 deletions ui-src/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
<template #left>
<van-space>
<van-icon size="1.2rem" @click="switchTheme" :name="iconName" />
<van-icon size="1.2rem" :name="lang" @click="localeShow = true" />
</van-space>
</template>
<template #right>
<!-- <el-icon><icon-ep-sunny /></el-icon>
<el-icon><icon-ep-moon /></el-icon> -->
<!-- <v-icon name="bi-music-player" /> -->
<van-icon v-if="router.currentRoute.value.fullPath !== '/setting'" :name="add" size="1.2rem"
@click="newAdd(undefined)" />
<van-space>
<van-icon v-if="router.currentRoute.value.fullPath !== '/setting'" :name="add" size="1.2rem"
@click="newAdd(undefined)" />
<van-icon size="1.2rem" :name="lang" @click="localeShow = true" />
</van-space>
</template>
</van-nav-bar>
<!-- <div style="height: 5rem;"></div> -->
Expand All @@ -22,8 +24,8 @@
</router-view>
<div style="height: 0.1rem;"></div>
<van-tabbar route safe-area-inset-bottom>
<van-tabbar-item replace to="/" icon="home-o">{{t('common.dash')}}</van-tabbar-item>
<van-tabbar-item replace to="/peers" icon="friends-o">{{t('common.peers')}}</van-tabbar-item>
<van-tabbar-item replace to="/" icon="home-o">{{ t('common.dash') }}</van-tabbar-item>
<van-tabbar-item replace to="/peers" icon="friends-o">{{ t('common.peers') }}</van-tabbar-item>
<van-tabbar-item replace to="/center">
<template #icon>
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 36 36">
Expand All @@ -36,11 +38,11 @@
</svg>

</template>
{{t('common.network')}}
{{ t('common.network') }}
</van-tabbar-item>
<van-tabbar-item replace to="/setting" icon="setting-o">{{t('common.setting')}}</van-tabbar-item>
<van-tabbar-item replace to="/setting" icon="setting-o">{{ t('common.setting') }}</van-tabbar-item>
</van-tabbar>
<van-action-sheet v-model:show="localeShow" :actions="language" @select="switchLocale" close-on-click-action/>
<van-action-sheet v-model:show="localeShow" :actions="language" @select="switchLocale" close-on-click-action />

</van-config-provider>
<!-- <van-floating-bubble icon="replay" axis="xy" magnetic="x" @click="onClick" /> -->
Expand All @@ -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()
Expand All @@ -72,7 +74,7 @@ const language = [
]
// 切换语言
const switchLocale = (language) => {
debugger
// Vant basic
vantLocales(language)
// Business component
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
</style>
26 changes: 12 additions & 14 deletions ui-src/src/Center.vue
Original file line number Diff line number Diff line change
@@ -1,52 +1,50 @@
<template>
<div style="height: 0.1rem;"></div>
<router-view />
<van-empty :description="t('network.api-not-found')" v-if="show"/>
<van-empty :description="t('network.api-not-found')" v-if="show" />
<div style="height: 2.8rem;"></div>
</template>

<script setup>
// 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 });
Expand Down
Loading

0 comments on commit 2ea7bde

Please sign in to comment.