mirror of
https://github.com/unraid/api.git
synced 2026-05-20 07:59:13 -05:00
fix(web): installPlugin composable for os updates
This commit is contained in:
@@ -9,12 +9,16 @@ const useInstallPlugin = () => {
|
||||
try {
|
||||
// @ts-ignore – `openPlugin` will be included in 6.10.4+ DefaultPageLayout
|
||||
if (typeof openPlugin === 'function') {
|
||||
const plgUrl = new URL(payload.pluginUrl);
|
||||
const installString = `${plgUrl.pathname.replace('.plg', '').substring(1)}:install`; // mimic what is done on the install plg page JS but without the regex that's hard to read
|
||||
// @ts-ignore
|
||||
openPlugin(
|
||||
`plugin ${payload.update ? 'update' : 'install'} ${payload.pluginUrl}`,
|
||||
payload.modalTitle,
|
||||
'',
|
||||
'refresh',
|
||||
`plugin ${payload.update ? 'update' : 'install'} ${payload.pluginUrl}`, // command
|
||||
payload.modalTitle, // title
|
||||
installString, // plg
|
||||
'refresh', // function defined in DefaultPageLayout.php
|
||||
0, // run command only when not already running (default)
|
||||
1, // hide close button
|
||||
);
|
||||
} else {
|
||||
// `openBox()` is defined in the webgui's DefaultPageLayout.php and used when openPlugin is not available
|
||||
|
||||
Reference in New Issue
Block a user