Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c67eb4d2c0 | ||
|
|
e99ee4f774 | ||
|
|
74e6c5c960 | ||
|
|
f801da88a7 | ||
|
|
66dcd1fa34 | ||
|
|
4f9e48cc17 |
@@ -2141,7 +2141,7 @@ Alternatively, you can also define the values within your `glance.yml` via the `
|
|||||||
- type: docker-containers
|
- type: docker-containers
|
||||||
containers:
|
containers:
|
||||||
container_name_1:
|
container_name_1:
|
||||||
title: Container Name
|
name: Container Name
|
||||||
description: Description of the container
|
description: Description of the container
|
||||||
url: https://container.domain.com
|
url: https://container.domain.com
|
||||||
icon: si:container-icon
|
icon: si:container-icon
|
||||||
|
|||||||
@@ -447,6 +447,8 @@ The following helper functions provided by Glance are available:
|
|||||||
- `concat(strings ...string) string`: Concatenates multiple strings together.
|
- `concat(strings ...string) string`: Concatenates multiple strings together.
|
||||||
- `unique(key string, arr []JSON) []JSON`: Returns a unique array of JSON objects based on the given key.
|
- `unique(key string, arr []JSON) []JSON`: Returns a unique array of JSON objects based on the given key.
|
||||||
- `percentChange(current float, previous float) float`: Calculates the percentage change between two numbers.
|
- `percentChange(current float, previous float) float`: Calculates the percentage change between two numbers.
|
||||||
|
- `startOfDay(t time.Time) time.Time`: Returns the start of the day for a given time.
|
||||||
|
- `endOfDay(t time.Time) time.Time`: Returns the end of the day for a given time.
|
||||||
|
|
||||||
The following helper functions provided by Go's `text/template` are available:
|
The following helper functions provided by Go's `text/template` are available:
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,12 @@ func newApplication(c *config) (*application, error) {
|
|||||||
page.DesktopNavigationWidth = page.Width
|
page.DesktopNavigationWidth = page.Width
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for i := range page.HeadWidgets {
|
||||||
|
widget := page.HeadWidgets[i]
|
||||||
|
app.widgetByID[widget.GetID()] = widget
|
||||||
|
widget.setProviders(providers)
|
||||||
|
}
|
||||||
|
|
||||||
for c := range page.Columns {
|
for c := range page.Columns {
|
||||||
column := &page.Columns[c]
|
column := &page.Columns[c]
|
||||||
|
|
||||||
@@ -180,7 +186,6 @@ func newApplication(c *config) (*application, error) {
|
|||||||
for w := range column.Widgets {
|
for w := range column.Widgets {
|
||||||
widget := column.Widgets[w]
|
widget := column.Widgets[w]
|
||||||
app.widgetByID[widget.GetID()] = widget
|
app.widgetByID[widget.GetID()] = widget
|
||||||
|
|
||||||
widget.setProviders(providers)
|
widget.setProviders(providers)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
<meta name="theme-color" content="{{ .Request.Theme.BackgroundColorAsHex }}">
|
<meta name="theme-color" content="{{ .Request.Theme.BackgroundColorAsHex }}">
|
||||||
<link rel="apple-touch-icon" sizes="512x512" href='{{ .App.Config.Branding.AppIconURL }}'>
|
<link rel="apple-touch-icon" sizes="512x512" href='{{ .App.Config.Branding.AppIconURL }}'>
|
||||||
<link rel="manifest" href='{{ .App.VersionedAssetPath "manifest.json" }}'>
|
<link rel="manifest" href='{{ .App.VersionedAssetPath "manifest.json" }}'>
|
||||||
<link rel="icon" type="image/png" href='{{ .App.StaticAssetPath "favicon.png" }}' />
|
|
||||||
<link rel="icon" type="{{ .App.Config.Branding.FaviconType }}" href="{{ .App.Config.Branding.FaviconURL }}" />
|
<link rel="icon" type="{{ .App.Config.Branding.FaviconType }}" href="{{ .App.Config.Branding.FaviconURL }}" />
|
||||||
<link rel="stylesheet" href='{{ .App.StaticAssetPath "css/bundle.css" }}'>
|
<link rel="stylesheet" href='{{ .App.StaticAssetPath "css/bundle.css" }}'>
|
||||||
<style id="theme-style">{{ .Request.Theme.CSS }}</style>
|
<style id="theme-style">{{ .Request.Theme.CSS }}</style>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content-bounds grow{{ if .Page.Width }} content-bounds-{{ .Page.Width }}{{ end }}">
|
<div class="content-bounds grow{{ if .Page.Width }} content-bounds-{{ .Page.Width }}{{ end }}">
|
||||||
<main class="page{{ if .Page.CenterVertically }} page-center-vertically{{ end }}" id="page" aria-live="polite" aria-busy="true">
|
<main class="page{{ if .Page.CenterVertically }} center-vertically{{ end }}" id="page" aria-live="polite" aria-busy="true">
|
||||||
<h1 class="visually-hidden">{{ .Page.Title }}</h1>
|
<h1 class="visually-hidden">{{ .Page.Title }}</h1>
|
||||||
<div class="page-content" id="page-content"></div>
|
<div class="page-content" id="page-content"></div>
|
||||||
<div class="page-loading-container">
|
<div class="page-loading-container">
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<li class="flex thumbnail-parent gap-10 items-center">
|
<li class="flex thumbnail-parent gap-10 items-center">
|
||||||
<img class="video-horizontal-list-thumbnail thumbnail" loading="lazy" src="{{ .ThumbnailUrl }}" alt="">
|
<img class="video-horizontal-list-thumbnail thumbnail" loading="lazy" src="{{ .ThumbnailUrl }}" alt="">
|
||||||
<div class="min-width-0">
|
<div class="min-width-0">
|
||||||
<a class="block text-truncate color-primary-if-not-visited" href="{{ .Url }}" target="_blank" rel="noreferrer">{{ .Title }}</a>
|
<a class="block text-truncate color-primary-if-not-visited" href="{{ .Url | safeURL }}" target="_blank" rel="noreferrer">{{ .Title }}</a>
|
||||||
<ul class="list-horizontal-text flex-nowrap">
|
<ul class="list-horizontal-text flex-nowrap">
|
||||||
<li class="shrink-0" {{ dynamicRelativeTimeAttrs .TimePosted }}></li>
|
<li class="shrink-0" {{ dynamicRelativeTimeAttrs .TimePosted }}></li>
|
||||||
<li class="min-width-0">
|
<li class="min-width-0">
|
||||||
|
|||||||
@@ -509,6 +509,12 @@ var customAPITemplateFuncs = func() template.FuncMap {
|
|||||||
// Shorthand to do both of the above with a single function call
|
// Shorthand to do both of the above with a single function call
|
||||||
return dynamicRelativeTimeAttrs(customAPIFuncParseTimeInLocation(layout, value, time.UTC))
|
return dynamicRelativeTimeAttrs(customAPIFuncParseTimeInLocation(layout, value, time.UTC))
|
||||||
},
|
},
|
||||||
|
"startOfDay": func(t time.Time) time.Time {
|
||||||
|
return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location())
|
||||||
|
},
|
||||||
|
"endOfDay": func(t time.Time) time.Time {
|
||||||
|
return time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 0, t.Location())
|
||||||
|
},
|
||||||
// The reason we flip the parameter order is so that you can chain multiple calls together like this:
|
// The reason we flip the parameter order is so that you can chain multiple calls together like this:
|
||||||
// {{ .JSON.String "foo" | trimPrefix "bar" | doSomethingElse }}
|
// {{ .JSON.String "foo" | trimPrefix "bar" | doSomethingElse }}
|
||||||
// instead of doing this:
|
// instead of doing this:
|
||||||
|
|||||||
Reference in New Issue
Block a user