mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-06-21 02:09:15 +02:00
Merge pull request #402 from Zareix/feature/portainer-environments
Portainer service - Select environments
This commit is contained in:
commit
9e1e82b0f3
@ -140,6 +140,7 @@ For Prometheus you need to set the type to Prometheus and provide a url.
|
|||||||
This service displays info about the total number of containers managed by your Portainer instance.
|
This service displays info about the total number of containers managed by your Portainer instance.
|
||||||
In order to use it, you must be using Portainer version 1.11 or later. Generate an access token from the UI and pass
|
In order to use it, you must be using Portainer version 1.11 or later. Generate an access token from the UI and pass
|
||||||
it to the apikey field.
|
it to the apikey field.
|
||||||
|
By default, every connected environments will be checked. To select specific ones,add an "environments" entry which can be a simple string or an array containing all the selected environments name.
|
||||||
|
|
||||||
See https://docs.portainer.io/v/ce-2.11/user/account-settings#access-tokens
|
See https://docs.portainer.io/v/ce-2.11/user/account-settings#access-tokens
|
||||||
|
|
||||||
@ -149,6 +150,9 @@ See https://docs.portainer.io/v/ce-2.11/user/account-settings#access-tokens
|
|||||||
url: "http://192.168.0.151/"
|
url: "http://192.168.0.151/"
|
||||||
type: "Portainer"
|
type: "Portainer"
|
||||||
apikey: "MY-SUPER-SECRET-API-KEY"
|
apikey: "MY-SUPER-SECRET-API-KEY"
|
||||||
|
# environments:
|
||||||
|
# - "raspberry"
|
||||||
|
# - "local"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Emby
|
## Emby
|
||||||
|
@ -83,6 +83,12 @@ export default {
|
|||||||
|
|
||||||
let containers = [];
|
let containers = [];
|
||||||
for (let endpoint of this.endpoints) {
|
for (let endpoint of this.endpoints) {
|
||||||
|
if (
|
||||||
|
this.item.environments &&
|
||||||
|
!this.item.environments.includes(endpoint.Name)
|
||||||
|
) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const uri = `/api/endpoints/${endpoint.Id}/docker/containers/json?all=1`;
|
const uri = `/api/endpoints/${endpoint.Id}/docker/containers/json?all=1`;
|
||||||
const endpointContainers = await this.fetch(uri, { headers }).catch(
|
const endpointContainers = await this.fetch(uri, { headers }).catch(
|
||||||
(e) => {
|
(e) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user