How does the plugin system work? Documentation Added - WIP


dlandon

Recommended Posts

  • Replies 195
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I don't think the suggestion was to remove the original page (normally under settings), but to provide a 'direct' jump to it from the plugins page.

 

Should it be any more complicated than detecting whether the plugin creates a .page file and, if so, run it?

What if a plugin generates more than one page file?

Link to comment

I assume they couldn't all be named Appname.page, which would be the only file the link looks for. In fact its already doing that. If a plugin doesn't have the .page file currently in beta 12, the link is disabled already. For example, dynamix plugin has no link.

 

Ideally the plugins tab will be the first tab a new user checks for when looking for the plugins settings and plugins that are installed. Having redundancy would be up to the plugin Dev, but not required.

Link to comment

I have made the suggestion to introduce a new optional setting in the PLG file, this is basically a reference to another page when clicking on the icon in the plugins page.

 

Most of the time the reference would point to the settings page of the plugin, but it may point to something else as well. This is similar to what has been done in Dynamix v5. After installation of a new plugin, one can click on the icon to go immediately to the settings of this new plugin.

 

Link to comment
  • 2 months later...

I have made the suggestion to introduce a new optional setting in the PLG file, this is basically a reference to another page when clicking on the icon in the plugins page.

 

Most of the time the reference would point to the settings page of the plugin, but it may point to something else as well. This is similar to what has been done in Dynamix v5. After installation of a new plugin, one can click on the icon to go immediately to the settings of this new plugin.

 

Just came across this post, think it's a fantastic idea, especially as everytime I want to access a plugin I automatically click the plugins tab rather than the settings tab.

Link to comment
  • 2 weeks later...

I have started converting my VirtualBox and Swapfile plugins to be compatible with the new Plugin System.

 

I have a few questions:

 

* How does the plugin system check for updates when pressing the "Check for Updates" button?

* Does there need to be a special update function/method to update the plugins?

* Are there any other method that need to be supported aside from "remove"?

 

Link to comment

I updated one of my plugins to support both v5 and v6 plugin architectures.

 

I found that for unRAID v5 "installplg" the "remove" method needs to be at the end of the "plg" files because installplg has a problem (generates an error) for creating it.

returns an error that it cannot create the file.

<FILE Run="/bin/bash" Method="remove">
<INLINE>
.
.
.
</INLINE>
</FILE>

 

can anyone else confirm this or is it something else?

 

If I put the "remove" method at the end then the error is still generated but at least the plugin is installed.

 

Link to comment

Yes thats correct. The problem is that v5 does not know the Method tag but expects a Run tag.

To solve it, I did it this way:

 

<FILE Name="/tmp/&name;-script" Run="/bin/bash" Method="remove">
<INLINE>
ARCHTYPE=$( /usr/bin/uname -m )
if [ "x86_64" == "$ARCHTYPE" ]; then
# ==============================================
# The 'remove' script
# ==============================================
...
... Put your remove script here
...
fi
rm -f "/tmp/&name;-script"
</INLINE>
</FILE>

 

That way it is extracted on v5 and executed, but as it checks the platform it is running on first, it will not do anything other than removing itself. The error will be gone.

 

On v6 it will execute only when the remove method is called. The Run tag will be ignored if a Method tag is found. At least it worked that way the last time I tested.

Link to comment

That's a good way to some the error. I have mine running anonymously but that gives the error on v5 still. I'll likely update to this.

 

Quick question, I saw plugins can now have an info cjangelog. How do I add that?

 

Use the <CHANGES> section.

It uses markdown (same as README.md).

 

See my plugin:

https://github.com/theone11/virtualbox_plugin/blob/master/virtualbox.plg

 

It is also mentioned in the OP.

 

 

Link to comment
  • 4 weeks later...

For plugins we should use the started, stopping_svcs instead of disks_mounted, unmounting_disks or are the disks events still valid for rc1/rc2?

 

It depends of what services/steps you need your plugin to precede/supervene. LT just postponed VMs and Docker init from disks_mounted to started.

Link to comment

For plugins we should use the started, stopping_svcs instead of disks_mounted, unmounting_disks or are the disks events still valid for rc1/rc2?

 

It depends of what services/steps you need your plugin to precede/supervene. LT just postponed VMs and Docker init from disks_mounted to started.

Ok I see. Thanks

Link to comment

For plugins we should use the started, stopping_svcs instead of disks_mounted, unmounting_disks or are the disks events still valid for rc1/rc2?

 

It depends of what services/steps you need your plugin to precede/supervene. LT just postponed VMs and Docker init from disks_mounted to started.

 

I think I will do it for my VirtualBox plugin as well.

 

What is the equivalent unmounting state? When does LT stop the VM and Docker?

 

Link to comment

For plugins we should use the started, stopping_svcs instead of disks_mounted, unmounting_disks or are the disks events still valid for rc1/rc2?

 

It depends of what services/steps you need your plugin to precede/supervene. LT just postponed VMs and Docker init from disks_mounted to started.

 

I think I will do it for my VirtualBox plugin as well.

 

What is the equivalent unmounting state? When does LT stop the VM and Docker?

 

stopping_svcs event.

Link to comment
  • 3 weeks later...

For plugins we should use the started, stopping_svcs instead of disks_mounted, unmounting_disks or are the disks events still valid for rc1/rc2?

 

It depends of what services/steps you need your plugin to precede/supervene. LT just postponed VMs and Docker init from disks_mounted to started.

 

I think I will do it for my VirtualBox plugin as well.

 

What is the equivalent unmounting state? When does LT stop the VM and Docker?

 

stopping_svcs event.

 

How do I implement this?

Do I just rename the files to "started" and "stopping_svcs" instead of "disks_mounted" and "unmounting_disks" and place them in the same events folder?

 

Link to comment
  • 3 weeks later...

How are shared dependencies handled? e.g. SNMP requires perl. If I install perl, then later uninstall it when the plugin gets uninstalled, will that potentially break some other plugin that also installed perl (as a no-op)?

 

Or should we have a standard perl plugin, and have SNMP fail with a helpful error message if perl can't be found?

Link to comment
  • 2 weeks later...

I noticed with recent builds of unraid 6 (especially the final) when a plugin echo's text, it is handled differently now than older versions.

 

In unraid 5 - the echo'd lines would show stacked

In unraid 6 - the echo'd lines now show one after another in a single line, bu tin the betas they would clear the previous entry before displaying the new echo.

 

Is there a better way to convey messages about what the plugin is doing that doesn't mash them all into a single line across the bottom of the page?

 

Edit: Ideally, the stacked layout of unraid 5 looks best and shows text long enough for users to see what's happening.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.