feat(export): work on export

This commit is contained in:
Torkel Ödegaard 2016-05-18 11:11:53 +02:00
parent 6632f883c0
commit 26ea0bc360
5 changed files with 15 additions and 4 deletions

View File

@ -22,6 +22,7 @@ function (angular, $, _, moment) {
this.id = data.id || null;
this.title = data.title || 'No Title';
this.description = data.description;
this.tags = data.tags || [];
this.style = data.style || "dark";
this.timezone = data.timezone || '';

View File

@ -26,9 +26,11 @@ export class DashboardExporter {
_.each(row.panels, (panel) => {
if (panel.datasource !== undefined) {
promises.push(this.datasourceSrv.get(panel.datasource).then(ds => {
var refName = 'DS_' + ds.name.toUpperCase();
var refName = 'DS_' + ds.name.replace(' ', '_').toUpperCase();
datasources[panel.datasource] = {
name: refName,
label: ds.name,
description: '',
type: 'datasource',
pluginId: ds.meta.id,
pluginName: ds.meta.name,

View File

@ -62,7 +62,7 @@
<div ng-repeat="input in ctrl.inputs">
<div class="gf-form">
<label class="gf-form-label width-15">{{input.name}}</label>
<label class="gf-form-label width-15">{{input.label}}</label>
<div class="gf-form-select-wrapper" style="width: 100%">
<select class="gf-form-input" ng-model="input.value" ng-options="v.value as v.text for v in input.options" ng-change="ctrl.inputValueChanged()"></select>
</div>

View File

@ -31,6 +31,8 @@ export class DashImportCtrl {
for (let input of this.dash.__inputs) {
var inputModel = {
name: input.name,
label: input.label,
description: input.description,
type: input.type,
pluginId: input.pluginId,
options: []
@ -55,6 +57,8 @@ export class DashImportCtrl {
if (sources.length === 0) {
inputModel.error = "No data sources of type " + input.pluginName + " found";
} else if (inputModel.description) {
inputModel.info = inputModel.description;
} else {
inputModel.info = "Select a " + input.pluginName + " data source";
}

View File

@ -23,9 +23,13 @@
<h5 class="section-heading">Details</h5>
<div class="gf-form">
<label class="gf-form-label width-7">Title</label>
<input type="text" class="gf-form-input width-25" ng-model='dashboard.title'></input>
<input type="text" class="gf-form-input width-30" ng-model='dashboard.title'></input>
</div>
<div class="gf-form">
<div class="gf-form">
<label class="gf-form-label width-7">Description</label>
<input type="text" class="gf-form-input width-30" ng-model='dashboard.description'></input>
</div>
<div class="gf-form">
<label class="gf-form-label width-7">
Tags
<info-popover mode="right-normal">Press enter to a add tag</info-popover>