From b7d7927b7c3ea49bd8fde48edd11e5d3693238ed Mon Sep 17 00:00:00 2001 From: root Date: Sat, 3 Jun 2023 17:36:08 +0000 Subject: [PATCH] initial commit of the proxmox lists widget --- docs/widgets.md | 59 ++++++++++ src/components/Widgets/Proxmox.vue | 156 ++++++++++++++++++++++++++ src/components/Widgets/WidgetBase.vue | 1 + 3 files changed, 216 insertions(+) create mode 100644 src/components/Widgets/Proxmox.vue diff --git a/docs/widgets.md b/docs/widgets.md index cc9a145065..6dd7c10d9b 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -58,6 +58,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a - [Nextcloud System](#nextcloud-system) - [Nextcloud Stats](#nextcloud-stats) - [Nextcloud PHP OPcache](#nextcloud-php-opcache-stats) + - [Proxmox lists](#proxmox-lists) - [Sabnzbd](#sabnzbd) - [Gluetun VPN Info](#gluetun-vpn-info) - [Drone CI Build](#drone-ci-builds) @@ -1967,6 +1968,64 @@ Shows statistics about PHP OPcache performance on your Nextcloud server. - **Host**: Self-Hosted (see [Nextcloud](https://nextcloud.com)) - **Privacy**: _See [Nextcloud Privacy Policy](https://nextcloud.com/privacy)_ + +--- + +### Proxmox lists + +Shows lists of nodes, containers, and VMs in a Proxmox virtual environment cluster, with a status indicator. + +#### Options +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`cluster_url`** | `string` | Required | The URL of the proxmox cluster server. No trailing `/`. for example: `https://proxmox.lan:8006` +**`user_name`** | `string` | Required | A Proxmox API Username, for example `root@pam` or `dashy@pve`. +**`token_name`** | `string` | Required | A Proxmox API token name. You can get a token in the API section of the cluster management interface. +**`token_uuid`** | `string` | Required | The value of the token entered above. This is normally a UUID. +**`node`** | `string` | optional | A Proxmox node name. If empty or not supplied, a list of nodes will be shown. +**`node_data`** | `string` | optional | This is required if a node is selected, Currently this accepts two values, either `lxc` or `qemu` but the widget can be improved to get other types of data from the Proxmox API. +**`title`** | `string` | optional | A widget title. +**`title_as_link`** | `boolean` | optional | When this is set to anything other than 0 or false, the title will be linked to the value entered in the `cluster_url` option. +**`footer`** | `string` | optional | A widget footer. +**`footer_as_link`** | `boolean` | optional | When this is set to anything other than 0 or false, the title will be linked to the value entered in the `cluster_url` option. +**`hide_templates`** | `boolean` | optional | When this is set to anything other than 0 or false, templates will be filtered out of the result list. + +#### Example +This will show the list of nodes. +```yaml + - type: proxmox-lists + useProxy: true + options: + cluster_url: https://proxmox.lan:8006 + user_name: root@pam + token_name: dashy + token_uuid: bfb152df-abcd-abcd-abcd-ccb95a472d01 +``` +This will show the list of VMs, with a title and a linked fotter, hiding VM templates. +```yaml + - type: proxmox-lists + useProxy: true + options: + cluster_url: https://proxmox.lan:8006 + user_name: root@pam + token_name: dashy + token_uuid: bfb152df-abcd-abcd-abcd-ccb95a472d01 + node: proxmox + node_data: qemu + title: Proxmox VMs + title_as_link: false + footer: Proxmox + footer_as_link: true + hide_templates: 1 +``` +#### Info + +- **CORS**: 🟠 Proxied +- **Auth**: 🟢 Required +- **Price**: 🟢 Free +- **Host**: Self-Hosted (see [Proxmox Virtual Environment](https://proxmox.com/en/proxmox-ve)) +- **Privacy**: _See [Proxmox's Privacy Policy](https://proxmox.com/en/privacy-policy)_ + --- ### Sabnzbd diff --git a/src/components/Widgets/Proxmox.vue b/src/components/Widgets/Proxmox.vue new file mode 100644 index 0000000000..78da0e1844 --- /dev/null +++ b/src/components/Widgets/Proxmox.vue @@ -0,0 +1,156 @@ + + + + + diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index fd6543e717..49b8c6664d 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -99,6 +99,7 @@ const COMPAT = { 'pi-hole-stats': 'PiHoleStats', 'pi-hole-top-queries': 'PiHoleTopQueries', 'pi-hole-traffic': 'PiHoleTraffic', + 'proxmox-lists': 'Proxmox', 'public-holidays': 'PublicHolidays', 'public-ip': 'PublicIp', 'rss-feed': 'RssFeed',