mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Restyle LAF (#12)
* Logos change * Coding HTML * Top bar * Top bar is fine * Restyling it * progressing * age line * cosmetics * Installed list is fine * Save * revision list display * Split up files * Rev list works * Details * Working on details * Action buttons * cosmetics * Describe flyout * Uninstall confirm flyout * Working on flyouts * Fixed the actions working * Polishing it * Cosmetics
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/hexops/gotextdiff"
|
||||
"github.com/hexops/gotextdiff/myers"
|
||||
"github.com/hexops/gotextdiff/span"
|
||||
@@ -174,8 +173,6 @@ func (d *DataLayer) ChartHistory(namespace string, chartName string) (res []*his
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var aprev *semver.Version
|
||||
var cprev *semver.Version
|
||||
for _, elm := range res {
|
||||
chartRepoName, curVer, err := chartAndVersion(elm.Chart)
|
||||
if err != nil {
|
||||
@@ -183,32 +180,7 @@ func (d *DataLayer) ChartHistory(namespace string, chartName string) (res []*his
|
||||
}
|
||||
elm.ChartName = chartRepoName
|
||||
elm.ChartVer = curVer
|
||||
elm.Action = ""
|
||||
elm.Updated.Time = elm.Updated.Time.Round(time.Second)
|
||||
|
||||
cver, err1 := semver.NewVersion(elm.ChartVer)
|
||||
aver, err2 := semver.NewVersion(elm.AppVersion)
|
||||
if err1 == nil && err2 == nil {
|
||||
if aprev != nil && cprev != nil {
|
||||
switch {
|
||||
case aprev.LessThan(aver):
|
||||
elm.Action = "app_upgrade"
|
||||
case aprev.GreaterThan(aver):
|
||||
elm.Action = "app_downgrade"
|
||||
case cprev.LessThan(cver):
|
||||
elm.Action = "chart_upgrade"
|
||||
case cprev.GreaterThan(cver):
|
||||
elm.Action = "chart_downgrade"
|
||||
default:
|
||||
elm.Action = "reconfigure"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log.Debugf("Semver parsing errors: %s=%s, %s=%s", elm.ChartVer, err1, elm.AppVersion, err2)
|
||||
}
|
||||
|
||||
aprev = aver
|
||||
cprev = cver
|
||||
}
|
||||
|
||||
return res, nil
|
||||
|
||||
Reference in New Issue
Block a user