Skip to content

Commit

Permalink
v1.5.1 Fix for plugin compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
sco01 committed Sep 26, 2019
1 parent 4f6f435 commit 12f3f41
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 91 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A dashboard tab for Octoprint that displays the most relevant info regarding the
* Configurable progress gauge type (Circle, Bar)
* Fullscreen mode
* Uses Estimates from [PrintTimeGenius](https://plugins.octoprint.org/plugins/PrintTimeGenius/) when installed
* Uses GCode analysis provided by [DisplayLayerProgress](https://plugins.octoprint.org/plugins/DisplayLayerProgress/) to get more accurate layer and fan data
* Uses GCode analysis provided by [DisplayLayerProgress](https://plugins.octoprint.org/plugins/DisplayLayerProgress/) to present layer and fan data
* Theme friendly:

![Screenshot](https://github.com/StefanCohen/OctoPrint-Dashboard/blob/master/screenshot-theme.png)
Expand All @@ -38,7 +38,7 @@ For release notes and release history, please visit the [wiki](https://github.co

## Dependencies

This plugin depends on [DisplayLayerProgress](https://plugins.octoprint.org/plugins/DisplayLayerProgress/) to be installed in order to provide all metrics. DisplayLayerProgress provides GCode analysis for the Dashboard. Only the events from DisplayLayerProgress are used by the Dashboard plugin so you may disable "Navigationbar" and "Printer Display" in the DisplayLayerProgress plugin settings if you want to see them in the UI.
This plugin depends on [DisplayLayerProgress](https://plugins.octoprint.org/plugins/DisplayLayerProgress/) to be installed. DisplayLayerProgress provides GCode analysis for the Fan, Layer, Height and Layer Average stats. Only the events from DisplayLayerProgress are used by the Dashboard plugin so you may disable "Navigationbar" and "Printer Display" in the DisplayLayerProgress plugin settings if you want to see them in the UI.

The dashboard uses the time estimates provided by PrintTimeGenius if it is installed but it is not required.

Expand Down
2 changes: 2 additions & 0 deletions octoprint_dashboard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def __plugin_load__():
__plugin_hooks__ = {
"octoprint.plugin.softwareupdate.check_config": __plugin_implementation__.get_update_information
}



global __plugin_settings_overlay__
__plugin_settings_overlay__ = dict(appearance=dict(components=dict(order=dict(tab=["plugin_dashboard",
Expand Down
20 changes: 16 additions & 4 deletions octoprint_dashboard/static/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ svg text {
fill: #08c;
}

/* Webcam */
#dashboard_webcam_container .webcam_rotated{position:relative;width:100%;padding-bottom:100%;pointer-events:none}
#dashboard_webcam_container .webcam_rotated .webcam_fixed_ratio{position:absolute;transform:rotate(-90deg);top:0;bottom:0;pointer-events:none}
#dashboard_webcam_container .webcam_rotated .webcam_fixed_ratio .webcam_fixed_ratio_inner{width:100%;height:100%;pointer-events:none}
#dashboard_webcam_container .webcam_unrotated .webcam_fixed_ratio{width:100%;pointer-events:none;padding-bottom:100%;position:relative}
#dashboard_webcam_container .webcam_unrotated .webcam_fixed_ratio.ratio43{padding-bottom:75%}
#dashboard_webcam_container .webcam_unrotated .webcam_fixed_ratio.ratio169{padding-bottom:56.25%}
#dashboard_webcam_container .webcam_unrotated .webcam_fixed_ratio.ratio1610{padding-bottom:62.5%}
#dashboard_webcam_container .webcam_unrotated .webcam_fixed_ratio .webcam_fixed_ratio_inner{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none}
#dashboard_webcam_container img{width:100%;height:100%;object-fit:contain}


/* Small Screens */

@media (max-width: 700px) {
Expand Down Expand Up @@ -132,7 +144,7 @@ svg text {
transform: translateY(-50%);
padding: 2vmin 0px;
}
.dasboardContainer:-moz-full-screen div#webcam_container {
.dasboardContainer:-moz-full-screen div#dashboard_webcam_container {
position: fixed;
max-width: 65vw;
max-height: calc(90vh - 4vmin);
Expand Down Expand Up @@ -189,7 +201,7 @@ svg text {
transform: translateY(-50%);
padding: 2vmin 0px;
}
.dasboardContainer:-ms-fullscreen div#webcam_container {
.dasboardContainer:-ms-fullscreen div#dashboard_webcam_container {
position: fixed;
max-width: 65vw;
max-height: calc(90vh - 4vmin);
Expand Down Expand Up @@ -244,7 +256,7 @@ svg text {
transform: translateY(-50%);
padding: 2vmin 0px;
}
.dasboardContainer:-webkit-full-screen div#webcam_container {
.dasboardContainer:-webkit-full-screen div#dashboard_webcam_container {
position: fixed;
max-width: 65vw;
max-height: calc(90vh - 4vmin);
Expand Down Expand Up @@ -299,7 +311,7 @@ svg text {
transform: translateY(-50%);
padding: 2vmin 0px;
}
.dasboardContainer:fullscreen div#webcam_container {
.dasboardContainer:fullscreen div#dashboard_webcam_container {
position: fixed;
max-width: 65vw;
max-height: calc(90vh - 4vmin);
Expand Down
29 changes: 2 additions & 27 deletions octoprint_dashboard/static/js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,38 +112,13 @@ $(function() {
if (data.cpuTemp) { self.cpuTemp(data.cpuTemp); }
};

// jneilliii/foosel hack to fix control tab disabling the webcam. Tricks the system by making it think you've switched to the control tab by calling it's onTabChange event and then reverting the internal selectedTab variable back to the dashboard
self.onTabChange = function(current, previous) {
if ((current === "#tab_plugin_dashboard") || (current === "#control")) {
var selected = OctoPrint.coreui.selectedTab;
OctoPrint.coreui.selectedTab = "#control";
self.controlViewModel.onTabChange("#control", previous);
OctoPrint.coreui.selectedTab = selected;
} else if (previous === "#tab_plugin_dashboard") {
self.controlViewModel.onTabChange(current, "#control");
}
};

// jneilliii/foosel hack to fix control tab disabling the webcam continued
self.controlViewModel.onBrowserTabVisibilityChange = function(status) {
if (status) {
var selected = OctoPrint.coreui.selectedTab;
OctoPrint.coreui.selectedTab = "#control";
self.controlViewModel._enableWebcam();
OctoPrint.coreui.selectedTab = selected;
} else {
self.controlViewModel._disableWebcam();
}
};

self.embedUrl = function() {
if (self.settingsViewModel.settings.webcam) {
return self.settingsViewModel.settings.webcam.streamUrl()
if (self.settingsViewModel.settings.webcam && self.settingsViewModel.settings.plugins.dashboard.showWebCam) {
return self.settingsViewModel.settings.webcam.streamUrl();
}
else return "ERROR: Webcam not enabled in config.";
};


self.getEta = function(seconds) {
dt = new Date();
dt.setSeconds( dt.getSeconds() + seconds )
Expand Down
1 change: 1 addition & 0 deletions octoprint_dashboard/templates/dashboard_settings.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
</div>
</div>


<legend>{{ _('Advanced Settings') }}</legend>
<div class="control-group">
<div >
Expand Down
Loading

0 comments on commit 12f3f41

Please sign in to comment.