Rename diskstation to downloadstation
This commit is contained in:
parent
04f803676a
commit
23ba45729e
6 changed files with 18 additions and 17 deletions
|
@ -126,7 +126,7 @@
|
|||
"leech": "Leech",
|
||||
"seed": "Seed"
|
||||
},
|
||||
"diskstation": {
|
||||
"downloadstation": {
|
||||
"download": "Download",
|
||||
"upload": "Upload",
|
||||
"leech": "Leech",
|
||||
|
|
|
@ -8,7 +8,7 @@ const components = {
|
|||
changedetectionio: dynamic(() => import("./changedetectionio/component")),
|
||||
coinmarketcap: dynamic(() => import("./coinmarketcap/component")),
|
||||
deluge: dynamic(() => import("./deluge/component")),
|
||||
diskstation: dynamic(() => import("./diskstation/component")),
|
||||
downloadstation: dynamic(() => import("./downloadstation/component")),
|
||||
docker: dynamic(() => import("./docker/component")),
|
||||
emby: dynamic(() => import("./emby/component")),
|
||||
flood: dynamic(() => import("./flood/component")),
|
||||
|
|
|
@ -17,10 +17,10 @@ export default function Component({ service }) {
|
|||
if (!tasks) {
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="diskstation.leech" />
|
||||
<Block label="diskstation.download" />
|
||||
<Block label="diskstation.seed" />
|
||||
<Block label="diskstation.upload" />
|
||||
<Block label="downloadstation.leech" />
|
||||
<Block label="downloadstation.download" />
|
||||
<Block label="downloadstation.seed" />
|
||||
<Block label="downloadstation.upload" />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
@ -32,10 +32,10 @@ export default function Component({ service }) {
|
|||
|
||||
return (
|
||||
<Container service={service}>
|
||||
<Block label="diskstation.leech" value={t("common.number", { value: leech })} />
|
||||
<Block label="diskstation.download" value={t("common.bitrate", { value: rateDl })} />
|
||||
<Block label="diskstation.seed" value={t("common.number", { value: completed })} />
|
||||
<Block label="diskstation.upload" value={t("common.bitrate", { value: rateUl })} />
|
||||
<Block label="downloadstation.leech" value={t("common.number", { value: leech })} />
|
||||
<Block label="downloadstation.download" value={t("common.bitrate", { value: rateDl })} />
|
||||
<Block label="downloadstation.seed" value={t("common.number", { value: completed })} />
|
||||
<Block label="downloadstation.upload" value={t("common.bitrate", { value: rateUl })} />
|
||||
</Container>
|
||||
);
|
||||
}
|
|
@ -4,7 +4,7 @@ import createLogger from "utils/logger";
|
|||
import widgets from "widgets/widgets";
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
|
||||
const logger = createLogger("diskstationProxyHandler");
|
||||
const logger = createLogger("downloadstationProxyHandler");
|
||||
const authApi = "{url}/webapi/auth.cgi?api=SYNO.API.Auth&version=2&method=login&account={username}&passwd={password}&session=DownloadStation&format=cookie"
|
||||
|
||||
async function login(widget) {
|
||||
|
@ -34,7 +34,7 @@ async function login(widget) {
|
|||
return [status, contentType, data];
|
||||
}
|
||||
|
||||
export default async function diskstationProxyHandler(req, res) {
|
||||
export default async function downloadstationProxyHandler(req, res) {
|
||||
const { group, service, endpoint } = req.query;
|
||||
|
||||
if (!group || !service) {
|
||||
|
@ -56,7 +56,7 @@ export default async function diskstationProxyHandler(req, res) {
|
|||
|
||||
const json = JSON.parse(data.toString());
|
||||
if (json?.success !== true) {
|
||||
logger.debug("Logging in to DiskStation");
|
||||
logger.debug("Logging in to DownloadStation");
|
||||
[status, contentType, data] = await login(widget);
|
||||
if (status !== 200) {
|
||||
return res.status(status).end(data)
|
|
@ -1,8 +1,8 @@
|
|||
import diskstationProxyHandler from "./proxy";
|
||||
import downloadstationProxyHandler from "./proxy";
|
||||
|
||||
const widget = {
|
||||
api: "{url}/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method={endpoint}",
|
||||
proxyHandler: diskstationProxyHandler,
|
||||
proxyHandler: downloadstationProxyHandler,
|
||||
|
||||
mappings: {
|
||||
"list": {
|
|
@ -5,7 +5,7 @@ import bazarr from "./bazarr/widget";
|
|||
import changedetectionio from "./changedetectionio/widget";
|
||||
import coinmarketcap from "./coinmarketcap/widget";
|
||||
import deluge from "./deluge/widget";
|
||||
import diskstation from "./diskstation/widget";
|
||||
import downloadstation from "./downloadstation/widget";
|
||||
import emby from "./emby/widget";
|
||||
import flood from "./flood/widget";
|
||||
import gluetun from "./gluetun/widget";
|
||||
|
@ -56,7 +56,8 @@ const widgets = {
|
|||
changedetectionio,
|
||||
coinmarketcap,
|
||||
deluge,
|
||||
diskstation,
|
||||
diskstation: downloadstation,
|
||||
downloadstation,
|
||||
emby,
|
||||
flood,
|
||||
gluetun,
|
||||
|
|
Loading…
Add table
Reference in a new issue