Compare commits

..

7 Commits

Author SHA1 Message Date
a12552a608 🎨去除首页的诗词 2024-08-27 09:48:48 +08:00
5f200ea989 🎨不想写啦 2024-08-23 11:25:27 +08:00
3f14df72be 📝修改文档 2024-08-23 10:36:21 +08:00
29902afe65 📝添加readme 2024-08-23 10:29:37 +08:00
coward
ddef41dfca 添加 web/.env 2024-08-22 16:02:01 +08:00
6c6b40593e 🎨优化 2024-08-22 16:01:00 +08:00
45d83da5c7 🎨优化一哈 2024-08-22 15:37:21 +08:00
20 changed files with 5000 additions and 32 deletions

56
.gitignore vendored
View File

@@ -233,33 +233,33 @@ fabric.properties
# vendor/
# Go workspace file
go.work
./go.work
.idea
web/.idea
./.idea
./web/.idea
web/node_modules
web/.DS_Store
web/dist
web/dist-ssr
web/*.local
web/.eslintcache
web/report.html
web/vite.config.*.timestamp*
./web/node_modules
./web/.DS_Store
./web/dist
./web/dist-ssr
./web/*.local
./web/.eslintcache
./web/report.html
./web/vite.config.*.timestamp*
web/yarn.lock
web/npm-debug.log*
web/.pnpm-error.log*
web/.pnpm-debug.log
web/tests/**/coverage/
web/.vscode/
./web/yarn.lock
./web/npm-debug.log*
./web/.pnpm-error.log*
./web/.pnpm-debug.log
./web/tests/**/coverage/
./web/.vscode/
# Editor directories and files
web/*.suo
web/*.ntvs*
web/*.njsproj
web/*.sln
web/tsconfig.tsbuildinfo
./web/*.suo
./web/*.ntvs*
./web/*.njsproj
./web/*.sln
./web/tsconfig.tsbuildinfo
dist/assets
dist/resource
@@ -267,10 +267,10 @@ dist/favicon.png
dist/favicon.svg
dist/index.html
template/tmp/*
logs/*
app.yaml
*.db
.env
*.env
./template/tmp/*
./logs/*
./app.yaml
./*.db
./.env
./*.env

91
README.md Normal file
View File

@@ -0,0 +1,91 @@
# Wireguard-UI
> wireguard的管理面板UI
## 安装(仅提供docker方式)
OS X & Linux & Windows:
```sh
# 先要创建一个配置文件 app.yaml
http:
port: 6687
endpoint: localhost:3100,localhost:6687
database:
driver: sqlite # sqlite时只填写db即可目前仅支持sqlite | mysql | pgsql
host:
port:
user:
password:
db: wg
cache:
type: redis # 缓存类型 暂时仅支持redis
host: 192.168.1.1
port: 6379
password: pGhQKwj7DE7FbFL1
db: 15
file:
type: oss # 文件类型支持本地文件存储与阿里云oss存储
path: test/ # oss填写前缀目录
endpoint: # oss必填
accessId: # oss必填
accessSecret: # oss必填
bucketName: # oss必填
# 邮件设置
mail:
host:
port:
user:
password:
skipTls:
# 一些系统配置
wireguard:
restartMode: DELAY
delayTime: 20
# 其中依赖了redis等自行安装一个即可
```
```sh
# 创建docker-compose.yaml
version: "3"
services:
wg:
image: gitea.mrx.ltd/go-pkg/wireguard-srv:2.1.0
container_name: wg-srv
restart: always
cap_add:
- NET_ADMIN
network_mode: host
logging:
driver: json-file
options:
max-size: 50m
volumes:
- ./app.yaml:/app/app.yaml
- ./db:/app/db
- ./logs:/app/logs
- /etc/wireguard:/etc/wireguard
- /etc/localtime:/etc/localtime
```
```sh
默认账户密码
账户: admin
密码: admin123
```
## 示例
![img.png](img.png)
![img_1.png](img_1.png)
![img_7.png](img_7.png)
![img_8.png](img_8.png)
![img_2.png](img_2.png)
![img_3.png](img_3.png)
![img_4.png](img_4.png)
![img_5.png](img_5.png)
![img_6.png](img_6.png)

33
http/api/remote.go Normal file
View File

@@ -0,0 +1,33 @@
package api
import "github.com/gin-gonic/gin"
type remote struct{}
func Remote() remote {
return remote{}
}
// SaveAuthClient
// @description: 添加授权客户端
// @receiver remote
// @param c
func (remote) SaveAuthClient(c *gin.Context) {
return
}
// DeleteAuthClient
// @description: 删除授权客户端
// @receiver remote
// @param c
func (remote) DeleteAuthClient(c *gin.Context) {
return
}
// GetClientNodes
// @description: 获取客户端节点
// @receiver remote
// @param c
func (remote) GetClientNodes(c *gin.Context) {
return
}

BIN
img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

BIN
img_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
img_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
img_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
img_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
img_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
img_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
img_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

BIN
img_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

3
web/.env Normal file
View File

@@ -0,0 +1,3 @@
VITE_TITLE = 'Wireguard-UI'
VITE_PORT = 3100

View File

@@ -37,7 +37,6 @@ export async function addDynamicRoutes() {
// 有token的情况
const userStore = useUserStore()
try {
const permissionStore = usePermissionStore()
!userStore.id && (await userStore.getUserInfo())
@@ -49,8 +48,8 @@ export async function addDynamicRoutes() {
router.addRoute(NOT_FOUND_ROUTE)
} catch (error) {
console.error(error)
$message.error('初始化用户信息失败: ' + error)
userStore.logout()
$message.error('初始化用户信息失败: ' + error)
}
}

View File

@@ -6,6 +6,7 @@ export default {
component: Layout,
redirect: '/client',
meta: {
title: '客户端',
order: 2,
},
children: [

View File

@@ -6,6 +6,7 @@ export default {
component: Layout,
redirect: '/setting',
meta: {
title: '设置',
order: 3,
},
children: [

View File

@@ -6,6 +6,7 @@ export default {
component: Layout,
redirect: '/user',
meta: {
title: '管理员',
order: 1,
},
children: [

View File

@@ -10,7 +10,7 @@
</div>
</div>
<p class="mt-40 text-14 opacity-60" style="cursor: pointer" @click="dailyPoe">{{ dailyPoetry.content || '莫向外求但从心觅行有不得反求诸己' }}</p>
<p class="mt-40 text-14 opacity-60">{{ dailyPoetry.content || '莫向外求,但从心觅,行有不得,反求诸己。' }}</p>
<p class="mt-32 text-right text-12 opacity-40"> {{ dailyPoetry.author || '佚名' }}</p>
</n-card>
<n-card class="ml-12 w-70%">
@@ -233,7 +233,7 @@ async function getClientConnections() {
const initFunc = debounce(() => {
getClientConnections()
dailyPoe()
// dailyPoe()
// connectionList()
},500)

View File

@@ -6,6 +6,7 @@ export default {
component: Layout,
redirect: '/workbench',
meta: {
title: '工作台',
order: 0,
},
children: [

4838
web/stats.html Normal file

File diff suppressed because one or more lines are too long