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
d8e4decc
Commit
d8e4decc
authored
Oct 11, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grid: fixed migration for rows without height
parent
d4ebcc82
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
99 deletions
+2
-99
public/app/features/dashboard/DashboardModel.ts
+1
-1
public/app/features/dashboard/all.js
+0
-1
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
+0
-1
public/app/features/dashboard/graphiteImportCtrl.js
+0
-95
public/app/plugins/panel/graph/specs/graph_specs.ts
+1
-1
No files found.
public/app/features/dashboard/DashboardModel.ts
View file @
d8e4decc
...
@@ -672,7 +672,7 @@ export class DashboardModel {
...
@@ -672,7 +672,7 @@ export class DashboardModel {
for
(
let
row
of
old
.
rows
)
{
for
(
let
row
of
old
.
rows
)
{
let
xPos
=
0
;
let
xPos
=
0
;
let
height
:
any
=
row
.
height
;
let
height
:
any
=
row
.
height
||
250
;
// if (this.meta.keepRows) {
// if (this.meta.keepRows) {
// this.panels.push({
// this.panels.push({
...
...
public/app/features/dashboard/all.js
View file @
d8e4decc
...
@@ -15,7 +15,6 @@ define([
...
@@ -15,7 +15,6 @@ define([
'./unsavedChangesSrv'
,
'./unsavedChangesSrv'
,
'./unsaved_changes_modal'
,
'./unsaved_changes_modal'
,
'./timepicker/timepicker'
,
'./timepicker/timepicker'
,
'./graphiteImportCtrl'
,
'./impression_store'
,
'./impression_store'
,
'./upload'
,
'./upload'
,
'./import/dash_import'
,
'./import/dash_import'
,
...
...
public/app/features/dashboard/dashgrid/DashboardGrid.tsx
View file @
d8e4decc
...
@@ -117,7 +117,6 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
...
@@ -117,7 +117,6 @@ export class DashboardGrid extends React.Component<DashboardGridProps, any> {
}
}
render
()
{
render
()
{
console
.
log
(
'DashboardGrid.render()'
);
return
(
return
(
<
SizedReactLayoutGrid
layout=
{
this
.
buildLayout
()
}
onLayoutChange=
{
this
.
onLayoutChange
}
onResize=
{
this
.
onResize
}
>
<
SizedReactLayoutGrid
layout=
{
this
.
buildLayout
()
}
onLayoutChange=
{
this
.
onLayoutChange
}
onResize=
{
this
.
onResize
}
>
{
this
.
renderPanels
()
}
{
this
.
renderPanels
()
}
...
...
public/app/features/dashboard/graphiteImportCtrl.js
deleted
100644 → 0
View file @
d4ebcc82
define
([
'angular'
,
'lodash'
,
'app/core/utils/kbn'
],
function
(
angular
,
_
,
kbn
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'GraphiteImportCtrl'
,
function
(
$scope
,
datasourceSrv
,
dashboardSrv
,
$location
)
{
$scope
.
options
=
{};
$scope
.
init
=
function
()
{
$scope
.
datasources
=
[];
_
.
each
(
datasourceSrv
.
getAll
(),
function
(
ds
)
{
if
(
ds
.
type
===
'graphite'
)
{
$scope
.
options
.
sourceName
=
ds
.
name
;
$scope
.
datasources
.
push
(
ds
.
name
);
}
});
};
$scope
.
listAll
=
function
()
{
datasourceSrv
.
get
(
$scope
.
options
.
sourceName
).
then
(
function
(
datasource
)
{
$scope
.
datasource
=
datasource
;
$scope
.
datasource
.
listDashboards
(
''
).
then
(
function
(
results
)
{
$scope
.
dashboards
=
results
;
},
function
(
err
)
{
var
message
=
err
.
message
||
err
.
statusText
||
'Error'
;
$scope
.
appEvent
(
'alert-error'
,
[
'Failed to load dashboard list from graphite'
,
message
]);
});
});
};
$scope
.
import
=
function
(
dashName
)
{
$scope
.
datasource
.
loadDashboard
(
dashName
).
then
(
function
(
results
)
{
if
(
!
results
.
data
||
!
results
.
data
.
state
)
{
throw
{
message
:
'no dashboard state received from graphite'
};
}
graphiteToGrafanaTranslator
(
results
.
data
.
state
,
$scope
.
datasource
.
name
);
},
function
(
err
)
{
var
message
=
err
.
message
||
err
.
statusText
||
'Error'
;
$scope
.
appEvent
(
'alert-error'
,
[
'Failed to load dashboard from graphite'
,
message
]);
});
};
function
graphiteToGrafanaTranslator
(
state
,
datasource
)
{
var
graphsPerRow
=
2
;
var
rowHeight
=
300
;
var
rowTemplate
;
var
currentRow
;
var
panel
;
rowTemplate
=
{
title
:
''
,
panels
:
[],
height
:
rowHeight
};
currentRow
=
angular
.
copy
(
rowTemplate
);
var
newDashboard
=
dashboardSrv
.
create
({});
newDashboard
.
rows
=
[];
newDashboard
.
title
=
state
.
name
;
newDashboard
.
rows
.
push
(
currentRow
);
_
.
each
(
state
.
graphs
,
function
(
graph
,
index
)
{
if
(
currentRow
.
panels
.
length
===
graphsPerRow
)
{
currentRow
=
angular
.
copy
(
rowTemplate
);
newDashboard
.
rows
.
push
(
currentRow
);
}
panel
=
{
type
:
'graph'
,
span
:
12
/
graphsPerRow
,
title
:
graph
[
1
].
title
,
targets
:
[],
datasource
:
datasource
,
id
:
index
+
1
};
_
.
each
(
graph
[
1
].
target
,
function
(
target
)
{
panel
.
targets
.
push
({
target
:
target
});
});
currentRow
.
panels
.
push
(
panel
);
});
window
.
grafanaImportDashboard
=
newDashboard
;
$location
.
path
(
'/dashboard-import/'
+
kbn
.
slugifyForUrl
(
newDashboard
.
title
));
}
});
});
public/app/plugins/panel/graph/specs/graph_specs.ts
View file @
d8e4decc
...
@@ -26,9 +26,9 @@ describe('grafanaGraph', function() {
...
@@ -26,9 +26,9 @@ describe('grafanaGraph', function() {
beforeEach
(
angularMocks
.
inject
(
function
(
$rootScope
,
$compile
)
{
beforeEach
(
angularMocks
.
inject
(
function
(
$rootScope
,
$compile
)
{
var
ctrl
:
any
=
{
var
ctrl
:
any
=
{
events
:
new
Emitter
(),
height
:
200
,
height
:
200
,
panel
:
{
panel
:
{
events
:
new
Emitter
(),
legend
:
{},
legend
:
{},
grid
:
{
},
grid
:
{
},
yaxes
:
[
yaxes
:
[
...
...
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