Moved dashboard import and json import to same view, found via dashboard search dropdown, #1511

This commit is contained in:
Torkel Ödegaard 2015-02-23 10:13:16 +01:00
parent a146a24c06
commit 4a93d205bb
8 changed files with 27 additions and 26 deletions

View File

@ -3,6 +3,5 @@ define([
'./datasourcesCtrl',
'./datasourceEditCtrl',
'./apiKeysCtrl',
'./importCtrl',
'./accountCtrl',
], function () {});

View File

@ -2,7 +2,6 @@
<ul class="nav">
<li class="active"><a href="account">Overview</a></li>
<li><a href="account/users">Users</a></li>
<li><a href="account/import">Import</a></li>
</ul>
</topnav>

View File

@ -13,4 +13,5 @@ define([
'./timeSrv',
'./unsavedChangesSrv',
'./directives/dashSearchView',
'./importCtrl',
], function () {});

View File

@ -7,7 +7,7 @@ function (angular, _) {
var module = angular.module('grafana.controllers');
module.controller('ImportCtrl', function($scope, $http, backendSrv, datasourceSrv) {
module.controller('DashboardImportCtrl', function($scope, $http, backendSrv, datasourceSrv) {
$scope.init = function() {
$scope.datasources = [];

View File

@ -1,14 +1,27 @@
<topnav icon="fa fa-shield" title="Account" subnav="true">
<topnav icon="fa fa-th-large" title="Dashboards" subnav="true">
<ul class="nav">
<li><a href="account">Overview</a></li>
<li><a href="account/users">Users</a></li>
<li class="active"><a href="account/import">Import</a></li>
<li class="active"><a href="import">Import</a></li>
</ul>
</topnav>
<div class="page-container">
<div class="page">
<h2>Import dashboards</h2>
<h2>
Import dashboard
<span><tip>Load dashboard JSON layout from file</tip></span>
</h2>
<div class="editor-row">
<div class="section">
<div class="editor-option">
<form>
<input type="file" id="dashupload" dash-upload/><br>
</form>
</div>
</div>
</div>
<h2>Migrate dashboards</h2>
<div class="tight-form">
<ul class="tight-form-list">

View File

@ -62,26 +62,15 @@
</div>
</div>
<div class="editor-row" ng-if="showImport">
<div class="section">
<div class="editor-option">
<h5>Local File <tip>Load dashboard JSON layout from file</tip></h5>
<form>
<input type="file" id="dashupload" dash-upload/><br>
</form>
</div>
</div>
</div>
<div class="search-button-row">
<button class="btn btn-inverse pull-left" ng-click="newDashboard()">
<i class="fa fa-plus"></i>
New
</button>
<button class="btn btn-inverse pull-left" ng-click="toggleImport($event)">
<a class="btn btn-inverse pull-left" href="dashboard/import">
<i class="fa fa-download"></i>
Import
</button>
</a>
<button class="btn btn-inverse pull-left" dash-editor-link="app/partials/playlist.html" editor-scope="isolated">
<i class="fa fa-play"></i>
Playlist

View File

@ -30,6 +30,10 @@ define([
controller : 'NewDashboardCtrl',
reloadOnSearch: false,
})
.when('/dashboard/import', {
templateUrl: 'app/features/dashboard/partials/import.html',
controller : 'DashboardImportCtrl',
})
.when('/account', {
templateUrl: 'app/features/account/partials/account.html',
controller : 'AccountCtrl',
@ -54,10 +58,6 @@ define([
templateUrl: 'app/features/account/partials/apikeys.html',
controller : 'ApiKeysCtrl',
})
.when('/account/import', {
templateUrl: 'app/features/account/partials/import.html',
controller : 'ImportCtrl',
})
.when('/profile', {
templateUrl: 'app/features/profile/partials/profile.html',
controller : 'ProfileCtrl',

View File

@ -92,7 +92,7 @@
.search-button-row {
padding-top: 20px;
button {
button, a {
margin-right: 10px;
}
}