diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml
index 85567e4..d8d5db0 100644
--- a/.github/workflows/build-images.yml
+++ b/.github/workflows/build-images.yml
@@ -1,7 +1,7 @@
name: "Build Images"
on:
release:
- types: [published]
+ types: [ published ]
# FIXME: these variables don't seem to work at all
workflow_call:
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 6e25c7d..69dc566 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -37,42 +37,42 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps:
- - name: Checkout repository
- uses: actions/checkout@v4
+ - name: Checkout repository
+ uses: actions/checkout@v4
- - if: matrix.language == 'go'
- name: Set up Go
- uses: actions/setup-go@v4
- with:
- go-version: '1.21.4'
+ - if: matrix.language == 'go'
+ name: Set up Go
+ uses: actions/setup-go@v4
+ with:
+ go-version: '1.21.4'
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v2
- with:
- languages: ${{ matrix.language }}
- # If you wish to specify custom queries, you can do so here or in a config file.
- # By default, queries listed here will override any specified in a config file.
- # Prefix the list here with "+" to use these queries and those in the config file.
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
- # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
- # queries: security-extended,security-and-quality
+ # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
+ # queries: security-extended,security-and-quality
- # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
- # If this step fails, then you should remove it and run the build manually (see below)
- - name: Autobuild
- uses: github/codeql-action/autobuild@v2
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v2
- # ℹ️ Command-line programs to run using the OS shell.
- # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+ # ℹ️ Command-line programs to run using the OS shell.
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- # If the Autobuild fails above, remove it and uncomment the following three lines.
- # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
+ # If the Autobuild fails above, remove it and uncomment the following three lines.
+ # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
- # - run: |
- # echo "Run, Build Application using script"
- # ./location_of_script_within_repo/buildscript.sh
+ # - run: |
+ # echo "Run, Build Application using script"
+ # ./location_of_script_within_repo/buildscript.sh
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v2
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml
index 1e613fc..2ee76e1 100644
--- a/.github/workflows/go-test.yml
+++ b/.github/workflows/go-test.yml
@@ -1,5 +1,5 @@
name: go-test
-on: [push]
+on: [ push ]
jobs:
build:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2176535..06a077c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -10,25 +10,21 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- -
- name: Checkout
+ - name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- -
- name: Docker Login
+ - name: Docker Login
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- -
- name: Set up Go
+ - name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.4'
cache: true
- -
- name: Run GoReleaser
+ - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
if: success() && startsWith(github.ref, 'refs/tags/')
with:
diff --git a/.goreleaser.yaml b/.goreleaser.yaml
index b49ac35..b61dc4f 100644
--- a/.goreleaser.yaml
+++ b/.goreleaser.yaml
@@ -5,8 +5,7 @@ before:
- go mod tidy
- make build-ui
builds:
- -
- env:
+ - env:
- CGO_ENABLED=0
goos:
- linux
@@ -29,8 +28,7 @@ release:
prerelease: auto
mode: append
archives:
- -
- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
+ - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
dockers:
- image_templates:
- "drewhammond/chefbrowser:{{ .Tag }}"
diff --git a/README.md b/README.md
index 78ddf90..aa891f8 100644
--- a/README.md
+++ b/README.md
@@ -51,7 +51,8 @@ I think the frontend could use some love.
Set `app_mode = development` in your config file to enable developer mode. This mode does the following:
-- Go Templates are loaded from the file system instead of embedded into the backend. They can be changed without recompiling.
+- Go Templates are loaded from the file system instead of embedded into the backend. They can be changed without
+ recompiling.
- CSS/JS links in the HTML are updated to point to the local Vite dev server for live reloading.
Install UI dependencies and start the frontend development server:
@@ -72,7 +73,7 @@ Access the dev server at http://localhost:8080.
CSS/JS changes will trigger automatic rebuilds
as long as you have the frontend development server running.
->Note: Go changes will not be live reloaded. Rebuild backend for changes to take effect.
+> Note: Go changes will not be live reloaded. Rebuild backend for changes to take effect.
## TODO
diff --git a/ui/bootstrap.js b/ui/bootstrap.js
index 80a7d0d..feab4cb 100644
--- a/ui/bootstrap.js
+++ b/ui/bootstrap.js
@@ -1,6 +1,6 @@
import hljs from 'highlight.js/lib/core';
import DOMPurify from 'dompurify';
-import { marked } from 'marked';
+import {marked} from 'marked';
import dayjs from "dayjs";
window.dayjs = dayjs
diff --git a/ui/index.html b/ui/index.html
index 6b5a296..597ed46 100644
--- a/ui/index.html
+++ b/ui/index.html
@@ -1,13 +1,13 @@
-
-
- {{ if index .node.AutomaticAttributes "lsb" }}
- {{ if index .node.AutomaticAttributes "lsb" "description" }}
-
OS:{{ index .node.AutomaticAttributes "lsb" "description" }}
- {{ end }}{{ end }}
- {{ if index .node.AutomaticAttributes "chef_packages"}}
- {{ if index .node.AutomaticAttributes "chef_packages" "chef" }}
- {{ if index .node.AutomaticAttributes "chef_packages" "chef" "version" }}
-
Chef version:{{ index .node.AutomaticAttributes "chef_packages" "chef" "version" }}
- {{ end }}{{ end }}{{ end }}
- {{ if index .node.AutomaticAttributes "ohai_time" }}
-
+
+ {{ if index .node.AutomaticAttributes "lsb" }}
+ {{ if index .node.AutomaticAttributes "lsb" "description" }}
+
OS:{{ index .node.AutomaticAttributes "lsb" "description" }}
+
+ {{ end }}{{ end }}
+ {{ if index .node.AutomaticAttributes "chef_packages"}}
+ {{ if index .node.AutomaticAttributes "chef_packages" "chef" }}
+ {{ if index .node.AutomaticAttributes "chef_packages" "chef" "version" }}
+
Chef version:
+ {{ index .node.AutomaticAttributes "chef_packages" "chef" "version" }}
+ {{ end }}{{ end }}{{ end }}
+ {{ if index .node.AutomaticAttributes "ohai_time" }}
+
-
-{{end}}
+ let flattenedAttrs;
+ for (const [attrClass, attrObj] of Object.entries(attrs)) {
+ let attrTbody = document.getElementById(`${attrClass}-tbody`)
+ let l = []
+ flattenedAttrs = flattenJSON(attrObj, {}, '$.')
+ for (const property in flattenedAttrs) {
+ l.push(`