Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
fa1d0e59
Commit
fa1d0e59
authored
Jun 29, 2015
by
Alex Robinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10422 from bcbroussard/gauge-colors
Update Web UI Bar Gauge Graphs
parents
28ff37f7
2f43fc72
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
83 deletions
+84
-83
datafile.go
pkg/ui/datafile.go
+0
-0
app.css
www/app/assets/css/app.css
+0
-0
app.js
www/app/assets/js/app.js
+7
-8
cAdvisorController.js
...ts/dashboard/js/modules/controllers/cAdvisorController.js
+1
-1
d3MinionBarGauge.js
...nents/dashboard/js/modules/directives/d3MinionBarGauge.js
+5
-6
colors.less
www/master/components/dashboard/less/dashboard/colors.less
+55
-53
servers.less
www/master/components/dashboard/less/dashboard/servers.less
+15
-14
cAdvisor.js
www/master/shared/js/modules/services/cAdvisor.js
+1
-1
No files found.
pkg/ui/datafile.go
View file @
fa1d0e59
This diff is collapsed.
Click to expand it.
www/app/assets/css/app.css
View file @
fa1d0e59
This diff is collapsed.
Click to expand it.
www/app/assets/js/app.js
View file @
fa1d0e59
...
@@ -378,7 +378,7 @@ app.controller('TabCtrl', [
...
@@ -378,7 +378,7 @@ app.controller('TabCtrl', [
.
service
(
'cAdvisorService'
,
[
"$http"
,
"$q"
,
"ENV"
,
function
(
$http
,
$q
,
ENV
)
{
.
service
(
'cAdvisorService'
,
[
"$http"
,
"$q"
,
"ENV"
,
function
(
$http
,
$q
,
ENV
)
{
var
_baseUrl
=
function
(
minionIp
)
{
var
_baseUrl
=
function
(
minionIp
)
{
var
minionPort
=
ENV
[
'/'
][
'cAdvisorPort'
]
||
"8081"
;
var
minionPort
=
ENV
[
'/'
][
'cAdvisorPort'
]
||
"8081"
;
var
proxy
=
ENV
[
'/'
][
'cAdvisorProxy'
]
||
"/api/v1
beta3
/proxy/nodes/"
;
var
proxy
=
ENV
[
'/'
][
'cAdvisorProxy'
]
||
"/api/v1/proxy/nodes/"
;
return
proxy
+
minionIp
+
':'
+
minionPort
+
'/api/v1.0/'
;
return
proxy
+
minionIp
+
':'
+
minionPort
+
'/api/v1.0/'
;
};
};
...
@@ -961,7 +961,7 @@ app.controller('cAdvisorController', [
...
@@ -961,7 +961,7 @@ app.controller('cAdvisorController', [
var
f
=
fsDataArray
[
i
];
var
f
=
fsDataArray
[
i
];
items
.
push
({
items
.
push
({
label
:
'F
S
#'
+
f
.
filesystemNumber
,
label
:
'F
ilesystem
#'
+
f
.
filesystemNumber
,
stats
:
f
.
usageDescription
+
' / '
+
f
.
capacityDescription
,
stats
:
f
.
usageDescription
+
' / '
+
f
.
capacityDescription
,
value
:
f
.
totalUsage
,
value
:
f
.
totalUsage
,
classNames
:
getColorForIndex
(
2
+
i
,
f
.
totalUsage
),
classNames
:
getColorForIndex
(
2
+
i
,
f
.
totalUsage
),
...
@@ -1967,7 +1967,7 @@ app.controller('ServiceCtrl', [
...
@@ -1967,7 +1967,7 @@ app.controller('ServiceCtrl', [
var
label_legend_area
=
legendSvg
.
append
(
"svg:g"
)
var
label_legend_area
=
legendSvg
.
append
(
"svg:g"
)
.
attr
(
"class"
,
"label_legend_area"
)
.
attr
(
"class"
,
"label_legend_area"
)
.
attr
(
"transform"
,
"translate("
+
((
w
-
18
5
)
/
2
)
+
","
+
35
+
")"
);
.
attr
(
"transform"
,
"translate("
+
((
w
-
21
5
)
/
2
)
+
","
+
35
+
")"
);
var
legend_group
=
label_legend_area
.
append
(
"svg:g"
).
attr
(
"class"
,
"legend_group"
);
var
legend_group
=
label_legend_area
.
append
(
"svg:g"
).
attr
(
"class"
,
"legend_group"
);
...
@@ -1977,7 +1977,7 @@ app.controller('ServiceCtrl', [
...
@@ -1977,7 +1977,7 @@ app.controller('ServiceCtrl', [
var
stats_group
=
label_legend_area
.
append
(
"svg:g"
)
var
stats_group
=
label_legend_area
.
append
(
"svg:g"
)
.
attr
(
"class"
,
"stats_group"
)
.
attr
(
"class"
,
"stats_group"
)
.
attr
(
"transform"
,
"translate("
+
8
5
+
","
+
11
+
")"
);
.
attr
(
"transform"
,
"translate("
+
11
5
+
","
+
11
+
")"
);
var
path_group
=
chart
.
append
(
"svg:g"
)
var
path_group
=
chart
.
append
(
"svg:g"
)
.
attr
(
"class"
,
"path_group"
)
.
attr
(
"class"
,
"path_group"
)
...
@@ -2134,9 +2134,7 @@ app.controller('ServiceCtrl', [
...
@@ -2134,9 +2134,7 @@ app.controller('ServiceCtrl', [
valueLabels
.
enter
()
valueLabels
.
enter
()
.
append
(
"svg:text"
)
.
append
(
"svg:text"
)
.
attr
(
"class"
,
"value"
)
.
attr
(
"class"
,
"value"
)
.
attr
(
.
attr
(
"dx"
,
function
(
d
,
i
)
{
return
68
;
})
"transform"
,
function
(
d
)
{
return
"translate("
+
(
getRadiusRing
(
ir
,
counts
-
1
))
+
", 0)"
;
})
.
attr
(
"dx"
,
function
(
d
,
i
)
{
return
0
;
})
.
attr
(
"dy"
,
function
(
d
,
i
)
{
return
(
thickness
+
3
)
*
i
;
})
.
attr
(
"dy"
,
function
(
d
,
i
)
{
return
(
thickness
+
3
)
*
i
;
})
.
attr
(
"text-anchor"
,
function
(
d
)
{
return
"start"
;
})
.
attr
(
"text-anchor"
,
function
(
d
)
{
return
"start"
;
})
.
text
(
function
(
d
)
{
return
d
.
value
;
});
.
text
(
function
(
d
)
{
return
d
.
value
;
});
...
@@ -2219,7 +2217,8 @@ app.controller('ServiceCtrl', [
...
@@ -2219,7 +2217,8 @@ app.controller('ServiceCtrl', [
return
;
return
;
}
}
svg
.
selectAll
(
"*"
).
remove
();
d3
.
select
(
element
[
0
]).
select
(
"svg.chart"
).
remove
();
d3
.
select
(
element
[
0
]).
select
(
"svg.legend"
).
remove
();
var
graph
=
$
(
element
[
0
]);
var
graph
=
$
(
element
[
0
]);
var
w
=
scope
.
graphWidth
;
var
w
=
scope
.
graphWidth
;
...
...
www/master/components/dashboard/js/modules/controllers/cAdvisorController.js
View file @
fa1d0e59
...
@@ -151,7 +151,7 @@ app.controller('cAdvisorController', [
...
@@ -151,7 +151,7 @@ app.controller('cAdvisorController', [
var
f
=
fsDataArray
[
i
];
var
f
=
fsDataArray
[
i
];
items
.
push
({
items
.
push
({
label
:
'F
S
#'
+
f
.
filesystemNumber
,
label
:
'F
ilesystem
#'
+
f
.
filesystemNumber
,
stats
:
f
.
usageDescription
+
' / '
+
f
.
capacityDescription
,
stats
:
f
.
usageDescription
+
' / '
+
f
.
capacityDescription
,
value
:
f
.
totalUsage
,
value
:
f
.
totalUsage
,
classNames
:
getColorForIndex
(
2
+
i
,
f
.
totalUsage
),
classNames
:
getColorForIndex
(
2
+
i
,
f
.
totalUsage
),
...
...
www/master/components/dashboard/js/modules/directives/d3MinionBarGauge.js
View file @
fa1d0e59
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
var
label_legend_area
=
legendSvg
.
append
(
"svg:g"
)
var
label_legend_area
=
legendSvg
.
append
(
"svg:g"
)
.
attr
(
"class"
,
"label_legend_area"
)
.
attr
(
"class"
,
"label_legend_area"
)
.
attr
(
"transform"
,
"translate("
+
((
w
-
18
5
)
/
2
)
+
","
+
35
+
")"
);
.
attr
(
"transform"
,
"translate("
+
((
w
-
21
5
)
/
2
)
+
","
+
35
+
")"
);
var
legend_group
=
label_legend_area
.
append
(
"svg:g"
).
attr
(
"class"
,
"legend_group"
);
var
legend_group
=
label_legend_area
.
append
(
"svg:g"
).
attr
(
"class"
,
"legend_group"
);
...
@@ -81,7 +81,7 @@
...
@@ -81,7 +81,7 @@
var
stats_group
=
label_legend_area
.
append
(
"svg:g"
)
var
stats_group
=
label_legend_area
.
append
(
"svg:g"
)
.
attr
(
"class"
,
"stats_group"
)
.
attr
(
"class"
,
"stats_group"
)
.
attr
(
"transform"
,
"translate("
+
8
5
+
","
+
11
+
")"
);
.
attr
(
"transform"
,
"translate("
+
11
5
+
","
+
11
+
")"
);
var
path_group
=
chart
.
append
(
"svg:g"
)
var
path_group
=
chart
.
append
(
"svg:g"
)
.
attr
(
"class"
,
"path_group"
)
.
attr
(
"class"
,
"path_group"
)
...
@@ -238,9 +238,7 @@
...
@@ -238,9 +238,7 @@
valueLabels
.
enter
()
valueLabels
.
enter
()
.
append
(
"svg:text"
)
.
append
(
"svg:text"
)
.
attr
(
"class"
,
"value"
)
.
attr
(
"class"
,
"value"
)
.
attr
(
.
attr
(
"dx"
,
function
(
d
,
i
)
{
return
68
;
})
"transform"
,
function
(
d
)
{
return
"translate("
+
(
getRadiusRing
(
ir
,
counts
-
1
))
+
", 0)"
;
})
.
attr
(
"dx"
,
function
(
d
,
i
)
{
return
0
;
})
.
attr
(
"dy"
,
function
(
d
,
i
)
{
return
(
thickness
+
3
)
*
i
;
})
.
attr
(
"dy"
,
function
(
d
,
i
)
{
return
(
thickness
+
3
)
*
i
;
})
.
attr
(
"text-anchor"
,
function
(
d
)
{
return
"start"
;
})
.
attr
(
"text-anchor"
,
function
(
d
)
{
return
"start"
;
})
.
text
(
function
(
d
)
{
return
d
.
value
;
});
.
text
(
function
(
d
)
{
return
d
.
value
;
});
...
@@ -323,7 +321,8 @@
...
@@ -323,7 +321,8 @@
return
;
return
;
}
}
svg
.
selectAll
(
"*"
).
remove
();
d3
.
select
(
element
[
0
]).
select
(
"svg.chart"
).
remove
();
d3
.
select
(
element
[
0
]).
select
(
"svg.legend"
).
remove
();
var
graph
=
$
(
element
[
0
]);
var
graph
=
$
(
element
[
0
]);
var
w
=
scope
.
graphWidth
;
var
w
=
scope
.
graphWidth
;
...
...
www/master/components/dashboard/less/dashboard/colors.less
View file @
fa1d0e59
@color-codes:
@color-codes:
#2962FF, //blue-deep
"#2962FF",
#AA00FF, //purple-deep
"#AA00FF",
#00C853, //green-deep
"#00C853",
#304FFE, //indigo-deep
"#304FFE",
#0091EA, //light-blue-deep
"#0091EA",
#FF6D00, //orange-deep
"#FF6D00",
#00BFA5, //teal-deep
"#00BFA5",
#C51162, //pink-deep
"#C51162",
#64DD17, //light-green-deep
"#64DD17",
#6200EA, //deep-purple-deep
"#6200EA",
#FFD600, //yellow-deep
"#FFD600",
#00B8D4, //cyan-deep
"#00B8D4",
#FFAB00, //amber-deep
"#FFAB00",
#DD2C00, //deep-orange-deep
"#DD2C00",
#2979FF, //blue-med
"#2979FF",
#D500F9, //purple-med
"#D500F9",
#00E676, //green-med
"#00E676",
#3D5AFE, //indigo-med
"#3D5AFE",
#00B0FF, //light-blue-med
"#00B0FF",
#FF9100, //orange-med
"#FF9100",
#1DE9B6, //teal-med
"#1DE9B6",
#F50057, //pink-med
"#F50057",
#76FF03, //light-green-med
"#76FF03",
#651FFF, //deep-purple-med
"#651FFF",
#FFEA00, //yellow-med
"#FFEA00",
#00E5FF, //cyan-med
"#00E5FF",
#FFC400, //amber-med
"#FFC400",
#FF3D00, //deep-orange-med
"#FF3D00",
#448AFF, //blue-light
"#448AFF",
#E040FB, //purple-light
"#E040FB",
#69F0AE, //green-light
"#69F0AE",
#536DFE, //indigo-light
"#536DFE",
#40C4FF, //light-blue-light
"#40C4FF",
#FFAB40, //orange-light
"#FFAB40",
#64FFDA, //teal-light
"#64FFDA",
#FF4081, //pink-light
"#FF4081",
#B2FF59, //light-green-light
"#B2FF59",
#7C4DFF, //deep-purple-light
"#7C4DFF",
#FFFF00, //yellow-light
"#FFFF00",
#18FFFF, //cyan-light
"#18FFFF",
#FFD740, //amber-light
"#FFD740",
#FF6E40; //deep-orange-light
"#FF6E40";
.dark-overlay {
.dark-overlay {
background-color: #292935;
background-color: #292935;
...
@@ -70,22 +69,25 @@
...
@@ -70,22 +69,25 @@
@index: @i; //mod(@i - 1, 3) * 7 + round((@i - 1) / 3 - .3);
@index: @i; //mod(@i - 1, 3) * 7 + round((@i - 1) / 3 - .3);
}
}
.creatcolorclasses(@i:1) when(@i <= length(@color-codes)) {
.creatcolorclasses(@i:1) when(@i <= length(@color-codes)) {
@colorCodeString: extract(@color-codes, @i);
@colorCode: color(@colorCodeString);
.getColorIndex(@i);
.getColorIndex(@i);
.color-@{index} {
.color-@{index} {
background-color: extract(@color-codes, @i);
background-color: @colorCode;
// border-color: lighten(extract(@color-codes, @i), 20%);
fill: @colorCode;
// border-width: 2px;
stroke: @colorCode;
// border-style: solid;
}
fill: extract(@color-codes, @i);
stroke: extract(@color-codes, @i);
.color-max-@{index} {
background-color: lighten(@colorCode, 35%);
border-color: lighten(@colorCode, 35%);
fill: lighten(@colorCode, 35%);
}
}
md-grid-list.list-color-@{i} md-grid-tile.colored {
md-grid-list.list-color-@{i} md-grid-tile.colored {
background-color: extract(@color-codes, @i);
background-color: @colorCode;
// border-color: darken(extract(@color-codes, @i), 10%);
// border-width: 1px;
// border-style: solid;
}
}
.creatcolorclasses((@i + 1));
.creatcolorclasses((@i + 1));
}
}
...
...
www/master/components/dashboard/less/dashboard/servers.less
View file @
fa1d0e59
...
@@ -23,24 +23,24 @@
...
@@ -23,24 +23,24 @@
}
}
.color-max-1 {
.color-max-1 {
background-color: lighten(#512DA8,
40
%);
background-color: lighten(#512DA8,
35
%);
border-color: lighten(#512DA8,
40
%);
border-color: lighten(#512DA8,
35
%);
fill: lighten(#512DA8,
40
%);
fill: lighten(#512DA8,
35
%);
// stroke: lighten(#512DA8,
40
%);
// stroke: lighten(#512DA8,
35
%);
}
}
.color-max-2 {
.color-max-2 {
background-color: lighten(#9C27B0,
40
%);
background-color: lighten(#9C27B0,
35
%);
border-color: lighten(#9C27B0,
40
%);
border-color: lighten(#9C27B0,
35
%);
fill: lighten(#9C27B0,
40
%);
fill: lighten(#9C27B0,
35
%);
// stroke: lighten(#9C27B0,
40
%);
// stroke: lighten(#9C27B0,
35
%);
}
}
.color-max-3 {
.color-max-3 {
background-color: lighten(#00BCD4,
40
%);
background-color: lighten(#00BCD4,
35
%);
border-color: lighten(#00BCD4,
40
%);
border-color: lighten(#00BCD4,
35
%);
fill: lighten(#00BCD4,
40
%);
fill: lighten(#00BCD4,
35
%);
// stroke: lighten(#00BCD4,
40
%);
// stroke: lighten(#00BCD4,
35
%);
}
}
.color-max-warning {
.color-max-warning {
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
}
}
svg.legend {
svg.legend {
height:
115px
;
height:
auto
;
text {
text {
font-size:12px;
font-size:12px;
...
@@ -120,6 +120,7 @@
...
@@ -120,6 +120,7 @@
}
}
.chart_area {
.chart_area {
width: 325px;
width: 325px;
height: 425px;
// height: 425px;
height: auto;
}
}
}
}
www/master/shared/js/modules/services/cAdvisor.js
View file @
fa1d0e59
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
.
service
(
'cAdvisorService'
,
function
(
$http
,
$q
,
ENV
)
{
.
service
(
'cAdvisorService'
,
function
(
$http
,
$q
,
ENV
)
{
var
_baseUrl
=
function
(
minionIp
)
{
var
_baseUrl
=
function
(
minionIp
)
{
var
minionPort
=
ENV
[
'/'
][
'cAdvisorPort'
]
||
"8081"
;
var
minionPort
=
ENV
[
'/'
][
'cAdvisorPort'
]
||
"8081"
;
var
proxy
=
ENV
[
'/'
][
'cAdvisorProxy'
]
||
"/api/v1
beta3
/proxy/nodes/"
;
var
proxy
=
ENV
[
'/'
][
'cAdvisorProxy'
]
||
"/api/v1/proxy/nodes/"
;
return
proxy
+
minionIp
+
':'
+
minionPort
+
'/api/v1.0/'
;
return
proxy
+
minionIp
+
':'
+
minionPort
+
'/api/v1.0/'
;
};
};
...
...
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