feat: 添加数据库资产、命令拦截器、授权资产等功能,修复GitHub Actions工作流
This commit is contained in:
+10
-8
@@ -13,12 +13,13 @@ type DashboardApi struct{}
|
||||
|
||||
func (api DashboardApi) GetTimeCounterEndpoint(c echo.Context) error {
|
||||
var (
|
||||
totalUser int64
|
||||
onlineUser int64
|
||||
countOnlineSession int64
|
||||
totalAsset int64
|
||||
activeAsset int64
|
||||
failLoginCount int64
|
||||
totalUser int64
|
||||
onlineUser int64
|
||||
countOnlineSession int64
|
||||
totalAsset int64
|
||||
activeAsset int64
|
||||
failLoginCount int64
|
||||
totalWebsite int64
|
||||
)
|
||||
|
||||
totalUser, _ = repository.UserRepository.Count(context.TODO())
|
||||
@@ -29,6 +30,7 @@ func (api DashboardApi) GetTimeCounterEndpoint(c echo.Context) error {
|
||||
failLoginCount, _ = repository.LoginLogRepository.CountByState(context.TODO(), "0")
|
||||
gatewayList, _ := repository.GatewayRepository.FindAll(context.TODO())
|
||||
gatewayActiveCount := int64(len(gatewayList))
|
||||
totalWebsite, _ = repository.WebsiteRepository.Count(context.TODO())
|
||||
|
||||
counter := map[string]interface{}{
|
||||
"loginFailedTimes": failLoginCount,
|
||||
@@ -39,7 +41,7 @@ func (api DashboardApi) GetTimeCounterEndpoint(c echo.Context) error {
|
||||
"assetActiveCount": activeAsset,
|
||||
"assetTotalCount": totalAsset,
|
||||
"websiteActiveCount": 0,
|
||||
"websiteTotalCount": 0,
|
||||
"websiteTotalCount": totalWebsite,
|
||||
"gatewayActiveCount": gatewayActiveCount,
|
||||
"gatewayTotalCount": gatewayActiveCount,
|
||||
}
|
||||
@@ -74,7 +76,7 @@ func (api DashboardApi) GetDateCounterV2Endpoint(c echo.Context) error {
|
||||
day := lastDate.AddDate(0, 0, i).Format("2006-01-02")
|
||||
|
||||
item := map[string]interface{}{
|
||||
"date": day,
|
||||
"date": day,
|
||||
"login": int64(0),
|
||||
"user": int64(0),
|
||||
"asset": int64(0),
|
||||
|
||||
Reference in New Issue
Block a user