xcad 4 hónapja
szülő
commit
ec5234f7ca

+ 23 - 0
cli/core/display.py

@@ -307,3 +307,26 @@ class DisplayManager:
                         section_node.add(f"[green]{var_name}[/green] = [yellow]{var_data}[/yellow]")
 
         console.print(tree)
+
+    def display_next_steps(self, next_steps: str, variable_values: dict) -> None:
+        """Display next steps after template generation, rendering them as a Jinja2 template.
+        
+        Args:
+            next_steps: The next_steps string from template metadata (may contain Jinja2 syntax)
+            variable_values: Dictionary of variable values to use for rendering
+        """
+        if not next_steps:
+            return
+        
+        console.print("\n[bold cyan]Next Steps:[/bold cyan]")
+        
+        try:
+            from jinja2 import Template as Jinja2Template
+            next_steps_template = Jinja2Template(next_steps)
+            rendered_next_steps = next_steps_template.render(variable_values)
+            console.print(rendered_next_steps)
+        except Exception as e:
+            logger.warning(f"Failed to render next_steps as template: {e}")
+            # Fallback to plain text if rendering fails
+            console.print(next_steps)
+

+ 1 - 2
cli/core/module.py

@@ -312,8 +312,7 @@ class Module(ABC):
       
       # Display next steps if provided in template metadata
       if template.metadata.next_steps:
-        console.print("\n[bold cyan]Next Steps:[/bold cyan]")
-        console.print(template.metadata.next_steps)
+        self.display.display_next_steps(template.metadata.next_steps, variable_values)
 
     except Exception as e:
       logger.error(f"Error rendering template '{id}': {e}")

+ 71 - 0
library/compose/homer/assets/config.yml.j2

@@ -0,0 +1,71 @@
+---
+# Homepage configuration
+# See https://fontawesome.com/icons for icons options
+
+title: "{{ homer_title | default('My Dashboard') }}"
+subtitle: "{{ homer_subtitle | default('Homer') }}"
+logo: "{{ homer_logo | default('logo.png') }}"
+# icon: "fas fa-home"  # Optional icon instead of logo
+
+header: true
+footer: false  # Set to "<Message>" to enable footer with a custom message
+
+# Optional theme customization
+theme: default  # Options: default, sui
+# colors:
+#   light:
+#     highlight-primary: "#3367d6"
+#     highlight-secondary: "#4285f4"
+#     highlight-hover: "#5a95f5"
+#     background: "#f5f5f5"
+#     card-background: "#ffffff"
+#     text: "#363636"
+#     text-header: "#ffffff"
+#   dark:
+#     highlight-primary: "#3367d6"
+#     highlight-secondary: "#4285f4"
+#     highlight-hover: "#5a95f5"
+#     background: "#131313"
+#     card-background: "#2b2b2b"
+#     text: "#eaeaea"
+#     text-header: "#ffffff"
+
+# Optional message displayed at the top
+# message:
+#   style: "is-dark"  # Options: is-dark, is-warning, is-info, is-success, is-danger
+#   title: "Welcome!"
+#   icon: "fa fa-grin"
+#   content: "This is your Homer dashboard. <br /> Add your services below."
+
+# Optional navbar links
+# links:
+#   - name: "GitHub"
+#     icon: "fab fa-github"
+#     url: "https://github.com"
+#     target: "_blank"  # optional: open in new tab
+#   - name: "Documentation"
+#     icon: "fas fa-book"
+#     url: "https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md"
+
+# Services
+# First level array represents a group.
+# Leave only an "items" key if not using groups (group name, icon & tagstyle are optional)
+services:
+  - name: "Applications"
+    icon: "fas fa-cloud"
+    # items:
+    #   - name: "Example App"
+    #     logo: "assets/tools/sample.png"  # or use "icon: fas fa-server"
+    #     subtitle: "Description of the app"
+    #     tag: "app"  # Optional tag
+    #     tagstyle: "is-success"  # Optional: is-success, is-warning, is-info, is-danger
+    #     url: "https://example.com"
+    #     target: "_blank"  # optional: open in new tab
+
+  # - name: "Monitoring"
+  #   icon: "fas fa-chart-line"
+  #   items:
+  #     - name: "Grafana"
+  #       icon: "fas fa-chart-area"
+  #       subtitle: "Metrics & dashboards"
+  #       url: "https://grafana.example.com"

+ 0 - 82
library/compose/homer/assets/example.config.yml

@@ -1,82 +0,0 @@
----
-# Homepage configuration
-# See https://fontawesome.com/icons for icons options
-
-title: "Demo dashboard"
-subtitle: "Homer"
-logo: "logo.png"
-# icon: "fas fa-skull-crossbones" # Optional icon
-
-header: true
-footer: false
-
-# Optional theme customization
-theme: default
-colors:
-  light:
-    highlight-primary: "#3367d6"
-    highlight-secondary: "#4285f4"
-    highlight-hover: "#5a95f5"
-    background: "#f5f5f5"
-    card-background: "#ffffff"
-    text: "#363636"
-    text-header: "#ffffff"
-    text-title: "#303030"
-    text-subtitle: "#424242"
-    card-shadow: rgba(0, 0, 0, 0.1)
-    link-hover: "#363636"
-  dark:
-    highlight-primary: "#3367d6"
-    highlight-secondary: "#4285f4"
-    highlight-hover: "#5a95f5"
-    background: "#131313"
-    card-background: "#2b2b2b"
-    text: "#eaeaea"
-    text-header: "#ffffff"
-    text-title: "#fafafa"
-    text-subtitle: "#f5f5f5"
-    card-shadow: rgba(0, 0, 0, 0.4)
-    link-hover: "#ffdd57"
-
-# Optional message
-message:
-  # url: https://b4bz.io
-  style: "is-dark"  # See https://bulma.io/documentation/components/message/#colors for styling options.
-  title: "Demo !"
-  icon: "fa fa-grin"
-  content: "This is a dummy homepage demo. <br /> Find more information on <a href='https://github.com/bastienwirtz/homer'>github.com/bastienwirtz/homer</a>"
-
-# Optional navbar
-# links: [] # Allows for navbar (dark mode, layout, and search) without any links
-links:
-  - name: "Contribute"
-    icon: "fab fa-github"
-    url: "https://github.com/bastienwirtz/homer"
-    target: "_blank"  # optional html a tag target attribute
-  - name: "Wiki"
-    icon: "fas fa-book"
-    url: "https://www.wikipedia.org/"
-  # this will link to a second homer page that will load config from additionnal-page.yml and keep default config values as in config.yml file
-  # see url field and assets/additionnal-page.yml.dist used in this example:
-  - name: "another page!"
-    icon: "fas fa-file-alt"
-    url: "#additionnal-page"
-
-# Services
-# First level array represent a group.
-# Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed).
-services:
-  - name: "Applications"
-    icon: "fas fa-cloud"
-    items:
-      - name: "Awesome app"
-        logo: "assets/tools/sample.png"
-        subtitle: "Bookmark example"
-        tag: "app"
-        url: "https://www.reddit.com/r/selfhosted/"
-        target: "_blank"  # optional html a tag target attribute
-      - name: "Another one"
-        logo: "assets/tools/sample2.png"
-        subtitle: "Another application"
-        tag: "app"
-        url: "#"

+ 0 - 8
library/compose/homer/assets/example.custom.css

@@ -1,8 +0,0 @@
-@charset "UTF-8";
-
-/* Custom card colors */
-/* Use with `class:` property of services in config.yml */
-body #app .card.green {
-  background-color: #006600;
-  color: #00ff00;
-}

+ 0 - 64
library/compose/homer/assets/example2.config.yml

