5.3.0 • Published 3 years ago

@astrouxds/rux-log v5.3.0

Weekly downloads
1,098
License
SEE LICENSE IN LI...
Repository
github
Last release
3 years ago

Log

A Log is a tabular representation of application events and may include username, priority, equipment type, signal type, etc. As part of the Notification System, Logs provide sorting and filtering function for examining events.

Guidelines

Web Components Usage

1. Installation

Install the Astro UXDS Log package via Command Line (Preferred Method)

npm i --save @astrouxds/rux-log

You may use Yarn, NPM, or your Node package manager of choice. The --save flag adds this component as a dependency in your package.json file.

Alternatively, download the Astro UXDS Component Library source to your project.

Via CLI:

git clone https://github.com/RocketCommunicationsInc/astro-components.git

Or, download the Astro UXDS Components as a .zip

2. Import the Astro Log Web Component

This example assumes you're using the NPM package in node_modules. Otherwise, import the component using the path to the Astro Components directory in your project.

import { RuxLog } from '@astrouxds/rux-log/rux-log.js'

3. Render the Astro Log Web Component

Pass an Array of log entries via the data attribute. Log entries must be Objects with a timestamp in JavaScript Date Object format, a status String matching one of the specified Astro UXDS Status values, and a message String:

import { RuxLog } from '@astrouxds/rux-log/rux-log.js';

const myLogData = [
  {
    timestamp: new Date(1557503698781), // date from Unix Time Stamp number
    status: "off",
    message: "Antenna DGS 1 went offline."
  },
  {
    timestamp: new Date('2019-05-10T16:21:12.000Z'), // date from ISO 8601 string format
    status: "serious",
    message: "USA-177 experienced solar panel misalignment."
  },
];

// ...

render() {
	return `<rux-log data="${myLogData}"></rux-log>`;
}

Properties (for the Log component)

PropertyTypeDefaultRequiredDescription
dataArray[]YesAn array of objects to display as log entries.
timezoneString'UTC'NoAccepts IANA timezone string format such as America/Los_Angeles. Default timezone is UTC. See toLocaleString() on MDN for more details.
_filterValueString''NoA string to filter the array to return only the children whose message property contains a case-insensitive substring match.

Sample data Array

;[
    {
        timestamp: new Date(1557503698781), // date from Unix Time Stamp number
        status: 'off',
        message: 'Antenna DGS 1 went offline.',
    },
    {
        timestamp: new Date('2019-05-10T16:21:12.000Z'), // date from ISO 8601 string format
        status: 'serious',
        message: 'USA-177 experienced solar panel misalignment.',
    },
    {
        timestamp: new Date(1557503698781),
        status: 'caution',
        message: 'USA-168 suffered power degradation.',
    },
    {
        timestamp: new Date(1557503698781),
        status: 'standby',
        message: 'Antenna DGS 2 has weak signal.',
    },
    {
        timestamp: new Date(1557503698781),
        status: 'off',
        message: 'Black FEP 121 is offline.',
    },
]

data Array Item Properties

PropertyTypeDefaultRequiredDescription
timestampDateYesA JavaScript Date object which displays a timestamp in the log entry's row. Displays in UTC, 24-hour time by default, configurable in the timezone and locale Astro UXDS Log component properties.
statusStringYesDisplays an icon from the Astro UXDS Status System in the log entry's row. Possible values include 'off', 'standby', 'normal', 'caution', 'serious', and 'critical'
messageStringYesA message which displays in the log entry's row. When a filter is applied to the log, the filter is a case-insensitive substring match against this string.

Revision History

4.0
  • Removed max-lines property. Suggest using flexbox and overflow to control visible lines and scrollable areas of components.
  • Removed locale property. All time displays assume us-EN locale.
  • Renamed entry property to message for data array items.
  • Replaced Polymer 3 implementation with LitElement for improved speed and interoperability with JS Frameworks as well as simpler template declaration now available in vanilla JavaScript.
5.3.0

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.8

4 years ago

4.0.7

4 years ago

4.0.6

4 years ago

4.0.5

4 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

4.0.0-alpha.2

5 years ago

4.0.0-alpha.1

5 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago