Skip to content

Commit

Permalink
Fix for #39 and #40. CSS for average row
Browse files Browse the repository at this point in the history
  • Loading branch information
imrahil committed Jan 1, 2017
1 parent f3e6f22 commit 8a8b64b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
8 changes: 4 additions & 4 deletions octoprint_printhistory/eventHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ def eventHandler(self, event, payload):
filamentVolume = fileData["analysis"]["filament"]["tool0"]["volume"]
filamentLength = fileData["analysis"]["filament"]["tool0"]['length']

currentFile["filamentVolume"] = filamentVolume
currentFile["filamentLength"] = filamentLength
currentFile["filamentVolume"] = filamentVolume if filamentVolume is not None else 0
currentFile["filamentLength"] = filamentLength if filamentLength is not None else 0

if "tool1" in fileData["analysis"]["filament"]:
filamentVolume = fileData["analysis"]["filament"]["tool1"]["volume"]
filamentLength = fileData["analysis"]["filament"]["tool1"]['length']

currentFile["filamentVolume2"] = filamentVolume
currentFile["filamentLength2"] = filamentLength
currentFile["filamentVolume2"] = filamentVolume if filamentVolume is not None else 0
currentFile["filamentLength2"] = filamentLength if filamentLength is not None else 0

estimatedPrintTime = fileData["analysis"]["estimatedPrintTime"] if "estimatedPrintTime" in fileData["analysis"] else 0

Expand Down
12 changes: 12 additions & 0 deletions octoprint_printhistory/static/css/printhistory.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@
font-size: 85%;
color: #999;
}

#tab_plugin_printhistory .summary {
margin-bottom: 5px;
}

#tab_plugin_printhistory .summary th {
font-weight: bold;
border-top: 1px solid #ddd;
background-color: #f9f9f9;
padding-top: 10px;
padding-bottom: 10px;
}
4 changes: 2 additions & 2 deletions octoprint_printhistory/templates/printhistory_tab.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Refresh <a href="#" data-bind="click: function() { requestData({force: true}); }
</ul>
</div>

<table class="table table-striped table-hover table-condensed table-hover">
<table class="table table-striped table-hover table-condensed table-hover summary">
<thead>
<tr>
<th style="width: 63%">Total:</th>
Expand All @@ -79,7 +79,7 @@ Refresh <a href="#" data-bind="click: function() { requestData({force: true}); }
</thead>
</table>

<table class="table table-striped table-hover table-condensed table-hover">
<table class="table table-striped table-hover table-condensed table-hover summary">
<thead>
<tr>
<th style="width: 63%">Average:</th>
Expand Down

0 comments on commit 8a8b64b

Please sign in to comment.