mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
more work on share panel, #864
This commit is contained in:
parent
6f1a6d5a56
commit
440ea666d9
@ -15,5 +15,6 @@ define([
|
|||||||
'./opentsdbTargetCtrl',
|
'./opentsdbTargetCtrl',
|
||||||
'./annotationsEditorCtrl',
|
'./annotationsEditorCtrl',
|
||||||
'./templateEditorCtrl',
|
'./templateEditorCtrl',
|
||||||
|
'./sharePanelCtrl',
|
||||||
'./jsonEditorCtrl',
|
'./jsonEditorCtrl',
|
||||||
], function () {});
|
], function () {});
|
||||||
|
42
src/app/controllers/sharePanelCtrl.js
Normal file
42
src/app/controllers/sharePanelCtrl.js
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
define([
|
||||||
|
'angular',
|
||||||
|
'lodash'
|
||||||
|
],
|
||||||
|
function (angular, _) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var module = angular.module('grafana.controllers');
|
||||||
|
|
||||||
|
module.controller('SharePanelCtrl', function($scope, $location, $timeout, timeSrv, $element) {
|
||||||
|
|
||||||
|
$scope.init = function() {
|
||||||
|
$scope.editor = { index: 0 };
|
||||||
|
|
||||||
|
var currentUrl = $location.absUrl();
|
||||||
|
var panelId = $scope.panel.id;
|
||||||
|
var range = timeSrv.timeRange(false);
|
||||||
|
var from = range.from;
|
||||||
|
var to = range.to;
|
||||||
|
if (_.isDate(from)) {
|
||||||
|
from = from.getTime();
|
||||||
|
}
|
||||||
|
if (_.isDate(to)) {
|
||||||
|
to = to.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.shareUrl = currentUrl + "?panelId=" + panelId + "&fullscreen";
|
||||||
|
$scope.shareUrl += "&from=" + from;
|
||||||
|
$scope.shareUrl += "&to=" + to;
|
||||||
|
|
||||||
|
$timeout(function() {
|
||||||
|
var input = $element.find('[data-share-panel-url]');
|
||||||
|
input.focus();
|
||||||
|
input.select();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.init();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
@ -1,9 +1,8 @@
|
|||||||
define([
|
define([
|
||||||
'angular',
|
'angular',
|
||||||
'app',
|
|
||||||
'lodash'
|
'lodash'
|
||||||
],
|
],
|
||||||
function (angular, app, _) {
|
function (angular, _) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var module = angular.module('grafana.controllers');
|
var module = angular.module('grafana.controllers');
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div ng-model="editor.index" bs-tabs style="text-transform:capitalize;">
|
<div ng-model="editor.index" bs-tabs style="text-transform:capitalize;">
|
||||||
<div ng-repeat="tab in ['Link', 'Embedd', 'Image']" data-title="{{tab}}">
|
<div ng-repeat="tab in ['Link', 'Embed', 'Image']" data-title="{{tab}}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -16,7 +16,18 @@
|
|||||||
|
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="editor-row">
|
<div class="editor-row">
|
||||||
<input type="text" class="input input-xxlarge"></input>
|
<div class="editor-option">
|
||||||
|
<label class="small">Current time range</label>
|
||||||
|
<input type="checkbox"></input>
|
||||||
|
</div>
|
||||||
|
<div class="editor-option">
|
||||||
|
<label class="small">To fullscreen panel</label>
|
||||||
|
<input type="checkbox"></input>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="editor-row" style="margin-top: 20px;">
|
||||||
|
<input type="text" data-share-panel-url ng-model="shareUrl" class="input input-fluid"></input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -53,8 +53,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
max-width: 1024px;
|
max-width: 800px;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|
||||||
right: 0;
|
right: 0;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
@ -528,3 +529,10 @@ select.grafana-target-segment-input {
|
|||||||
.grafana-tip {
|
.grafana-tip {
|
||||||
padding-left: 5px;
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input[type=text].input-fluid {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -562,12 +562,6 @@ div.flot-text {
|
|||||||
background-color: darken(@purple, 10%);
|
background-color: darken(@purple, 10%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.annotation-editor-table {
|
|
||||||
td {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Top menu
|
// Top menu
|
||||||
.save-dashboard-dropdown {
|
.save-dashboard-dropdown {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
Loading…
Reference in New Issue
Block a user