Possible to create module/plugin for the UI?

Hi,

I'm running Klipper fw and by now my commands list in the console is pretty long.
I'd like to create possibly a new menu in the UI to move those in there and add more options as well to interact with the Klipper Fw.
Question is, looking at the documentation closest framework I could find is module but those don't seem to be able to interact with the UI part. 

So is there anything similar to plugins in Octoprint in RepetierServer that would allow me to extend the UI funcionality?

Thanks!

Comments

  • Actually module is the same as plugin for octoprint. If you check the already existing firmware module you see that it has a lua part for server side changes and a www part for the web gui. This is more limited to what you can add and where. You can add new tabs for printer and add menu entries. Not sure what exactly you want to add - seems like you want a central place for the klipper gcodes. So adding a "Klipper" tab would maybe what you want. Used framework in Angular 1 with bootstrap-ui 2.5 (bootstrap 3). 

    The problem is that this will only happen in the normal gui. Not in touch screen and not in repetier-server monitor. For the later future I want to add a special "plugin"-solution that is independent from framework so it would add it to all 3 systems if wanted, but that has to wait as that is a quite complex thing. 
  • Thanks, appreciate the information shared.
     I have to say I cross read the documentation, so I'll read it now more carefully as I definitely did miss that.

    Yes that is pretty much the idea, I only use the normal web UI not the touch so that is fine in my case.
    There are a few commands I tend to use often so it would be handy to have them always available not just under 
    the console tab.
    As well as it would allow to me have dynamic inputs as at the moment they have to use static pre-defined values.
    One use case, swapping between PEI and powder coated bed, need to adjust the Z offset.




  • In this case you can really just add a tab with your special commands. That is quite easy. As lua script you only need the registration of your javascript file which will then register the tab and add the page. See firmware as example. Then you can send the gcode. Only thing I fear is that the javascript modules are not documented making it complicated.
    For sending gcode you need to import "RSCom" module and use it like this:
    RSCom.send("move", {z: z, relative: false});
    the first is the API command, the object contains the parameter you would send. That way you can send and use all web api calls. The function returns a promise that will contain the response of the api call.
    You get state and status of printer using
    $rootScope.active.state and $rootScope.active.status
    In console rs is $rootScope so you easily inspect variables.
  • Awesome! Really appreciate the insights. Thanks!
    I'll give this a try and share something here when done.


Sign In or Register to comment.