Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
855e913b
Commit
855e913b
authored
May 19, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(dashboards): began work on dashboard list
parent
fb74d105
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
36 deletions
+34
-36
pkg/api/api.go
+1
-0
pkg/api/index.go
+2
-1
public/app/core/routes/dashboard_loaders.js
+0
-12
public/app/core/routes/routes.ts
+6
-8
public/app/features/dashboard/all.js
+1
-0
public/app/features/dashboard/dash_list_ctrl.ts
+11
-0
public/app/features/dashboard/partials/dash_list.html
+10
-0
public/app/features/dashboard/partials/migrate.html
+3
-15
No files found.
pkg/api/api.go
View file @
855e913b
...
...
@@ -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
)
...
...
pkg/api/index.go
View file @
855e913b
...
...
@@ -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
{
...
...
public/app/core/routes/dashboard_loaders.js
View file @
855e913b
...
...
@@ -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
},
...
...
public/app/core/routes/routes.ts
View file @
855e913b
...
...
@@ -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'
,
{
...
...
public/app/features/dashboard/all.js
View file @
855e913b
...
...
@@ -19,4 +19,5 @@ define([
'./upload'
,
'./import/import'
,
'./export/export_modal'
,
'./dash_list_ctrl'
,
],
function
()
{});
public/app/features/dashboard/dash_list_ctrl.ts
0 → 100644
View file @
855e913b
///<reference path="../../headers/common.d.ts" />
import
coreModule
from
'app/core/core_module'
;
export
class
DashListCtrl
{
/** @ngInject */
constructor
()
{
}
}
coreModule
.
controller
(
'DashListCtrl'
,
DashListCtrl
);
public/app/features/dashboard/partials/dash_list.html
0 → 100644
View file @
855e913b
<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>
public/app/features/dashboard/partials/
import
.html
→
public/app/features/dashboard/partials/
migrate
.html
View file @
855e913b
<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"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment