feat(ui): support custom icons (#20864)

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
This commit is contained in:
Michael Crenshaw
2025-10-02 11:42:35 -04:00
committed by GitHub
parent 1b973b81ef
commit 90b3e856a6
29 changed files with 244 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Users may configure custom resource icons in resource_customizations. This script generates a list of those icons so
# that the UI knows which icons are available.
{
echo "// Code generated by hack/generate-icons-typescript.sh; DO NOT EDIT.";
echo "/* eslint-disable prettier/prettier */";
echo "";
echo "// resourceIconGroups is a map of resource kind globs to whether or not a custom icon exists for that kind.";
echo "// Each glob corresponds to a directory under ui/src/assets/images/resources, where any asterisk is represented as an underscore (_).";
echo "export const resourceIconGroups = {";
find ui/src/assets/images/resources -name icon.svg | sort | sed "s/ui\/src\/assets\/images\/resources\// '/" | sed "s/\/icon.svg/': true,/" | sed 's/_/*/';
echo "};";
} > ui/src/app/applications/components/resource-customizations.ts