Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pre-releases for test devices only.

## 0.3.0-beta.17

- **Style "Glass".** A third look next to Classic dark and light: *System → Appearance → Style*. The same pages, elements, sizes and corners – only the material changes: translucent, blurred panes over a soft aurora background, in a slate dark and a misty light theme (neither black nor white), with all eight accent colours (raised where needed so small accent text stays readable). It covers the classic and the desktop view and the login page; users with web access can pick their own style. Web apps follow it through the app SDK (`data-style="glass"` on `<html>`, a glass variant of `/_shareos/theme.css`). UCI: `shareos.ui.style` (`classic` | `glass`).
- **Devtest images for new models.** A model that is being added is built as `ShareOS-<version>-<model>-devtest.*` until it is tested (status `devtest` in `post-image.sh`, `BOARD_DEVTEST` in `board.sh`): root keeps the password `shareos` instead of being claimed with a button – the buttons of a new model are not known yet – and the overview and the messages say so. The release build refuses such files, so they only come from the build of a pull request. See [docs/DEVICES.md](docs/DEVICES.md#devtest-image-the-first-image-for-a-new-model).
- **Device info** (`http://<box>/deviceinfo`, admins, on every model; not in the menu): everything needed to add a model – flash partitions, CPU, memory, device tree, LEDs, sensors, buttons, GPIOs, serial ports, I2C, USB, network, the U-Boot environment (read only) and the kernel log – as a text file to download or copy. MAC addresses and serial numbers are masked for public issues unless asked for. The same report in the rescue system: `shareos-deviceinfo`.

Expand Down
5 changes: 3 additions & 2 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ The timeline covers the first month, from the start on Friday, 16 Oct to 16 Nov
## The web interface

The default is the dark blue theme with the logo. Light, dark or "same as the
operating system" and the accent colours blue, green, red and white apply to
all users. The logo and the browser icon take on the accent colour; the logo
operating system", the style (*Classic* or *Glass*: the same pages with
translucent panes over a soft mid-tone background) and the accent colours
apply to all users; users with web access can choose their own. The logo and the browser icon take on the accent colour; the logo
can be switched off. Every section with tiles has a switch for a table view at
the right of its heading. The interface is available in German and English.

Expand Down
5 changes: 3 additions & 2 deletions docs/ENTWICKLUNG.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,9 @@ Die Chronik umfasst den ersten Monat, vom Start am Freitag, 16.10., bis zum 16.1
## Die Oberfläche

Standard ist das dunkelblaue Design mit Logo. Hell, Dunkel oder „wie das
Betriebssystem“ sowie die Akzentfarben Blau, Grün, Rot und Weiß gelten für alle
Nutzer. Logo und Browser-Symbol nehmen die Akzentfarbe an, das Logo lässt sich
Betriebssystem“, der Stil (*Classic* oder *Glass*: dieselben Seiten mit
durchscheinenden Flächen über einem weichen, mittelhellen Hintergrund) und die
Akzentfarben gelten für alle Nutzer; Benutzer mit Web-Zugang können eigene wählen. Logo und Browser-Symbol nehmen die Akzentfarbe an, das Logo lässt sich
abschalten. Jeder Bereich mit Kacheln hat rechts in der Kopfzeile einen
Schalter für die Tabellenansicht. Die Oberfläche gibt es auf Deutsch und
Englisch.
Expand Down
3 changes: 2 additions & 1 deletion docs/TESTEN.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ Die Desktop-Ansicht ist ein **Modul**. Die klassische Ansicht bleibt daneben.
- **Admins:** Freigaben → **Dateien** zeigt alle eingehängten Laufwerke: Ordner anlegen, hochladen (auch per Ziehen), herunterladen, umbenennen, verschieben, kopieren, löschen.
- **Benutzer:** Im Benutzerkonto „Dateien“ einschalten. Dann gibt es in „Mein ShareOS“ den Reiter **Dateien** mit dem eigenen Ordner und den Freigaben, für die der Benutzer Rechte hat (ab 0.2.0-beta.6, siehe 14m).
- **Darstellung:** Benutzer mit Web-Zugang stellen unter **Darstellung** Hell/Dunkel und Akzentfarbe für sich ein (seit 0.3.0-beta.6 acht Farben, darunter Grau: Logo, Browser-Symbol und eine offene App ziehen mit). „Wie für alle“ nimmt wieder die Vorgabe des Admins.
- **Stil Glass:** System → Appearance → **Style: Glass** – jede Seite (klassische und Desktop-Ansicht, Anmeldeseite) zeigt durchscheinende, unscharf hinterlegte Flächen über einem weichen Hintergrund, in Dunkel und Hell, mit denselben Elementgrößen und Ecken wie Classic; die Scanline-Option ist ausgeblendet. Zurück auf Classic: der alte Look, unverändert. Ein Benutzer kann einen eigenen Stil wählen; „Wie für alle“ folgt wieder dem Admin.
- Testidee: eine große Datei (z. B. 1 GB) hochladen und wieder herunterladen. Das darf nicht nach 60 s abbrechen.

