fleetfolio/assets.sql

              SELECT 'dynamic' AS component, sqlpage.run_sql('shell/shell.sql') AS properties;
              SELECT 'breadcrumb' as component;
WITH RECURSIVE breadcrumbs AS (
    SELECT
        COALESCE(abbreviated_caption, caption) AS title,
        COALESCE(url, path) AS link,
        parent_path, 0 AS level,
        namespace
    FROM sqlpage_aide_navigation
    WHERE namespace = 'prime' AND path='fleetfolio/assets.sql'
    UNION ALL
    SELECT
        COALESCE(nav.abbreviated_caption, nav.caption) AS title,
        COALESCE(nav.url, nav.path) AS link,
        nav.parent_path, b.level + 1, nav.namespace
    FROM sqlpage_aide_navigation nav
    INNER JOIN breadcrumbs b ON nav.namespace = b.namespace AND nav.path = b.parent_path
)
SELECT title ,      
sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/'||link as link        
FROM breadcrumbs ORDER BY level DESC;
              -- not including page title from sqlpage_aide_navigation
              

                  SELECT 'title' AS component, (SELECT COALESCE(title, caption)
    FROM sqlpage_aide_navigation
   WHERE namespace = 'prime' AND path = 'fleetfolio/assets.sql/index.sql') as contents;
    ;

    -- sets up $limit, $offset, and other variables (use pagination.debugVars() to see values in web-ui)
      --- Dsply Page Title
  SELECT
      'title'   as component,
      'Assets ' contents;
    select
      'text'              as component,
      'Assets refer to a collection of IT resources such as nodes, servers, virtual machines, and other infrastructure components' as contents;

  -- Display dasboard count of physical boundaries
  SELECT 
    'card'                     as component,
    'Physical boundaries' as title,
    4                     as columns;
    select 
        boundary_name  as title,
        'assets.sql?physical_boundary='||boundary_name as link,
        host_count as description
        FROM boundary_asset_count_list;

  

  -- Display dasboard count of logical boundaries
  SELECT 
    'card'                     as component,
    'Logical boundaries' as title,
    4                     as columns;
    select 
        boundary_name  as title,
        'assets.sql?logical_boundary='||boundary_name as link,
        host_count as description
        FROM logical_boundary_asset_count_list;

    -- asset list
SELECT 'table' AS component,
    'host' as markdown,
    TRUE as sort,
    TRUE as search;
SELECT
'[' || host || '](' || sqlpage.environment_variable('SQLPAGE_SITE_PREFIX') || '/fleetfolio/host_detail.sql?host_identifier=' || host_identifier || '&path=direct)' as host,
boundary,
logical_boundary as "logical boundary",
CASE 
    WHEN status = 'Online' THEN '🟢 Online'
    WHEN status = 'Offline' THEN '🔴 Offline'
    ELSE '⚠️ Unknown'
END AS "Status",
osquery_version as "Os query version",
available_space AS "Disk space available",
operating_system AS "Operating System",
osquery_version AS "osQuery Version",
ip_address AS "IP Address",
last_fetched AS "Last Fetched",
last_restarted AS "Last Restarted"
FROM host_list 
WHERE
  CASE
      WHEN $physical_boundary IS NOT NULL THEN boundary LIKE '%'||$physical_boundary||'%'
      WHEN $logical_boundary IS NOT NULL THEN logical_boundary LIKE '%'||$logical_boundary||'%'
      ELSE 1 = 1
  END;
            

;