| 1234567891011121314151617181920212223242526272829 |
- 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>';
- }
- };
- $scope.shareDashboard = function() {
- $scope.appEvent('show-modal', {
- src: './app/features/dashboard/partials/shareModal.html',
- scope: $scope.$new(),
- });
- };
- });
- });
|