Code Monkey home page Code Monkey logo

Comments (4)

svilenmarkov avatar svilenmarkov commented on August 19, 2024

Hey,

Admittedly I'm not much into DevOps so I'm not familiar with the different use cases for Docker labels. Could you provide some examples of how they could be used by Glance? Is it just to specify different properties of the config from within your docker compose file?

from glance.

samcro1967 avatar samcro1967 commented on August 19, 2024

Great question. I should have been more specific with an example. The example below automatically adds Gitea to the Plugsy dashboard:

    labels:
      - plugsy.name=Gitea
      - plugsy.category=CI/CD Pipeline
      - plugsy.link=http://local.gitea:3069/
      - plugsy.icon=https://docs.gitea.io/images/gitea.png

A similiar approach could be used to automatically add things to a Glance page with either a bookmark or a monitor:

    labels:
      - galnce.page.name=Links
      - glance.widget.type=monitor
      - glance.widget.name=CI/CD Pipeline
      - glance.widget.sites.title=Gitea
      - glance.widget.sites.url=http://local.gitea:3069/
      - glance.widget.sites.icon=https://docs.gitea.io/images/gitea.png

Glance then monitors docker.sock, detects the new labels when the container is created, and automatically add Gitea to the Links page under the sites for the CI/CD Pipeline monitor.

from glance.

svilenmarkov avatar svilenmarkov commented on August 19, 2024

Thanks for providing some examples!

I'm not sure whether doing this in Glance is very practical as the configuration is fairly deep in terms of nesting and position dependent. With your example from above it's not easy to derive where the widget should get placed - which page, column, order, etc. It would probably have to look more like this, which is quite verbose and ugly:

glance.page[0].name=Links
glance.page[0].columns[0].widgets[0].type=monitor
glance.page[0].columns[0].widgets[0].sites[0].title=Gitea
glance.page[0].columns[0].widgets[0].sites[0].url=http://local.gitea:3069/
glance.page[0].columns[0].widgets[0].sites[0].icon=https://docs.gitea.io/images/gitea.png

from glance.

samcro1967 avatar samcro1967 commented on August 19, 2024

When I have seen this implemented with other apps, there would still be a glance.yml file where the "stub" and manual entries would be added. You would use the labels to determine where the stub is and add them there. You would know which page and widget to add them to from the labels. Order would have to be worked out. Do you just add them at the end, sort alphabetically by default (my preference), add a property to monitor and bookmarks so users can specify order manually themselves, give multiple sorting options, etc.

In the example below, a container would just be added right after the Router entry below with the labels I suggested above.

pages:
  - name: Home
    columns:
      - size: small
        widgets:
          - type: search
            search-engine: google
            bangs:
              - title: YouTube
                shortcut: "!yt"
                url: https://www.youtube.com/results?search_query={QUERY}
          - type: clock
            hour-format: 24h
            timezones:
              - timezone: America/New_York
                label: Eastern
              - timezone: America/Denver
                label: Mountain
              - timezone: America/Los_Angeles
                label: Pacific

          - type: calendar

      - size: full
        widgets:

          - type: rss
            limit: 10
            collapse-after: 3
            cache: 3h
            feeds:
              - url: https://lifehacker.com/rss
                title: Lifehacker
              - url: http://feeds.wired.com/wired/index
                title: Wired

          - type: videos
            channels:
              - UCVy16RS5eEDh8anP8j94G2A # DB Tech

          - type: reddit
            subreddit: selfhosted

      - size: small
        widgets:
          - type: weather
            units: imperial
            hour-format: 12h
            location: Chicago, United States

          - type: markets
            markets:
              - symbol: NDAQ
                name: NASDAQ
              - symbol: ICE
                name: NYSE
              - symbol: SPY
                name: S&P 500
              - symbol: DIA
                name: DJIA

  - name: Links
    columns:
      - size: small
        widgets:
          - type: monitor
            style: dynamic-columns-experimental
            cache: 1m
            title: CI/CD Pipeline
            sites:
              - title: Router
                url: http://192.168.1.1

from glance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.