platform: modularize api/gui, add docs-tests-web foundation, and refresh root config
This commit is contained in:
23
selective-vpn-api/app/traffic_appmarks_ops.go
Normal file
23
selective-vpn-api/app/traffic_appmarks_ops.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func appMarksGetStatus() (vpnCount int, directCount int) {
|
||||
_ = pruneExpiredAppMarks()
|
||||
|
||||
appMarksMu.Lock()
|
||||
defer appMarksMu.Unlock()
|
||||
|
||||
st := loadAppMarksState()
|
||||
for _, it := range st.Items {
|
||||
switch strings.ToLower(strings.TrimSpace(it.Target)) {
|
||||
case "vpn":
|
||||
vpnCount++
|
||||
case "direct":
|
||||
directCount++
|
||||
}
|
||||
}
|
||||
return vpnCount, directCount
|
||||
}
|
||||
Reference in New Issue
Block a user