mirror of
https://github.com/unraid/api.git
synced 2026-05-08 08:00:19 -05:00
feat: WebguiCheckForUpdate using server-side check
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
import { request } from '~/composables/services/request';
|
import { request } from '~/composables/services/request';
|
||||||
|
import { OS_RELEASES } from '~/helpers/urls';
|
||||||
|
import type { ServerUpdateOsResponse } from '~/types/server';
|
||||||
/**
|
/**
|
||||||
* @name WebguiInstallKey
|
* @name WebguiInstallKey
|
||||||
* @description used to auto install key urls
|
* @description used to auto install key urls
|
||||||
@@ -92,3 +94,27 @@ export const WebguiNotify = async (payload: NotifyPostParameters) => {
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const WebguiCheckForUpdate = async (): Promise<ServerUpdateOsResponse | unknown> => {
|
||||||
|
console.debug('[WebguiCheckForUpdate]');
|
||||||
|
try {
|
||||||
|
const response: ServerUpdateOsResponse = await request
|
||||||
|
.url('/plugins/dynamix.plugin.manager/include/UnraidCheck.php')
|
||||||
|
.query({
|
||||||
|
altUrl: OS_RELEASES.toString(),
|
||||||
|
json: true,
|
||||||
|
})
|
||||||
|
.get()
|
||||||
|
.json((json) => {
|
||||||
|
return json;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('[WebguiCheckForUpdate] catch failed to execute UpdateCheck', error);
|
||||||
|
return error;
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('[WebguiCheckForUpdate] catch failed to execute UpdateCheck', error);
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user