浏览代码

0.3.5 (#464)

* initial completion of the sharing function

* Adjusting multi-partition disk mounts

* Add file sharing function

* update usb auto mount shell

* update samba config

* add umount disk function

* update change log

* update usb auto mount \

* update usb auto mount

* Update periodical.go

* Update periodical.go

* resolve alpha.1 issues

* Update UI
link 2 年之前
父节点
当前提交
b6f413b9e9
共有 21 个文件被更改,包括 136 次插入86 次删除
  1. 1 0
      .gitignore
  2. 7 1
      route/init.go
  3. 11 2
      route/v1/disk.go
  4. 1 1
      route/v1/docker.go
  5. 3 2
      route/v1/samba.go
  6. 8 3
      route/v1/storage.go
  7. 6 5
      service/docker.go
  8. 10 0
      service/model/o_disk.go
  9. 7 1
      service/shares.go
  10. 9 9
      web/browserconfig.xml
  11. 14 14
      web/favicon.svg
  12. 25 25
      web/img/icon/safari-pinned-tab.svg
  13. 12 1
      web/index.html
  14. 0 0
      web/js/4.js
  15. 1 1
      web/js/7.js
  16. 0 0
      web/js/8.js
  17. 0 0
      web/js/9.js
  18. 0 0
      web/js/app.js
  19. 1 1
      web/robots.txt
  20. 14 14
      web/site.webmanifest
  21. 6 6
      web/static.go

+ 1 - 0
.gitignore

@@ -38,3 +38,4 @@ main
 CasaOS
 github.com
 .all-contributorsrc
+build

+ 7 - 1
route/init.go

@@ -5,15 +5,18 @@ import (
 	"os"
 	"strconv"
 	"strings"
+	"time"
 
 	"github.com/IceWhaleTech/CasaOS/pkg/config"
 	"github.com/IceWhaleTech/CasaOS/pkg/samba"
 	"github.com/IceWhaleTech/CasaOS/pkg/utils/command"
 	"github.com/IceWhaleTech/CasaOS/pkg/utils/encryption"
 	"github.com/IceWhaleTech/CasaOS/pkg/utils/file"
+	"github.com/IceWhaleTech/CasaOS/pkg/utils/loger"
 	"github.com/IceWhaleTech/CasaOS/service"
 	model2 "github.com/IceWhaleTech/CasaOS/service/model"
 	uuid "github.com/satori/go.uuid"
+	"go.uber.org/zap"
 )
 
 func InitFunction() {
@@ -24,7 +27,8 @@ func InitFunction() {
 	// Soon to be removed
 	ChangeAPIUrl()
 	MoveUserToDB()
-	InitNetworkMount()
+	go InitNetworkMount()
+
 }
 
 func CheckSerialDiskMount() {
@@ -141,12 +145,14 @@ func MoveUserToDB() {
 }
 
 func InitNetworkMount() {
+	time.Sleep(time.Second * 10)
 	connections := service.MyService.Connections().GetConnectionsList()
 	for _, v := range connections {
 		connection := service.MyService.Connections().GetConnectionByID(fmt.Sprint(v.ID))
 		directories, err := samba.GetSambaSharesList(connection.Host, connection.Port, connection.Username, connection.Password)
 		if err != nil {
 			service.MyService.Connections().DeleteConnection(fmt.Sprint(connection.ID))
+			loger.Error("mount samba err", zap.Any("err", err), zap.Any("info", connection))
 			continue
 		}
 		baseHostPath := "/mnt/" + connection.Host

+ 11 - 2
route/v1/disk.go

@@ -1,6 +1,7 @@
 package v1
 
 import (
+	"fmt"
 	"net/http"
 	"reflect"
 	"strconv"
@@ -255,6 +256,8 @@ func DeleteDisksUmount(c *gin.Context) {
 		service.MyService.Disk().UmountPointAndRemoveDir(v.Path)
 		//delete data
 		service.MyService.Disk().DeleteMountPoint(v.Path, v.MountPoint)
+
+		service.MyService.Shares().DeleteShareByPath(v.MountPoint)
 	}
 
 	service.MyService.Disk().RemoveLSBLKCache()
@@ -367,7 +370,7 @@ func PostDiskAddPartition(c *gin.Context) {
 	js := make(map[string]interface{})
 	c.ShouldBind(&js)
 	path := js["path"].(string)
-	//name := js["name"].(string)
+	name := js["name"].(string)
 	format := js["format"].(bool)
 
 	if len(path) == 0 {
@@ -412,10 +415,16 @@ func PostDiskAddPartition(c *gin.Context) {
 	// 	c.JSON(common_err.SERVICE_ERROR, model.Result{Success: common_err.DISK_NEEDS_FORMAT, Message: common_err.GetMsg(common_err.DISK_NEEDS_FORMAT)})
 	// 	return
 	// }
+	fmt.Println(name)
+	if len(name) == 0 {
+		name = "Storage"
+	}
+	fmt.Println(name)
 	for i := 0; i < len(currentDisk.Children); i++ {
 		childrenName := currentDisk.Children[i].Label
 		if len(childrenName) == 0 {
-			childrenName = "Storage_" + currentDisk.Children[i].Name
+			//childrenName = name + "_" + currentDisk.Children[i].Name
+			childrenName = name + "_" + strconv.Itoa(i+1)
 		}
 		mountPath := "/DATA/" + childrenName
 		if !file.CheckNotExist(mountPath) {

+ 1 - 1
route/v1/docker.go

@@ -1120,7 +1120,7 @@ func ContainerUpdateInfo(c *gin.Context) {
 	showENV := info.Config.Labels["show_env"]
 	showENVList := strings.Split(showENV, ",")
 	showENVMap := make(map[string]string)
-	if len(showENVList) > 0 {
+	if len(showENVList) > 0 && showENVList[0] != "" {
 		for _, name := range showENVList {
 			showENVMap[name] = "1"
 		}

+ 3 - 2
route/v1/samba.go

@@ -2,7 +2,7 @@
  * @Author: LinkLeong link@icewhale.com
  * @Date: 2022-07-26 11:08:48
  * @LastEditors: LinkLeong
- * @LastEditTime: 2022-08-05 12:16:39
+ * @LastEditTime: 2022-08-17 18:25:42
  * @FilePath: /CasaOS/route/v1/samba.go
  * @Description:
  * @Website: https://www.casaos.io
@@ -85,6 +85,7 @@ func PostSambaSharesCreate(c *gin.Context) {
 		shareDBModel.Anonymous = true
 		shareDBModel.Path = v.Path
 		shareDBModel.Name = filepath.Base(v.Path)
+		os.Chmod(v.Path, 0777)
 		service.MyService.Shares().CreateShare(shareDBModel)
 	}
 
@@ -127,8 +128,8 @@ func PostSambaConnectionsCreate(c *gin.Context) {
 		c.JSON(common_err.CLIENT_ERROR, model.Result{Success: common_err.INVALID_PARAMS, Message: common_err.GetMsg(common_err.INVALID_PARAMS)})
 		return
 	}
+	connection.Host = strings.Split(connection.Host, "/")[0]
 	// check is exists
-
 	connections := service.MyService.Connections().GetConnectionByHost(connection.Host)
 	if len(connections) > 0 {
 		c.JSON(common_err.SERVICE_ERROR, model.Result{Success: common_err.Record_ALREADY_EXIST, Message: common_err.GetMsg(common_err.Record_ALREADY_EXIST), Data: common_err.GetMsg(common_err.Record_ALREADY_EXIST)})

+ 8 - 3
route/v1/storage.go

@@ -2,7 +2,7 @@
  * @Author: LinkLeong link@icewhale.com
  * @Date: 2022-07-11 16:02:29
  * @LastEditors: LinkLeong
- * @LastEditTime: 2022-08-11 14:20:02
+ * @LastEditTime: 2022-08-17 19:14:50
  * @FilePath: /CasaOS/route/v1/storage.go
  * @Description:
  * @Website: https://www.casaos.io
@@ -11,8 +11,8 @@
 package v1
 
 import (
+	"path/filepath"
 	"reflect"
-	"strconv"
 
 	"github.com/IceWhaleTech/CasaOS/model"
 	"github.com/IceWhaleTech/CasaOS/pkg/utils/common_err"
@@ -70,7 +70,12 @@ func GetStorageList(c *gin.Context) {
 					stor.Type = v.FsType
 					stor.DriveName = v.Name
 					if len(v.Label) == 0 {
-						stor.Label = "Storage" + strconv.Itoa(diskNumber) + "_" + strconv.Itoa(children)
+						if stor.MountPoint == "/" {
+							stor.Label = "System"
+						} else {
+							stor.Label = filepath.Base(stor.MountPoint)
+						}
+
 						children += 1
 					} else {
 						stor.Label = v.Label

+ 6 - 5
service/docker.go

@@ -535,13 +535,14 @@ func (ds *dockerService) DockerContainerCreate(m model.CustomizationPostData, id
 		// info.NetworkSettings = &types.NetworkSettings{}
 		hostConfig = info.HostConfig
 		config = info.Config
+	} else {
+		config.Cmd = m.Cmd
+		config.Image = m.Image
+		config.Env = envArr
+		config.Hostname = m.HostName
+		config.ExposedPorts = ports
 	}
 
-	config.Cmd = m.Cmd
-	config.Image = m.Image
-	config.Env = envArr
-	config.Hostname = m.HostName
-	config.ExposedPorts = ports
 	config.Labels["origin"] = m.Origin
 	config.Labels["casaos"] = "casaos"
 	config.Labels["web"] = m.PortMap

+ 10 - 0
service/model/o_disk.go

@@ -1,3 +1,13 @@
+/*
+ * @Author: LinkLeong link@icewhale.org
+ * @Date: 2021-12-07 17:14:41
+ * @LastEditors: LinkLeong
+ * @LastEditTime: 2022-08-17 18:46:43
+ * @FilePath: /CasaOS/service/model/o_disk.go
+ * @Description:
+ * @Website: https://www.casaos.io
+ * Copyright (c) 2022 by icewhale, All Rights Reserved.
+ */
 package model
 
 //SerialAdvanced Technology Attachment (STAT)

+ 7 - 1
service/shares.go

@@ -2,7 +2,7 @@
  * @Author: LinkLeong link@icewhale.org
  * @Date: 2022-07-26 11:21:14
  * @LastEditors: LinkLeong
- * @LastEditTime: 2022-08-11 14:04:00
+ * @LastEditTime: 2022-08-18 11:16:25
  * @FilePath: /CasaOS/service/shares.go
  * @Description:
  * @Website: https://www.casaos.io
@@ -30,12 +30,18 @@ type SharesService interface {
 	DeleteShare(id string)
 	UpdateConfigFile()
 	InitSambaConfig()
+	DeleteShareByPath(path string)
 }
 
 type sharesStruct struct {
 	db *gorm.DB
 }
 
+func (s *sharesStruct) DeleteShareByPath(path string) {
+	s.db.Where("path LIKE ?", path+"%").Delete(&model.SharesDBModel{})
+	s.UpdateConfigFile()
+}
+
 func (s *sharesStruct) GetSharesByName(name string) (shares []model2.SharesDBModel) {
 	s.db.Select("anonymous,path,id").Where("name = ?", name).Find(&shares)
 

+ 9 - 9
web/browserconfig.xml

@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="utf-8"?>
-<browserconfig>
-    <msapplication>
-        <tile>
-            <square150x150logo src="/ui/img/icon/mstile-150x150.png"/>
-            <TileColor>#da532c</TileColor>
-        </tile>
-    </msapplication>
-</browserconfig>
+<?xml version="1.0" encoding="utf-8"?>
+<browserconfig>
+    <msapplication>
+        <tile>
+            <square150x150logo src="/ui/img/icon/mstile-150x150.png"/>
+            <TileColor>#da532c</TileColor>
+        </tile>
+    </msapplication>
+</browserconfig>

+ 14 - 14
web/favicon.svg

@@ -1,14 +1,14 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
-	 viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
-<style type="text/css">
-	.st0{fill:none;stroke:#363636;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:2;}
-	@media ( prefers-color-scheme: dark ) {
-		.st0{fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:2;}
-	}
-</style>
-<path class="st0" d="M12,22c5.5,0,10-4.5,10-10S17.5,2,12,2S2,6.5,2,12S6.5,22,12,22z"/>
-<path class="st0" d="M12,22c3.9,0,7-3.1,7-7s-3.1-7-7-7s-7,3.1-7,7S8.1,22,12,22z"/>
-<path class="st0" d="M12,22c2.2,0,4-1.8,4-4s-1.8-4-4-4s-4,1.8-4,4S9.8,22,12,22z"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:none;stroke:#363636;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:2;}
+	@media ( prefers-color-scheme: dark ) {
+		.st0{fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:2;}
+	}
+</style>
+<path class="st0" d="M12,22c5.5,0,10-4.5,10-10S17.5,2,12,2S2,6.5,2,12S6.5,22,12,22z"/>
+<path class="st0" d="M12,22c3.9,0,7-3.1,7-7s-3.1-7-7-7s-7,3.1-7,7S8.1,22,12,22z"/>
+<path class="st0" d="M12,22c2.2,0,4-1.8,4-4s-1.8-4-4-4s-4,1.8-4,4S9.8,22,12,22z"/>
+</svg>

+ 25 - 25
web/img/icon/safari-pinned-tab.svg

@@ -1,25 +1,25 @@
-<?xml version="1.0" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
- "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
-<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
- width="200.000000pt" height="200.000000pt" viewBox="0 0 200.000000 200.000000"
- preserveAspectRatio="xMidYMid meet">
-<metadata>
-Created by potrace 1.14, written by Peter Selinger 2001-2017
-</metadata>
-<g transform="translate(0.000000,200.000000) scale(0.100000,-0.100000)"
-fill="#000000" stroke="none">
-<path d="M875 1894 c-11 -2 -51 -11 -88 -20 -341 -78 -610 -364 -673 -714 -82
--459 197 -902 647 -1030 94 -27 277 -37 378 -21 303 47 575 261 690 540 55
-133 66 192 65 361 -1 136 -4 165 -27 235 -36 116 -62 170 -123 261 -123 186
--347 336 -566 379 -42 8 -276 15 -303 9z m250 -168 c11 -2 42 -9 70 -16 131
--30 288 -135 387 -260 160 -201 198 -506 93 -745 l-22 -50 2 80 c3 180 -64
-351 -184 476 -209 216 -544 260 -807 105 -201 -117 -326 -347 -319 -587 l2
--74 -19 44 c-63 140 -80 332 -44 476 24 94 87 219 147 292 109 133 290 238
-448 259 25 3 47 7 49 9 5 4 173 -3 197 -9z m8 -501 c33 -8 85 -31 116 -50 227
--137 305 -418 183 -651 l-21 -39 -1 35 c-9 251 -245 439 -490 389 -186 -38
--323 -200 -330 -389 l-1 -35 -23 45 c-101 194 -61 429 99 578 130 122 292 162
-468 117z m-27 -499 c182 -85 183 -345 1 -438 -53 -27 -161 -26 -215 1 -146 75
--180 267 -69 390 63 69 190 90 283 47z"/>
-</g>
-</svg>
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
+ width="200.000000pt" height="200.000000pt" viewBox="0 0 200.000000 200.000000"
+ preserveAspectRatio="xMidYMid meet">
+<metadata>
+Created by potrace 1.14, written by Peter Selinger 2001-2017
+</metadata>
+<g transform="translate(0.000000,200.000000) scale(0.100000,-0.100000)"
+fill="#000000" stroke="none">
+<path d="M875 1894 c-11 -2 -51 -11 -88 -20 -341 -78 -610 -364 -673 -714 -82
+-459 197 -902 647 -1030 94 -27 277 -37 378 -21 303 47 575 261 690 540 55
+133 66 192 65 361 -1 136 -4 165 -27 235 -36 116 -62 170 -123 261 -123 186
+-347 336 -566 379 -42 8 -276 15 -303 9z m250 -168 c11 -2 42 -9 70 -16 131
+-30 288 -135 387 -260 160 -201 198 -506 93 -745 l-22 -50 2 80 c3 180 -64
+351 -184 476 -209 216 -544 260 -807 105 -201 -117 -326 -347 -319 -587 l2
+-74 -19 44 c-63 140 -80 332 -44 476 24 94 87 219 147 292 109 133 290 238
+448 259 25 3 47 7 49 9 5 4 173 -3 197 -9z m8 -501 c33 -8 85 -31 116 -50 227
+-137 305 -418 183 -651 l-21 -39 -1 35 c-9 251 -245 439 -490 389 -186 -38
+-323 -200 -330 -389 l-1 -35 -23 45 c-101 194 -61 429 99 578 130 122 292 162
+468 117z m-27 -499 c182 -85 183 -345 1 -438 -53 -27 -161 -26 -215 1 -146 75
+-180 267 -69 390 63 69 190 90 283 47z"/>
+</g>
+</svg>

+ 12 - 1
web/index.html

@@ -1,3 +1,13 @@
+<!--
+ * @Author: LinkLeong link@icewhale.org
+ * @Date: 2022-08-18 11:14:30
+ * @LastEditors: LinkLeong
+ * @LastEditTime: 2022-08-18 11:17:26
+ * @FilePath: /CasaOS/web/index.html
+ * @Description: 
+ * @Website: https://www.casaos.io
+ * Copyright (c) 2022 by icewhale, All Rights Reserved. 
+-->
 <!DOCTYPE html>
 <html lang="">
 
@@ -20,7 +30,7 @@
   <title>
     CasaOS
   </title>
-<link href="/ui/css/13.a16d5119.css" rel="prefetch"><link href="/ui/css/14.cf8c898a.css" rel="prefetch"><link href="/ui/css/4.f17f9b01.css" rel="prefetch"><link href="/ui/css/5.e8438f80.css" rel="prefetch"><link href="/ui/css/6.d72d6157.css" rel="prefetch"><link href="/ui/css/7.805596b0.css" rel="prefetch"><link href="/ui/css/8.92188e4d.css" rel="prefetch"><link href="/ui/css/9.dccf29b4.css" rel="prefetch"><link href="/ui/js/0.js" rel="prefetch"><link href="/ui/js/1.js" rel="prefetch"><link href="/ui/js/10.js" rel="prefetch"><link href="/ui/js/11.js" rel="prefetch"><link href="/ui/js/12.js" rel="prefetch"><link href="/ui/js/13.js" rel="prefetch"><link href="/ui/js/14.js" rel="prefetch"><link href="/ui/js/15.js" rel="prefetch"><link href="/ui/js/2.js" rel="prefetch"><link href="/ui/js/3.js" rel="prefetch"><link href="/ui/js/4.js" rel="prefetch"><link href="/ui/js/5.js" rel="prefetch"><link href="/ui/js/6.js" rel="prefetch"><link href="/ui/js/7.js" rel="prefetch"><link href="/ui/js/8.js" rel="prefetch"><link href="/ui/js/9.js" rel="prefetch"><link href="/ui/css/app.c78d232d.css" rel="preload" as="style"><link href="/ui/css/vendors~app.c42f9a2b.css" rel="preload" as="style"><link href="/ui/js/app.js" rel="preload" as="script"><link href="/ui/js/vendors~app.js" rel="preload" as="script"><link href="/ui/css/vendors~app.c42f9a2b.css" rel="stylesheet"><link href="/ui/css/app.c78d232d.css" rel="stylesheet"></head>
+<link href="/ui/css/13.4aea6393.css" rel="prefetch"><link href="/ui/css/14.177dd094.css" rel="prefetch"><link href="/ui/css/4.5facaf2f.css" rel="prefetch"><link href="/ui/css/5.3f6e4ac6.css" rel="prefetch"><link href="/ui/css/6.0cf49524.css" rel="prefetch"><link href="/ui/css/7.515410b8.css" rel="prefetch"><link href="/ui/css/8.d30a96e7.css" rel="prefetch"><link href="/ui/css/9.3e385d0d.css" rel="prefetch"><link href="/ui/js/0.js" rel="prefetch"><link href="/ui/js/1.js" rel="prefetch"><link href="/ui/js/10.js" rel="prefetch"><link href="/ui/js/11.js" rel="prefetch"><link href="/ui/js/12.js" rel="prefetch"><link href="/ui/js/13.js" rel="prefetch"><link href="/ui/js/14.js" rel="prefetch"><link href="/ui/js/15.js" rel="prefetch"><link href="/ui/js/2.js" rel="prefetch"><link href="/ui/js/3.js" rel="prefetch"><link href="/ui/js/4.js" rel="prefetch"><link href="/ui/js/5.js" rel="prefetch"><link href="/ui/js/6.js" rel="prefetch"><link href="/ui/js/7.js" rel="prefetch"><link href="/ui/js/8.js" rel="prefetch"><link href="/ui/js/9.js" rel="prefetch"><link href="/ui/css/app.66eff8da.css" rel="preload" as="style"><link href="/ui/css/vendors~app.3967bc71.css" rel="preload" as="style"><link href="/ui/js/app.js" rel="preload" as="script"><link href="/ui/js/vendors~app.js" rel="preload" as="script"><link href="/ui/css/vendors~app.3967bc71.css" rel="stylesheet"><link href="/ui/css/app.66eff8da.css" rel="stylesheet"></head>
 
 <body>
   <noscript>
@@ -32,3 +42,4 @@
 <script type="text/javascript" src="/ui/js/vendors~app.js"></script><script type="text/javascript" src="/ui/js/app.js"></script></body>
 
 </html>
+

文件差异内容过多而无法显示
+ 0 - 0
web/js/4.js


+ 1 - 1
web/js/7.js

@@ -18,7 +18,7 @@
 /*!**************************************************!*\
   !*** ./src/assets/background/preview-widget.svg ***!
   \**************************************************/
-/*! no static exports found */function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__.p + "img/preview-widget.5069b926.svg";\n\n//# sourceURL=webpack:///./src/assets/background/preview-widget.svg?')},"./src/assets/background/wallpaper01.jpg":
+/*! no static exports found */function(module,exports,__webpack_require__){eval('module.exports = __webpack_require__.p + "img/preview-widget.e228363c.svg";\n\n//# sourceURL=webpack:///./src/assets/background/preview-widget.svg?')},"./src/assets/background/wallpaper01.jpg":
 /*!***********************************************!*\
   !*** ./src/assets/background/wallpaper01.jpg ***!
   \***********************************************/

文件差异内容过多而无法显示
+ 0 - 0
web/js/8.js


文件差异内容过多而无法显示
+ 0 - 0
web/js/9.js


文件差异内容过多而无法显示
+ 0 - 0
web/js/app.js


+ 1 - 1
web/robots.txt

@@ -1,2 +1,2 @@
-User-agent: *
+User-agent: *
 Disallow: /

+ 14 - 14
web/site.webmanifest

@@ -1,14 +1,14 @@
-{
-    "name": "",
-    "short_name": "",
-    "icons": [
-        {
-            "src": "/ui/img/icon/android-chrome-192x192.png",
-            "sizes": "192x192",
-            "type": "image/png"
-        }
-    ],
-    "theme_color": "#ffffff",
-    "background_color": "#ffffff",
-    "display": "standalone"
-}
+{
+    "name": "",
+    "short_name": "",
+    "icons": [
+        {
+            "src": "/ui/img/icon/android-chrome-192x192.png",
+            "sizes": "192x192",
+            "type": "image/png"
+        }
+    ],
+    "theme_color": "#ffffff",
+    "background_color": "#ffffff",
+    "display": "standalone"
+}

+ 6 - 6
web/static.go

@@ -1,6 +1,6 @@
-package web
-
-import "embed"
-
-//go:embed index.html favicon.svg browserconfig.xml site.webmanifest robots.txt img js fonts css
-var Static embed.FS
+package web
+
+import "embed"
+
+//go:embed index.html favicon.svg browserconfig.xml site.webmanifest robots.txt img js fonts css
+var Static embed.FS

部分文件因为文件数量过多而无法显示