-
Notifications
You must be signed in to change notification settings - Fork 34
/
index.go
29 lines (25 loc) · 822 Bytes
/
index.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package policies
import (
"github.com/TeaWeb/code/teaconfigs"
"github.com/TeaWeb/code/tealogs"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/lists"
"github.com/iwind/TeaGo/maps"
"github.com/iwind/TeaGo/types"
)
type IndexAction actions.Action
// 日志策略
func (this *IndexAction) RunGet(params struct{}) {
this.Data["policyList"] = lists.Map(teaconfigs.SharedAccessLogStoragePolicyList().FindAllPolicies(), func(k int, v interface{}) interface{} {
policy := v.(*teaconfigs.AccessLogStoragePolicy)
format, _ := policy.Options["format"]
return maps.Map{
"id": policy.Id,
"name": policy.Name,
"on": policy.On,
"typeName": tealogs.FindStorageTypeName(policy.Type),
"formatName": tealogs.FindStorageFormatName(types.String(format)),
}
})
this.Show()
}