Skip to content

Instantly share code, notes, and snippets.

@foosel
Last active July 22, 2024 04:35
Show Gist options
  • Save foosel/86157172899666cc0658 to your computer and use it in GitHub Desktop.
Save foosel/86157172899666cc0658 to your computer and use it in GitHub Desktop.
OctoPrint Filetab plugin & configuration instructions
import octoprint.plugin
class FiletabPlugin(octoprint.plugin.TemplatePlugin,
octoprint.plugin.AssetPlugin):
def get_template_configs(self):
return [
dict(type="tab", name="Files")
]
def get_assets(self):
return dict(css=["css/filetab.css"])
__plugin_implementation__ = FiletabPlugin()
__plugin_settings_overlay__ = dict(appearance=dict(components=dict(disabled=dict(sidebar=["files"]))))

Moving the "Files" component from the sidebar to the tab section

  1. Create .octoprint/plugins/filetab, .octoprint/plugins/filetab/templates and .octoprint/plugins/filetab/static/css

  2. Copy __init__.py to .octoprint/plugins/filetab

  3. Copy filetab_tab.jinja2 to .octoprint/plugins/filetab/templates

  4. Copy filetab.css to .octoprint/plugins/filetab/static/css

  5. Optional: Adjust the appearance.components.tab.order to list plugin_filetab in .octoprint/config.yaml if you want the "Files" tab to be placed somewhere else than after the regular tab components, e.g.:

    # ...
    appearance:
      components:
        order:
          tab:
          - plugin_filetab
    # ...
  6. Restart OctoPrint, verify in the log that it discovered the plugin

#files_wrapper .accordion-heading-button a {
display: inline-block;
padding: 8px 15px;
font-size: 14px;
line-height: 20px;
color: #000;
text-decoration: none;
background: 0 0;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
#files {
clear: both;
}
<div id="files_wrapper">
<div class="pull-right" style="font-size: 14px;">
{% include "sidebar/files_header.jinja2" %}
</div>
<div id="files">
{% include "sidebar/files.jinja2" %}
</div>
</div>
@Jack77777777
Copy link

This is a pity. So POC failed for Octopi 0.18.

@foosel
Copy link
Author

foosel commented Jan 14, 2021

I welcome any volunteers who want to take over maintenance and turn that into a proper plugin. I already have my hands more than full with maintaining OctoPrint itself plus its ecosystem, I can't do everything 🤷🏻‍♀️

@Jack77777777
Copy link

I really appreciate your great work/development of Octoprint. I just wanted to inform that Filetab is no longer working with Octopi 0.18 if someone else has the same problem.

@faush01
Copy link

faush01 commented Jul 22, 2024

I have packaged this up into an installable plugin
https://github.com/faush01/OctoPrint-Filetab
I have tested on the OctoPrint 1.10.2
Install from URL instructions should work fine.
After more testing and feedback, I will try to have this added to the plugins catalogue.

@jneilliii
Copy link

small warning @faush01 the line here may not apply as you expect if someone has already disabled other sidebar items manually or with something like my dragon drop plugin. settings overlays get tricky with list items like what's being applied in yours. that being said, I can't think of too many people that have mentioned disabling any sidebar items.

I also don't know if you knew about the FileManager plugin or not. It was created after this gist. https://plugins.octoprint.org/plugins/filemanager/

@faush01
Copy link

faush01 commented Jul 22, 2024

small warning @faush01 the line here may not apply as you expect if someone has already disabled other sidebar items manually or with something like my dragon drop plugin. settings overlays get tricky with list items like what's being applied in yours. that being said, I can't think of too many people that have mentioned disabling any sidebar items.

yeah, there are many problems and overlapping plugin issues with many of the interface altering plugins and settings.

For instance, this plugin does not work with the widescreen plugin

I also don't know if you knew about the FileManager plugin or not. It was created after this gist. https://plugins.octoprint.org/plugins/filemanager/

I have used this one in the past but it has a few issues with layout when you alter the display width, I have a fork of it I am playing with but am not happy with yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment