Compare commits

..

7 Commits

Author SHA1 Message Date
Bjorn Lammers
17cb615947 feat: adds XML tree (#625)
Closes #625
2025-01-05 01:56:24 +01:00
Dashboard Icons Bot
eae46619d4 ci: github-actions: generate file tree 2025-01-05 00:10:13 +00:00
Bjorn Lammers
a0fddd586c fix: move tree.json output to parent folder
Signed-off-by: Bjorn Lammers <bjorn@lammers.media>
2025-01-05 01:07:39 +01:00
Dashboard Icons Bot
118b13aac3 ci: github-actions: generate ICONS.md 2025-01-05 00:03:58 +00:00
Dashboard Icons Bot
55a8791a4e ci: github-actions: convert SVG assets to PNG and WEBP 2025-01-05 00:03:31 +00:00
Bjorn Lammers
a395aaa48c feat(icons): add 7zip (#855) 2025-01-05 01:02:27 +01:00
Bjorn Lammers
8639624179 ci: match commit messages to new guidelines 2025-01-05 00:58:49 +01:00
9 changed files with 177 additions and 14 deletions

View File

@@ -43,6 +43,6 @@ jobs:
git config --global user.email "homarr-labs@proton.me"
git config --global user.name "Dashboard Icons Bot"
git add png/ svg/ webp/
git commit -m ":compression: Compress icons" || exit 0
git commit -m "ci: github-actions: compress icons" || exit 0
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}

View File

@@ -38,7 +38,7 @@ jobs:
git config --global user.email "homarr-labs@proton.me"
git config --global user.name "Dashboard Icons Bot"
git add png/ webp/
git commit -m ":recycle: Convert SVG assets to PNG and WEBP" || exit 0
git commit -m "ci: github-actions: convert SVG assets to PNG and WEBP" || exit 0
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}
@@ -65,8 +65,8 @@ jobs:
run: |
git config --global user.email "homarr-labs@proton.me"
git config --global user.name "Dashboard Icons Bot"
git add tree.json
git commit -m ":construction_worker: Generate file tree" || exit 0
git add tree.json tree.xml
git commit -m "ci: github-actions: generate file tree" || exit 0
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}
@@ -94,6 +94,6 @@ jobs:
git config --global user.email "homarr-labs@proton.me"
git config --global user.name "Dashboard Icons Bot"
git add ICONS.md
git commit -m ":construction_worker: Generate ICONS.md" || exit 0
git commit -m "ci: github-actions: generate ICONS.md" || exit 0
git pull --rebase origin ${{ github.ref_name }}
git push origin HEAD:${{ github.ref_name }}

File diff suppressed because one or more lines are too long

BIN
png/7zip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -1,10 +1,13 @@
import os
import json
import sys
import base64
from pathlib import Path
import re
def generate_folder_tree(paths):
tree = {}
webp_files = []
for path in paths:
resolved_path = Path(path).resolve()
base_folder = resolved_path.name or Path.cwd().name
@@ -13,7 +16,36 @@ def generate_folder_tree(paths):
key = base_folder if relative_path == '.' else os.path.join(base_folder, relative_path)
if files:
tree[key] = sorted(files) # Sort the list of files alphabetically
return tree
# Collect WebP files for XML generation
for file in files:
if file.lower().endswith('.webp'):
webp_files.append(os.path.join(root, file))
return tree, webp_files
def generate_webp_xml(webp_files):
json_obj_list = []
for path in webp_files:
with open(path, "rb") as image_file:
# Encode the WebP image to base64
data = base64.b64encode(image_file.read()).decode('ascii')
# Build the base64 string for data URI
data_string = f"data:image/webp;base64,{data}"
# Extract name from the path
name = Path(path).stem
# Append the base64 encoded WebP data into the list
json_obj_list.append({
"data": data_string,
"w": 48,
"h": 48,
"title": name,
"aspect": "fixed"
})
# Convert to JSON string with no extra spaces for XML output
return json.dumps(json_obj_list, separators=(',', ':'))
if __name__ == "__main__":
# Adjust paths to be one level up
@@ -24,14 +56,24 @@ if __name__ == "__main__":
print("Please provide at least one folder path.")
sys.exit(1)
# Generate the combined folder tree
folder_tree = generate_folder_tree(folder_paths)
# Generate the folder tree and get WebP files
folder_tree, webp_files = generate_folder_tree(folder_paths)
# Write the JSON structure to 'tree.json' in the root folder
# Write the JSON structure to 'tree.json' in the parent folder
root_dir = Path(__file__).resolve().parent
tree_json_path = root_dir / 'tree.json'
tree_json_path = root_dir.parent / 'tree.json'
with open(tree_json_path, 'w') as f:
json.dump(folder_tree, f, indent=4, sort_keys=True) # Sort the keys in the JSON output
print(f"Folder tree successfully written to '{tree_json_path}'.")
print(f"Folder tree successfully written to '{tree_json_path}'.")
# Generate WebP XML
if webp_files:
webp_json = generate_webp_xml(webp_files)
# Write XML structure (with wrapped JSON) to 'tree.xml'
xml_output_path = root_dir.parent / 'tree.xml'
with open(xml_output_path, 'w') as xml_output:
print(f"<mxlibrary>{webp_json}</mxlibrary>", file=xml_output)
print(f"WebP assets successfully written to '{xml_output_path}'.")
else:
print("No WebP files found for XML generation.")

1
svg/7zip.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283 162" xmlns:v="https://vecta.io/nano"><style><![CDATA[.B{stroke:#000}.C{filter:url(#B)}.D{stroke-width:1}.E{fill-rule:evenodd}.F{stroke-width:10}.G{stroke:#fff}]]></style><defs><clipPath id="A"><path d="M49.91 52.76h168.6v51.02c-43.95 52.89-71.73 113.9-74.31 187.4H86.52c2.27-63.39 8.836-125.7 57.68-177.5H49.92v-61z" fill="#fff" class="B D E"/></clipPath><filter id="B" x="-.5" y="-.5" width="4" height="2"><feGaussianBlur stdDeviation="4"/></filter><clipPath id="C"><path d="M415.9 112.7v175.2h36.59V112.7H415.9zM285 113.794v39.94h56.56l-58.78 96.5v38.81h107.6v-38.81H321.6l71-100.9v-35.5H285zm200.7.0625v176.2h39.94v-62.06h26.59c42.59-.1455 43.72-115.5-2.25-114.2H485.7zm37.72 37.72h15.59c17.35-.5945 17.71 38.94 0 36.5l-14.41 1.219-1.188-37.72z" fill="#000" class="B D E"/></clipPath><clipPath id="D"><path d="M0-.0625v345.6h257.8 11.09 334.5v-268.8h-334.5v-76.78H.09z" fill="#000" class="B D"/></clipPath><clipPath id="E"><path transform="rotate(90)" d="M80.59-598.4h261.1v335.7H80.59v-335.7z" fill="#fff" class="B D"/></clipPath><filter id="F" x="-.5" y="-.5" width="2" height="2"><feGaussianBlur stdDeviation="4"/></filter></defs><g transform="matrix(.4697 0 0 .4682 .02562 .221)"><g class="B"><path d="M0-.0625v345.6h257.8 11.09 334.5v-268.8h-334.5v-76.78H.09z"/><path d="M49.91 52.76h168.6v51.02c-43.95 52.89-71.73 113.9-74.31 187.4H86.52c2.27-63.39 8.836-125.7 57.68-177.5H49.92v-61z" fill="#fff" class="E"/></g><g clip-path="url(#A)" fill="none" class="F"><path d="m49.91 52.76h168.6v51.02c-43.95 52.89-71.73 113.9-74.31 187.4" class="C G"/><path d="M144.2 291.2H86.52c2.27-63.39 8.836-125.7 57.68-177.5H49.92v-61" class="B C"/></g><g clip-path="url(#D)" fill="none" class="F"><path d="M603.4 345.6V76.8H268.9V.02H.1" class="C G"/><path d="M0-.0625v345.6h603.39" class="B C"/></g><g transform="matrix(.9942 0 0 .9852 1.514 5.061999999999999)"><g class="B"><path transform="rotate(90)" d="M80.59-598.4h261.1v335.7H80.59v-335.7z" fill="#fff"/><path d="M415.9 112.7v175.2h36.59V112.7H415.9zM285 113.794v39.94h56.56l-58.78 96.5v38.81h107.6v-38.81H321.6l71-100.9v-35.5H285zm200.7.0625v176.2h39.94v-62.06h26.59c42.59-.1455 43.72-115.5-2.25-114.2H485.7zm37.72 37.72h15.59c17.35-.5945 17.71 38.94 0 36.5l-14.41 1.219-1.188-37.72z" class="E"/></g><g clip-path="url(#C)" fill="none" class="F"><path d="M452.5 287.9V112.7h-36.59M390.41 289v-38.81h-68.78l71-100.9v-35.5h-107.6m240.7 176.3v-62.06m26.59 0c42.59-.1455 43.72-115.5-2.25-114.2h-64.28m53.31 74.22l-14.41 1.219-1.188-37.72" class="C G"/><path d="M415.9 112.7v175.2h36.59m-167.5-174.2v39.94h56.56l-58.78 96.5v38.81h107.6m95.34-175.2v176.2h39.94m0-62.06h26.59m-28.81-76.44h15.59c17.35-.5945 17.71 38.94 0 36.5" class="B C"/></g><g clip-path="url(#E)" class="F"><g transform="rotate(90)"><g fill="none"><path d="M80.59-598.4h261.1M80.59-262.7v-335.7" filter="url(#F)" class="G"/><path d="M341.7-598.4v335.7H80.6" filter="url(#F)" class="B"/></g></g></g></g></g></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

