Skip to content

Instantly share code, notes, and snippets.

@foosel
Last active July 25, 2021 14:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • 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>
@jneilliii
Copy link

I think newer changes may have made these instructions and files deprecated. I like the idea of having a larger file manager and would appreciate an update.

@pelrun
Copy link

pelrun commented Jun 17, 2016

It actually still works - you absolutely need to disable the sidebar though, or the file list won't populate the main tab.

The big problem is you lose the controls that were on the sidebar header - the refresh button, and the dropdown with the file filters.

@jrzingel
Copy link

jrzingel commented Oct 1, 2017

I also think it would be really cool if this was integrated into the normal OctoPi. It would be really useful for long file names as these are cut off in the small file window currently.

@sbts
Copy link

sbts commented Oct 20, 2017

I'll plus one this.
The missing refresh, config, SD Operations, etc need to be sorted, but other than that I like the larger layout.
Also, as prints are generally longer running, it seems pointless having the file list Always visible, it's not that often that you need to see it.

The free'd up space in the sidebar can likely be put to good use with a "status" widget that shows temps, material use, and progress

@OllisGit
Copy link

I installed the plugin with the Octoprint Version 1.3.6. on a fresh RasPI and on my Windows-System, but without success.
The mentioned file .octoprint/plugins/config.yaml doesn't existst so I can't change anything.

The files-tab is shown, but

  • only the search-box is shown, no files listed
  • the orig. files box is shown (because not disabled)

The log shows no errors. Do you have any idea, how to solve the issue?
Thx, in advance
Olli

@Paulf007
Copy link

Paulf007 commented May 6, 2018

I also have the same problem as OllisGit but running OCTOPi . Any one have an Idea what we are missing?

@foosel
Copy link
Author

foosel commented Jun 8, 2018

@OllisGit @Paulf007 Sounds like both of you missed step 4 (which btw still had a typo and was referring to .octoprint/plugins/config.yaml instead of .octoprint/config.yaml).

In any case, I just updated this stuff so it will now use a settings overlay to take care of that by itself and also added the refresh/sdcard/settings buttons.

Installation is still manual leg work, if anyone finds this (former?) proof of concept worthwhile to bundle up as a proper plugin for the repository, feel free to take this code and do it :)

@OllisGit
Copy link

OllisGit commented Jun 8, 2018

@foosel I retested the installation on my raspi and now it works!

@MakanMaker
Copy link

MakanMaker commented Jan 5, 2020

Installed on OctoPrint 1.3.12 running on OctoPi 0.16.0 and the scripts are working :) Thanks for this!

Btw I skipped step 4 and used the TabOrder plugin instead to move the new files tab to where I wanted it. (pretty much the same thing but maybe good to know for those not comfortable to edit the config file directly)

@Jack77777777
Copy link

I have Octopi 0.18 RC2 installed. Can make filetab python3 combatible ?

"WARNING - Plugin filetab is not compatible to Python 3.7.3 (compatibility string: >=2.7,<3)."

@foosel
Copy link
Author

foosel commented Jan 14, 2021

This is a proof of concept and not maintained by me. So no.

@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.

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