forked from IceWhaleTech/CasaOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Showing
21 changed files
with
234 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,4 @@ main | |
CasaOS | ||
github.com | ||
.all-contributorsrc | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: LinkLeong [email protected] | ||
* @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)}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: LinkLeong [email protected] | ||
* @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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
/* | ||
* @Author: LinkLeong [email protected] | ||
* @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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: LinkLeong [email protected] | ||
* @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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
<!-- | ||
* @Author: LinkLeong [email protected] | ||
* @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> | ||
|
Oops, something went wrong.