Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
501e67a6
Commit
501e67a6
authored
Sep 23, 2016
by
Dan Cech
Committed by
Torkel Ödegaard
Sep 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use semver when comparing grafana and plugin versions (#6108)
parent
9a94072c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
pkg/plugins/update_checker.go
+17
-1
public/views/index.html
+4
-4
No files found.
pkg/plugins/update_checker.go
View file @
501e67a6
...
...
@@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/setting"
"github.com/hashicorp/go-version"
)
var
(
...
...
@@ -85,7 +86,15 @@ func checkForUpdates() {
for
_
,
gplug
:=
range
gNetPlugins
{
if
gplug
.
Slug
==
plug
.
Id
{
plug
.
GrafanaNetVersion
=
gplug
.
Version
plug
.
GrafanaNetHasUpdate
=
plug
.
Info
.
Version
!=
plug
.
GrafanaNetVersion
plugVersion
,
err1
:=
version
.
NewVersion
(
plug
.
Info
.
Version
)
gplugVersion
,
err2
:=
version
.
NewVersion
(
gplug
.
Version
)
if
err1
!=
nil
||
err2
!=
nil
{
plug
.
GrafanaNetHasUpdate
=
plug
.
Info
.
Version
!=
plug
.
GrafanaNetVersion
}
else
{
plug
.
GrafanaNetHasUpdate
=
plugVersion
.
LessThan
(
gplugVersion
)
}
}
}
}
...
...
@@ -117,4 +126,11 @@ func checkForUpdates() {
GrafanaLatestVersion
=
githubLatest
.
Stable
GrafanaHasUpdate
=
githubLatest
.
Stable
!=
setting
.
BuildVersion
}
currVersion
,
err1
:=
version
.
NewVersion
(
setting
.
BuildVersion
)
latestVersion
,
err2
:=
version
.
NewVersion
(
GrafanaLatestVersion
)
if
err1
==
nil
&&
err2
==
nil
{
GrafanaHasUpdate
=
currVersion
.
LessThan
(
latestVersion
)
}
}
public/views/index.html
View file @
501e67a6
...
...
@@ -64,13 +64,13 @@
<a
href=
"http://grafana.org"
target=
"_blank"
>
Grafana
</a>
<span>
v[[.BuildVersion]] (commit: [[.BuildCommit]])
</span>
</li>
<li>
[[if .NewGrafanaVersionExists]]
[[if .NewGrafanaVersionExists]]
<li>
<a
href=
"http://grafana.org/download"
target=
"_blank"
bs-tooltip=
"'[[.NewGrafanaVersion]]'"
>
New version available!
</a>
[[end]]
</li>
</li>
[[end]]
</ul>
</div>
</footer>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment