fix: 修复关闭SSH终端标签页时会话状态未更新的问题

This commit is contained in:
2026-04-18 02:35:38 +08:00
commit 6e2e2f9387
43467 changed files with 5489040 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
package dto
import "next-terminal/server/model"
type Authorization struct {
Token string
Remember bool
Type string // LoginToken: 登录令牌, AccessToken: 授权令牌, ShareSession: 会话分享, AccessSession: 只允许访问特定的会话
User *model.User
Roles []string
}
type LoginAccount struct {
Username string `json:"username"`
Password string `json:"password"`
Remember bool `json:"remember"`
TOTP string `json:"totp"`
}
type ConfirmTOTP struct {
Secret string `json:"secret"`
TOTP string `json:"totp"`
}
type ChangePassword struct {
NewPassword string `json:"newPassword"`
OldPassword string `json:"oldPassword"`
}
type UserCreate struct {
Username string `json:"username"`
Password string `json:"password"`
Nickname string `json:"nickname"`
}
+52
View File
@@ -0,0 +1,52 @@
package dto
import "next-terminal/server/common"
type AuthorisedAsset struct {
AssetIds []string `json:"assetIds"`
CommandFilterId string `json:"commandFilterId"`
StrategyId string `json:"strategyId"`
UserId string `json:"userId"`
UserGroupId string `json:"userGroupId"`
}
type AuthorisedUser struct {
UserIds []string `json:"userIds"`
CommandFilterId string `json:"commandFilterId"`
StrategyId string `json:"strategyId"`
AssetId string `json:"assetId"`
}
type AuthorisedUserGroup struct {
UserGroupIds []string `json:"UserGroupIds"`
CommandFilterId string `json:"commandFilterId"`
StrategyId string `json:"strategyId"`
AssetId string `json:"assetId"`
}
type AssetPageForAuthorised struct {
Id string `json:"id"`
AssetId string `json:"assetId"`
AssetName string `json:"assetName"`
StrategyId string `json:"strategyId"`
StrategyName string `json:"strategyName"`
Created common.JsonTime `json:"created"`
}
type UserPageForAuthorised struct {
Id string `json:"id"`
UserId string `json:"userId"`
UserName string `json:"userName"`
StrategyId string `json:"strategyId"`
StrategyName string `json:"strategyName"`
Created common.JsonTime `json:"created"`
}
type UserGroupPageForAuthorised struct {
Id string `json:"id"`
UserGroupId string `json:"userGroupId"`
UserGroupName string `json:"userGroupName"`
StrategyId string `json:"strategyId"`
StrategyName string `json:"strategyName"`
Created common.JsonTime `json:"created"`
}
+10
View File
@@ -0,0 +1,10 @@
package dto
type Counter struct {
TotalUser int64 `json:"totalUser"`
OnlineUser int64 `json:"onlineUser"`
TotalAsset int64 `json:"totalAsset"`
ActiveAsset int64 `json:"activeAsset"`
OfflineSession int64 `json:"offlineSession"`
FailLoginCount int64 `json:"failLoginCount"`
}
+15
View File
@@ -0,0 +1,15 @@
package dto
import "next-terminal/server/common"
type UserGroup struct {
Id string `json:"id"`
Name string `json:"name"`
Members []UserGroupMember `json:"members"`
Created common.JsonTime `json:"created"`
}
type UserGroupMember struct {
Id string `json:"id"`
Name string `json:"name"`
}
+7
View File
@@ -0,0 +1,7 @@
package dto
type DateCounter struct {
Date string `json:"date"`
Value uint64 `json:"value"`
Type string `json:"type"`
}
+8
View File
@@ -0,0 +1,8 @@
package dto
type TreeMenu struct {
Title string `json:"title"`
Key string `json:"key"`
IsLeaf bool `json:"isLeaf"`
Children []TreeMenu `json:"children"`
}
+31
View File
@@ -0,0 +1,31 @@
package dto
import "next-terminal/server/model"
type RU struct {
UserGroupId string `json:"userGroupId"`
UserId string `json:"userId"`
StrategyId string `json:"strategyId"`
ResourceType string `json:"resourceType"`
ResourceIds []string `json:"resourceIds"`
}
type UR struct {
ResourceId string `json:"resourceId"`
ResourceType string `json:"resourceType"`
UserIds []string `json:"userIds"`
}
type Backup struct {
Users []model.User `json:"users"`
UserGroups []model.UserGroup `json:"user_groups"`
Storages []model.Storage `json:"storages"`
Strategies []model.Strategy `json:"strategies"`
AccessSecurities []model.AccessSecurity `json:"access_securities"`
AccessGateways []model.AccessGateway `json:"access_gateways"`
Commands []model.Command `json:"commands"`
Credentials []model.Credential `json:"credentials"`
Assets []map[string]interface{} `json:"assets"`
Jobs []model.Job `json:"jobs"`
}
+11
View File
@@ -0,0 +1,11 @@
package dto
type ExternalSession struct {
AssetId string `json:"assetId"`
FileSystem string `json:"fileSystem"`
Upload string `json:"upload"`
Download string `json:"download"`
Delete string `json:"delete"`
Rename string `json:"rename"`
Edit string `json:"edit"`
}
+39
View File
@@ -0,0 +1,39 @@
package dto
import "strconv"
type Message struct {
Type int `json:"type"`
Content string `json:"content"`
}
func (r Message) ToString() string {
if r.Content != "" {
return strconv.Itoa(r.Type) + r.Content
} else {
return strconv.Itoa(r.Type)
}
}
func NewMessage(_type int, content string) Message {
return Message{Content: content, Type: _type}
}
func ParseMessage(value string) (message Message, err error) {
if value == "" {
return
}
_type, err := strconv.Atoi(value[:1])
if err != nil {
return
}
var content = value[1:]
message = NewMessage(_type, content)
return
}
type WindowSize struct {
Cols int `json:"cols"`
Rows int `json:"rows"`
}
+15
View File
@@ -0,0 +1,15 @@
package dto
import "next-terminal/server/common"
type StorageLogForPage struct {
ID string `json:"id"`
AssetId string `json:"assetId"`
AssetName string `json:"assetName"`
SessionId string `json:"sessionId"`
UserId string `json:"userId"`
UserName string `json:"userName"`
Action string `json:"action"` // 操作类型: 上传、下载、删除、重命名、编辑
FileName string `json:"fileName"` // 文件名称
Created common.JsonTime `json:"created"` // 操作时间
}
+32
View File
@@ -0,0 +1,32 @@
package dto
type WebsiteDTO struct {
ID string `json:"id"`
Name string `json:"name"`
Enabled bool `json:"enabled"`
TargetUrl string `json:"targetUrl"`
TargetHost string `json:"targetHost"`
TargetPort int `json:"targetPort"`
Domain string `json:"domain"`
AsciiDomain string `json:"asciiDomain"`
Entrance string `json:"entrance"`
Description string `json:"description"`
Status string `json:"status"`
StatusText string `json:"statusText"`
GatewayType string `json:"gatewayType"`
GatewayId string `json:"gatewayId"`
BasicAuth interface{} `json:"basicAuth"`
Headers interface{} `json:"headers"`
Cert interface{} `json:"cert"`
Public interface{} `json:"public"`
TempAllow interface{} `json:"tempAllow"`
Created int64 `json:"createdAt"`
GroupId string `json:"groupId"`
Sort string `json:"sort"`
Logo string `json:"logo"`
Scheme string `json:"scheme"`
Host string `json:"host"`
Port int `json:"port"`
PreserveHost bool `json:"preserveHost"`
DisableAccessLog bool `json:"disableAccessLog"`
}