Commit 855e913b by Torkel Ödegaard

feat(dashboards): began work on dashboard list

parent fb74d105
......@@ -56,6 +56,7 @@ func Register(r *macaron.Macaron) {
r.Get("/dashboard/*", reqSignedIn, Index)
r.Get("/dashboard-solo/*", reqSignedIn, Index)
r.Get("/import/dashboard", reqSignedIn, Index)
r.Get("/dashboards/*", reqSignedIn, Index)
r.Get("/playlists/", reqSignedIn, Index)
r.Get("/playlists/*", reqSignedIn, Index)
......
......@@ -65,7 +65,8 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Divider: true})
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Text: "New", Icon: "fa fa-plus", Url: setting.AppSubUrl + "/dashboard/new"})
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Text: "Import", Icon: "fa fa-download", Url: setting.AppSubUrl + "/import/dashboard"})
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Text: "Import", Icon: "fa fa-download", Url: setting.AppSubUrl + "/dashboard/new/?editview=import"})
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Text: "Dashboard list", Icon: "fa fa-list", Url: setting.AppSubUrl + "/dashboards/list"})
}
data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
......
......@@ -25,18 +25,6 @@ function (coreModule) {
});
coreModule.default.controller('DashFromImportCtrl', function($scope, $location, alertSrv) {
if (!window.grafanaImportDashboard) {
alertSrv.set('Not found', 'Cannot reload page with unsaved imported dashboard', 'warning', 7000);
$location.path('');
return;
}
$scope.initDashboard({
meta: { canShare: false, canStar: false },
dashboard: window.grafanaImportDashboard
}, $scope);
});
coreModule.default.controller('NewDashboardCtrl', function($scope) {
$scope.initDashboard({
meta: { canStar: false, canShare: false },
......
......@@ -32,20 +32,18 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
controller : 'SoloPanelCtrl',
pageClass: 'page-dashboard',
})
.when('/dashboard-import/:file', {
templateUrl: 'public/app/partials/dashboard.html',
controller : 'DashFromImportCtrl',
reloadOnSearch: false,
pageClass: 'page-dashboard',
})
.when('/dashboard/new', {
templateUrl: 'public/app/partials/dashboard.html',
controller : 'NewDashboardCtrl',
reloadOnSearch: false,
pageClass: 'page-dashboard',
})
.when('/import/dashboard', {
templateUrl: 'public/app/features/dashboard/partials/import.html',
.when('/dashboards/list', {
templateUrl: 'public/app/features/dashboard/partials/dash_list.html',
controller : 'DashListCtrl',
})
.when('/dashboards/migrate', {
templateUrl: 'public/app/features/dashboard/partials/migrate.html',
controller : 'DashboardImportCtrl',
})
.when('/datasources', {
......
......@@ -19,4 +19,5 @@ define([
'./upload',
'./import/import',
'./export/export_modal',
'./dash_list_ctrl',
], function () {});
///<reference path="../../headers/common.d.ts" />
import coreModule from 'app/core/core_module';
export class DashListCtrl {
/** @ngInject */
constructor() {
}
}
coreModule.controller('DashListCtrl', DashListCtrl);
<navbar title="Dashboards" title-url="dashboards" icon="icon-gf icon-gf-dashboard">
</navbar>
<div class="page-container">
<div class="page-header">
<h1>Dashboards</h1>
</div>
</div>
<navbar title="Import" title-url="import/dashboard" icon="fa fa-download">
<navbar title="Migrate" title-url="dashboards/migrate" icon="fa fa-download">
</navbar>
<div class="page-container">
<div class="page-header">
<h1>
Import dashboard
Migrate dashboards
</h1>
</div>
<h5 class="section-heading">
Upload .json file
</h5>
<div class="gf-form-group">
<form class="gf-form">
<input type="file" id="dashupload" dash-upload name="dashupload" class="hide"/><br>
<label class="btn btn-success" for="dashupload">Select file</label>
</form>
</div>
<h5 class="section-heading">
Migrate dashboards
<em style="font-size: 14px;padding-left: 10px;"><i class="fa fa-info-circle"></i> Import dashboards from Elasticsearch or InfluxDB</em>
Import dashboards from Elasticsearch or InfluxDB
</h5>
<div class="gf-form-inline gf-form-group">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment