mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-25 05:25:52 -07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2163747170 |
@@ -23,7 +23,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: crowdin action
|
||||
uses: crowdin/github-action@9af557de76d70c480f88065d336f445a362f402b # v3.1.0
|
||||
uses: crowdin/github-action@0d5670f539973aea2f01abce61a8989934df0025 # v3.0.2
|
||||
with:
|
||||
upload_translations: false
|
||||
download_translations: true
|
||||
|
||||
@@ -99,14 +99,14 @@ jobs:
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Setup QEMU
|
||||
uses: docker/setup-qemu-action@99012661954931238ded8c8b007157a8430204e1 # v4.4.0
|
||||
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4.3.0
|
||||
|
||||
- name: Setup Docker buildx
|
||||
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
|
||||
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
|
||||
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
# Run Vitest directly so `--shard` is parsed as an option
|
||||
- run: pnpm -s exec vitest run --coverage --shard ${{ matrix.shard }}/4 --pool forks
|
||||
- name: Upload coverage reports to Codecov
|
||||
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
|
||||
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: ./coverage/lcov.info
|
||||
|
||||
@@ -6,7 +6,6 @@ description: Arcane Widget Configuration
|
||||
Learn more about [Arcane](https://github.com/getarcaneapp/arcane).
|
||||
|
||||
**Allowed fields** (max 4): `running`, `stopped`, `total`, `images`, `images_used`, `images_unused`, `image_updates`.
|
||||
|
||||
**Default fields**: `running`, `stopped`, `total`, `image_updates`.
|
||||
|
||||
```yaml
|
||||
@@ -18,4 +17,4 @@ widget:
|
||||
fields: ["running", "stopped", "total", "image_updates"] # optional
|
||||
```
|
||||
|
||||
Using an API key for the widget requires permissions for: `containers:list`, `images:list`, and `image-updates:read`.
|
||||
Using an api key for the widget requires permissions for: `containers:list` `images:list and `image-updates:read`
|
||||
|
||||
@@ -30,8 +30,6 @@ You can also find a list of all available service widgets in the sidebar navigat
|
||||
- [Coin Market Cap](coin-market-cap.md)
|
||||
- [CrowdSec](crowdsec.md)
|
||||
- [Custom API](customapi.md)
|
||||
- [Dashdot](dashdot.md)
|
||||
- [DDNS-Updater](ddns-updater.md)
|
||||
- [Deluge](deluge.md)
|
||||
- [DeveLanCacheUI](develancacheui.md)
|
||||
- [DiskStation](diskstation.md)
|
||||
@@ -117,6 +115,7 @@ You can also find a list of all available service widgets in the sidebar navigat
|
||||
- [Prowlarr](prowlarr.md)
|
||||
- [Proxmox](proxmox.md)
|
||||
- [Proxmox Backup Server](proxmoxbackupserver.md)
|
||||
- [PrusaLink](prusalink.md)
|
||||
- [Pterodactyl](pterodactyl.md)
|
||||
- [PyLoad](pyload.md)
|
||||
- [qBittorrent](qbittorrent.md)
|
||||
|
||||
@@ -11,13 +11,10 @@ const widget = {
|
||||
},
|
||||
issues: {
|
||||
endpoint: "repos/issues/search",
|
||||
map: (data) => {
|
||||
const items = asJson(data);
|
||||
return {
|
||||
pulls: items.filter((issue) => issue.pull_request),
|
||||
issues: items.filter((issue) => !issue.pull_request),
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
pulls: asJson(data).filter((issue) => issue.pull_request),
|
||||
issues: asJson(data).filter((issue) => !issue.pull_request),
|
||||
}),
|
||||
},
|
||||
repositories: {
|
||||
endpoint: "repos/search",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
@@ -8,13 +8,4 @@ describe("gitea widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
});
|
||||
|
||||
it("splits issues and pull requests", () => {
|
||||
const result = widget.mappings.issues.map(
|
||||
Buffer.from(JSON.stringify([{ id: 1, pull_request: {} }, { id: 2 }, { id: 3 }])),
|
||||
);
|
||||
|
||||
expect(result.pulls.map((i) => i.id)).toEqual([1]);
|
||||
expect(result.issues.map((i) => i.id)).toEqual([2, 3]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,13 +8,10 @@ const widget = {
|
||||
mappings: {
|
||||
counters: {
|
||||
endpoint: "feeds/counters",
|
||||
map: (data) => {
|
||||
const { reads, unreads } = asJson(data);
|
||||
return {
|
||||
read: Object.values(reads).reduce((acc, i) => acc + i, 0),
|
||||
unread: Object.values(unreads).reduce((acc, i) => acc + i, 0),
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
read: Object.values(asJson(data).reads).reduce((acc, i) => acc + i, 0),
|
||||
unread: Object.values(asJson(data).unreads).reduce((acc, i) => acc + i, 0),
|
||||
}),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
@@ -8,12 +8,4 @@ describe("miniflux widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
});
|
||||
|
||||
it("sums read and unread counters", () => {
|
||||
const result = widget.mappings.counters.map(
|
||||
Buffer.from(JSON.stringify({ reads: { 1: 2, 2: 3 }, unreads: { 1: 4, 2: 1 } })),
|
||||
);
|
||||
|
||||
expect(result).toEqual({ read: 5, unread: 5 });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { asJson } from "utils/proxy/api-helpers";
|
||||
import { asJson, jsonArrayFilter } from "utils/proxy/api-helpers";
|
||||
import genericProxyHandler from "utils/proxy/handlers/generic";
|
||||
|
||||
const widget = {
|
||||
@@ -8,18 +8,15 @@ const widget = {
|
||||
mappings: {
|
||||
movie: {
|
||||
endpoint: "movie",
|
||||
map: (data) => {
|
||||
const movieData = asJson(data) ?? [];
|
||||
return {
|
||||
wanted: movieData.filter((item) => item.monitored && !item.hasFile && item.isAvailable).length,
|
||||
have: movieData.filter((item) => item.hasFile).length,
|
||||
missing: movieData.filter((item) => item.monitored && !item.hasFile).length,
|
||||
all: movieData.map((entry) => ({
|
||||
title: entry.title,
|
||||
id: entry.id,
|
||||
})),
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
wanted: jsonArrayFilter(data, (item) => item.monitored && !item.hasFile && item.isAvailable).length,
|
||||
have: jsonArrayFilter(data, (item) => item.hasFile).length,
|
||||
missing: jsonArrayFilter(data, (item) => item.monitored && !item.hasFile).length,
|
||||
all: asJson(data).map((entry) => ({
|
||||
title: entry.title,
|
||||
id: entry.id,
|
||||
})),
|
||||
}),
|
||||
},
|
||||
"queue/status": {
|
||||
endpoint: "queue/status",
|
||||
|
||||
@@ -33,27 +33,4 @@ describe("radarr widget config", () => {
|
||||
|
||||
expect(queue.map((entry) => entry.movieId)).toEqual([2, 1]);
|
||||
});
|
||||
|
||||
it("maps movie counts and titles", () => {
|
||||
const movies = widget.mappings.movie.map(
|
||||
Buffer.from(
|
||||
JSON.stringify([
|
||||
{ id: 1, title: "A", monitored: true, hasFile: false, isAvailable: true },
|
||||
{ id: 2, title: "B", monitored: true, hasFile: true },
|
||||
{ id: 3, title: "C", monitored: true, hasFile: false, isAvailable: false },
|
||||
]),
|
||||
),
|
||||
);
|
||||
|
||||
expect(movies).toEqual({
|
||||
wanted: 1,
|
||||
have: 1,
|
||||
missing: 2,
|
||||
all: [
|
||||
{ title: "A", id: 1 },
|
||||
{ title: "B", id: 2 },
|
||||
{ title: "C", id: 3 },
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,13 +8,10 @@ const widget = {
|
||||
mappings: {
|
||||
workers: {
|
||||
endpoint: "workers/status",
|
||||
map: (data) => {
|
||||
const workers = asJson(data).workers_status;
|
||||
return {
|
||||
total_workers: workers.length,
|
||||
active_workers: workers.filter((worker) => !worker.idle).length,
|
||||
};
|
||||
},
|
||||
map: (data) => ({
|
||||
total_workers: asJson(data).workers_status.length,
|
||||
active_workers: asJson(data).workers_status.filter((worker) => !worker.idle).length,
|
||||
}),
|
||||
},
|
||||
pending: {
|
||||
method: "POST",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
@@ -8,12 +8,4 @@ describe("unmanic widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
});
|
||||
|
||||
it("counts total and active workers", () => {
|
||||
const result = widget.mappings.workers.map(
|
||||
Buffer.from(JSON.stringify({ workers_status: [{ idle: true }, { idle: false }, { idle: false }] })),
|
||||
);
|
||||
|
||||
expect(result).toEqual({ total_workers: 3, active_workers: 2 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user