Skip to content

Commit

Permalink
Improve the way "Updates" tab is loaded
Browse files Browse the repository at this point in the history
The "Updates" tab was requesting information about the host to get
loaded which is not needed.
Also, there were some HTML elements without ID or with wrong reference to an ID
(in those cases the widget needs to know the parent (data-parent) and the content (href and aria-controls))
This patch also removes unused CSS.

All those issues were identified while investigating the cause of the
problem reported on #122.
  • Loading branch information
alinefm authored and danielhb committed Oct 18, 2016
1 parent 1d2027d commit fbfe853
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 62 deletions.
11 changes: 0 additions & 11 deletions ui/css/gingerbase.css
Original file line number Diff line number Diff line change
Expand Up @@ -893,17 +893,6 @@
padding-right: 26px;
}

#software-update-section {
margin: 0 10px 14px 10px;
padding-top: 14px;
}

@media (min-width: 1199px) and (max-width: 1200px) {
#software-update-section {
margin: 0 0 14px 0;
}
}

#repositories-grid .wok-list-content,
#available-reports-grid .wok-list-content {
overflow-x: hidden;
Expand Down
15 changes: 1 addition & 14 deletions ui/css/src/modules/_host.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,6 @@
padding-right: 26px;
}

#software-update-section {
margin: 0 10px 14px 10px;
padding-top: 14px;
}


@media (min-width: $screen-md-max) and (max-width: $screen-lg) {

#software-update-section {
margin: 0 0 14px 0;
}
}

#repositories-grid,
#available-reports-grid {
.wok-list-content {
Expand Down Expand Up @@ -361,4 +348,4 @@
/* End of Software Update Accordion */


/* End of Software Updates */
/* End of Software Updates */
12 changes: 1 addition & 11 deletions ui/js/src/gingerbase.host-update.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,17 +379,7 @@ gingerbase.init_update = function() {
setupUI();
};

gingerbase.getHost(function(data) {
var htmlTmpl = $('#host-update-tmpl').html();
data['logo'] = data['logo'] || '';
data['memory'] = wok.formatMeasurement(data['memory'], {
fixed: 2
});
var templated = wok.substitute(htmlTmpl, data);
$('#host-content-container').html(templated);

initPage();
});
initPage();

$('#host-root-container').on('remove', function() {
if (gingerbase.hostTimer) {
Expand Down
44 changes: 18 additions & 26 deletions ui/pages/tabs/host-update.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,35 +41,35 @@
<div class="host-panel">
<div class="container">
<div id="repositories-section" class="row hidden"></div>
<div class="row">
<div id="" class="panel-group accordion" role="tablist" aria-multiselectable="false">
<div id="software-update-section" class="row">
<div id="software-update-grid-section" class="panel-group accordion" role="tablist" aria-multiselectable="false">
<h3>
<a role="button" data-toggle="collapse" data-parent="#software-update-accordion" href="#software-update-content-area" aria-expanded="false" aria-controls="software-update-content-area" class="">
<a role="button" data-toggle="collapse" data-parent="#software-update-grid-section" href="#content-software-update-grid" aria-expanded="false" aria-controls="content-software-update-grid" class="">
<span class="accordion-icon"></span><span class="accordion-text" id="software-update-header">$_("Software Updates")</span>
</a>
</h3>
<div id="software-update-content-area" class="panel-collapse collapse" role="tabpanel" aria-labelledby="software-update-header">
<div id="content-software-update-grid" class="panel-collapse collapse" role="tabpanel" aria-expanded="false">
<span id='message-container-area' style='display: none;'></span>
<div class="row">
<div id="software-update-buttons" class="row">
<button id="update-packages" class="btn btn-primary" disabled>$_("Update")</button>
<button id="update-all-packages" class="btn btn-primary">$_("Update All")</button>
</div>

<div class="panel-group accordion" id="update-accordion" role="tablist" aria-multiselectable="true" style="display:none;">
<h3>
<a role="button" data-toggle="collapse" data-parent="#updates-accordion" href="#updates-content-area" aria-expanded="false" aria-controls="updates-content-area" class="">
<span class="accordion-icon"></span><span class="accordion-text">$_("Update Status")</span>
</a>
</h3>
<div id="updates-content-area" class="panel-collapse collapse in" role="tabpanel">
<div class="row grid-control">
<div class="update-alter">
<div class="update-inner">
<textarea class="collapse in" id="software-updates-progress-textarea" readonly></textarea>
</div>
</div>
<div class="panel-group accordion" id="updates-accordion" role="tablist" aria-multiselectable="true" style="display:none;">
<h3>
<a role="button" data-toggle="collapse" data-parent="#updates-accordion" href="#updates-content-area" aria-expanded="false" aria-controls="updates-content-area" class="">
<span class="accordion-icon"></span><span class="accordion-text">$_("Update Status")</span>
</a>
</h3>
<div id="updates-content-area" class="panel-collapse collapse in" role="tabpanel">
<div class="row grid-control">
<div class="update-alter">
<div class="update-inner">
<textarea class="collapse in" id="software-updates-progress-textarea" readonly></textarea>
</div>
</div>
</div>
</div>
</div>
<table id="grid-basic" class="table table-condensed table-hover table-striped">
<thead>
Expand Down Expand Up @@ -97,14 +97,6 @@
</div>
</div>
</div>

<script id="host-update-tmpl" type="gingerbase/template">
<div class="host-panel">
<div class="container">
<div id="repositories-section" class="hidden"></div>
</div>
</div>
</script>
<div id="modalWindow" class="modal fade host-modal" tabindex="-1" role="dialog" aria-labelledby="hostsModalLabel" aria-hidden="true">
</div>
<script type="text/javascript">
Expand Down

0 comments on commit fbfe853

Please sign in to comment.