mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added update notice to plugin list
This commit is contained in:
parent
6ac3bd4c7c
commit
ab34b174f9
@ -140,6 +140,8 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
|
|||||||
"version": setting.BuildVersion,
|
"version": setting.BuildVersion,
|
||||||
"commit": setting.BuildCommit,
|
"commit": setting.BuildCommit,
|
||||||
"buildstamp": setting.BuildStamp,
|
"buildstamp": setting.BuildStamp,
|
||||||
|
"latestVersion": plugins.GrafanaLatestVersion,
|
||||||
|
"hasUpdate": plugins.GrafanaHasUpdate,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,6 @@ func checkForUpdates() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("GNET PLUG: %v", len(data.Plugins))
|
|
||||||
for _, plug := range Plugins {
|
for _, plug := range Plugins {
|
||||||
for _, gplug := range data.Plugins {
|
for _, gplug := range data.Plugins {
|
||||||
if gplug.Id == plug.Id {
|
if gplug.Id == plug.Id {
|
||||||
@ -103,6 +102,7 @@ func checkForUpdates() {
|
|||||||
|
|
||||||
if strings.Contains(setting.BuildVersion, "-") {
|
if strings.Contains(setting.BuildVersion, "-") {
|
||||||
GrafanaLatestVersion = githubLatest.Testing
|
GrafanaLatestVersion = githubLatest.Testing
|
||||||
|
GrafanaHasUpdate = githubLatest.Testing != setting.BuildVersion
|
||||||
} else {
|
} else {
|
||||||
GrafanaLatestVersion = githubLatest.Stable
|
GrafanaLatestVersion = githubLatest.Stable
|
||||||
GrafanaHasUpdate = githubLatest.Stable != setting.BuildVersion
|
GrafanaHasUpdate = githubLatest.Stable != setting.BuildVersion
|
||||||
|
@ -39,7 +39,9 @@ function (angular, coreModule, config) {
|
|||||||
$scope.buildInfo = {
|
$scope.buildInfo = {
|
||||||
version: config.buildInfo.version,
|
version: config.buildInfo.version,
|
||||||
commit: config.buildInfo.commit,
|
commit: config.buildInfo.commit,
|
||||||
buildstamp: new Date(config.buildInfo.buildstamp * 1000)
|
buildstamp: new Date(config.buildInfo.buildstamp * 1000),
|
||||||
|
latestVersion: config.buildInfo.latestVersion,
|
||||||
|
hasUpdate: config.buildInfo.hasUpdate,
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.submit = function() {
|
$scope.submit = function() {
|
||||||
|
@ -20,9 +20,10 @@
|
|||||||
<li class="card-item-wrapper" ng-repeat="ds in ctrl.datasources">
|
<li class="card-item-wrapper" ng-repeat="ds in ctrl.datasources">
|
||||||
<a class="card-item" href="datasources/edit/{{ds.id}}/">
|
<a class="card-item" href="datasources/edit/{{ds.id}}/">
|
||||||
<div class="card-item-header">
|
<div class="card-item-header">
|
||||||
<i class="icon-gf icon-gf-{{ds.type}}"></i>
|
<div class="card-item-type">
|
||||||
{{ds.type}}
|
{{ds.type}}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="card-item-body">
|
<div class="card-item-body">
|
||||||
<figure class="card-item-figure">
|
<figure class="card-item-figure">
|
||||||
<img ng-src="{{ds.typeLogoUrl}}">
|
<img ng-src="{{ds.typeLogoUrl}}">
|
||||||
|
@ -33,9 +33,14 @@
|
|||||||
<li class="card-item-wrapper" ng-repeat="plugin in ctrl.plugins">
|
<li class="card-item-wrapper" ng-repeat="plugin in ctrl.plugins">
|
||||||
<a class="card-item" href="plugins/{{plugin.id}}/edit">
|
<a class="card-item" href="plugins/{{plugin.id}}/edit">
|
||||||
<div class="card-item-header">
|
<div class="card-item-header">
|
||||||
|
<div class="card-item-type">
|
||||||
<i class="icon-gf icon-gf-{{plugin.type}}"></i>
|
<i class="icon-gf icon-gf-{{plugin.type}}"></i>
|
||||||
{{plugin.type}}
|
{{plugin.type}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="card-item-notice" ng-show="plugin.hasUpdate">
|
||||||
|
<span bs-tooltip="plugin.latestVersion">Update available!</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="card-item-body">
|
<div class="card-item-body">
|
||||||
<figure class="card-item-figure">
|
<figure class="card-item-figure">
|
||||||
<img ng-src="{{plugin.info.logos.small}}">
|
<img ng-src="{{plugin.info.logos.small}}">
|
||||||
|
@ -78,9 +78,9 @@
|
|||||||
Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}},
|
Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}},
|
||||||
build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }}
|
build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="version-footer text-center small" ng-show="buildInfo.hasUpdate">
|
||||||
|
<a class="external-link" target="_blank" href="http://grafana.org/download">New Grafana Version Available ({{buildInfo.latestVersion}})</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,13 +76,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.card-item-header {
|
.card-item-header {
|
||||||
|
margin-bottom: $spacer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-item-type {
|
||||||
color: $text-color-weak;
|
color: $text-color-weak;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
margin-bottom: $spacer;
|
|
||||||
font-size: $font-size-sm;
|
font-size: $font-size-sm;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.card-item-notice {
|
||||||
|
font-size: $font-size-sm;
|
||||||
|
}
|
||||||
|
|
||||||
.card-item-name {
|
.card-item-name {
|
||||||
color: $headings-color;
|
color: $headings-color;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -107,6 +114,16 @@
|
|||||||
|
|
||||||
.card-list-layout-grid {
|
.card-list-layout-grid {
|
||||||
|
|
||||||
|
.card-item-type {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-item-notice {
|
||||||
|
font-size: $font-size-sm;
|
||||||
|
display: inline-block;
|
||||||
|
margin-left: $spacer;
|
||||||
|
}
|
||||||
|
|
||||||
.card-item-header-action {
|
.card-item-header-action {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
@ -165,6 +182,7 @@
|
|||||||
|
|
||||||
.card-item-header {
|
.card-item-header {
|
||||||
float: right;
|
float: right;
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-item-figure {
|
.card-item-figure {
|
||||||
|
Loading…
Reference in New Issue
Block a user