Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reference-repository
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
grid5000
reference-repository
Commits
e641aa6f
Commit
e641aa6f
authored
5 years ago
by
Lucas Nussbaum
Browse files
Options
Downloads
Patches
Plain Diff
[dev] add table for storage firmwares
parent
80911877
No related branches found
No related tags found
No related merge requests found
Pipeline
#121117
passed
5 years ago
Stage: validate
Stage: generate
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/refrepo/firmwares.rb
+85
-1
85 additions, 1 deletion
lib/refrepo/firmwares.rb
with
85 additions
and
1 deletion
lib/refrepo/firmwares.rb
+
85
−
1
View file @
e641aa6f
...
...
@@ -89,6 +89,31 @@ def gen_firmwares_tables
e
[
0
].
merge
(
{
'nodes'
=>
nodes
,
'nodes_count'
=>
e
[
1
].
length
}
)
end
# Storage table
stos
=
[]
data
[
'sites'
].
keys
.
each
do
|
site
|
data
[
'sites'
][
site
][
'clusters'
].
keys
.
each
do
|
cluster
|
data
[
'sites'
][
site
][
'clusters'
][
cluster
][
'nodes'
].
keys
.
each
do
|
node
|
stos
+=
data
[
'sites'
][
site
][
'clusters'
][
cluster
][
'nodes'
][
node
][
'storage_devices'
].
map
do
|
st
|
{
'address'
=>
"
#{
node
}
-
#{
st
[
'device'
]
}
"
,
'vendor'
=>
st
[
'vendor'
],
'model'
=>
st
[
'model'
],
'driver'
=>
st
[
'driver'
],
'firmware_version'
=>
st
[
'firmware_version'
]
}
end
end
end
end
stosets
=
stos
.
group_by
{
|
e
|
e
.
except
(
'address'
)
}.
map
do
|
e
|
e
[
1
]
=
e
[
1
].
map
{
|
f
|
f
[
'address'
]
}
nodes
=
`echo
#{
e
[
1
].
join
(
','
)
}
| nodeset -f`
.
chomp
e
[
0
].
merge
(
{
'nodes'
=>
nodes
,
'nodes_count'
=>
e
[
1
].
length
}
)
end
puts
<<-
EOF
<!DOCTYPE html>
<html>
...
...
@@ -96,7 +121,7 @@ def gen_firmwares_tables
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
Bugzilla summary
</title>
<title>
Firmwares
</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
...
...
@@ -238,6 +263,65 @@ def gen_firmwares_tables
} );
</script>
<h3>Storage</h3>
<div class="table-responsive"><div class='container-fluid'>
<table id="table2" class="table table-bordered table-hover table-condensed text-center table-reducedrowheight">
<thead>
<tr>
<th class="text-center">Vendor</th>
<th class="text-center">Model</th>
<th class="text-center">Driver</th>
<th class="text-center">Firmware</th>
<th class="text-center">Nodes</th>
<th class="text-center">Nodes count</th>
</tr>
</thead>
<tfoot style="display: table-header-group;">
<tr>
<td><input type="text" placeholder="" size="2" style="width:100%;" /></td>
<td><input type="text" placeholder="" size="2" style="width:100%;" /></td>
<td><input type="text" placeholder="" size="2" style="width:100%;" /></td>
<td><input type="text" placeholder="" size="2" style="width:100%;" /></td>
<td><input type="text" placeholder="" size="2" style="width:100%;" /></td>
<td><input type="text" placeholder="" size="2" style="width:100%;" /></td>
</tr>
</tfoot>
<tbody>
EOF
stosets
.
each
do
|
r
|
puts
<<-
EOF
<tr>
<td class="text-nowrap">
#{
r
[
'vendor'
]
}
</td>
<td class="text-nowrap">
#{
r
[
'model'
]
}
</td>
<td class="text-nowrap">
#{
r
[
'driver'
]
}
</td>
<td class="text-nowrap">
#{
r
[
'firmware_version'
]
}
</td>
<td>
#{
r
[
'nodes'
]
}
</td>
<td class="text-nowrap">
#{
r
[
'nodes_count'
]
}
</td>
</tr>
EOF
end
puts
<<-
EOF
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript" class="init">
$('#table2').DataTable(
{ "bPaginate": false, }
).columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
</script>
</body>
</html>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment