views

package
v0.13.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package views provides HTML templates and view-related functionality for rendering web pages in the Immich Kiosk application.

It includes structures and utilities for managing page data, handling URL queries, and preparing content for browser display.

templ: version: v0.2.793

templ: version: v0.2.793

templ: version: v0.2.793

templ: version: v0.2.793

templ: version: v0.2.793

templ: version: v0.2.793

templ: version: v0.2.793

templ: version: v0.2.793

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clock

func Clock(requestConfig config.Config) templ.Component

func Error

func Error(data ErrorData) templ.Component

func Home

func Home(viewData ViewData) templ.Component

Home renders the main kiosk HTML template

func Image

func Image(viewData ViewData) templ.Component

Image is the main entry point for rendering images. It determines whether to use a single or split view layout based on the number of images, and renders the history form.

Parameters:

  • viewData: ViewData containing all necessary information for rendering the images.

func ImageDateTime added in v0.8.0

func ImageDateTime(viewData ViewData, imageIndex int) string

ImageDateTime generates a formatted date and time string for an image based on the view data settings. It can display date, time, or both, in various formats.

func ImageExif added in v0.8.0

func ImageExif(info immich.ExifInfo) string

ImageExif generates a formatted string of EXIF information for an image. It includes f-number, exposure time, focal length, and ISO if available.

func ImageLocation added in v0.8.0

func ImageLocation(info immich.ExifInfo, hideCountries []string) string

ImageLocation generates a formatted string of the image location based on EXIF information. It combines the city, state, and country information if available.

func RenderImageWithContainFit added in v0.12.0

func RenderImageWithContainFit(ImageData, imageFit string) templ.Component

RenderImageWithContainFit renders an image with "contain" fit style.

Parameters:

  • ImageData: A string containing the image data (typically a URL or base64-encoded image).
  • imageFit: A string specifying the image fit style (unused in this function).

func RenderImageWithCoverFit added in v0.12.0

func RenderImageWithCoverFit(ImageData, imageFit string) templ.Component

RenderImageWithCoverFit renders an image with "cover" fit style.

Parameters:

  • ImageData: A string containing the image data (typically a URL or base64-encoded image).
  • imageFit: A string specifying the image fit style (unused in this function).

func RenderImageWithoutFit added in v0.12.0

func RenderImageWithoutFit(ImageData, imageFit string) templ.Component

RenderImageWithoutFit renders an image without any specific fit style.

Parameters:

  • ImageData: A string containing the image data (typically a URL or base64-encoded image).
  • imageFit: A string specifying the image fit style (unused in this function).

func Weather added in v0.12.0

func Weather(weatherData weather.WeatherLocation) templ.Component

Types

type ErrorData

type ErrorData struct {
	Title   string
	Message string
}

type ImageData added in v0.11.0

type ImageData struct {
	// ImmichImage immich asset data
	ImmichImage immich.ImmichAsset
	// ImageData image as base64 data
	ImageData string
	// ImageData blurred image as base64 data
	ImageBlurData string
	// Date image date
	ImageDate string
}

type ViewData added in v0.11.0

type ViewData struct {
	// KioskVersion the current build version of Kiosk
	KioskVersion string
	// DeviceID unique id for device
	DeviceID string
	// Images the images to display in view
	Images []ImageData
	// URL queries
	Queries url.Values
	// CustomCss
	CustomCss []byte
	// instance config
	config.Config
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL