mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 14:18:47 +00:00
Feature: Zabbix service widget (#3905)
Co-Authored-By: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
4c6150a545
commit
44f8e9d4da
10 changed files with 136 additions and 6 deletions
|
@ -79,7 +79,21 @@ By default the key is passed as an `X-API-Key` header. If you need to pass the k
|
|||
|
||||
### `jsonrpcProxyHandler`
|
||||
|
||||
A proxy handler that makes authenticated JSON-RPC requests to the specified API endpoint. Where the endpoint is the method to call.
|
||||
A proxy handler that makes authenticated JSON-RPC requests to the specified API endpoint, either using username + password or an API token.
|
||||
The endpoint is the method to call and queryParams are used as the parameters.
|
||||
|
||||
=== "component.js"
|
||||
|
||||
```js
|
||||
import Container from "components/services/widget/container";
|
||||
import useWidgetAPI from "utils/proxy/use-widget-api";
|
||||
|
||||
export default function Component({ service }) {
|
||||
const { widget } = service;
|
||||
|
||||
const { data, error } = useWidgetAPI(widget, 'trigger', { "triggerids": "14062", "output": "extend", "selectFunctions": "extend" });
|
||||
}
|
||||
```
|
||||
|
||||
=== "widget.js"
|
||||
|
||||
|
@ -93,6 +107,7 @@ A proxy handler that makes authenticated JSON-RPC requests to the specified API
|
|||
mappings: {
|
||||
total: { endpoint: "total" },
|
||||
average: { endpoint: "average" },
|
||||
trigger: { endpoint: "trigger.get" },
|
||||
},
|
||||
};
|
||||
```
|
||||
|
@ -110,6 +125,16 @@ A proxy handler that makes authenticated JSON-RPC requests to the specified API
|
|||
password: your-password
|
||||
```
|
||||
|
||||
```yaml
|
||||
- Your Widget:
|
||||
icon: yourwidget.svg
|
||||
href: https://example.com/
|
||||
widget:
|
||||
type: yourwidget
|
||||
url: http://127.0.0.1:1337
|
||||
key: your-api-token
|
||||
```
|
||||
|
||||
### `synologyProxyHandler`
|
||||
|
||||
A proxy handler that makes authenticated requests to the specified Synology API endpoint. This is used exclusively for Synology DSM services.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue