| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package config
- import (
- "fmt"
- "strings"
- )
- var emojis = map[string]string{
- "poop": "💩",
- "smile": "😀",
- "ping": "📡",
- "backup": "💾",
- "reboot": "🔄",
- "restart": "🔄",
- "box": "📦",
- "ashtonished": "😲",
- "clock": "🕒",
- "disk": "💽",
- "logs": "🔍",
- "light": "💡",
- "robot": "🤖",
- "ssh": "🔐",
- "theme": "🎨",
- }
- func lookupHTMLIcon(keyToLookup string, defaultIcon string) string {
- if keyToLookup == "" {
- return defaultIcon
- }
- if emoji, found := emojis[keyToLookup]; found {
- return emoji
- }
- keyToLookup = expandShortPathToFullPath(keyToLookup)
- return keyToLookup
- }
- func expandShortPathToFullPath(keyToLookup string) string {
- if strings.Contains(keyToLookup, "/") && !strings.HasPrefix(keyToLookup, "<") {
- return fmt.Sprintf("<img src = \"/custom-webui/%s\" />", keyToLookup)
- }
- return keyToLookup
- }
|