Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/homepage/commit/04cccfdd60f4cfe7f229481e8b23ddccc0075208 You should set ROOT_URL correctly, otherwise the web may not work correctly.

Adds azure pipelines widget

Add translation for result and status
remove buildId value translation
Fixes syntax in azure pipelines
hide running status if finished
pull/1701/head
Nitzan Miranda 2 years ago committed by shamoon
parent 2aeb3f4c89
commit 04cccfdd60

@ -664,5 +664,15 @@
"kavita": {
"seriesCount": "Series",
"totalFiles": "Files"
},
"azurePipelines": {
"result": "Result",
"status": "Status",
"buildId": "Build ID",
"succeeded": "Succeeded",
"notStarted": "Not Started",
"failed": "Failed",
"canceled": "Canceled",
"inProgress": "In Progress"
}
}

@ -61,6 +61,9 @@ export default async function credentialedProxyHandler(req, res, map) {
} else {
headers.Authorization = `Basic ${Buffer.from(`${widget.username}:${widget.password}`).toString("base64")}`;
}
}
else if (widget.type === "azurePipelines") {
headers.Authorization = `Basic ${Buffer.from(`$:${widget.key}`).toString("base64")}`;
} else {
headers["X-API-Key"] = `${widget.key}`;
}

@ -0,0 +1,36 @@
import { useTranslation } from "next-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: pipelineData, error: pipelineError } = useWidgetAPI(widget);
if (pipelineError) {
return <Container service={service} error={pipelineError} />;
}
if (!pipelineData || !Array.isArray(pipelineData.value)) {
return (
<Container service={service}>
<Block label="azurePipelines.result" />
<Block label="azurePipelines.buildId" />
</Container>
);
}
return (
<Container service={service}>
{pipelineData.value[0].result ?
<Block label="azurePipelines.result" value={t(`azurePipelines.${pipelineData.value[0].result.toString()}`)} /> :
<Block label="azurePipelines.status" value={t(`azurePipelines.${pipelineData.value[0].status.toString()}`)} />
}
<Block label="azurePipelines.buildId" value= { pipelineData.value[0].id } />
</Container>
);
}

@ -0,0 +1,8 @@
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
const widget = {
api: "https://dev.azure.com/{organization}/{project}/_apis/build/Builds?branchName={branchName}&definitions={definitionId}",
proxyHandler: credentialedProxyHandler,
};
export default widget;

@ -5,6 +5,7 @@ const components = {
audiobookshelf: dynamic(() => import("./audiobookshelf/component")),
authentik: dynamic(() => import("./authentik/component")),
autobrr: dynamic(() => import("./autobrr/component")),
azurePipelines: dynamic(() => import("./azurePipelines/component")),
bazarr: dynamic(() => import("./bazarr/component")),
caddy: dynamic(() => import("./caddy/component")),
changedetectionio: dynamic(() => import("./changedetectionio/component")),

@ -2,6 +2,7 @@ import adguard from "./adguard/widget";
import audiobookshelf from "./audiobookshelf/widget";
import authentik from "./authentik/widget";
import autobrr from "./autobrr/widget";
import azurePipelines from "./azurePipelines/widget";
import bazarr from "./bazarr/widget";
import caddy from "./caddy/widget";
import changedetectionio from "./changedetectionio/widget";
@ -91,6 +92,7 @@ const widgets = {
audiobookshelf,
authentik,
autobrr,
azurePipelines,
bazarr,
caddy,
changedetectionio,

Loading…
Cancel
Save