tteck / Proxmox

Proxmox VE Helper-Scripts
https://Helper-Scripts.com
MIT License
14.26k stars 2.33k forks source link

homepage lxc, prwolarr widget not working #1095

Closed divemasterjm closed 1 year ago

divemasterjm commented 1 year ago

i saw after upgrading homepage lxc, that the widget for prowlar doesnt work, tried on a docker and works fine, i review script and you have 2 lines one of them removing prowlarr jsx,

sed -i 's/prowlarr: dynamic(() => import(".\/prowlarr\/component")),/\/\/ &/' /opt/homepage/src/widgets/components.js rm -rf /opt/homepage/src/widgets/prowlarr/component.jsx

can you please tell me how to have this widget working?

Thanks

tteck commented 1 year ago

You are correct that Prowlarr was removed due to a linting error with new installs. However, I have just checked and it appears that this issue has been resolved. The fix for the linting error has been reverted, so Prowlarr should now be available again.

divemasterjm commented 1 year ago

You are correct that Prowlarr was removed due to a linting error with new installs. However, I have just checked and it appears that this issue has been resolved. The fix for the linting error has been reverted, so Prowlarr should now be available again.

I update homepage lxc but still the same, do i have to do anything else?, i look at /opt/homepage directory and in the prowlarr directory still missing the file also i installed code server in a kxc, how can i remove the package? Thanks

tteck commented 1 year ago

To undo the Prowlarr linting fix nano /opt/homepage/src/widgets/components.js and uncomment prowlarr

nano /opt/homepage/src/widgets/prowlarr/component.jsx and insert the following:

import { useTranslation } from "react-i18next";

import Container from "components/services/widget/container";
import Block from "components/services/widget/block";
import useWidgetAPI from "utils/proxy/use-widget-api";

export default function Component({ service }) {
  const { t } = useTranslation();
  const { widget } = service;

  const { data: grabsData, error: grabsError } = useWidgetAPI(widget, "indexerstats");

  if (grabsError) {
    return <Container error={grabsError} />;
  }

  if (!grabsData) {
    return (
      <Container service={service}>
        <Block label="prowlarr.numberOfGrabs" />
        <Block label="prowlarr.numberOfQueries" />
        <Block label="prowlarr.numberOfFailGrabs" />
        <Block label="prowlarr.numberOfFailQueries" />
      </Container>
    );
  }

  let numberOfGrabs = 0;
  let numberOfQueries = 0;
  let numberOfFailedGrabs = 0;
  let numberOfFailedQueries = 0;
  grabsData?.indexers?.forEach((element) => {
    numberOfGrabs += element.numberOfGrabs;
    numberOfQueries += element.numberOfQueries;
    numberOfFailedGrabs += numberOfFailedGrabs + element.numberOfFailedGrabs;
    numberOfFailedQueries += numberOfFailedQueries + element.numberOfFailedQueries;
  });

  return (
    <Container service={service}>
      <Block label="prowlarr.numberOfGrabs" value={t("common.number", { value: numberOfGrabs })} />
      <Block label="prowlarr.numberOfQueries" value={t("common.number", { value: numberOfQueries })} />
      <Block label="prowlarr.numberOfFailGrabs" value={t("common.number", { value: numberOfFailedGrabs })} />
      <Block label="prowlarr.numberOfFailQueries" value={t("common.number", { value: numberOfFailedQueries })} />
    </Container>
  );
}

Update Note: This is untested, but should work

To uninstall code-server: https://coder.com/docs/code-server/latest/install#uninstall

divemasterjm commented 1 year ago

Thanks, it works!!!

divemasterjm commented 1 year ago

To undo the Prowlarr linting fix nano /opt/homepage/src/widgets/components.js and uncomment prowlarr

nano /opt/homepage/src/widgets/prowlarr/component.jsx and insert the following:

import { useTranslation } from "react-i18next";

import Container from "components/services/widget/container";
import Block from "components/services/widget/block";
import useWidgetAPI from "utils/proxy/use-widget-api";

export default function Component({ service }) {
  const { t } = useTranslation();
  const { widget } = service;

  const { data: grabsData, error: grabsError } = useWidgetAPI(widget, "indexerstats");

  if (grabsError) {
    return <Container error={grabsError} />;
  }

  if (!grabsData) {
    return (
      <Container service={service}>
        <Block label="prowlarr.numberOfGrabs" />
        <Block label="prowlarr.numberOfQueries" />
        <Block label="prowlarr.numberOfFailGrabs" />
        <Block label="prowlarr.numberOfFailQueries" />
      </Container>
    );
  }

  let numberOfGrabs = 0;
  let numberOfQueries = 0;
  let numberOfFailedGrabs = 0;
  let numberOfFailedQueries = 0;
  grabsData?.indexers?.forEach((element) => {
    numberOfGrabs += element.numberOfGrabs;
    numberOfQueries += element.numberOfQueries;
    numberOfFailedGrabs += numberOfFailedGrabs + element.numberOfFailedGrabs;
    numberOfFailedQueries += numberOfFailedQueries + element.numberOfFailedQueries;
  });

  return (
    <Container service={service}>
      <Block label="prowlarr.numberOfGrabs" value={t("common.number", { value: numberOfGrabs })} />
      <Block label="prowlarr.numberOfQueries" value={t("common.number", { value: numberOfQueries })} />
      <Block label="prowlarr.numberOfFailGrabs" value={t("common.number", { value: numberOfFailedGrabs })} />
      <Block label="prowlarr.numberOfFailQueries" value={t("common.number", { value: numberOfFailedQueries })} />
    </Container>
  );
}

Update Note: This is untested, but should work

To uninstall code-server: https://coder.com/docs/code-server/latest/install#uninstall

hi new version of homepage tried to update and ive got

[ERROR] in line 329: exit code 1: while executing command git pull --force &> /dev/null