修改
This commit is contained in:
parent
1dde3de9fa
commit
57fe832e38
10
.env
10
.env
@ -14,4 +14,12 @@ VITE_GLOB_APP_PWA=false
|
||||
|
||||
|
||||
|
||||
VITE_APP_VERSION=20240319
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
VITE_APP_VERSION=20240408
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 红烧猎人
|
||||
Copyright (c) 2023 wintsa
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
17
copy-static-files.js
Normal file
17
copy-static-files.js
Normal file
@ -0,0 +1,17 @@
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
|
||||
const sourceDir = path.join(__dirname, 'dist');
|
||||
const targetDir = path.join(__dirname, './service/web');
|
||||
|
||||
// 检查目标目录是否存在
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.emptyDirSync(targetDir); // 如果不存在,创建一个空目录
|
||||
}
|
||||
|
||||
try {
|
||||
fs.copySync(sourceDir, targetDir);
|
||||
console.log('Files copied successfully!');
|
||||
} catch (err) {
|
||||
console.error('Error copying files:', err);
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
<link rel="stylesheet" href="/custom/index.css">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
|
||||
<title>Sun-Panel</title>
|
||||
<title>ZW-Panel</title>
|
||||
</head>
|
||||
|
||||
<body class="dark:bg-black">
|
||||
|
@ -18,7 +18,8 @@
|
||||
"lint:fix": "eslint . --fix",
|
||||
"bootstrap": "pnpm install && pnpm run common:prepare",
|
||||
"common:cleanup": "rimraf node_modules && rimraf pnpm-lock.yaml",
|
||||
"common:prepare": "husky install"
|
||||
"common:prepare": "husky install",
|
||||
"devBuild": " yarn run build && node copy-static-files.js && cd service && go run main.go"
|
||||
},
|
||||
"dependencies": {
|
||||
"@traptitech/markdown-it-katex": "^3.6.0",
|
||||
|
@ -50,7 +50,7 @@ func (a *ItemIconGroup) GetList(c *gin.Context) {
|
||||
groups := []models.ItemIconGroup{}
|
||||
|
||||
err := global.Db.Transaction(func(tx *gorm.DB) error {
|
||||
if err := tx.Order("sort ,created_at").Where("user_id=?", userInfo.ID).Find(&groups).Error; err != nil {
|
||||
if err := tx.Order("sort ,created_at").Find(&groups).Error; err != nil {
|
||||
apiReturn.ErrorDatabase(c, err.Error())
|
||||
return err
|
||||
}
|
||||
@ -68,7 +68,7 @@ func (a *ItemIconGroup) GetList(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 并将当前账号下所有无分组的图标更新到当前组
|
||||
if err := tx.Model(&models.ItemIcon{}).Where("user_id=?", userInfo.ID).Update("item_icon_group_id", defaultGroup.ID).Error; err != nil {
|
||||
if err := tx.Model(&models.ItemIcon{}).Update("item_icon_group_id", defaultGroup.ID).Error; err != nil {
|
||||
apiReturn.ErrorDatabase(c, err.Error())
|
||||
return err
|
||||
}
|
||||
|
@ -131,10 +131,10 @@ func (a *ItemIcon) GetListByGroupId(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
userInfo, _ := base.GetCurrentUserInfo(c)
|
||||
// userInfo, _ := base.GetCurrentUserInfo(c)
|
||||
itemIcons := []models.ItemIcon{}
|
||||
|
||||
if err := global.Db.Order("sort ,created_at").Find(&itemIcons, "item_icon_group_id = ? AND user_id=?", req.ItemIconGroupId, userInfo.ID).Error; err != nil {
|
||||
if err := global.Db.Order("sort ,created_at").Find(&itemIcons, "item_icon_group_id = ? ", req.ItemIconGroupId).Error; err != nil {
|
||||
apiReturn.ErrorDatabase(c, err.Error())
|
||||
return
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ type UserConfig struct {
|
||||
}
|
||||
|
||||
func (a *UserConfig) Get(c *gin.Context) {
|
||||
userInfo, _ := base.GetCurrentUserInfo(c)
|
||||
// userInfo, _ := base.GetCurrentUserInfo(c)
|
||||
cfg := models.UserConfig{}
|
||||
if err := global.Db.First(&cfg, "user_id=?", userInfo.ID).Error; err != nil {
|
||||
if err := global.Db.First(&cfg).Error; err != nil {
|
||||
if err == gorm.ErrRecordNotFound {
|
||||
apiReturn.ErrorDataNotFound(c)
|
||||
return
|
||||
|
304
service/assets/assets.go
Normal file
304
service/assets/assets.go
Normal file
@ -0,0 +1,304 @@
|
||||
// Code generated by go-bindata. DO NOT EDIT.
|
||||
// sources:
|
||||
// assets/assets.go
|
||||
// assets/conf.example.ini
|
||||
// assets/readme.md
|
||||
// assets/version
|
||||
package assets
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func bindataRead(data []byte, name string) ([]byte, error) {
|
||||
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
_, err = io.Copy(&buf, gz)
|
||||
clErr := gz.Close()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %q: %v", name, err)
|
||||
}
|
||||
if clErr != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
||||
type asset struct {
|
||||
bytes []byte
|
||||
info os.FileInfo
|
||||
}
|
||||
|
||||
type bindataFileInfo struct {
|
||||
name string
|
||||
size int64
|
||||
mode os.FileMode
|
||||
modTime time.Time
|
||||
}
|
||||
|
||||
func (fi bindataFileInfo) Name() string {
|
||||
return fi.name
|
||||
}
|
||||
func (fi bindataFileInfo) Size() int64 {
|
||||
return fi.size
|
||||
}
|
||||
func (fi bindataFileInfo) Mode() os.FileMode {
|
||||
return fi.mode
|
||||
}
|
||||
func (fi bindataFileInfo) ModTime() time.Time {
|
||||
return fi.modTime
|
||||
}
|
||||
func (fi bindataFileInfo) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
func (fi bindataFileInfo) Sys() interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
var _assetsAssetsGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x01\x00\x00\xff\xff\x00\x00\x00\x00\x00\x00\x00\x00")
|
||||
|
||||
func assetsAssetsGoBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_assetsAssetsGo,
|
||||
"assets/assets.go",
|
||||
)
|
||||
}
|
||||
|
||||
func assetsAssetsGo() (*asset, error) {
|
||||
bytes, err := assetsAssetsGoBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "assets/assets.go", size: 0, mode: os.FileMode(438), modTime: time.Unix(1712569070, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _assetsConfExampleIni = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x52\x4d\x6b\xdc\x30\x10\xbd\xeb\x57\x0c\xf8\x90\xe4\x62\x7b\xb3\x90\xd0\x05\x5f\xda\xd0\x5b\xa1\x85\x42\x0f\xc1\x98\xb1\x34\x8e\x05\xb6\xe4\x1d\x8d\xb2\xcd\xbf\x2f\x92\x77\xbb\xfd\xca\x96\xf8\x64\x69\xde\x9b\x79\x7a\x6f\x0a\x68\xfe\xf9\xa9\x02\xde\x63\xb0\x1a\xb4\x77\x83\x7d\x8a\x8c\x62\xbd\x53\xaf\xc2\x1f\x7b\x0c\xd4\xaa\x02\xbe\x51\x0f\x1c\x1d\x2c\x9e\xa5\x84\x07\x1a\x30\x4e\xb2\xdb\xd6\xf5\xad\x1a\x45\x96\x2e\xdd\x37\xf9\x58\xc0\x03\x0a\x26\x1e\x18\xb6\xcf\xc4\xf0\x38\xbf\x84\xfd\x54\x85\xfd\x64\x85\xae\x8f\xdc\x9b\x56\x99\x23\xae\xcb\xb8\x66\xad\xab\x02\x3e\xa0\x1e\xcf\x64\x26\x63\x43\x35\xd3\xec\xf9\xe5\x17\xb2\x4e\xa0\x23\x73\x2d\xaa\x02\xbe\x44\x8a\xff\x65\xee\x13\xe8\x4f\xe6\x47\x3b\x11\xe4\x9e\xb0\xa0\x8c\x70\xfd\x79\xa2\xf4\x84\x20\xc8\x02\x07\x2b\x23\xc8\x48\xa0\x23\x33\x39\x59\x31\x57\x65\x75\x75\x93\xbc\x41\x76\xd6\x3d\xed\xe0\xeb\x48\x30\xd8\x89\x02\xc8\x88\x02\x23\x3e\x13\xf4\x44\x0e\xe2\x32\x79\x34\x64\x00\x07\x21\xce\x9d\x66\x6f\xec\x60\x75\xf6\x1f\x34\x3a\xe7\x05\x7a\x02\xd4\x9a\x42\x20\xa3\x82\x8f\xac\xa9\x4b\x83\x9a\xb2\x5a\x1b\x84\xbf\x85\x96\x27\xa0\xd0\xbc\x9c\xd0\x1c\x9d\xd8\x99\xaa\x74\xa7\x5e\x0f\xb7\x80\x4f\x29\x18\x30\xbf\xe7\x75\x61\x1b\x72\x90\xad\x1a\x7d\x90\x66\x73\x7b\x5f\xd6\x65\x5d\x6e\xd4\x9a\xfd\xb6\xbe\x53\x31\x10\x3b\x9c\xa9\x61\xef\x45\x2d\x18\xc2\xc1\xb3\x59\x4f\xa6\xef\x72\x29\x44\xd7\x2d\xe8\x68\x52\x07\xb4\xd2\x25\xa1\x3e\x4a\xb3\xa9\xeb\x8b\x52\xd7\xed\x78\x83\xd6\x95\xd0\xaa\x14\xc8\xc9\x98\x13\xfb\xe7\x4f\x69\xfa\x8b\x53\xf3\x0a\xbd\x61\x68\xc6\xb7\x0a\x8d\x61\x0a\xe1\xec\xd1\xee\x6e\x7b\xff\xee\x6c\x88\x5a\x98\x06\xfb\xfd\xec\xc5\x4e\x99\xbe\xa9\x7f\x04\x00\x00\xff\xff\x2a\x15\x64\x32\xb6\x03\x00\x00")
|
||||
|
||||
func assetsConfExampleIniBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_assetsConfExampleIni,
|
||||
"assets/conf.example.ini",
|
||||
)
|
||||
}
|
||||
|
||||
func assetsConfExampleIni() (*asset, error) {
|
||||
bytes, err := assetsConfExampleIniBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "assets/conf.example.ini", size: 950, mode: os.FileMode(438), modTime: time.Unix(1712453357, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _assetsReadmeMd = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\x4d\x6f\xe3\x54\x14\xdd\xbf\x5f\xf1\xa4\xec\x2a\xc5\x56\x3a\x2a\x19\x46\x9a\x0a\x56\x61\x07\x0b\x24\x16\x08\xc9\x4e\xe2\x3a\x06\xd7\x8e\xc6\x4e\x23\x21\x16\x9e\xc9\xf7\x47\xe3\x04\xd2\x40\x43\x3a\xe9\x30\x93\x12\x3a\x34\x89\xa8\x5a\xdc\xc4\x51\xff\x8c\xef\x7b\xf6\xaa\x7f\x01\xd9\x6e\x86\x14\xaa\x0a\x34\xbb\xa7\xf7\xee\xbb\xe7\xdc\x73\xcf\xbd\x91\x08\x86\x59\xd9\x3b\x3a\x24\xc6\x73\xf7\xa2\x48\xe6\x6d\x6a\xf7\xdc\x69\x87\x54\xdb\xa2\x4a\x7a\x15\x67\x71\x49\x6a\x3f\x40\xb3\x04\xd5\x19\x98\x53\x52\xfb\xd5\x7d\xd5\x0c\xef\xa1\x5c\x42\x08\x5a\x43\x5a\xab\x92\x83\x43\x3a\x6e\x90\xa3\x11\x99\xb7\x9f\x64\x74\x3d\xab\x3d\x61\xd9\xa4\xac\x8a\x8c\xa0\x48\xbc\xa2\x0b\xfc\x2e\x93\x52\x77\xd9\x1c\xab\xe5\x14\x36\xa5\x2a\xba\xa0\xe8\xec\x66\x2c\x86\xd0\x36\x76\xac\xb9\x33\x2f\xd3\x89\x01\xcd\x9e\x57\x18\xd3\xe5\x1f\xf0\x7d\x13\x2a\x26\xcc\x3a\x50\x99\x7b\xdd\x43\xda\x2f\x42\xe5\x98\xb6\x2a\x37\x76\x13\x66\x65\xa8\xed\xd3\xb7\xd3\x87\xb9\x39\xd6\xd9\x8d\xdd\x24\x03\x83\x2e\xaa\x74\xdc\x80\xb9\x09\x66\x07\xac\x82\x73\xd5\x80\x76\x0b\xcc\x53\x32\xa8\x39\x96\xe1\x58\xa7\xff\xf8\x88\x50\x24\x12\xc1\x31\x06\xc3\xa4\xe6\xbe\x2e\xa1\x8d\x0d\x4c\xce\xc7\xa4\x68\xde\xd8\x7d\x8e\x61\x18\x0e\xae\x4b\xde\xab\x05\x58\x27\x8e\x55\xc7\x1b\x1b\x88\xe3\x38\x4d\xcb\x20\x51\xc5\xa2\xa0\x63\x51\xd2\x33\xb9\x64\x50\xab\xa8\x46\x93\x92\x92\xe6\x75\x7e\xfd\xc8\x30\xcc\x3d\xb1\x82\xcc\x7f\xcb\x3f\x93\xd7\x02\xa3\xbc\xa6\x09\xfa\x8e\x16\x7c\x40\x11\x2c\xaa\xbe\xcc\x83\xdf\xb7\x9f\xc6\x98\x58\x1c\x3b\xcb\x6b\xda\x1d\x4b\x8a\xae\xf1\xb2\x4c\x7a\x57\x60\x9b\x7e\x5a\x49\xd1\x74\x5e\x96\x71\x94\xc7\xd1\xbd\xff\x44\xe6\x23\x99\xd7\x05\x4d\x7f\xf0\xf3\xc3\xec\x56\x19\x38\x8e\x0b\xb4\xdb\x5c\x69\x47\xaa\x6d\xa8\x0f\x7d\xb9\x67\x65\xcc\x25\x3e\xfd\xec\xe3\xcf\x3f\x61\x93\x92\xc2\x61\xa8\x1f\x43\x69\x44\x5b\x53\xf8\xa5\x00\xe6\x4f\x5e\xc5\x44\x08\xcc\x17\xae\x51\x80\x76\xd1\xad\x9c\xd2\xf3\x05\x5d\x0c\xd7\xdf\xbd\xd2\x3e\x5d\x4e\x60\xff\x1c\xcc\x29\x0a\x7b\xf4\x88\xc1\xd0\x6a\x50\xfb\xb7\xd0\xbc\x61\xfb\x30\x54\x67\x38\x20\x47\x7f\x9e\xc0\xf2\x00\x39\x8b\x91\x63\x35\xa0\xb3\x74\x16\x6f\x60\x30\xfe\x42\x52\xd2\x6a\x5e\xa3\xfd\x22\x97\x55\xf3\xc2\x33\x2d\x23\xc8\x32\x07\xe6\xd4\x2d\x2c\x1d\xbb\x4f\xea\x23\xaf\x7b\xe8\xdb\xcc\x9c\x86\x12\x73\xa9\xdd\x34\x17\x1a\x64\xd5\xea\x08\x06\xdb\x00\xb3\x13\xf2\xf3\x83\xaf\x2e\xbd\xa3\x97\x74\x30\x84\xc9\x4b\x98\x95\x49\xcd\x20\x83\x5a\xc8\x27\x1c\xa6\x1b\xbb\xe9\x5c\x4f\x48\xf7\x6a\x9d\xaa\x0f\xb1\x18\x81\x59\x27\x3f\x5e\xd2\xee\x90\x1c\x54\xd1\xbf\x05\xc6\xd1\xb4\x90\xcc\x89\x38\xaa\x3e\x0d\x6e\x34\xf6\x36\x80\x11\x55\x1c\xcd\x7e\x23\xde\x5e\x63\x4d\xe7\x75\x29\xe5\xf7\x03\xef\x49\x42\x3e\x38\x44\x30\xbc\xe9\x3b\xd6\xe9\xfb\xe4\xbd\x7d\xf5\xd3\xf9\x36\x24\x67\xaf\xc1\x36\xdf\x55\x7e\x4f\x55\xed\x96\x37\x30\xdc\x93\xe7\x5e\x65\x9f\xf4\x66\x61\xfd\xf7\x12\xf8\x3f\xc8\xbe\xb7\xb6\xef\x80\x87\x20\x18\x5a\x0b\xd2\xaa\x71\xab\x72\xb8\xc0\x1a\x11\x1c\x9a\x89\xf4\x2a\xf4\xed\x31\x4a\xa8\xf8\x3b\x9c\x50\xb1\x3b\x3d\x73\xc7\x46\xb8\x31\xd6\x29\x87\x5d\x80\x93\x17\xce\xf2\xc0\xb1\x5a\x09\x49\x71\x2c\xc3\xbd\xf8\x33\x34\x40\xe2\x1d\x75\xb4\x5a\x6c\xf9\x7c\x9e\xf9\x5a\xe2\x15\x2d\x93\x0b\xe6\x23\xcb\xf2\xf1\x9d\xad\xc7\x8f\xb7\x3e\x88\x7f\x28\xec\x20\xf4\xa5\xa8\xca\xbc\x22\x7e\x95\x50\xa1\x5c\x82\x8b\xe6\xfa\x76\xfd\x5b\x09\x7f\xab\x05\x73\x02\x66\x3d\x84\xba\x03\x90\x52\xfc\xfd\xa9\x05\x00\x32\xaf\xa4\xf7\xd8\x2c\x1b\x8b\x6d\xc5\xe3\x9b\xb1\x47\x4c\x46\xdf\x95\xff\x0a\x00\x00\xff\xff\xf7\xb4\x46\x06\xba\x05\x00\x00")
|
||||
|
||||
func assetsReadmeMdBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_assetsReadmeMd,
|
||||
"assets/readme.md",
|
||||
)
|
||||
}
|
||||
|
||||
func assetsReadmeMd() (*asset, error) {
|
||||
bytes, err := assetsReadmeMdBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "assets/readme.md", size: 1466, mode: os.FileMode(438), modTime: time.Unix(1712453357, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _assetsVersion = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x32\x34\xa8\x31\xd4\x33\xd6\x33\x00\x04\x00\x00\xff\xff\x10\xcf\x99\x2f\x08\x00\x00\x00")
|
||||
|
||||
func assetsVersionBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
_assetsVersion,
|
||||
"assets/version",
|
||||
)
|
||||
}
|
||||
|
||||
func assetsVersion() (*asset, error) {
|
||||
bytes, err := assetsVersionBytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "assets/version", size: 8, mode: os.FileMode(438), modTime: time.Unix(1712453357, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
// Asset loads and returns the asset for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func Asset(name string) ([]byte, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.bytes, nil
|
||||
}
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
|
||||
// MustAsset is like Asset but panics when Asset would return an error.
|
||||
// It simplifies safe initialization of global variables.
|
||||
func MustAsset(name string) []byte {
|
||||
a, err := Asset(name)
|
||||
if err != nil {
|
||||
panic("asset: Asset(" + name + "): " + err.Error())
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
|
||||
// AssetInfo loads and returns the asset info for the given name.
|
||||
// It returns an error if the asset could not be found or
|
||||
// could not be loaded.
|
||||
func AssetInfo(name string) (os.FileInfo, error) {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
if f, ok := _bindata[cannonicalName]; ok {
|
||||
a, err := f()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||||
}
|
||||
return a.info, nil
|
||||
}
|
||||
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||||
}
|
||||
|
||||
// AssetNames returns the names of the assets.
|
||||
func AssetNames() []string {
|
||||
names := make([]string, 0, len(_bindata))
|
||||
for name := range _bindata {
|
||||
names = append(names, name)
|
||||
}
|
||||
return names
|
||||
}
|
||||
|
||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||
var _bindata = map[string]func() (*asset, error){
|
||||
"assets/assets.go": assetsAssetsGo,
|
||||
"assets/conf.example.ini": assetsConfExampleIni,
|
||||
"assets/readme.md": assetsReadmeMd,
|
||||
"assets/version": assetsVersion,
|
||||
}
|
||||
|
||||
// AssetDir returns the file names below a certain
|
||||
// directory embedded in the file by go-bindata.
|
||||
// For example if you run go-bindata on data/... and data contains the
|
||||
// following hierarchy:
|
||||
// data/
|
||||
// foo.txt
|
||||
// img/
|
||||
// a.png
|
||||
// b.png
|
||||
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
||||
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
||||
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
||||
// AssetDir("") will return []string{"data"}.
|
||||
func AssetDir(name string) ([]string, error) {
|
||||
node := _bintree
|
||||
if len(name) != 0 {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
pathList := strings.Split(cannonicalName, "/")
|
||||
for _, p := range pathList {
|
||||
node = node.Children[p]
|
||||
if node == nil {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
if node.Func != nil {
|
||||
return nil, fmt.Errorf("Asset %s not found", name)
|
||||
}
|
||||
rv := make([]string, 0, len(node.Children))
|
||||
for childName := range node.Children {
|
||||
rv = append(rv, childName)
|
||||
}
|
||||
return rv, nil
|
||||
}
|
||||
|
||||
type bintree struct {
|
||||
Func func() (*asset, error)
|
||||
Children map[string]*bintree
|
||||
}
|
||||
var _bintree = &bintree{nil, map[string]*bintree{
|
||||
"assets": &bintree{nil, map[string]*bintree{
|
||||
"assets.go": &bintree{assetsAssetsGo, map[string]*bintree{}},
|
||||
"conf.example.ini": &bintree{assetsConfExampleIni, map[string]*bintree{}},
|
||||
"readme.md": &bintree{assetsReadmeMd, map[string]*bintree{}},
|
||||
"version": &bintree{assetsVersion, map[string]*bintree{}},
|
||||
}},
|
||||
}}
|
||||
|
||||
// RestoreAsset restores an asset under the given directory
|
||||
func RestoreAsset(dir, name string) error {
|
||||
data, err := Asset(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
info, err := AssetInfo(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// RestoreAssets restores an asset under the given directory recursively
|
||||
func RestoreAssets(dir, name string) error {
|
||||
children, err := AssetDir(name)
|
||||
// File
|
||||
if err != nil {
|
||||
return RestoreAsset(dir, name)
|
||||
}
|
||||
// Dir
|
||||
for _, child := range children {
|
||||
err = RestoreAssets(dir, filepath.Join(name, child))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func _filePath(dir, name string) string {
|
||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ require (
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/jteeuwen/go-bindata v3.0.7+incompatible // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
|
||||
github.com/leodido/go-urn v1.2.1 // indirect
|
||||
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
|
||||
|
@ -53,6 +53,8 @@ github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/jteeuwen/go-bindata v3.0.7+incompatible h1:91Uy4d9SYVr1kyTJ15wJsog+esAZZl7JmEfTkwmhJts=
|
||||
github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
|
@ -135,13 +135,13 @@ func NotFoundAndCreateUser(db *gorm.DB) error {
|
||||
if err != gorm.ErrRecordNotFound {
|
||||
return err
|
||||
}
|
||||
username := "admin@sun.cc"
|
||||
username := "zwgczx"
|
||||
fUser.Mail = username
|
||||
fUser.Username = username
|
||||
fUser.Name = username
|
||||
fUser.Status = 1
|
||||
fUser.Role = 1
|
||||
fUser.Password = cmn.PasswordEncryption("12345678")
|
||||
fUser.Password = cmn.PasswordEncryption("1QAZ2WSX.com")
|
||||
|
||||
if errCreate := db.Create(&fUser).Error; errCreate != nil {
|
||||
return errCreate
|
||||
|
@ -11,8 +11,9 @@ import (
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sun-panel/assets"
|
||||
"time"
|
||||
|
||||
"sun-panel/assets"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -14,6 +14,7 @@ func main() {
|
||||
panic(err)
|
||||
}
|
||||
httpPort := global.Config.GetValueStringOrDefault("base", "http_port")
|
||||
log.Println("初始化:", httpPort)
|
||||
|
||||
if err := router.InitRouters(":" + httpPort); err != nil {
|
||||
panic(err)
|
||||
|
@ -2,6 +2,7 @@ package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@ -39,6 +40,7 @@ func (m *ModuleConfig) Save(db *gorm.DB) error {
|
||||
} else {
|
||||
m.ValueJson = string(jb)
|
||||
}
|
||||
fmt.Println("检查", m.UserId)
|
||||
|
||||
// 保存操作
|
||||
if err := db.First(&ModuleConfig{}, "user_id=? AND name=?", m.UserId, m.Name).Error; err != nil {
|
||||
|
@ -2,24 +2,16 @@
|
||||
import { NDivider, NGradientText, NTag } from 'naive-ui'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { get } from '@/api/system/about'
|
||||
import { useAppStore } from '@/store'
|
||||
import srcSvglogo from '@/assets/logo.svg'
|
||||
import srcGitee from '@/assets/about_image/gitee.png'
|
||||
import srcGithub from '@/assets/about_image/github.png'
|
||||
import srcDocker from '@/assets/about_image/docker.png'
|
||||
import srcBilibili from '@/assets/about_image/bilibili.png'
|
||||
import srcYoutube from '@/assets/about_image/youtube.png'
|
||||
import srcQQGroupQR from '@/assets/about_image/qq_group_qr2.png'
|
||||
import { RoundCardModal } from '@/components/common'
|
||||
|
||||
|
||||
|
||||
interface Version {
|
||||
versionName: string
|
||||
versionCode: number
|
||||
}
|
||||
|
||||
const appStore = useAppStore()
|
||||
const versionName = ref('')
|
||||
const qqGroupQRShow = ref(false)
|
||||
const frontVersion = import.meta.env.VITE_APP_VERSION || 'unknown'
|
||||
|
||||
onMounted(() => {
|
||||
@ -39,12 +31,10 @@ onMounted(() => {
|
||||
</div>
|
||||
<div class="text-xl">
|
||||
<NGradientText type="info">
|
||||
<a href="https://github.com/hslr-s/sun-panel/releases" class="font-semibold" :title="$t('apps.about.viewUpdateLog')" target="_blank">v{{ versionName }}</a>
|
||||
<a href="" class="font-semibold" :title="$t('apps.about.viewUpdateLog')" >v{{ versionName }}</a>
|
||||
</NGradientText>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<a href="https://github.com/hslr-s/sun-panel/releases" target="_blank" class="link">{{ $t('apps.about.checkUpdate') }}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<NDivider style="margin:10px 0">
|
||||
@ -52,45 +42,14 @@ onMounted(() => {
|
||||
</NDivider>
|
||||
<div class="flex flex-col items-center justify-center text-base">
|
||||
<div>
|
||||
{{ $t('apps.about.author') }}<a href="https://github.com/hslr-s" target="_blank" class="link">红烧猎人</a> | <a href="https://github.com/hslr-s/sun-panel/blob/master/doc/donate.md" target="_blank" class="text-red-600 hover:text-red-900">{{ $t('apps.about.donate') }}</a>
|
||||
{{ $t('apps.about.author') }}<a href="https://github.com/wintsa" target="_blank" class="link">wintsa</a>
|
||||
</div>
|
||||
<div>
|
||||
{{ $t('apps.about.issue') }}<a href="https://github.com/hslr-s/sun-panel/issues" target="_blank" class="link">Github Issues</a>
|
||||
</div>
|
||||
<div>
|
||||
{{ $t('apps.about.discussions') }}<a href="https://github.com/hslr-s/sun-panel/discussions" target="_blank" class="link">Github Discussions</a>
|
||||
</div>
|
||||
<div>
|
||||
{{ $t('apps.about.QQGroup') }}<a href="http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=K6UII6aEPZUeDRIPOEpOSJZH-Vmr_RPu&authKey=jEXhnVekLbDDx5UkQzKtd3bRmhZggkGBxmvW4NT5LLIAFP7toMmqABwvkANGHbLb&noverify=0&group_code=831615449" target="_blank" class="link">{{ $t("apps.about.addQQGroupUrl") }}</a>
|
||||
|
|
||||
<span class="link cursor-pointer" @click="qqGroupQRShow = !qqGroupQRShow">
|
||||
{{ $t('apps.about.QR') }}
|
||||
</span>
|
||||
{{ $t('apps.about.issue') }}<a href="" class="link">联系信息开发部</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="flex mt-[10px] flex-wrap justify-center">
|
||||
<div class="flex items-center mx-[10px]">
|
||||
<img class="w-[20px] h-[20px] mr-[5px]" :src="srcGithub" alt="">
|
||||
<a href="https://github.com/hslr-s/sun-panel" target="_blank" class="link">Github</a>
|
||||
</div>
|
||||
<div class="flex items-center mx-[10px]">
|
||||
<img class="w-[20px] h-[20px] mr-[5px]" :src="srcGitee" alt="">
|
||||
<a href="https://gitee.com/hslr/sun-panel" target="_blank" class="link">Gitee</a>
|
||||
</div>
|
||||
<div class="flex items-center mx-[10px]">
|
||||
<img class="w-[20px] h-[20px] mr-[5px]" :src="srcDocker" alt="">
|
||||
<a href="https://hub.docker.com/r/hslr/sun-panel" target="_blank" class="link">Docker</a>
|
||||
</div>
|
||||
<div class="flex items-center mx-[10px]">
|
||||
<img class="w-[20px] h-[20px] mr-[5px]" :src="srcBilibili" alt="">
|
||||
<!-- <a href="https://space.bilibili.com/27407696/channel/collectiondetail?sid=2023810" target="_blank" class="link">Bilibili</a> -->
|
||||
<a href="https://space.bilibili.com/27407696/channel/collectiondetail?sid=2023810" target="_blank" class="link">Bilibili</a>
|
||||
</div>
|
||||
<div v-if="appStore.language !== 'zh-CN'" class="flex items-center mx-[10px]">
|
||||
<img class="w-[20px] h-[20px] mr-[5px]" :src="srcYoutube" alt="">
|
||||
<a href="https://www.youtube.com/channel/UCKwbFmKU25R602z6P2fgPYg" target="_blank" class="link">YouTube</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-5">
|
||||
<NTag :bordered="false" size="small">
|
||||
@ -98,14 +57,7 @@ onMounted(() => {
|
||||
</NTag>
|
||||
</div>
|
||||
|
||||
<RoundCardModal v-model:show="qqGroupQRShow" title="交流群二维码" style="width: 300px;">
|
||||
<div class="text-center">
|
||||
- 如果失效请返回联系作者 -
|
||||
</div>
|
||||
<div class="flex justify-center">
|
||||
<img :src="srcQQGroupQR" class="h-[260px]">
|
||||
</div>
|
||||
</RoundCardModal>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -131,7 +131,7 @@
|
||||
"action": "Action",
|
||||
"add": "Add",
|
||||
"addSuccess": "Added successfully",
|
||||
"appName": "Sun-Panel",
|
||||
"appName": "ZW-Panel",
|
||||
"backgroundColor": "Background color",
|
||||
"cancel": "Cancel",
|
||||
"confirm": "Confirm",
|
||||
|
@ -131,7 +131,7 @@
|
||||
"action": "操作",
|
||||
"add": "添加",
|
||||
"addSuccess": "添加成功",
|
||||
"appName": "Sun-Panel",
|
||||
"appName": "ZW-Panel",
|
||||
"backgroundColor": "背景颜色",
|
||||
"cancel": "取消",
|
||||
"confirm": "确定",
|
||||
|
@ -3,7 +3,7 @@ import { PanelPanelConfigStyleEnum, PanelStateNetworkModeEnum } from '@/enums'
|
||||
import defaultBackground from '@/assets/defaultBackground.webp'
|
||||
const LOCAL_NAME = 'panelStorage'
|
||||
|
||||
const defaultFooterHtml = '<div class="flex justify-center text-slate-300" style="margin-top:100px">Powered By <a href="https://github.com/hslr-s/sun-panel" target="_blank" class="ml-[5px]">Sun-Panel</a></div>'
|
||||
const defaultFooterHtml = '<div class="flex justify-center text-slate-300" style="margin-top:100px"></div>'
|
||||
|
||||
export function defaultStatePanelConfig(): Panel.panelConfig {
|
||||
return {
|
||||
@ -14,7 +14,7 @@ export function defaultStatePanelConfig(): Panel.panelConfig {
|
||||
iconTextColor: '#ffffff',
|
||||
iconTextInfoHideDescription: false,
|
||||
iconTextIconHideTitle: false,
|
||||
logoText: 'Sun-Panel',
|
||||
logoText: 'ZW-Panel',
|
||||
logoImageSrc: '',
|
||||
clockShowSecond: false,
|
||||
searchBoxShow: false,
|
||||
|
@ -116,9 +116,7 @@ function handleChangeLanuage(value: Language) {
|
||||
</NButton>
|
||||
</div> -->
|
||||
|
||||
<div class="flex justify-center text-slate-300">
|
||||
Powered By <a href="https://github.com/hslr-s/sun-panel" target="_blank" class="ml-[5px] text-slate-500">Sun-Panel</a>
|
||||
</div>
|
||||
|
||||
</NForm>
|
||||
</NCard>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user