121
tree.json
View File

@@ -1,13 +1,22 @@
{
"png": [
"13ft.png",
"1password-dark.png",
"1password.png",
"2fauth-light.png",
"2fauth.png",
"3cx-light.png",
"3cx.png",
"5etools-dark.png",
"5etools.png",
"7zip.png",
"act.png",
"activepieces.png",
"actual-budget.png",
"adblock.png",
"adguard-home.png",
"adminer.png",
"ads-b-exchange.png",
"adventure-log.png",
"affine-light.png",
"affine.png",
@@ -17,11 +26,15 @@
"airvpn.png",
"akkoma-light.png",
"akkoma.png",
"alarmpi.png",
"albert-heijn.png",
"alertmanager.png",
"algo.png",
"aliexpress.png",
"alist.png",
"alloy.png",
"alltube-light.png",
"alltube.png",
"alma-linux.png",
"alpine-linux.png",
"amazon-light.png",
@@ -29,8 +42,15 @@
"amazon-web-services-light.png",
"amazon-web-services.png",
"amazon.png",
"amcrest-cloud.png",
"amcrest.png",
"amd-light.png",
"amd.png",
"ami-alt-light.png",
"ami-alt.png",
"ami.png",
"amp.png",
"ampache.png",
"android-auto-dark.png",
"android-auto.png",
"android-robot.png",
@@ -38,9 +58,12 @@
"anonaddy.png",
"ansible-light.png",
"ansible.png",
"anything-llm-light.png",
"anything-llm.png",
"apache-airflow.png",
"apache-answer.png",
"apache-cassandra.png",
"apache-cloudstack.png",
"apache-druid.png",
"apache-openoffice.png",
"apache-solr.png",
@@ -51,6 +74,7 @@
"apc.png",
"apiscp.png",
"app-store.png",
"appdaemon.png",
"appflowy.png",
"apple-alt.png",
"apple-light.png",
@@ -58,16 +82,27 @@
"apple-tv-plus-light.png",
"apple-tv-plus.png",
"apple.png",
"apprise.png",
"appwrite.png",
"ara-records-ansible.png",
"arch-linux.png",
"archisteamfarm.png",
"archivebox.png",
"archiveteam-warrior-light.png",
"archiveteam-warrior.png",
"arduino.png",
"argo-cd.png",
"ariang.png",
"arm.png",
"artifacthub.png",
"artifactory.png",
"aruba.png",
"asana.png",
"asciinema.png",
"asrock-rack-ipmi.png",
"asrock-rack.png",
"assetgrid.png",
"asterisk.png",
"astral.png",
"astuto-light.png",
"astuto.png",
@@ -78,6 +113,7 @@
"at-t.png",
"atlassian-bamboo.png",
"atlassian-bitbucket.png",
"atlassian-confluence.png",
"atlassian-jira.png",
"atlassian-opsgenie.png",
"atlassian-trello.png",
@@ -93,6 +129,7 @@
"autobrr.png",
"automad-light.png",
"automad.png",
"avg.png",
"avigilon.png",
"avm-fritzbox-light.png",
"avm-fritzbox.png",
@@ -100,6 +137,7 @@
"aws-light.png",
"aws.png",
"awwesome.png",
"awx.png",
"azuracast.png",
"azure-container-instances.png",
"azure-container-service.png",
@@ -189,6 +227,8 @@
"cinny-light.png",
"cinny.png",
"cisco.png",
"claude-ai-light.png",
"claude-ai.png",
"clickhouse.png",
"cloud66.png",
"cloud9-light.png",
@@ -276,6 +316,7 @@
"dlna.png",
"docassemble-light.png",
"docassemble.png",
"docker-amvd.png",
"docker-engine.png",
"docker-mailserver-light.png",
"docker-mailserver.png",
@@ -548,6 +589,7 @@
"haptic.png",
"harbor.png",
"harvester.png",
"hasheous.png",
"hashicorp-boundary.png",
"hashicorp-consul.png",
"hashicorp-nomad.png",
@@ -654,6 +696,7 @@
"jelu.png",
"jenkins.png",
"jetbrains-youtrack.png",
"jfrog.png",
"jio.png",
"jira.png",
"jitsi-meet.png",
@@ -855,6 +898,8 @@
"mongodb.png",
"monica-light.png",
"monica.png",
"moodist-dark.png",
"moodist.png",
"moodle-light.png",
"moodle.png",
"morphos.png",
@@ -1327,6 +1372,7 @@
"sophos.png",
"sourcegraph.png",
"spamassassin.png",
"spark.png",
"sparkleshare.png",
"specifically-clementines.png",
"sphinx-doc.png",
@@ -1380,7 +1426,9 @@
"talos.png",
"tandoor-recipes.png",
"tangerine-ui.png",
"tar1090.png",
"taskcafe.png",
"tasmocompiler.png",
"tasmota-light.png",
"tasmota.png",
"tautulli.png",
@@ -1618,10 +1666,16 @@
"zyxel-networks.png"
],
"svg": [
".DS_Store",
"13ft.svg",
"1password-dark.svg",
"1password.svg",
"2fauth-light.svg",
"2fauth.svg",
"3cx-light.svg",
"3cx.svg",
"5etools-dark.svg",
"5etools.svg",
"7zip.svg",
"act.svg",
"activepieces.svg",
"actual-budget.svg",
@@ -1657,9 +1711,12 @@
"anonaddy.svg",
"ansible-light.svg",
"ansible.svg",
"anything-llm-light.svg",
"anything-llm.svg",
"apache-airflow.svg",
"apache-answer.svg",
"apache-cassandra.svg",
"apache-cloudstack.svg",
"apache-druid.svg",
"apache-openoffice.svg",
"apache-solr.svg",
@@ -1684,9 +1741,13 @@
"argo-cd.svg",
"arm.svg",
"artifacthub.svg",
"artifactory.svg",
"aruba.svg",
"asana.svg",
"asciinema.svg",
"asrock-rack-ipmi.svg",
"asrock-rack.svg",
"assetgrid.png",
"astral.svg",
"astuto-light.svg",
"astuto.svg",
@@ -1697,6 +1758,7 @@
"at-t.svg",
"atlassian-bamboo.svg",
"atlassian-bitbucket.svg",
"atlassian-confluence.svg",
"atlassian-jira.svg",
"atlassian-opsgenie.svg",
"atlassian-trello.svg",
@@ -1712,6 +1774,7 @@
"autobrr.svg",
"automad-light.svg",
"automad.svg",
"avg.svg",
"avigilon.svg",
"avm-fritzbox-light.svg",
"avm-fritzbox.svg",
@@ -1808,6 +1871,8 @@
"cinny-light.svg",
"cinny.svg",
"cisco.svg",
"claude-ai-light.svg",
"claude-ai.svg",
"clickhouse.svg",
"cloud66.svg",
"cloud9-light.svg",
@@ -2167,6 +2232,7 @@
"haptic.svg",
"harbor.svg",
"harvester.svg",
"hasheous.svg",
"hashicorp-boundary.svg",
"hashicorp-consul.svg",
"hashicorp-nomad.svg",
@@ -2273,6 +2339,7 @@
"jelu.svg",
"jenkins.svg",
"jetbrains-youtrack.svg",
"jfrog.svg",
"jio.svg",
"jira.svg",
"jitsi-meet.svg",
@@ -2474,6 +2541,8 @@
"mongodb.svg",
"monica-light.svg",
"monica.svg",
"moodist-dark.svg",
"moodist.svg",
"moodle-light.svg",
"moodle.svg",
"morphos.svg",
@@ -2946,6 +3015,7 @@
"sophos.svg",
"sourcegraph.svg",
"spamassassin.svg",
"spark.svg",
"sparkleshare.svg",
"specifically-clementines.svg",
"sphinx-doc.svg",
@@ -3000,6 +3070,7 @@
"tandoor-recipes.svg",
"tangerine-ui.svg",
"taskcafe.svg",
"tasmocompiler.svg",
"tasmota-light.svg",
"tasmota.svg",
"tautulli.svg",
@@ -3238,13 +3309,22 @@
],
"webp": [
"13ft.webp",
"1password-dark.webp",
"1password.webp",
"2fauth-light.webp",
"2fauth.webp",
"3cx-light.webp",
"3cx.webp",
"5etools-dark.webp",
"5etools.webp",
"7zip.webp",
"act.webp",
"activepieces.webp",
"actual-budget.webp",
"adblock.webp",
"adguard-home.webp",
"adminer.webp",
"ads-b-exchange.webp",
"adventure-log.webp",
"affine-light.webp",
"affine.webp",
@@ -3254,11 +3334,15 @@
"airvpn.webp",
"akkoma-light.webp",
"akkoma.webp",
"alarmpi.webp",
"albert-heijn.webp",
"alertmanager.webp",
"algo.webp",
"aliexpress.webp",
"alist.webp",
"alloy.webp",
"alltube-light.webp",
"alltube.webp",
"alma-linux.webp",
"alpine-linux.webp",
"amazon-light.webp",
@@ -3266,8 +3350,15 @@
"amazon-web-services-light.webp",
"amazon-web-services.webp",
"amazon.webp",
"amcrest-cloud.webp",
"amcrest.webp",
"amd-light.webp",
"amd.webp",
"ami-alt-light.webp",
"ami-alt.webp",
"ami.webp",
"amp.webp",
"ampache.webp",
"android-auto-dark.webp",
"android-auto.webp",
"android-robot.webp",
@@ -3275,9 +3366,12 @@
"anonaddy.webp",
"ansible-light.webp",
"ansible.webp",
"anything-llm-light.webp",
"anything-llm.webp",
"apache-airflow.webp",
"apache-answer.webp",
"apache-cassandra.webp",
"apache-cloudstack.webp",
"apache-druid.webp",
"apache-openoffice.webp",
"apache-solr.webp",
@@ -3288,6 +3382,7 @@
"apc.webp",
"apiscp.webp",
"app-store.webp",
"appdaemon.webp",
"appflowy.webp",
"apple-alt.webp",
"apple-light.webp",
@@ -3295,16 +3390,27 @@
"apple-tv-plus-light.webp",
"apple-tv-plus.webp",
"apple.webp",
"apprise.webp",
"appwrite.webp",
"ara-records-ansible.webp",
"arch-linux.webp",
"archisteamfarm.webp",
"archivebox.webp",
"archiveteam-warrior-light.webp",
"archiveteam-warrior.webp",
"arduino.webp",
"argo-cd.webp",
"ariang.webp",
"arm.webp",
"artifacthub.webp",
"artifactory.webp",
"aruba.webp",
"asana.webp",
"asciinema.webp",
"asrock-rack-ipmi.webp",
"asrock-rack.webp",
"assetgrid.webp",
"asterisk.webp",
"astral.webp",
"astuto-light.webp",
"astuto.webp",
@@ -3315,6 +3421,7 @@
"at-t.webp",
"atlassian-bamboo.webp",
"atlassian-bitbucket.webp",
"atlassian-confluence.webp",
"atlassian-jira.webp",
"atlassian-opsgenie.webp",
"atlassian-trello.webp",
@@ -3330,6 +3437,7 @@
"autobrr.webp",
"automad-light.webp",
"automad.webp",
"avg.webp",
"avigilon.webp",
"avm-fritzbox-light.webp",
"avm-fritzbox.webp",
@@ -3337,6 +3445,7 @@
"aws-light.webp",
"aws.webp",
"awwesome.webp",
"awx.webp",
"azuracast.webp",
"azure-container-instances.webp",
"azure-container-service.webp",
@@ -3426,6 +3535,8 @@
"cinny-light.webp",
"cinny.webp",
"cisco.webp",
"claude-ai-light.webp",
"claude-ai.webp",
"clickhouse.webp",
"cloud66.webp",
"cloud9-light.webp",
@@ -3513,6 +3624,7 @@
"dlna.webp",
"docassemble-light.webp",
"docassemble.webp",
"docker-amvd.webp",
"docker-engine.webp",
"docker-mailserver-light.webp",
"docker-mailserver.webp",
@@ -3785,6 +3897,7 @@
"haptic.webp",
"harbor.webp",
"harvester.webp",
"hasheous.webp",
"hashicorp-boundary.webp",
"hashicorp-consul.webp",
"hashicorp-nomad.webp",
@@ -3891,6 +4004,7 @@
"jelu.webp",
"jenkins.webp",
"jetbrains-youtrack.webp",
"jfrog.webp",
"jio.webp",
"jira.webp",
"jitsi-meet.webp",
@@ -4092,6 +4206,8 @@
"mongodb.webp",
"monica-light.webp",
"monica.webp",
"moodist-dark.webp",
"moodist.webp",
"moodle-light.webp",
"moodle.webp",
"morphos.webp",
@@ -4564,6 +4680,7 @@
"sophos.webp",
"sourcegraph.webp",
"spamassassin.webp",
"spark.webp",
"sparkleshare.webp",
"specifically-clementines.webp",
"sphinx-doc.webp",
@@ -4617,7 +4734,9 @@
"talos.webp",
"tandoor-recipes.webp",
"tangerine-ui.webp",
"tar1090.webp",
"taskcafe.webp",
"tasmocompiler.webp",
"tasmota-light.webp",
"tasmota.webp",
"tautulli.webp",

1
tree.xml Normal file

File diff suppressed because one or more lines are too long

BIN
webp/7zip.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB