2015-03-28 11:53:52 -05:00
|
|
|
define([
|
|
|
|
'angular',
|
|
|
|
'moment',
|
|
|
|
],
|
|
|
|
function (angular, moment) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var module = angular.module('grafana.controllers');
|
|
|
|
|
|
|
|
module.controller('SnapshotTopNavCtrl', function($scope) {
|
|
|
|
|
|
|
|
$scope.init = function() {
|
|
|
|
var meta = $scope.dashboardMeta;
|
|
|
|
$scope.titleTooltip = 'Created: ' + moment(meta.created).calendar();
|
|
|
|
if (meta.expires) {
|
|
|
|
$scope.titleTooltip += '<br>Expires: ' + moment(meta.expires).fromNow() + '<br>';
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-03-29 07:30:03 -05:00
|
|
|
$scope.shareDashboard = function() {
|
|
|
|
$scope.appEvent('show-modal', {
|
|
|
|
src: './app/features/dashboard/partials/shareModal.html',
|
|
|
|
scope: $scope.$new(),
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2015-03-28 11:53:52 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
});
|