feature: Easier loading of custom-webui icons with simplified paths (#567)
This commit is contained in:
parent
c19428f6b6
commit
765c698a9b
|
|
@ -1,5 +1,10 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var emojis = map[string]string{
|
||||
"poop": "💩",
|
||||
"smile": "😀",
|
||||
|
|
@ -27,5 +32,15 @@ func lookupHTMLIcon(keyToLookup string, defaultIcon string) string {
|
|||
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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,6 +219,10 @@ span.icon {
|
|||
font-size: 3em;
|
||||
}
|
||||
|
||||
span.icon img {
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
.action-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
|
|
|||
Loading…
Reference in New Issue