This commit is contained in:
cdle
2023-06-14 23:09:42 +08:00
parent 08012952a2
commit 73c678755b
+6 -4
View File
@@ -130,6 +130,9 @@ func initWebPluginList() {
rr.Page = current rr.Page = current
rr.Data = []*common.Function{} rr.Data = []*common.Function{}
if current != 0 { if current != 0 {
if current == 1 && init != "false" {
initPluginList()
}
var list []*common.Function var list []*common.Function
if keyword == "" { if keyword == "" {
list = append(list, plugin_list...) list = append(list, plugin_list...)
@@ -140,9 +143,6 @@ func initWebPluginList() {
} }
} }
} }
if current == 1 && init != "false" {
initPluginList()
}
rr.Total = len(list) rr.Total = len(list)
tab1 := []*common.Function{} tab1 := []*common.Function{}
tab2 := []*common.Function{} tab2 := []*common.Function{}
@@ -183,6 +183,9 @@ func initWebPluginList() {
rr.Tab3 = len(tab3) rr.Tab3 = len(tab3)
} }
rr.Total = len(list) rr.Total = len(list)
if last := (rr.Total + pageSize - 1) / pageSize; current > last {
current = last
}
begin := (current - 1) * pageSize begin := (current - 1) * pageSize
end := (current) * pageSize end := (current) * pageSize
if end > rr.Total { if end > rr.Total {
@@ -192,7 +195,6 @@ func initWebPluginList() {
begin = end begin = end
} }
rr.Data = append(rr.Data, list[begin:end]...) rr.Data = append(rr.Data, list[begin:end]...)
publics := []string{} publics := []string{}
for _, f := range Functions { for _, f := range Functions {
if f.Public && f.UUID != "" { if f.Public && f.UUID != "" {