Updates
This commit is contained in:
parent
7e8e352989
commit
f46b523093
@ -1,3 +1,3 @@
|
||||
# Lavender
|
||||
# mosaic
|
||||
|
||||
Lavendar is a full-featured widget dashboard that is configurable. Right now, it does not have the capability to share across different browsers and devices the configuration. This is planned! Until then, happily plug in your widgets into Lavender for a wonderful experience.
|
||||
Lavendar is a full-featured widget dashboard that is configurable. Right now, it does not have the capability to share across different browsers and devices the configuration. This is planned! Until then, happily plug in your widgets into mosaic for a wonderful experience.
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "lavender",
|
||||
"name": "mosaic",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "lavender",
|
||||
"name": "mosaic",
|
||||
"version": "1.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "lavender",
|
||||
"name": "mosaic",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "npm run build && npm run deploy",
|
||||
"build": "npx tsc && cp -R public dist && npx gulp && npx rollup -c",
|
||||
"deploy": "rm -rf ~/www/html/lavender && cp -R build ~/www/html/lavender",
|
||||
"deploy": "rm -rf ~/www/html/mosaic && cp -R build ~/www/html/mosaic",
|
||||
"clean": "rm -rf build && rm -rf dist",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
@ -1,5 +1,5 @@
|
||||
body {
|
||||
background-color: #967BB6;
|
||||
background-color: #DFCF99;
|
||||
}
|
||||
|
||||
.link-box {
|
||||
|
@ -6,7 +6,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<lavender-configure></lavender-configure>
|
||||
<mosaic-configure></mosaic-configure>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -8,10 +8,10 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<lavender-widgets></lavender-widgets>
|
||||
<mosaic-widgets></mosaic-widgets>
|
||||
<div class="link-box">
|
||||
<a href="./edit.html" class="edit-link" alt="Edit Widgets"><i class="fa-solid fa-pen-to-square"></i></a>
|
||||
<a href="https://rezrov.xyz/caranmegil/lavender" class="edit-link" target="_blank" alt="Source Code"><i class="fa-brands fa-square-git"></i></a>
|
||||
<a href="https://rezrov.xyz/caranmegil/mosaic" class="edit-link" target="_blank" alt="Source Code"><i class="fa-brands fa-square-git"></i></a>
|
||||
</div>
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"short_name": "Lavender",
|
||||
"name": "Lavender Dashboard",
|
||||
"short_name": "Mosaic",
|
||||
"name": "Mosaic",
|
||||
"icons": [
|
||||
{
|
||||
"src": "../images/favicon.png",
|
||||
|
18
src/edit.ts
18
src/edit.ts
@ -1,10 +1,10 @@
|
||||
import { LitElement, css, html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
|
||||
const LAVENDER_WIDGETS = 'lavender-widgets';
|
||||
const mosaic_WIDGETS = 'mosaic-widgets';
|
||||
|
||||
@customElement('lavender-configure')
|
||||
export default class LavenderConfigure extends LitElement {
|
||||
@customElement('mosaic-configure')
|
||||
export default class mosaicConfigure extends LitElement {
|
||||
text = '[]'
|
||||
|
||||
constructor() {
|
||||
@ -91,7 +91,7 @@ export default class LavenderConfigure extends LitElement {
|
||||
const file = event?.target?.files[0];
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
localStorage.setItem(LAVENDER_WIDGETS, reader?.result as string ?? '[]');
|
||||
localStorage.setItem(mosaic_WIDGETS, reader?.result as string ?? '[]');
|
||||
window.location.replace('./index.html');
|
||||
}
|
||||
reader.readAsText(file);
|
||||
@ -102,7 +102,7 @@ export default class LavenderConfigure extends LitElement {
|
||||
const elems = this.shadowRoot?.children ?? null;
|
||||
const widgets = elems ? elems?.item(2)?.children : null;
|
||||
const widgetsLen = widgets ? widgets?.length : 0
|
||||
const lavenderWidgets = [];
|
||||
const mosaicWidgets = [];
|
||||
|
||||
for (let widgetI = 0; widgetI < widgetsLen; widgetI++) {
|
||||
const elem = widgets?.item(widgetI);
|
||||
@ -113,7 +113,7 @@ export default class LavenderConfigure extends LitElement {
|
||||
const url = urlEditElem.value;
|
||||
const height = heightEditElem.value;
|
||||
if (title && title.trim() !== '' && url && url.trim() !== '') {
|
||||
lavenderWidgets.push({
|
||||
mosaicWidgets.push({
|
||||
title,
|
||||
url,
|
||||
height,
|
||||
@ -121,7 +121,7 @@ export default class LavenderConfigure extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
fetch(`CONFIG_STORE_URL?json=${JSON.stringify(lavenderWidgets)}`).then(() => window.location.replace('./index.html'));
|
||||
fetch(`CONFIG_STORE_URL?json=${JSON.stringify(mosaicWidgets)}`).then(() => window.location.replace('./index.html'));
|
||||
}
|
||||
|
||||
override render() {
|
||||
@ -129,7 +129,7 @@ export default class LavenderConfigure extends LitElement {
|
||||
const widgets = JSON.parse(widgetJSON);
|
||||
|
||||
return html`
|
||||
<h1 class="centerit">Lavender Widget Editor</h1>
|
||||
<h1 class="centerit">mosaic Widget Editor</h1>
|
||||
<div class="buttonbar"><button class="button" @click="${async () => await this.save()}">Save</button></div>
|
||||
<div class="widgets">
|
||||
${widgets.map((widget: any) => {
|
||||
@ -156,6 +156,6 @@ export default class LavenderConfigure extends LitElement {
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'lavender-configure': LavenderConfigure;
|
||||
'mosaic-configure': mosaicConfigure;
|
||||
}
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
import { LitElement, css, html } from 'lit';
|
||||
import { customElement } from 'lit/decorators.js';
|
||||
|
||||
@customElement('lavender-widgets')
|
||||
export class LavenderWidgets extends LitElement {
|
||||
@customElement('mosaic-widgets')
|
||||
export class mosaicWidgets extends LitElement {
|
||||
widgets = []
|
||||
|
||||
constructor() {
|
||||
@ -75,7 +75,7 @@ export class LavenderWidgets extends LitElement {
|
||||
|
||||
override render() {
|
||||
return html`
|
||||
<h1 class="centerit">Lavender</h1>
|
||||
<h1 class="centerit">Mosaic</h1>
|
||||
<div class="widgets">
|
||||
${this.widgets.map((widget: any) => {
|
||||
return html`<iframe width="100%" framespacing="0" frameborder="no" style="${widget.height ? `height: ${widget.height}` : ''}" src="${widget.url}" title="${widget.title}">${widget.title}</iframe>`;
|
||||
@ -87,6 +87,6 @@ export class LavenderWidgets extends LitElement {
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'lavender-widgets': LavenderWidgets;
|
||||
'mosaic-widgets': mosaicWidgets;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user