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
@ -137,9 +137,11 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro
|
||||
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
|
||||
"authProxyEnabled": setting.AuthProxyEnabled,
|
||||
"buildInfo": map[string]interface{}{
|
||||
"version": setting.BuildVersion,
|
||||
"commit": setting.BuildCommit,
|
||||
"buildstamp": setting.BuildStamp,
|
||||
"version": setting.BuildVersion,
|
||||
"commit": setting.BuildCommit,
|
||||
"buildstamp": setting.BuildStamp,
|
||||
"latestVersion": plugins.GrafanaLatestVersion,
|
||||
"hasUpdate": plugins.GrafanaHasUpdate,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,6 @@ func checkForUpdates() {
|
||||
return
|
||||
}
|
||||
|
||||
log.Info("GNET PLUG: %v", len(data.Plugins))
|
||||
for _, plug := range Plugins {
|
||||
for _, gplug := range data.Plugins {
|
||||
if gplug.Id == plug.Id {
|
||||
@ -103,6 +102,7 @@ func checkForUpdates() {
|
||||
|
||||
if strings.Contains(setting.BuildVersion, "-") {
|
||||
GrafanaLatestVersion = githubLatest.Testing
|
||||
GrafanaHasUpdate = githubLatest.Testing != setting.BuildVersion
|
||||
} else {
|
||||
GrafanaLatestVersion = githubLatest.Stable
|
||||
GrafanaHasUpdate = githubLatest.Stable != setting.BuildVersion
|
||||
|
@ -39,7 +39,9 @@ function (angular, coreModule, config) {
|
||||
$scope.buildInfo = {
|
||||
version: config.buildInfo.version,
|
||||
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() {
|
||||
|
@ -20,8 +20,9 @@
|
||||
<li class="card-item-wrapper" ng-repeat="ds in ctrl.datasources">
|
||||
<a class="card-item" href="datasources/edit/{{ds.id}}/">
|
||||
<div class="card-item-header">
|
||||
<i class="icon-gf icon-gf-{{ds.type}}"></i>
|
||||
{{ds.type}}
|
||||
<div class="card-item-type">
|
||||
{{ds.type}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-item-body">
|
||||
<figure class="card-item-figure">
|
||||
|
@ -33,8 +33,13 @@
|
||||
<li class="card-item-wrapper" ng-repeat="plugin in ctrl.plugins">
|
||||
<a class="card-item" href="plugins/{{plugin.id}}/edit">
|
||||
<div class="card-item-header">
|
||||
<i class="icon-gf icon-gf-{{plugin.type}}"></i>
|
||||
{{plugin.type}}
|
||||
<div class="card-item-type">
|
||||
<i class="icon-gf icon-gf-{{plugin.type}}"></i>
|
||||
{{plugin.type}}
|
||||
</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">
|
||||
<figure class="card-item-figure">
|
||||
|
@ -78,9 +78,9 @@
|
||||
Grafana version: {{buildInfo.version}}, commit: {{buildInfo.commit}},
|
||||
build date: {{buildInfo.buildstamp | date: 'yyyy-MM-dd HH:mm:ss' }}
|
||||
</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>
|
||||
|
||||
|
||||
|
@ -76,13 +76,20 @@
|
||||
}
|
||||
|
||||
.card-item-header {
|
||||
margin-bottom: $spacer;
|
||||
}
|
||||
|
||||
.card-item-type {
|
||||
color: $text-color-weak;
|
||||
text-transform: uppercase;
|
||||
margin-bottom: $spacer;
|
||||
font-size: $font-size-sm;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.card-item-notice {
|
||||
font-size: $font-size-sm;
|
||||
}
|
||||
|
||||
.card-item-name {
|
||||
color: $headings-color;
|
||||
overflow: hidden;
|
||||
@ -107,6 +114,16 @@
|
||||
|
||||
.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 {
|
||||
float: right;
|
||||
}
|
||||
@ -165,6 +182,7 @@
|
||||
|
||||
.card-item-header {
|
||||
float: right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.card-item-figure {
|
||||
|
Loading…
Reference in New Issue
Block a user