OctoPrint-Estop/octoprint_estop/__init__.py
ntoff ab3d1b66d5 dynamic class, invisible to anon users
dynamic class based on state, completely invisible to non logged in
users
2017-03-24 16:18:30 +10:00

22 lines
585 B
Python

# coding=utf-8
from __future__ import absolute_import
import octoprint.plugin
class EstopPlugin(octoprint.plugin.AssetPlugin,
octoprint.plugin.TemplatePlugin):
def get_assets(self):
return dict(
js=["js/estop.js"],
css=["css/estop.css"]
)
def get_template_configs(self):
return [
dict(type="sidebar", name="Emergency STOP!", icon="fa fa-times", template="estop_sidebar.jinja2", styles=["display: none"], data_bind="visible: loginState.isUser")
]
__plugin_name__ = "Emergency Stop Button"
__plugin_implementation__ = EstopPlugin()