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
49abb205
Commit
49abb205
authored
Aug 01, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'v3.1.x'
Conflicts: public/sass/_variables.light.scss
parents
c997923b
a4d27083
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
194 deletions
+10
-194
public/app/core/profiler.ts
+2
-1
public/app/features/dashboard/dynamicDashboardSrv.js
+0
-182
public/app/features/dashboard/dynamic_dashboard_srv.ts
+2
-6
public/sass/_variables.light.scss
+2
-2
public/sass/components/_switch.scss
+1
-1
public/test/specs/dynamicDashboardSrv-specs.js
+2
-1
public/views/index.html
+1
-1
No files found.
public/app/core/profiler.ts
View file @
49abb205
...
...
@@ -101,7 +101,8 @@ export class Profiler {
renderingCompleted
(
panelId
,
panelTimings
)
{
// add render counter to root scope
// used by phantomjs render.js to know when panel has rendered
this
.
$rootScope
.
panelsRendered
=
this
.
panelsRendered
+
1
;
this
.
panelsRendered
=
(
this
.
panelsRendered
||
0
)
+
1
;
this
.
$rootScope
.
panelsRendered
=
this
.
panelsRendered
;
if
(
this
.
enabled
)
{
panelTimings
.
renderEnd
=
new
Date
().
getTime
();
...
...
public/app/features/dashboard/dynamicDashboardSrv.js
deleted
100644 → 0
View file @
c997923b
define
([
'angular'
,
'lodash'
,
],
function
(
angular
,
_
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.services'
);
module
.
service
(
'dynamicDashboardSrv'
,
function
()
{
var
self
=
this
;
this
.
init
=
function
(
dashboard
)
{
if
(
dashboard
.
snapshot
)
{
return
;
}
this
.
iteration
=
new
Date
().
getTime
();
this
.
process
(
dashboard
);
};
this
.
update
=
function
(
dashboard
)
{
if
(
dashboard
.
snapshot
)
{
return
;
}
this
.
iteration
=
this
.
iteration
+
1
;
this
.
process
(
dashboard
);
};
this
.
process
=
function
(
dashboard
)
{
if
(
dashboard
.
templating
.
list
.
length
===
0
)
{
return
;
}
this
.
dashboard
=
dashboard
;
var
i
,
j
,
row
,
panel
;
for
(
i
=
0
;
i
<
this
.
dashboard
.
rows
.
length
;
i
++
)
{
row
=
this
.
dashboard
.
rows
[
i
];
// handle row repeats
if
(
row
.
repeat
)
{
this
.
repeatRow
(
row
,
i
);
}
// clean up old left overs
else
if
(
row
.
repeatRowId
&&
row
.
repeatIteration
!==
this
.
iteration
)
{
this
.
dashboard
.
rows
.
splice
(
i
,
1
);
i
=
i
-
1
;
continue
;
}
// repeat panels
for
(
j
=
0
;
j
<
row
.
panels
.
length
;
j
++
)
{
panel
=
row
.
panels
[
j
];
if
(
panel
.
repeat
)
{
this
.
repeatPanel
(
panel
,
row
);
}
// clean up old left overs
else
if
(
panel
.
repeatPanelId
&&
panel
.
repeatIteration
!==
this
.
iteration
)
{
row
.
panels
=
_
.
without
(
row
.
panels
,
panel
);
j
=
j
-
1
;
}
else
if
(
row
.
repeat
||
row
.
repeatRowId
)
{
continue
;
}
else
if
(
!
_
.
isEmpty
(
panel
.
scopedVars
)
&&
panel
.
repeatIteration
!==
this
.
iteration
)
{
panel
.
scopedVars
=
{};
}
}
}
};
// returns a new row clone or reuses a clone from previous iteration
this
.
getRowClone
=
function
(
sourceRow
,
repeatIndex
,
sourceRowIndex
)
{
if
(
repeatIndex
===
0
)
{
return
sourceRow
;
}
var
i
,
panel
,
row
,
copy
;
var
sourceRowId
=
sourceRowIndex
+
1
;
// look for row to reuse
for
(
i
=
0
;
i
<
this
.
dashboard
.
rows
.
length
;
i
++
)
{
row
=
this
.
dashboard
.
rows
[
i
];
if
(
row
.
repeatRowId
===
sourceRowId
&&
row
.
repeatIteration
!==
this
.
iteration
)
{
copy
=
row
;
break
;
}
}
if
(
!
copy
)
{
copy
=
angular
.
copy
(
sourceRow
);
this
.
dashboard
.
rows
.
splice
(
sourceRowIndex
+
repeatIndex
,
0
,
copy
);
// set new panel ids
for
(
i
=
0
;
i
<
copy
.
panels
.
length
;
i
++
)
{
panel
=
copy
.
panels
[
i
];
panel
.
id
=
this
.
dashboard
.
getNextPanelId
();
}
}
copy
.
repeat
=
null
;
copy
.
repeatRowId
=
sourceRowId
;
copy
.
repeatIteration
=
this
.
iteration
;
return
copy
;
};
// returns a new row clone or reuses a clone from previous iteration
this
.
repeatRow
=
function
(
row
,
rowIndex
)
{
var
variables
=
this
.
dashboard
.
templating
.
list
;
var
variable
=
_
.
findWhere
(
variables
,
{
name
:
row
.
repeat
});
if
(
!
variable
)
{
return
;
}
var
selected
,
copy
,
i
,
panel
;
if
(
variable
.
current
.
text
===
'All'
)
{
selected
=
variable
.
options
.
slice
(
1
,
variable
.
options
.
length
);
}
else
{
selected
=
_
.
filter
(
variable
.
options
,
{
selected
:
true
});
}
_
.
each
(
selected
,
function
(
option
,
index
)
{
copy
=
self
.
getRowClone
(
row
,
index
,
rowIndex
);
copy
.
scopedVars
=
{};
copy
.
scopedVars
[
variable
.
name
]
=
option
;
for
(
i
=
0
;
i
<
copy
.
panels
.
length
;
i
++
)
{
panel
=
copy
.
panels
[
i
];
panel
.
scopedVars
=
{};
panel
.
scopedVars
[
variable
.
name
]
=
option
;
}
},
this
);
};
this
.
getPanelClone
=
function
(
sourcePanel
,
row
,
index
)
{
// if first clone return source
if
(
index
===
0
)
{
return
sourcePanel
;
}
var
i
,
tmpId
,
panel
,
clone
;
// first try finding an existing clone to use
for
(
i
=
0
;
i
<
row
.
panels
.
length
;
i
++
)
{
panel
=
row
.
panels
[
i
];
if
(
panel
.
repeatIteration
!==
this
.
iteration
&&
panel
.
repeatPanelId
===
sourcePanel
.
id
)
{
clone
=
panel
;
break
;
}
}
if
(
!
clone
)
{
clone
=
{
id
:
this
.
dashboard
.
getNextPanelId
()
};
row
.
panels
.
push
(
clone
);
}
// save id
tmpId
=
clone
.
id
;
// copy properties from source
angular
.
copy
(
sourcePanel
,
clone
);
// restore id
clone
.
id
=
tmpId
;
clone
.
repeatIteration
=
this
.
iteration
;
clone
.
repeatPanelId
=
sourcePanel
.
id
;
clone
.
repeat
=
null
;
return
clone
;
};
this
.
repeatPanel
=
function
(
panel
,
row
)
{
var
variables
=
this
.
dashboard
.
templating
.
list
;
var
variable
=
_
.
findWhere
(
variables
,
{
name
:
panel
.
repeat
});
if
(
!
variable
)
{
return
;
}
var
selected
;
if
(
variable
.
current
.
text
===
'All'
)
{
selected
=
variable
.
options
.
slice
(
1
,
variable
.
options
.
length
);
}
else
{
selected
=
_
.
filter
(
variable
.
options
,
{
selected
:
true
});
}
_
.
each
(
selected
,
function
(
option
,
index
)
{
var
copy
=
self
.
getPanelClone
(
panel
,
row
,
index
);
copy
.
span
=
Math
.
max
(
12
/
selected
.
length
,
panel
.
minSpan
);
copy
.
scopedVars
=
copy
.
scopedVars
||
{};
copy
.
scopedVars
[
variable
.
name
]
=
option
;
});
};
});
});
public/app/features/dashboard/dynamic_dashboard_srv.ts
View file @
49abb205
...
...
@@ -10,10 +10,6 @@ export class DynamicDashboardSrv {
iteration
:
number
;
dashboard
:
any
;
constructor
()
{
this
.
iteration
=
new
Date
().
getTime
();
}
init
(
dashboard
)
{
if
(
dashboard
.
snapshot
)
{
return
;
}
this
.
process
(
dashboard
,
{});
...
...
@@ -21,14 +17,14 @@ export class DynamicDashboardSrv {
update
(
dashboard
)
{
if
(
dashboard
.
snapshot
)
{
return
;
}
this
.
iteration
=
this
.
iteration
+
1
;
this
.
process
(
dashboard
,
{});
}
process
(
dashboard
,
options
)
{
if
(
dashboard
.
templating
.
list
.
length
===
0
)
{
return
;
}
this
.
dashboard
=
dashboard
;
this
.
iteration
=
(
this
.
iteration
||
new
Date
().
getTime
())
+
1
;
var
cleanUpOnly
=
options
.
cleanUpOnly
;
...
...
public/sass/_variables.light.scss
View file @
49abb205
...
...
@@ -60,8 +60,8 @@ $page-bg: $white;
$body-color
:
$gray-1
;
$text-color
:
$gray-1
;
$text-color-strong
:
$white
;
$text-color-weak
:
$gray-
2
;
$text-color-faint
:
$gray-
3
;
$text-color-weak
:
$gray-
3
;
$text-color-faint
:
$gray-
4
;
$text-color-emphasis
:
$dark-5
;
$text-shadow-strong
:
none
;
...
...
public/sass/components/_switch.scss
View file @
49abb205
...
...
@@ -64,7 +64,7 @@ $switch-height: 1.5rem;
input
+
label
:
:
before
{
font-family
:
'FontAwesome'
;
content
:
"\f096"
;
// square-o
color
:
$text-color-
faint
;
color
:
$text-color-
weak
;
transition
:
transform
0
.4s
;
backface-visibility
:
hidden
;
text-shadow
:
$text-shadow-faint
;
...
...
public/test/specs/dynamicDashboardSrv-specs.js
View file @
49abb205
define
([
'app/features/dashboard/dynamic
DashboardS
rv'
,
'app/features/dashboard/dynamic
_dashboard_s
rv'
,
'app/features/dashboard/dashboardSrv'
],
function
()
{
'use strict'
;
...
...
@@ -12,6 +12,7 @@ define([
ctx
.
setup
=
function
(
setupFunc
)
{
beforeEach
(
module
(
'grafana.services'
));
beforeEach
(
module
(
'grafana.core'
));
beforeEach
(
module
(
function
(
$provide
)
{
$provide
.
value
(
'contextSrv'
,
{
user
:
{
timezone
:
'utc'
}
...
...
public/views/index.html
View file @
49abb205
...
...
@@ -55,7 +55,7 @@
</a>
</li>
<li>
<a
href=
"http
s
://grafana.org/community"
target=
"_blank"
>
<a
href=
"http://grafana.org/community"
target=
"_blank"
>
<i
class=
"fa fa-comments-o"
></i>
Community
</a>
...
...
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