next-terminal/server/model/asset.go
dushixiang ded4dc492a - 修复mysql模式下「资产授权列表」「用户授权列表」「用户组授权列表」无法使用的问题 fixed #315
- 修复资产新增、修改无权限的缺陷 fixed #314
- 修复执行动态指令时多行失败且无法自动执行的问题 fixed #313 #310
- 修复计划任务无法选择资产的问题 fixed #312
- 修复导入导出备份无效的问题 fixed #303
- 增加「资产详情」「资产授权」「用户详情」「用户授权」「用户组详情」「用户组授权」「角色详情」「授权策略详情」按钮
- 修复资产列表使用IP搜索无效的问题
- 资产列表增加最近接入时间排序、增加修改每页数量 fixed #311
- 修复登录页面双因素认证输入框无法自动获取焦点的问题 fixed #311
- 增加普通页面资产列表最后接入时间排序 fixed #311
- 计划任务增加执行本机系统命令
2022-11-20 17:36:27 +08:00

62 lines
2.4 KiB
Go

package model
import (
"next-terminal/server/common"
)
type AssetProto string
type Asset struct {
ID string `gorm:"primary_key,type:varchar(36)" json:"id"`
Name string `gorm:"type:varchar(500)" json:"name"`
Protocol string `gorm:"type:varchar(20)" json:"protocol"`
IP string `gorm:"type:varchar(200)" json:"ip"`
Port int `json:"port"`
AccountType string `gorm:"type:varchar(20)" json:"accountType"`
Username string `gorm:"type:varchar(200)" json:"username"`
Password string `gorm:"type:varchar(500)" json:"password"`
CredentialId string `gorm:"index,type:varchar(36)" json:"credentialId"`
PrivateKey string `gorm:"type:text" json:"privateKey"`
Passphrase string `gorm:"type:varchar(500)" json:"passphrase"`
Description string `json:"description"`
Active bool `json:"active"`
ActiveMessage string `gorm:"type:varchar(200)" json:"activeMessage"`
Created common.JsonTime `json:"created"`
LastAccessTime common.JsonTime `json:"lastAccessTime"`
Tags string `json:"tags"`
Owner string `gorm:"index,type:varchar(36)" json:"owner"`
Encrypted bool `json:"encrypted"`
AccessGatewayId string `gorm:"type:varchar(36)" json:"accessGatewayId"`
}
type AssetForPage struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
IP string `json:"ip"`
Protocol string `json:"protocol"`
Port int `json:"port"`
Active bool `json:"active"`
ActiveMessage string `json:"activeMessage"`
Created common.JsonTime `json:"created"`
LastAccessTime common.JsonTime `json:"lastAccessTime"`
Tags string `json:"tags"`
Owner string `json:"owner"`
OwnerName string `json:"ownerName"`
}
func (r *Asset) TableName() string {
return "assets"
}
type AssetAttribute struct {
Id string `gorm:"index" json:"id"`
AssetId string `gorm:"index" json:"assetId"`
Name string `gorm:"index" json:"name"`
Value string `json:"value"`
}
func (r *AssetAttribute) TableName() string {
return "asset_attributes"
}