Rename diskstation to downloadstation

pull/715/head
Michael Shamoon 2 years ago
parent 04f803676a
commit 23ba45729e

@ -126,7 +126,7 @@
"leech": "Leech", "leech": "Leech",
"seed": "Seed" "seed": "Seed"
}, },
"diskstation": { "downloadstation": {
"download": "Download", "download": "Download",
"upload": "Upload", "upload": "Upload",
"leech": "Leech", "leech": "Leech",

@ -8,7 +8,7 @@ const components = {
changedetectionio: dynamic(() => import("./changedetectionio/component")), changedetectionio: dynamic(() => import("./changedetectionio/component")),
coinmarketcap: dynamic(() => import("./coinmarketcap/component")), coinmarketcap: dynamic(() => import("./coinmarketcap/component")),
deluge: dynamic(() => import("./deluge/component")), deluge: dynamic(() => import("./deluge/component")),
diskstation: dynamic(() => import("./diskstation/component")), downloadstation: dynamic(() => import("./downloadstation/component")),
docker: dynamic(() => import("./docker/component")), docker: dynamic(() => import("./docker/component")),
emby: dynamic(() => import("./emby/component")), emby: dynamic(() => import("./emby/component")),
flood: dynamic(() => import("./flood/component")), flood: dynamic(() => import("./flood/component")),

@ -17,10 +17,10 @@ export default function Component({ service }) {
if (!tasks) { if (!tasks) {
return ( return (
<Container service={service}> <Container service={service}>
<Block label="diskstation.leech" /> <Block label="downloadstation.leech" />
<Block label="diskstation.download" /> <Block label="downloadstation.download" />
<Block label="diskstation.seed" /> <Block label="downloadstation.seed" />
<Block label="diskstation.upload" /> <Block label="downloadstation.upload" />
</Container> </Container>
); );
} }
@ -32,10 +32,10 @@ export default function Component({ service }) {
return ( return (
<Container service={service}> <Container service={service}>
<Block label="diskstation.leech" value={t("common.number", { value: leech })} /> <Block label="downloadstation.leech" value={t("common.number", { value: leech })} />
<Block label="diskstation.download" value={t("common.bitrate", { value: rateDl })} /> <Block label="downloadstation.download" value={t("common.bitrate", { value: rateDl })} />
<Block label="diskstation.seed" value={t("common.number", { value: completed })} /> <Block label="downloadstation.seed" value={t("common.number", { value: completed })} />
<Block label="diskstation.upload" value={t("common.bitrate", { value: rateUl })} /> <Block label="downloadstation.upload" value={t("common.bitrate", { value: rateUl })} />
</Container> </Container>
); );
} }

@ -4,7 +4,7 @@ import createLogger from "utils/logger";
import widgets from "widgets/widgets"; import widgets from "widgets/widgets";
import getServiceWidget from "utils/config/service-helpers"; 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" 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) { async function login(widget) {
@ -34,7 +34,7 @@ async function login(widget) {
return [status, contentType, data]; return [status, contentType, data];
} }
export default async function diskstationProxyHandler(req, res) { export default async function downloadstationProxyHandler(req, res) {
const { group, service, endpoint } = req.query; const { group, service, endpoint } = req.query;
if (!group || !service) { if (!group || !service) {
@ -56,7 +56,7 @@ export default async function diskstationProxyHandler(req, res) {
const json = JSON.parse(data.toString()); const json = JSON.parse(data.toString());
if (json?.success !== true) { if (json?.success !== true) {
logger.debug("Logging in to DiskStation"); logger.debug("Logging in to DownloadStation");
[status, contentType, data] = await login(widget); [status, contentType, data] = await login(widget);
if (status !== 200) { if (status !== 200) {
return res.status(status).end(data) return res.status(status).end(data)

@ -1,8 +1,8 @@
import diskstationProxyHandler from "./proxy"; import downloadstationProxyHandler from "./proxy";
const widget = { const widget = {
api: "{url}/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method={endpoint}", api: "{url}/webapi/DownloadStation/task.cgi?api=SYNO.DownloadStation.Task&version=1&method={endpoint}",
proxyHandler: diskstationProxyHandler, proxyHandler: downloadstationProxyHandler,
mappings: { mappings: {
"list": { "list": {

@ -5,7 +5,7 @@ import bazarr from "./bazarr/widget";
import changedetectionio from "./changedetectionio/widget"; import changedetectionio from "./changedetectionio/widget";
import coinmarketcap from "./coinmarketcap/widget"; import coinmarketcap from "./coinmarketcap/widget";
import deluge from "./deluge/widget"; import deluge from "./deluge/widget";
import diskstation from "./diskstation/widget"; import downloadstation from "./downloadstation/widget";
import emby from "./emby/widget"; import emby from "./emby/widget";
import flood from "./flood/widget"; import flood from "./flood/widget";
import gluetun from "./gluetun/widget"; import gluetun from "./gluetun/widget";
@ -56,7 +56,8 @@ const widgets = {
changedetectionio, changedetectionio,
coinmarketcap, coinmarketcap,
deluge, deluge,
diskstation, diskstation: downloadstation,
downloadstation,
emby, emby,
flood, flood,
gluetun, gluetun,

Loading…
Cancel
Save