Commit 855e913b by Torkel Ödegaard

feat(dashboards): began work on dashboard list

parent fb74d105
...@@ -56,6 +56,7 @@ func Register(r *macaron.Macaron) { ...@@ -56,6 +56,7 @@ func Register(r *macaron.Macaron) {
r.Get("/dashboard/*", reqSignedIn, Index) r.Get("/dashboard/*", reqSignedIn, Index)
r.Get("/dashboard-solo/*", reqSignedIn, Index) r.Get("/dashboard-solo/*", reqSignedIn, Index)
r.Get("/import/dashboard", reqSignedIn, Index) r.Get("/import/dashboard", reqSignedIn, Index)
r.Get("/dashboards/*", reqSignedIn, Index)
r.Get("/playlists/", reqSignedIn, Index) r.Get("/playlists/", reqSignedIn, Index)
r.Get("/playlists/*", reqSignedIn, Index) r.Get("/playlists/*", reqSignedIn, Index)
......
...@@ -65,7 +65,8 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { ...@@ -65,7 +65,8 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR { if c.OrgRole == m.ROLE_ADMIN || c.OrgRole == m.ROLE_EDITOR {
dashboardChildNavs = append(dashboardChildNavs, &dtos.NavLink{Divider: true}) 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: "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{ data.MainNavLinks = append(data.MainNavLinks, &dtos.NavLink{
......
...@@ -25,18 +25,6 @@ function (coreModule) { ...@@ -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) { coreModule.default.controller('NewDashboardCtrl', function($scope) {
$scope.initDashboard({ $scope.initDashboard({
meta: { canStar: false, canShare: false }, meta: { canStar: false, canShare: false },
......
...@@ -32,20 +32,18 @@ function setupAngularRoutes($routeProvider, $locationProvider) { ...@@ -32,20 +32,18 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
controller : 'SoloPanelCtrl', controller : 'SoloPanelCtrl',
pageClass: 'page-dashboard', pageClass: 'page-dashboard',
}) })
.when('/dashboard-import/:file', {
templateUrl: 'public/app/partials/dashboard.html',
controller : 'DashFromImportCtrl',
reloadOnSearch: false,
pageClass: 'page-dashboard',
})
.when('/dashboard/new', { .when('/dashboard/new', {
templateUrl: 'public/app/partials/dashboard.html', templateUrl: 'public/app/partials/dashboard.html',
controller : 'NewDashboardCtrl', controller : 'NewDashboardCtrl',
reloadOnSearch: false, reloadOnSearch: false,
pageClass: 'page-dashboard', pageClass: 'page-dashboard',
}) })
.when('/import/dashboard', { .when('/dashboards/list', {
templateUrl: 'public/app/features/dashboard/partials/import.html', templateUrl: 'public/app/features/dashboard/partials/dash_list.html',
controller : 'DashListCtrl',
})
.when('/dashboards/migrate', {
templateUrl: 'public/app/features/dashboard/partials/migrate.html',
controller : 'DashboardImportCtrl', controller : 'DashboardImportCtrl',
}) })
.when('/datasources', { .when('/datasources', {
......
...@@ -19,4 +19,5 @@ define([ ...@@ -19,4 +19,5 @@ define([
'./upload', './upload',
'./import/import', './import/import',
'./export/export_modal', './export/export_modal',
'./dash_list_ctrl',
], function () {}); ], 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> </navbar>
<div class="page-container"> <div class="page-container">
<div class="page-header"> <div class="page-header">
<h1> <h1>
Import dashboard Migrate dashboards
</h1> </h1>
</div> </div>
<h5 class="section-heading"> <h5 class="section-heading">
Upload .json file Import dashboards from Elasticsearch or InfluxDB
</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>
</h5> </h5>
<div class="gf-form-inline gf-form-group"> <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