image

Display images in a dashboard, either from a known, publicly accessible src URL or from a src returned in a SQL query.

Image blocks can be declared as named resources at the top level of a mod, or they can be declared as anonymous blocks inside a dashboard or container, or be re-used inside a dashboard or container by using an image with base = <mod>.image.<image_resource_name>.

Example Usage

image {
src = "https://steampipe.io/images/steampipe_logo_wordmark_color.svg"
alt = "Powerpipe Logo"
width = 2
}

Argument Reference

ArgumentTypeOptional?Description
altStringOptionalAlternative text for the image.
argsMapOptionalA map of arguments to pass to the query.
baseText ReferenceOptionalA reference to a named text resource that this text should source its definition from. title and width can be overridden after sourcing via base.
databaseStringOptionalA database connection string for the database you wish to query. If not specified, the active database will be used.
paramBlockOptionalA param block that defines the parameters that can be passed in to the query. param blocks may only be specified for images that specify the sql argument.
queryQuery ReferenceOptionalA reference to a query resource that defines the query to run. An image may either specify the query argument or the sql argument, but not both.
--search-pathStringOptionalSet a comma-separated list of connections to use as a custom search path for the query
--search-path-prefixStringOptionalSet a comma-separated list of connections to use as a prefix to the current search path for the query.
sqlStringOptionalAn SQL string to provide data for the image. An image may either specify the query argument or the sql argument, but not both.
srcStringOptionalPublicly-accessible URL for the image.
titleStringOptionalA plain text title to display for this image.
widthNumberOptionalThe width as a number of grid units that this item should consume from its parent.

Data Structure

If an image provides a sql query, it supports 2 data structures.

  1. A simple structure where column 1's name is the alt and column 1's value is the image src.
  2. A formal data structure where the column names map to properties of the image.

Simple data structure:

<alt>
<src>

Formal data structure:

More Examples

Via query

image {
sql = <<-EOQ
select
avatar_url as "Avatar"
from
github_user
where
login = 'torvalds'
EOQ
width = 2
}

Dynamic Styling via formal query data structure

image {
sql = <<-EOQ
select
avatar_url as src,
'Avatar' as alt
from
github_user
where
login = 'ken'
EOQ
width = 2
}