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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
pkg/plugins/update_checker.go
+16
-0
public/views/index.html
+2
-2
No files found.
pkg/plugins/update_checker.go
View file @
501e67a6
...
@@ -9,6 +9,7 @@ import (
...
@@ -9,6 +9,7 @@ import (
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/setting"
"github.com/hashicorp/go-version"
)
)
var
(
var
(
...
@@ -85,7 +86,15 @@ func checkForUpdates() {
...
@@ -85,7 +86,15 @@ func checkForUpdates() {
for
_
,
gplug
:=
range
gNetPlugins
{
for
_
,
gplug
:=
range
gNetPlugins
{
if
gplug
.
Slug
==
plug
.
Id
{
if
gplug
.
Slug
==
plug
.
Id
{
plug
.
GrafanaNetVersion
=
gplug
.
Version
plug
.
GrafanaNetVersion
=
gplug
.
Version
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
plug
.
GrafanaNetHasUpdate
=
plug
.
Info
.
Version
!=
plug
.
GrafanaNetVersion
}
else
{
plug
.
GrafanaNetHasUpdate
=
plugVersion
.
LessThan
(
gplugVersion
)
}
}
}
}
}
}
}
...
@@ -117,4 +126,11 @@ func checkForUpdates() {
...
@@ -117,4 +126,11 @@ func checkForUpdates() {
GrafanaLatestVersion
=
githubLatest
.
Stable
GrafanaLatestVersion
=
githubLatest
.
Stable
GrafanaHasUpdate
=
githubLatest
.
Stable
!=
setting
.
BuildVersion
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 @@
...
@@ -64,13 +64,13 @@
<a
href=
"http://grafana.org"
target=
"_blank"
>
Grafana
</a>
<a
href=
"http://grafana.org"
target=
"_blank"
>
Grafana
</a>
<span>
v[[.BuildVersion]] (commit: [[.BuildCommit]])
</span>
<span>
v[[.BuildVersion]] (commit: [[.BuildCommit]])
</span>
</li>
</li>
<li>
[[if .NewGrafanaVersionExists]]
[[if .NewGrafanaVersionExists]]
<li>
<a
href=
"http://grafana.org/download"
target=
"_blank"
bs-tooltip=
"'[[.NewGrafanaVersion]]'"
>
<a
href=
"http://grafana.org/download"
target=
"_blank"
bs-tooltip=
"'[[.NewGrafanaVersion]]'"
>
New version available!
New version available!
</a>
</a>
[[end]]
</li>
</li>
[[end]]
</ul>
</ul>
</div>
</div>
</footer>
</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