Expose network system state table to api

This commit is contained in:
Daniel
2020-05-19 09:39:03 +02:00
parent ad93b19968
commit 3f9876fc09
2 changed files with 59 additions and 7 deletions

View File

@@ -5,6 +5,8 @@ import (
"strings"
"sync"
"github.com/safing/portmaster/network/state"
"github.com/safing/portbase/database"
"github.com/safing/portbase/database/iterator"
"github.com/safing/portbase/database/query"
@@ -57,13 +59,13 @@ func (s *StorageInterface) Get(key string) (record.Record, error) {
return conn, nil
}
}
// case "system":
// if len(splitted) >= 2 {
// switch splitted[1] {
// case "":
// process.Get
// }
// }
case "system":
if len(splitted) >= 2 {
switch splitted[1] {
case "state":
return state.GetStateInfo(), nil
}
}
}
return nil, storage.ErrNotFound