Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
casper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
faimaison-public
casper
Compare Revisions
d26f2283a30334742c55ecadc474bb6f8a6200b7...0e3b8d285b63bb32cecaf0ec4de1361fd13cdc27
Source
0e3b8d285b63bb32cecaf0ec4de1361fd13cdc27
Select Git revision
...
Target
d26f2283a30334742c55ecadc474bb6f8a6200b7
Select Git revision
Compare
Commits (2)
Typo
· dbf5c5c6
JocelynD
authored
Apr 06, 2019
dbf5c5c6
Affiche les xDSL, mais sur une seule ligne
· 0e3b8d28
JocelynD
authored
Apr 06, 2019
Au lieu de les masquer ; parce-que ça nous arrange bien pour les réunions.
0e3b8d28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
+31
-4
script.js
script.js
+31
-4
No files found.
script.js
View file @
0e3b8d28
let
MONTHS
=
{
let
MONTHS
=
{
1
:
'
Janvier
'
,
1
:
'
Janvier
'
,
2
:
'
Fé
t
vrier
'
,
2
:
'
Février
'
,
3
:
'
Mars
'
,
3
:
'
Mars
'
,
4
:
'
Avril
'
,
4
:
'
Avril
'
,
5
:
'
Mai
'
,
5
:
'
Mai
'
,
...
@@ -102,9 +102,7 @@ function fetchSubscriptions(month) {
...
@@ -102,9 +102,7 @@ function fetchSubscriptions(month) {
return
fetch
(
url
).
then
(
function
(
response
)
{
return
fetch
(
url
).
then
(
function
(
response
)
{
return
response
.
json
();
return
response
.
json
();
}).
then
(
function
(
data
)
{
}).
then
(
function
(
data
)
{
return
groupByRef
(
data
).
filter
(
function
(
row
)
{
return
groupADSL
(
groupByRef
(
data
));
return
!
row
.
reference
.
startsWith
(
'
ADSL
'
);
});
});
});
}
}
...
@@ -131,6 +129,35 @@ function groupByRef(subscriptionsCount) {
...
@@ -131,6 +129,35 @@ function groupByRef(subscriptionsCount) {
return
grouppedArray
;
return
grouppedArray
;
}
}
/** Regrouppe les Services xDSL en une seule ligne
*
* @param subscriptionsCount tableau tel que renvoyé par l'API coin.
*/
function
groupADSL
(
subscriptionsCount
)
{
var
map
=
{};
for
(
let
row
of
subscriptionsCount
)
{
if
(
row
.
reference
.
startsWith
(
'
ADSL-
'
))
{
let
DSLRef
=
'
ADSL-*
'
;
if
(
!
map
[
DSLRef
])
{
map
[
DSLRef
]
=
{
'
reference
'
:
DSLRef
,
'
name
'
:
'
xDSL (tous types, hors transparence)
'
,
'
subscriptions_count
'
:
0
,
};
}
map
[
DSLRef
].
subscriptions_count
+=
row
.
subscriptions_count
;
}
else
{
map
[
row
.
reference
]
=
row
;
}
}
var
grouppedArray
=
[];
for
(
let
key
in
map
)
{
grouppedArray
.
push
(
map
[
key
]);
}
return
grouppedArray
;
}
/** Construit l'URL de l'image d'un graphe munin mensuel
/** Construit l'URL de l'image d'un graphe munin mensuel
*/
*/
function
graphURL
(
plugin
,
month
)
{
function
graphURL
(
plugin
,
month
)
{
...
...