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
d87653b0
Commit
d87653b0
authored
Aug 25, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: new grid progress
parent
160d8cec
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
50 deletions
+30
-50
public/app/features/dashboard/dashgrid/dashgrid.ts
+0
-9
public/app/features/dashboard/model.ts
+5
-8
public/app/features/dashboard/row/add_panel.html
+0
-2
public/app/features/dashboard/row/add_panel.ts
+19
-1
public/app/features/panel/panel_ctrl.ts
+1
-11
public/app/partials/panelgeneral.html
+3
-16
public/sass/components/_navbar.scss
+2
-2
public/sass/components/_sidemenu.scss
+0
-1
No files found.
public/app/features/dashboard/dashgrid/dashgrid.ts
View file @
d87653b0
...
...
@@ -170,15 +170,6 @@ export function dashGridItem($timeout, $rootScope) {
'data-gs-no-resize'
:
panel
.
type
===
'row'
,
});
// listen for row moments
scope
.
$watch
(
"panel.y"
,
function
(
newModelY
)
{
let
elementY
=
parseInt
(
element
.
attr
(
'data-gs-y'
));
console
.
log
(
'new panel y'
,
newModelY
,
elementY
);
if
(
_
.
isNumber
(
newModelY
)
&&
elementY
!==
newModelY
)
{
gridCtrl
.
gridstack
.
move
(
element
,
panel
.
x
,
panel
.
y
);
}
});
$rootScope
.
onAppEvent
(
'panel-fullscreen-exit'
,
(
evt
,
payload
)
=>
{
if
(
panel
.
id
!==
payload
.
panelId
)
{
return
;
...
...
public/app/features/dashboard/model.ts
View file @
d87653b0
...
...
@@ -144,14 +144,11 @@ export class DashboardModel {
}
getNextPanelId
()
{
var
i
,
j
,
row
,
panel
,
max
=
0
;
for
(
i
=
0
;
i
<
this
.
rows
.
length
;
i
++
)
{
row
=
this
.
rows
[
i
];
for
(
j
=
0
;
j
<
row
.
panels
.
length
;
j
++
)
{
panel
=
row
.
panels
[
j
];
var
j
,
panel
,
max
=
0
;
for
(
j
=
0
;
j
<
this
.
panels
.
length
;
j
++
)
{
panel
=
this
.
panels
[
j
];
if
(
panel
.
id
>
max
)
{
max
=
panel
.
id
;
}
}
}
return
max
+
1
;
}
...
...
@@ -170,9 +167,9 @@ export class DashboardModel {
return
null
;
}
addPanel
(
panel
,
row
)
{
addPanel
(
panel
)
{
panel
.
id
=
this
.
getNextPanelId
();
row
.
addPanel
(
panel
);
this
.
panels
.
push
(
panel
);
}
removePanel
(
panel
,
ask
?)
{
...
...
public/app/features/dashboard/row/add_panel.html
View file @
d87653b0
...
...
@@ -17,8 +17,6 @@
ng-repeat=
"panel in ctrl.panelHits"
ng-class=
"{active: $index === ctrl.activeIndex}"
ng-click=
"ctrl.addPanel(panel)"
ui-draggable=
"true"
drag=
"panel.id"
title=
"{{panel.name}}"
>
<img
class=
"add-panel-item-img"
ng-src=
"{{panel.info.logos.small}}"
></img>
<div
class=
"add-panel-item-name"
>
{{panel.name}}
</div>
...
...
public/app/features/dashboard/row/add_panel.ts
View file @
d87653b0
...
...
@@ -32,7 +32,7 @@ export class AddPanelCtrl {
keyDown
(
evt
)
{
if
(
evt
.
keyCode
===
27
)
{
//this.rowCtrl.dropView = 0
;
this
.
dismiss
()
;
return
;
}
...
...
@@ -79,6 +79,24 @@ export class AddPanelCtrl {
}
addPanel
(
panelPluginInfo
)
{
let
defaultHeight
=
6
;
let
defaultWidth
=
6
;
if
(
panelPluginInfo
.
id
===
"singlestat"
)
{
defaultWidth
=
3
;
defaultHeight
=
3
;
}
this
.
dashboard
.
addPanel
({
type
:
panelPluginInfo
.
id
,
x
:
0
,
y
:
0
,
width
:
defaultWidth
,
height
:
defaultHeight
,
title
:
'New panel'
,
});
this
.
dismiss
();
}
}
...
...
public/app/features/panel/panel_ctrl.ts
View file @
d87653b0
...
...
@@ -18,7 +18,6 @@ import {Emitter} from 'app/core/core';
export
class
PanelCtrl
{
panel
:
any
;
error
:
any
;
row
:
any
;
dashboard
:
any
;
editorTabIndex
:
number
;
pluginName
:
string
;
...
...
@@ -201,21 +200,12 @@ export class PanelCtrl {
}
duplicate
()
{
this
.
dashboard
.
duplicatePanel
(
this
.
panel
,
this
.
row
);
this
.
dashboard
.
duplicatePanel
(
this
.
panel
);
this
.
$timeout
(()
=>
{
this
.
$scope
.
$root
.
$broadcast
(
'render'
);
});
}
updateColumnSpan
(
span
)
{
this
.
panel
.
span
=
Math
.
min
(
Math
.
max
(
Math
.
floor
(
this
.
panel
.
span
+
span
),
1
),
12
);
this
.
row
.
panelSpanChanged
();
this
.
$timeout
(()
=>
{
this
.
render
();
});
}
removePanel
()
{
this
.
dashboard
.
removePanel
(
this
.
panel
);
}
...
...
public/app/partials/panelgeneral.html
View file @
d87653b0
...
...
@@ -12,32 +12,19 @@
</div>
<div
class=
"section gf-form-group"
>
<h5
class=
"section-heading"
>
Dimensions
</h5>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-7"
>
Span
</span>
<select
class=
"gf-form-input width-6"
ng-model=
"ctrl.panel.span"
ng-options=
"f for f in [0,1,2,3,4,5,6,7,8,9,10,11,12]"
></select>
</div>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-7"
>
Height
</span>
<input
type=
"text"
class=
"gf-form-input width-6"
ng-model=
'ctrl.panel.height'
placeholder=
"100px"
></input>
</div>
<gf-form-switch
class=
"gf-form"
label-class=
"width-7"
switch-class=
"max-width-6"
label=
"Transparent"
checked=
"ctrl.panel.transparent"
on-change=
"ctrl.render()"
></gf-form-switch>
</div>
<div
class=
"section gf-form-group"
>
<h5
class=
"section-heading"
>
Templating
</h5>
<h5
class=
"section-heading"
>
Options
</h5>
<gf-form-switch
class=
"gf-form"
label-class=
"width-8"
switch-class=
"max-width-6"
label=
"Transparent"
checked=
"ctrl.panel.transparent"
on-change=
"ctrl.render()"
></gf-form-switch>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-8"
>
Repeat Panel
</span>
<dash-repeat-option
model=
"ctrl.panel"
></dash-repeat-option>
</div>
<div
class=
"gf-form"
>
<span
class=
"gf-form-label width-8"
>
Min
span
</span>
<span
class=
"gf-form-label width-8"
>
Min
width
</span>
<select
class=
"gf-form-input"
ng-model=
"ctrl.panel.minSpan"
ng-options=
"f for f in [1,2,3,4,5,6,7,8,9,10,11,12]"
>
<option
value=
""
></option>
</select>
</div>
</div>
</div>
<panel-links-editor
panel=
"ctrl.panel"
></panel-links-editor>
...
...
public/sass/components/_navbar.scss
View file @
d87653b0
...
...
@@ -3,7 +3,7 @@
display
:
block
;
overflow
:
visible
;
position
:
relative
;
margin
-left
:
$side-menu-width
;
padding
-left
:
$side-menu-width
;
box-shadow
:
0
0
20px
black
;
z-index
:
1
;
}
...
...
@@ -17,7 +17,7 @@
.sidemenu-open
{
.navbar
{
margin
-left
:
0
;
padding
-left
:
0
;
}
}
...
...
public/sass/components/_sidemenu.scss
View file @
d87653b0
...
...
@@ -6,7 +6,6 @@
width
:
$side-menu-width
;
background
:
$navbarBackground
;
z-index
:
10
;
box-shadow
:
0
0
20px
black
;
a
:focus
{
text-decoration
:
none
;
...
...
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