mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 03:38:04 +00:00
Cosmetics
This commit is contained in:
2
Makefile
2
Makefile
@@ -15,7 +15,7 @@ pull: ; $(info $(M) Pulling source...) @
|
||||
|
||||
.PHONY: build
|
||||
build: $(BIN) ; $(info $(M) Building executable...) @ ## Build program binary
|
||||
$Q $(GO) build \
|
||||
go build \
|
||||
-ldflags '-X main.version=$(VERSION) -X main.buildDate=$(DATE)' \
|
||||
-o bin/dashboard .
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ func (h *KubeHandler) GetResourceInfo(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// custom logic to provide most meaningful status for the resource
|
||||
if res.Status.Phase == "Active" || res.Status.Phase == "Error" {
|
||||
_ = res.Name + ""
|
||||
} else if res.Status.Phase == "" && len(res.Status.Conditions) > 0 {
|
||||
|
||||
@@ -71,18 +71,6 @@ function popUpUpgrade(elm, ns, name, verCur, lastRev) {
|
||||
$("#upgradeModal .rel-ns").prop("disabled", false).val("")
|
||||
}
|
||||
|
||||
$.getJSON("/api/kube/namespaces").fail(function (xhr) {
|
||||
reportError("Failed to get namespaces", xhr)
|
||||
}).done(function(res) {
|
||||
const ns = res.items.map(i => i.metadata.name)
|
||||
$.each(ns, function(i, item) {
|
||||
$("#upgradeModal #ns-datalist").append($("<option>", {
|
||||
value: item,
|
||||
text: item
|
||||
}))
|
||||
})
|
||||
})
|
||||
|
||||
$.getJSON("/api/helm/repo/search?name=" + elm.name).fail(function (xhr) {
|
||||
reportError("Failed to find chart in repo", xhr)
|
||||
}).done(function (vers) {
|
||||
|
||||
@@ -14,6 +14,18 @@ $(function () {
|
||||
initView(); // can only do it after loading cluster list
|
||||
})
|
||||
|
||||
$.getJSON("/api/kube/namespaces").fail(function (xhr) {
|
||||
reportError("Failed to get namespaces", xhr)
|
||||
}).done(function(res) {
|
||||
const ns = res.items.map(i => i.metadata.name)
|
||||
$.each(ns, function(i, item) {
|
||||
$("#upgradeModal #ns-datalist").append($("<option>", {
|
||||
value: item,
|
||||
text: item
|
||||
}))
|
||||
})
|
||||
})
|
||||
|
||||
$.getJSON("/api/scanners").fail(function (xhr) {
|
||||
reportError("Failed to get list of scanners", xhr)
|
||||
}).done(function (data) {
|
||||
|
||||
@@ -521,3 +521,11 @@ func GetDiff(text1 string, text2 string, name1 string, name2 string) string {
|
||||
log.Debugf("The diff is: %s", diff)
|
||||
return diff
|
||||
}
|
||||
|
||||
type NamespaceElement struct {
|
||||
Items []struct {
|
||||
Metadata struct {
|
||||
Name string `json:"name"`
|
||||
} `json:"metadata"`
|
||||
} `json:"items"`
|
||||
}
|
||||
|
||||
@@ -43,11 +43,3 @@ type RepositoryElement struct {
|
||||
Name string `json:"name"`
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
type NamespaceElement struct {
|
||||
Items []struct {
|
||||
Metadata struct {
|
||||
Name string `json:"name"`
|
||||
} `json:"metadata"`
|
||||
} `json:"items"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user