add resync function and support to view deployed applications

This commit is contained in:
richardxz
2018-07-30 23:13:42 -04:00
parent f8a057abc8
commit 49e297d663
23 changed files with 1261 additions and 453 deletions

View File

@@ -22,6 +22,8 @@ import (
"k8s.io/apimachinery/pkg/api/resource"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"fmt"
"kubesphere.io/kubesphere/pkg/client"
"kubesphere.io/kubesphere/pkg/models/controllers"
)
@@ -55,7 +57,12 @@ func getUsage(namespace, resource string) int {
if err != nil {
return 0
}
return ctl.Count(namespace)
if len(namespace) == 0 {
return ctl.CountWithConditions("")
}
return ctl.CountWithConditions(fmt.Sprintf("namespace = '%s' ", namespace))
}
func GetClusterQuota() (*ResourceQuota, error) {