mirror of
https://github.com/khairul169/vaulterm.git
synced 2026-09-15 17:03:30 +07:00
feat: add group
This commit is contained in:
@@ -149,7 +149,13 @@ func getDiskUsage(client *lib.SSHClient, wg *sync.WaitGroup, result chan<- strin
|
||||
return
|
||||
}
|
||||
|
||||
fields := strings.Fields(lines[1])
|
||||
fields := strings.Fields(lines[len(lines)-2])
|
||||
if len(fields) < 5 {
|
||||
return
|
||||
}
|
||||
if !strings.HasPrefix(fields[0], "/") {
|
||||
fields = append([]string{"/"}, fields...)
|
||||
}
|
||||
result <- fmt.Sprintf("\x03%s,%s,%s", fields[1], fields[2], fields[4])
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ func HandleStats(c *websocket.Conn) {
|
||||
|
||||
user := utils.GetUserWs(c)
|
||||
hostRepo := hosts.NewRepository(&hosts.Hosts{User: user})
|
||||
data, _ := hostRepo.Get(hostId)
|
||||
data, _ := hostRepo.GetWithKeys(hostId)
|
||||
|
||||
if data == nil || !data.HasAccess(&user.User) {
|
||||
c.WriteMessage(websocket.TextMessage, []byte("Host not found"))
|
||||
|
||||
Reference in New Issue
Block a user