mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-18 10:39:49 +00:00
wrapped proxy calls via useWidgetAPI
This commit is contained in:
parent
649f0038bc
commit
0a58f259ff
30 changed files with 115 additions and 153 deletions
|
@ -151,18 +151,18 @@ function SessionEntry({ playCommand, session }) {
|
|||
export default function Component({ service }) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const config = service.widget;
|
||||
const { widget } = service;
|
||||
|
||||
const {
|
||||
data: sessionsData,
|
||||
error: sessionsError,
|
||||
mutate: sessionMutate,
|
||||
} = useSWR(formatProxyUrl(config, "Sessions"), {
|
||||
} = useSWR(formatProxyUrl(widget, "Sessions"), {
|
||||
refreshInterval: 5000,
|
||||
});
|
||||
|
||||
async function handlePlayCommand(session, command) {
|
||||
const url = formatProxyUrlWithSegments(config, "PlayControl", {
|
||||
const url = formatProxyUrlWithSegments(widget, "PlayControl", {
|
||||
sessionId: session.Id,
|
||||
command,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue