mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(): various fixes to snapshots
This commit is contained in:
parent
454ccb451b
commit
aa8bd044c5
@ -8,8 +8,8 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="top-nav-snapshot-title" ng-if="dashboardMeta.isSnapshot">
|
||||
<a class="pointer" bs-tooltip="titleTooltip" data-placement="bottom">
|
||||
<div class="top-nav-btn top-nav-dashboards-btn" ng-if="dashboardMeta.isSnapshot">
|
||||
<a class="pointer" bs-tooltip="titleTooltip" data-placement="bottom" ng-click="openSearch()">
|
||||
<i class="icon-gf icon-gf-snapshot"></i>
|
||||
<span class="dashboard-title">
|
||||
{{dashboard.title}}
|
||||
|
@ -5,10 +5,59 @@ import $ from 'jquery';
|
||||
|
||||
var module = angular.module('grafana.directives');
|
||||
|
||||
var panelTemplate = `
|
||||
<div class="panel-container" ng-class="{'panel-transparent': ctrl.panel.transparent}">
|
||||
<div class="panel-header">
|
||||
<span class="alert-error panel-error small pointer" ng-if="ctrl.error" ng-click="ctrl.openInspector()">
|
||||
<span data-placement="top" bs-tooltip="ctrl.error">
|
||||
<i class="fa fa-exclamation"></i><span class="panel-error-arrow"></span>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
<span class="panel-loading" ng-show="ctrl.loading">
|
||||
<i class="fa fa-spinner fa-spin"></i>
|
||||
</span>
|
||||
|
||||
<div class="panel-title-container drag-handle" panel-menu></div>
|
||||
</div>
|
||||
|
||||
<div class="panel-content">
|
||||
<ng-transclude></ng-transclude>
|
||||
</div>
|
||||
<panel-resizer></panel-resizer>
|
||||
</div>
|
||||
|
||||
<div class="panel-full-edit" ng-if="ctrl.editMode">
|
||||
<div class="gf-box">
|
||||
<div class="gf-box-header">
|
||||
<div class="gf-box-title">
|
||||
<i ng-class="ctrl.icon"></i>
|
||||
{{ctrl.name}}
|
||||
</div>
|
||||
|
||||
<div ng-model="ctrl.editorTabIndex" bs-tabs>
|
||||
<div ng-repeat="tab in ctrl.editorTabs" data-title="{{tab.title}}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button class="gf-box-header-close-btn" ng-click="ctrl.exitFullscreen();">
|
||||
Back to dashboard
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="gf-box-body">
|
||||
<div ng-repeat="tab in ctrl.editorTabs" ng-if="ctrl.editorTabIndex === $index">
|
||||
<panel-editor-tab editor-tab="tab" ctrl="ctrl" index="$index"></panel-editor-tab>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
module.directive('grafanaPanel', function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'public/app/features/panel/partials/panel.html',
|
||||
template: panelTemplate,
|
||||
transclude: true,
|
||||
scope: { ctrl: "=" },
|
||||
link: function(scope, elem) {
|
||||
|
@ -59,7 +59,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
||||
super.initEditMode();
|
||||
this.icon = "fa fa-dashboard";
|
||||
this.fontSizes = ['20%', '30%','50%','70%','80%','100%', '110%', '120%', '150%', '170%', '200%'];
|
||||
this.addEditorTab('Options', 'app/plugins/panel/singlestat/editor.html', 2);
|
||||
this.addEditorTab('Options', 'public/app/plugins/panel/singlestat/editor.html', 2);
|
||||
this.unitFormats = kbn.getUnitFormats();
|
||||
}
|
||||
|
||||
@ -172,11 +172,11 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
||||
data.flotpairs = [];
|
||||
|
||||
if (this.series.length > 1) {
|
||||
this.inspector.error = new Error();
|
||||
this.inspector.error.message = 'Multiple Series Error';
|
||||
this.inspector.error.data = 'Metric query returns ' + this.series.length +
|
||||
var error: any = new Error();
|
||||
error.message = 'Multiple Series Error';
|
||||
error.data = 'Metric query returns ' + this.series.length +
|
||||
' series. Single Stat Panel expects a single series.\n\nResponse:\n'+JSON.stringify(this.series);
|
||||
throw this.inspector.error;
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (this.series && this.series.length > 0) {
|
||||
|
@ -83,6 +83,13 @@
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.icon-gf {
|
||||
position: relative;
|
||||
top: 5px;
|
||||
font-size: 27px;
|
||||
line-height: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-title {
|
||||
@ -114,20 +121,4 @@
|
||||
color: @linkColor;
|
||||
}
|
||||
|
||||
.top-nav-snapshot-title {
|
||||
.gf-icon {
|
||||
position: relative;
|
||||
top: 3px;
|
||||
font-size: 27px;
|
||||
}
|
||||
a {
|
||||
display: inline-block;
|
||||
padding: 0px 15px 5px 10px;
|
||||
}
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 1.4em;
|
||||
margin: 9px 18px 5px 14px;
|
||||
color: @linkColor;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user