Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added metadata info panel #3304

Merged
merged 6 commits into from
Dec 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion public/app/features/dashboard/dashboardCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ define([
'angular',
'jquery',
'app/core/config',
'moment',
],
function (angular, $, config) {
function (angular, $, config, moment) {
"use strict";

var module = angular.module('grafana.controllers');
Expand Down Expand Up @@ -149,6 +150,10 @@ function (angular, $, config) {
});
};

$scope.formatDate = function(date) {
return moment(date).format('MMM Do YYYY, h:mm:ss a');
};

});

});
32 changes: 31 additions & 1 deletion public/app/features/dashboard/partials/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</div>

<div ng-model="editor.index" bs-tabs style="text-transform:capitalize;">
<div ng-repeat="tab in ['General', 'Rows', 'Links', 'Time picker']" data-title="{{tab}}">
<div ng-repeat="tab in ['General', 'Rows', 'Links', 'Time picker', 'Metadata']" data-title="{{tab}}">
</div>
</div>

Expand Down Expand Up @@ -114,6 +114,36 @@ <h5>Rows settings</h5>
<gf-time-picker-settings dashboard="dashboard"></gf-time-picker-settings>
</div>

<div ng-if="editor.index == 4">
<div class="editor-row">
<div class="tight-form-section">
<h5>Info</h5>
<div class="tight-form">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 120px">
Last updated at:
</li>
<li class="tight-form-item" style="width: 180px">
{{formatDate(dashboardMeta.updated)}}
</li>
</ul>
<div class="clearfix"></div>
</div>
<div class="tight-form last">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 120px">
Created at:
</li>
<li class="tight-form-item" style="width: 180px">
{{formatDate(dashboardMeta.created)}}
</li>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
</div>

</div>

<div class="clearfix"></div>
Expand Down