Changed Gitea Widget, Added Repositories

This commit is contained in:
Florian Stamer 2024-06-08 21:13:01 +02:00
parent e6f2ff970b
commit 5bd604cc0e
52 changed files with 3566 additions and 2814 deletions

View File

@ -5,9 +5,9 @@ description: Gitea Widget Configuration
Learn more about [Gitea](https://gitea.com). Learn more about [Gitea](https://gitea.com).
API token requires `notifications`, `repository` and `issue` permissions. See the [gitea documentation](https://docs.gitea.com/development/api-usage#generating-and-listing-api-tokens) for details on generating tokens. API token requires `repos`,`notifications`, `repository` and `issue` permissions. See the [gitea documentation](https://docs.gitea.com/development/api-usage#generating-and-listing-api-tokens) for details on generating tokens.
Allowed fields: `["notifications", "issues", "pulls"]`. Allowed fields: `["repos","notifications", "issues", "pulls"]`.
```yaml ```yaml
widget: widget:

View File

@ -62,5 +62,6 @@
}, },
"optionalDependencies": { "optionalDependencies": {
"osx-temperature-sensor": "^1.0.8" "osx-temperature-sensor": "^1.0.8"
} },
"packageManager": "pnpm@9.2.0+sha512.98a80fd11c2e7096747762304106432b3ddc67dcf54b5a8c01c93f68a2cd5e05e6821849522a06fb76284d41a2660d5e334f2ee3bbf29183bf2e739b1dafa771"
} }

File diff suppressed because it is too large Load Diff

BIN
public/locales.zip Normal file

Binary file not shown.

View File

@ -840,9 +840,10 @@
"species": "Spesies" "species": "Spesies"
}, },
"gitea": { "gitea": {
"notifications": "Kennisgewings", "repos": "Repositories",
"issues": "Kwessies", "notifications": "Notifications",
"pulls": "Trek Versoeke" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Tonele", "scenes": "Tonele",

View File

@ -840,9 +840,10 @@
"species": "الأنواع" "species": "الأنواع"
}, },
"gitea": { "gitea": {
"notifications": "الإشعارات", "repos": "Repositories",
"issues": "المُشكِلات", "notifications": "Notifications",
"pulls": "طلبات السحب" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "المشاهد", "scenes": "المشاهد",

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,9 +840,10 @@
"species": "Espècies" "species": "Espècies"
}, },
"gitea": { "gitea": {
"notifications": "Notificacions", "repos": "Repositories",
"issues": "Problemes", "notifications": "Notifications",
"pulls": "Sol·licitud de Canvis" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Escenes", "scenes": "Escenes",

View File

@ -840,8 +840,9 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Problémy", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"
}, },
"stash": { "stash": {

View File

@ -840,8 +840,9 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Problemer", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"
}, },
"stash": { "stash": {

View File

@ -840,9 +840,10 @@
"species": "Spezies" "species": "Spezies"
}, },
"gitea": { "gitea": {
"notifications": "Benachrichtigungen", "repos": "Repositories",
"issues": "Probleme", "notifications": "Notifications",
"pulls": "Pull-Requests" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Szenen", "scenes": "Szenen",

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -777,7 +777,7 @@
"ping": "Ping" "ping": "Ping"
}, },
"urbackup": { "urbackup": {
"ok" : "Ok", "ok": "Ok",
"errored": "Errors", "errored": "Errors",
"noRecent": "Out of Date", "noRecent": "Out of Date",
"totalUsed": "Used Storage" "totalUsed": "Used Storage"
@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,9 +840,10 @@
"species": "Especies" "species": "Especies"
}, },
"gitea": { "gitea": {
"notifications": "Notificaciones", "repos": "Repositories",
"issues": "Números", "notifications": "Notifications",
"pulls": "Solicitudes de cambios" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Escenas", "scenes": "Escenas",

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,9 +840,10 @@
"species": "Espèces" "species": "Espèces"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Anomalies", "issues": "Issues",
"pulls": "Demandes de tirage" "pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Scènes", "scenes": "Scènes",

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,9 +840,10 @@
"species": "Vrste" "species": "Vrste"
}, },
"gitea": { "gitea": {
"notifications": "Obavijesti", "repos": "Repositories",
"issues": "Problemi", "notifications": "Notifications",
"pulls": "Zahtjevi za povlačenje" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Scene", "scenes": "Scene",

View File

@ -840,9 +840,10 @@
"species": "Fajok" "species": "Fajok"
}, },
"gitea": { "gitea": {
"notifications": "Üzenetek", "repos": "Repositories",
"issues": "Problémák", "notifications": "Notifications",
"pulls": "Pull request-ek" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Jelenetek", "scenes": "Jelenetek",

View File

@ -840,8 +840,9 @@
"species": "Spesies" "species": "Spesies"
}, },
"gitea": { "gitea": {
"notifications": "Notifikasi", "repos": "Repositories",
"issues": "Isu", "notifications": "Notifications",
"issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"
}, },
"stash": { "stash": {

View File

@ -840,9 +840,10 @@
"species": "Specie" "species": "Specie"
}, },
"gitea": { "gitea": {
"notifications": "Notifiche", "repos": "Repositories",
"issues": "Problemi", "notifications": "Notifications",
"pulls": "Richieste di Pull" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Scene", "scenes": "Scene",

View File

@ -840,9 +840,10 @@
"species": "種" "species": "種"
}, },
"gitea": { "gitea": {
"notifications": "通知", "repos": "Repositories",
"issues": "課題", "notifications": "Notifications",
"pulls": "プルリクエスト" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "シーン", "scenes": "シーン",

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -746,5 +746,11 @@
"physicalRelease": "Physical release", "physicalRelease": "Physical release",
"inCinemas": "In cinemas", "inCinemas": "In cinemas",
"digitalRelease": "Digital release" "digitalRelease": "Digital release"
},
"gitea": {
"repos": "Repositories",
"notifications": "Notifications",
"issues": "Issues",
"pulls": "Pull Requests"
} }
} }