## 12. Apps (Store)
Expand Down Expand Up @@ -325,7 +326,7 @@ Ab der ersten Version mit Release-Schlüssel auf der Box (*System → Firmware*

- **Webpad 1.1** installieren (Store). Im Dateibrowser steht bei einer `.txt`-Datei **Webpad ↗**; darauf (oder auf den Dateinamen) klicken: Webpad öffnet sich in einem eigenen Fenster mit der Datei.
- Etwas ändern, **Ctrl+S**: Meldung „gespeichert“; der Dateibrowser zeigt neue Größe und Zeit. Besitzer und Rechte der Datei bleiben.
- Aussehen: in ShareOS Hell/Dunkel oder die Akzentfarbe wechseln – eine offene App zieht mit.
- Aussehen: in ShareOS Hell/Dunkel, die Akzentfarbe oder den Stil (Classic/Glass) wechseln – eine offene App zieht mit.
- Benutzer mit persönlichem Ordner können das genauso mit ihren Dateien.

- **Name und Symbole (beta.10):** ShareOS über die IP öffnen (`https://10.241.1.106`). Unter **Apps → Installiert** haben Webpad und WebTerm ihr Symbol. **Öffnen** startet die App unter dem Namen des Zertifikats (`https://shareos.skynet.lan:8444/…`), ohne Zertifikatswarnung. **System → Netzwerk → Name der Box für Links** zeigt den Namen aus dem Zertifikat als Vorschlag; ein eigener Name wird dort gespeichert, leer = automatisch.
Expand Down
3 changes: 2 additions & 1 deletion docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ The desktop view is a **module**. The classic view stays next to it.
- **Admins:** Shares → **Files** shows every mounted drive: create folders, upload (also by dragging), download, rename, move, copy, delete.
- **Users:** enable "Files" in the user account. "My ShareOS" then has a **Files** tab with the own folder and the shares the user has rights to (from 0.2.0-beta.6, see 14m).
- **Look:** users with web access set light/dark and the accent colour for themselves under **Appearance** (eight colours since 0.3.0-beta.6, among them grey: logo, browser icon and an open app take it on). "Same as for everyone" goes back to the admin's choice.
- **Style Glass:** System → Appearance → **Style: Glass** – every page (classic and desktop view, login page) shows translucent, blurred panes over a soft background in dark and light, with the same element sizes and corners as Classic; the scanline option is hidden. Change it back to Classic: the old look, unchanged. A user can pick a style of their own; "Same as for everyone" follows the admin again.
- Test idea: upload a large file (e.g. 1 GB) and download it again. It must not stop after 60 s.

## 12. Apps (store)
Expand Down Expand Up @@ -320,7 +321,7 @@ From the first version with a release key on the box (*System → Firmware* then

- Install **Webpad 1.1** (store). In the file browser a `.txt` file shows **Webpad ↗**; click it (or the file name): Webpad opens in its own window with the file.
- Change something, **Ctrl+S**: the message says "saved"; the file browser shows the new size and time. Owner and rights of the file stay.
- Look: switch light/dark or the accent colour in ShareOS – an open app follows.
- Look: switch light/dark, the accent colour or the style (Classic/Glass) in ShareOS – an open app follows.
- Users with a personal folder can do the same with their files.

- **Name and icons (beta.10):** open ShareOS by its IP (`https://10.241.1.106`). Under **Apps → Installed** Webpad and WebTerm show their icon. **Open** starts the app under the certificate's name (`https://shareos.skynet.lan:8444/…`) without a certificate warning. **System → Network → Box name for links** shows the name from the certificate as suggestion; a name of your own is saved there, empty = automatic.
Expand Down
4 changes: 3 additions & 1 deletion src/shareos-core/etc/config/shareos
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ config ui 'ui'
# language of the web interface for everyone: en, de, ... (www/i18n/)
option lang 'en'
# look for everyone: theme dark | light | system (follows the computer),
# accent blue | green | red | white
# accent blue | green | red | white | grey | violet | orange | teal,
# style classic | glass (translucent panes)
option theme 'dark'
option accent 'blue'
option style 'classic'

config web 'web'
# HTTPS on port 443 (a self-signed certificate is created on first boot)
Expand Down
7 changes: 4 additions & 3 deletions src/shareos-core/parts/rpc/me.uc
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,19 @@ add_methods({

ui_set: {
// own look; null/'' = back to the look for everyone
args: { theme: '', accent: '' },
args: { theme: '', accent: '', style: '' },
call: function(req) {
let u = session_user(req), a = req.args, c = cursor();
if (!u || u == 'root' || c.get('accounts', u) != 'user') return { error: 'session not bound' };
if (a.theme && !(a.theme in { dark: 1, light: 1, system: 1 })) return { error: 'invalid theme' };
if (a.accent && !(a.accent in ACCENTS)) return { error: 'invalid accent' };
for (let k in [ 'theme', 'accent' ]) {
if (a.style && !(a.style in STYLES)) return { error: 'invalid style' };
for (let k in [ 'theme', 'accent', 'style' ]) {
if (!(k in a)) continue;
if (a[k]) c.set('accounts', u, k, a[k]); else c.delete('accounts', u, k);
}
c.commit('accounts');
return { theme: c.get('accounts', u, 'theme') ?? null, accent: c.get('accounts', u, 'accent') ?? null };
return { theme: c.get('accounts', u, 'theme') ?? null, accent: c.get('accounts', u, 'accent') ?? null, style: c.get('accounts', u, 'style') ?? null };
}
},

Expand Down
2 changes: 1 addition & 1 deletion src/shareos-core/parts/rpc/media.uc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function me_info(u) {
info.apps = role == 'admin' || !area_on('apps') ? [] : map(apps_for(u), (a) => ({ id: a.id, name: a.name, entry: a.entry, icon: a.icon, icon_data: a.icon_data, description: a.description,
permissions: a.permissions ?? [], window: a.window, display: a.display }));
info.apps_server = apps_server();
info.ui = u == 'root' ? null : { theme: c.get('accounts', u, 'theme') ?? null, accent: c.get('accounts', u, 'accent') ?? null };
info.ui = u == 'root' ? null : { theme: c.get('accounts', u, 'theme') ?? null, accent: c.get('accounts', u, 'accent') ?? null, style: c.get('accounts', u, 'style') ?? null };
info.fav = fav_of(c, u);
info.paperless = area_on('paperless') && !!c.get('paperless', 'global', 'url') && c.get('paperless', 'global', 'enabled') != '0' && !!home;
return info;
Expand Down
14 changes: 11 additions & 3 deletions src/shareos-core/parts/rpc/web.uc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const THEMES = { dark: 1, light: 1, system: 1 };
// accent colours – also in www-apps/_shareos/app.js (accepted list) and
// www/app.js (ACCENT_NAMES, LOGO_FILTER), palettes in shareos.css and theme.css
const ACCENTS = { blue: 1, green: 1, red: 1, white: 1, grey: 1, violet: 1, orange: 1, teal: 1 };
// styles (material of the panes) – also in www/app.js (STYLE_NAMES) and
// www-apps/_shareos/app.js; the glass style is at the end of shareos.css, desktop.css, theme.css
const STYLES = { classic: 1, glass: 1 };

// modules: system apps with "module" (see shareos-apps) that switch on an
// area of the firmware – tab, "My ShareOS" part, background work. The code
Expand All @@ -35,7 +38,7 @@ function area_on(a) {

function ui_settings() {
let c = cursor();
let theme = c.get('shareos', 'ui', 'theme'), accent = c.get('shareos', 'ui', 'accent');
let theme = c.get('shareos', 'ui', 'theme'), accent = c.get('shareos', 'ui', 'accent'), style = c.get('shareos', 'ui', 'style');
let areas = {};
for (let a in AREAS) areas[a] = c.get('shareos', 'ui', 'area_' + a) != '0';
for (let m in MODULES) areas[m] = module_on(m);
Expand All @@ -44,7 +47,8 @@ function ui_settings() {
logo: (c.get('shareos', 'ui', 'logo') ?? '1') != '0',
areas,
theme: THEMES[theme] ? theme : 'dark',
accent: ACCENTS[accent] ? accent : 'blue'
accent: ACCENTS[accent] ? accent : 'blue',
style: STYLES[style] ? style : 'classic'
};
}

Expand All @@ -58,7 +62,7 @@ add_methods({
},

set: {
args: { lang: '', logo: false, theme: '', accent: '', areas: {} },
args: { lang: '', logo: false, theme: '', accent: '', style: '', areas: {} },
call: function(req) {
let c = cursor();
c.set('shareos', 'ui', 'ui'); // section may be missing in configs from older versions
Expand All @@ -83,6 +87,10 @@ add_methods({
if (!ACCENTS[req.args.accent]) return { error: 'invalid accent' };
c.set('shareos', 'ui', 'accent', req.args.accent);
}
if (req.args.style) {
if (!STYLES[req.args.style]) return { error: 'invalid style' };
c.set('shareos', 'ui', 'style', req.args.style);
}
c.commit('shareos');
if (length(changed)) {
system('/usr/sbin/shareos-cron sync >/dev/null 2>&1');
Expand Down
4 changes: 2 additions & 2 deletions src/shareos-core/parts/web/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async function favSave(args) {
// apps get the look and the address of this interface (for messages) in the URL
function appParams(extra = {}) {
// user: the app SDK keeps the browser storage of the accounts apart
return new URLSearchParams({ theme: effTheme(), accent: S.accent, origin: location.origin, user: S.me?.name || S.user || '', lang: LANG, ...extra }).toString();
return new URLSearchParams({ theme: effTheme(), accent: S.accent, style: S.style, origin: location.origin, user: S.me?.name || S.user || '', lang: LANG, ...extra }).toString();
}
const appLaunchUrl = (a, srv, extra) => `${appUrl(a, srv)}?${appParams(extra)}`;
const appWins = new Set();
Expand Down Expand Up @@ -128,7 +128,7 @@ async function appFrameLoad() {

// tell open app windows and embedded apps about a new look
function themeToApps() {
const msg = { sos: 'theme', theme: effTheme(), accent: S.accent }, origin = appBase(appSrv());
const msg = { sos: 'theme', theme: effTheme(), accent: S.accent, style: S.style }, origin = appBase(appSrv());
for (const w of appWins) { if (w.closed) appWins.delete(w); else try { w.postMessage(msg, origin); } catch (e) { } }
// the app shown in the page and the app windows of the desktop view
for (const f of document.querySelectorAll('#appframe, iframe.dk-app')) try { f.contentWindow?.postMessage(msg, origin); } catch (e) { }
Expand Down
12 changes: 8 additions & 4 deletions src/shareos-core/parts/web/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const S = {
// theme and accent are system-wide (UCI shareos.ui), cached here for the first paint
theme: store.get('theme') || 'dark', // dark | light | system
accent: store.get('accent') || 'blue',
style: store.get('style') === 'glass' ? 'glass' : 'classic', // classic | glass (material of the panes)
scan: store.get('scan') !== '0', // only this browser
views: (() => { try { return JSON.parse(store.get('views') || '{}'); } catch (e) { return {}; } })(),
logo: store.get('logo') !== '0' // global setting (UCI shareos.ui.logo), cached for the login page
Expand Down Expand Up @@ -226,16 +227,19 @@ const LOGO_FILTER = {
const logoFilter = () => LOGO_FILTER[effTheme() === 'light' && LOGO_FILTER[S.accent + '-light'] != null ? S.accent + '-light' : S.accent] || '';
// the accent colours to choose from (order of the swatches)
const ACCENT_NAMES = { blue: 'Blue', teal: 'Teal', green: 'Green', orange: 'Orange', red: 'Red', violet: 'Violet', grey: 'Grey', white: 'White' };
// the styles: the same interface, other material of the panes
const STYLE_NAMES = { classic: 'Classic', glass: 'Glass' };

const MQ_DARK = window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;
function effTheme() { return S.theme === 'system' ? (MQ_DARK && !MQ_DARK.matches ? 'light' : 'dark') : S.theme; }
MQ_DARK?.addEventListener?.('change', () => { if (S.theme === 'system') { applyTheme(); renderHeader(); } });

function applyTheme() {
const app = $('#app');
app.className = 'sos acc-' + S.accent + (effTheme() === 'light' ? ' light' : '') + (S.desk ? ' desk' : '');
app.className = 'sos acc-' + S.accent + (effTheme() === 'light' ? ' light' : '') + (S.style === 'glass' ? ' glass' : '') + (S.desk ? ' desk' : '');
$('.scan', app).hidden = !S.scan;
const bg = getComputedStyle(app).getPropertyValue('--bg').trim();
// the page ground: --ground in the glass style (there --bg is the well inside a pane)
const cs = getComputedStyle(app), bg = (cs.getPropertyValue('--ground') || cs.getPropertyValue('--bg')).trim();
document.body.style.background = bg;
$('meta[name=theme-color]')?.setAttribute('content', bg || '#1b2433');
tintFavicon();
Expand Down Expand Up @@ -264,10 +268,10 @@ function tintFavicon() {
}

async function saveLook(v) {
store.set('theme', S.theme); store.set('accent', S.accent);
store.set('theme', S.theme); store.set('accent', S.accent); store.set('style', S.style);
try {
if (isUser()) S.me.ui = await rpc('shareos.me', 'ui_set', v);
else { await rpc('shareos.ui', 'set', v); S.sysLook = { theme: S.theme, accent: S.accent }; }
else { await rpc('shareos.ui', 'set', v); S.sysLook = { theme: S.theme, accent: S.accent, style: S.style }; }
} catch (e) { toast('Appearance: ' + e.message, true); }
}

Expand Down
6 changes: 3 additions & 3 deletions src/shareos-core/parts/web/deviceinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Object.assign(SYS, {
<button class="btn sm ghost" type="button" data-act="di-reload">Read again</button>
</div>
</div>
${!d || d.loading ? html`<div class="panel"><div class="empty"><div class="spin" style="margin:0"></div><span>Reading …</span></div></div>`
: d.error ? html`<div class="banner">${svg(I.warn)}<span>${d.error}</span></div>`
: html`<pre class="panel" style="white-space:pre-wrap;word-break:break-all;font-size:12px;max-height:60vh;overflow:auto;margin:0">${d.text}</pre>`}
${!d || d.loading ? html`<div class="panel" style="margin-top:16px"><div class="empty"><div class="spin" style="margin:0"></div><span>Reading …</span></div></div>`
: d.error ? html`<div class="banner" style="margin-top:16px">${svg(I.warn)}<span>${d.error}</span></div>`
: html`<pre class="panel" style="white-space:pre-wrap;word-break:break-all;font-size:12px;max-height:60vh;overflow:auto;margin:16px 0 0">${d.text}</pre>`}
</section>`;
}
});
Expand Down
3 changes: 2 additions & 1 deletion src/shareos-core/parts/web/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ async function loadUiSettings() {
S.defaultPw = !!r.default_password;
if (r.theme) { S.theme = r.theme; store.set('theme', r.theme); }
if (r.accent) { S.accent = r.accent; store.set('accent', r.accent); }
S.sysLook = { theme: r.theme || S.theme, accent: r.accent || S.accent };
if (r.style) { S.style = r.style; store.set('style', r.style); }
S.sysLook = { theme: r.theme || S.theme, accent: r.accent || S.accent, style: r.style || S.style };
if (r.lang && r.lang !== LANG) { try { localStorage.setItem('shareos.lang', r.lang); } catch (e) { } return r.lang; }
} catch (e) { }
return LANG;
Expand Down
Loading
Loading