# j-Console

> j-Console: easy usage; singleton

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 6fa2d1fc1e00c079f77751851d7e29f10ea1e9cfdd8ecd359265a2454f46b960
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- singleton
- supports app tabs
- supports __dark mode__

__Configuration__:

- `datasource {String}` a path to data-source (learn from example)
- __NEW__ `clear {String}` clear logs, link to the `function(source)`

__Good to know__:

- `path` can be `{String}` with the `appid` due to focusing logs

Use it with `<ui-component name="console">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<style>
	body { background-color: #D0D0D0; }
</style>

<ui-component name="console" path="visible" config="datasource:logs"></ui-component>

<script>

	var visible = true;
	var logs = {};

	logs['app1'] = { icon: 'cog', name: 'Settings', encode: false, items: [{ type: 'info', body: 'Lorem <b>ipsum</b> dolor sit amet, consectetur adipisicing elit. Soluta, ea.' }, { type: 'error', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, ea.' }] };
	logs['app2'] = { icon: 'cloud', items: [{ type: 'warning', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, ea.' }, { type: 'success', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, ea.' }] };

	// 2 seconds delay
	PUSH('logs.app1.items', { type: 'warning', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic, tempora.' }, 2000);

</script>
```