View File

@ -840,8 +840,9 @@
"species": "Soorten" "species": "Soorten"
}, },
"gitea": { "gitea": {
"notifications": "Notificaties", "repos": "Repositories",
"issues": "Problemen", "notifications": "Notifications",
"issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"
}, },
"stash": { "stash": {

View File

@ -840,9 +840,10 @@
"species": "Arter" "species": "Arter"
}, },
"gitea": { "gitea": {
"notifications": "Varslinger", "repos": "Repositories",
"notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Forespørsel" "pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Scener", "scenes": "Scener",

View File

@ -840,9 +840,10 @@
"species": "Gatunki" "species": "Gatunki"
}, },
"gitea": { "gitea": {
"notifications": "Powiadomienia", "repos": "Repositories",
"issues": "Zgłoszenia", "notifications": "Notifications",
"pulls": "Żądania Pull" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Sceny", "scenes": "Sceny",

View File

@ -746,5 +746,11 @@
"physicalRelease": "Physical release", "physicalRelease": "Physical release",
"inCinemas": "In cinemas", "inCinemas": "In cinemas",
"digitalRelease": "Digital release" "digitalRelease": "Digital release"
},
"gitea": {
"repos": "Repositories",
"notifications": "Notifications",
"issues": "Issues",
"pulls": "Pull Requests"
} }
} }

View File

@ -840,8 +840,9 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Problemas", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"
}, },
"stash": { "stash": {

View File

@ -840,9 +840,10 @@
"species": "Espécies" "species": "Espécies"
}, },
"gitea": { "gitea": {
"notifications": "Notificações", "repos": "Repositories",
"issues": "Problemas", "notifications": "Notifications",
"pulls": "Solicitações de Envio" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Cenas", "scenes": "Cenas",

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,9 +840,10 @@
"species": "Виды" "species": "Виды"
}, },
"gitea": { "gitea": {
"notifications": "Уведомления", "repos": "Repositories",
"issues": "Вопросы", "notifications": "Notifications",
"pulls": "Запросы на слияние (Pull Request)" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Сцены", "scenes": "Сцены",

View File

@ -840,9 +840,10 @@
"species": "Druhy" "species": "Druhy"
}, },
"gitea": { "gitea": {
"notifications": "Oznámenia", "repos": "Repositories",
"issues": "Problémy", "notifications": "Notifications",
"pulls": "Pull requesty" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Scény", "scenes": "Scény",

View File

@ -840,9 +840,10 @@
"species": "Vrste" "species": "Vrste"
}, },
"gitea": { "gitea": {
"notifications": "Obvestila", "repos": "Repositories",
"issues": "Težave", "notifications": "Notifications",
"pulls": "Zahteve za prenos" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Scene", "scenes": "Scene",

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,9 +840,10 @@
"species": "Türler" "species": "Türler"
}, },
"gitea": { "gitea": {
"notifications": "Bildirimler", "repos": "Repositories",
"issues": "Sorunlar", "notifications": "Notifications",
"pulls": "Değişiklik İstekleri" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "Sahneler", "scenes": "Sahneler",

View File

@ -840,8 +840,9 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Питання", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"
}, },
"stash": { "stash": {

View File

@ -840,6 +840,7 @@
"species": "Species" "species": "Species"
}, },
"gitea": { "gitea": {
"repos": "Repositories",
"notifications": "Notifications", "notifications": "Notifications",
"issues": "Issues", "issues": "Issues",
"pulls": "Pull Requests" "pulls": "Pull Requests"

View File

@ -840,9 +840,10 @@
"species": "物種" "species": "物種"
}, },
"gitea": { "gitea": {
"notifications": "信息", "repos": "Repositories",
"issues": "出版", "notifications": "Notifications",
"pulls": "提取請求" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "場景", "scenes": "場景",

View File

@ -746,5 +746,11 @@
"physicalRelease": "Physical release", "physicalRelease": "Physical release",
"inCinemas": "In cinemas", "inCinemas": "In cinemas",
"digitalRelease": "Digital release" "digitalRelease": "Digital release"
},
"gitea": {
"repos": "Repositories",
"notifications": "Notifications",
"issues": "Issues",
"pulls": "Pull Requests"
} }
} }

View File

@ -840,9 +840,10 @@
"species": "物种" "species": "物种"
}, },
"gitea": { "gitea": {
"notifications": "通知", "repos": "Repositories",
"issues": "出版", "notifications": "Notifications",
"pulls": "PR" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "场景", "scenes": "场景",

View File

@ -840,9 +840,10 @@
"species": "物種" "species": "物種"
}, },
"gitea": { "gitea": {
"notifications": "信息", "repos": "Repositories",
"issues": "出版", "notifications": "Notifications",
"pulls": "提取請求" "issues": "Issues",
"pulls": "Pull Requests"
}, },
"stash": { "stash": {
"scenes": "場景", "scenes": "場景",

View File

@ -7,23 +7,26 @@ export default function Component({ service }) {
const { data: giteaNotifications, error: giteaNotificationsError } = useWidgetAPI(widget, "notifications"); const { data: giteaNotifications, error: giteaNotificationsError } = useWidgetAPI(widget, "notifications");
const { data: giteaIssues, error: giteaIssuesError } = useWidgetAPI(widget, "issues"); const { data: giteaIssues, error: giteaIssuesError } = useWidgetAPI(widget, "issues");
const { data: giteaRepos, error: giteaReposError } = useWidgetAPI(widget, "repos");
if (giteaNotificationsError || giteaIssuesError) { if (giteaNotificationsError || giteaIssuesError || giteaReposError) {
return <Container service={service} error={giteaNotificationsError ?? giteaIssuesError} />; return <Container service={service} error={giteaNotificationsError ?? giteaIssuesError ?? giteaReposError} />;
} }
if (!giteaNotifications || !giteaIssues) { if (!giteaNotifications || !giteaIssues || !giteaRepos ) {
return ( return (
<Container service={service}> <Container service={service}>
<Block label="gitea.notifications" /> <Block label="gitea.notifications" />
<Block label="gitea.issues" /> <Block label="gitea.issues" />
<Block label="gitea.pulls" /> <Block label="gitea.pulls" />
<Block label="gitea.repos" />
</Container> </Container>
); );
} }
return ( return (
<Container service={service}> <Container service={service}>
<Block label="gitea.repos" value={giteaRepos.data.length} />
<Block label="gitea.notifications" value={giteaNotifications.length} /> <Block label="gitea.notifications" value={giteaNotifications.length} />
<Block label="gitea.issues" value={giteaIssues.issues.length} /> <Block label="gitea.issues" value={giteaIssues.issues.length} />
<Block label="gitea.pulls" value={giteaIssues.pulls.length} /> <Block label="gitea.pulls" value={giteaIssues.pulls.length} />

View File

@ -16,6 +16,9 @@ const widget = {
issues: asJson(data).filter((issue) => !issue.pull_request), issues: asJson(data).filter((issue) => !issue.pull_request),
}), }),
}, },
repos: {
endpoint: "repos/search"
}
}, },
}; };