@@ -1,64 +0,0 @@
----
-# Homepage configuration
-# See https://fontawesome.com/icons for icons options
-
-title: "Hello beautiful!"
-subtitle: "App dashboard"
-logo: false
-# icon: "fas fa-skull-crossbones" Optional icon
-
-header: true
-
-# Optional theme customization
-theme: sui
-colors:
-  light:
-    highlight-primary: transparent
-    highlight-secondary: transparent
-    highlight-hover: "#4a4a4a"
-    text-subtitle: "#424242"
-  dark:
-    background: "#2B2C56"
-    highlight-primary: transparent
-    highlight-secondary: transparent
-    highlight-hover: "#200b35"
-    text-subtitle: "#6375e8"
-
-# Optional navbar
-# links: [] # Allows for navbar (dark mode, layout, and search) without any links
-links: []
-
-# Services
-# First level array represent a group.
-# Leave only a "items" key if not using group (group name, icon & tagstyle are optional, section separation will not be displayed).
-services:
-  - name: "APPLICATIONS"
-    items:
-      - name: "Jenkins"
-        logo: "assets/tools/jenkins.png"
-        subtitle: "Continuous integration server"
-        url: "https://jenkins.io/"
-      - name: "RabbitMQ Management"
-        logo: "assets/tools/rabbitmq.png"
-        subtitle: "Manage & monitor RabbitMQ server"
-        # Optional tagstyle
-        # Same styling options as the optional message.
-        tagstyle: "is-success"
-        url: "https://www.rabbitmq.com/"
-      - name: "M/Monit"
-        logo: "assets/tools/monit.png"
-        subtitle: "Monitor & manage all monit enabled hosts"
-        url: "https://mmonit.com/monit/"
-      - name: "Grafana"
-        logo: "assets/tools/grafana.png"
-        subtitle: "Metric analytics & dashboards"
-        url: "https://grafana.com/"
-      - name: "Kibana"
-        logo: "assets/tools/elastic.png"
-        subtitle: "Explore & visualize logs"
-        url: "https://www.elastic.co/products/kibana"
-      - name: "Website monitoring"
-        logo: "assets/tools/pingdom.png"
-        subtitle: "Pingdom public reports overview"
-        tag: "CI"
-        url: "https://www.pingdom.com/"

+ 1 - 1
library/compose/homer/compose.yaml.j2

@@ -9,7 +9,7 @@ services:
       - "{{ ports_http | default(8080) }}:8080"
     {% endif %}
     volumes:
-      - /etc/homer/assets/:/www/assets
+      - ./assets:/www/assets
     {% if network_enabled %}
     networks:
       - {{ network_name | default('bridge') }}

+ 49 - 1
library/compose/homer/template.yaml

@@ -2,13 +2,61 @@
 kind: compose
 metadata:
   name: Homer
-  description: Docker compose setup for homer
+  description: >
+    A very simple static homepage for your server to keep your services on hand, from a simple yaml configuration file.
+
+
+    Project: https://github.com/bastienwirtz/homer
+
+    Documentation: https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md
   version: v25.08.1
   author: Christian Lempa
   date: '2025-09-28'
   tags:
     - dashboard
+  next_steps: |
+    1. Start the Homer dashboard:
+       docker compose up -d
+
+    2. Customize your dashboard:
+       - Edit assets/config.yml to add your services
+       - Organize services into groups (Applications, Monitoring, etc.)
+       - Add links to the navbar for quick access
+
+    3. Optional: Add a logo:
+       - Place your logo.png file in the assets/ directory
+       - Or update the logo path in assets/config.yml
+       - Supported formats: PNG, SVG, JPG
+
+    4. Optional: Customize the theme:
+       - Uncomment and modify the colors section in config.yml
+       - Available themes: default, sui
+       - See documentation for advanced theming options
+
+    5. Access your dashboard:
+       {% if traefik_enabled -%}
+       - Via Traefik: https://{{ traefik_host }}
+       {% if ports_enabled %}- Direct access: http://localhost:{{ ports_http }}{% endif %}
+       {%- else -%}
+       - Open http://localhost:{{ ports_http }} in your browser
+       {%- endif %}
+
+    For more information, visit: https://github.com/bastienwirtz/homer/blob/main/docs/configuration.md
 spec:
+  general:
+    vars:
+      homer_title:
+        description: "Dashboard title"
+        type: str
+        default: "My Dashboard"
+      homer_subtitle:
+        description: "Dashboard subtitle"
+        type: str
+        default: "Homer"
+      homer_logo:
+        description: "Logo file path (relative to assets/)"
+        type: str
+        default: "logo.png"
   ports:
     vars:
       ports_http: