mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
feat(export): work on export
This commit is contained in:
parent
6632f883c0
commit
26ea0bc360
@ -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 || '';
|
||||
|
@ -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,
|
||||
|
@ -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>
|
||||
|
@ -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";
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user