fix: scale indicator, logo crop, gateway LAN IP, setup spacing
webapp:
- Scale indicator: replace plain green dot with ⚖️ emoji + colored
status badge (green/amber/grey/red); icon fades out when disconnected;
tap shows a toast with device name + battery level
- Logo images: crop excess transparent padding from logo.png and
logo_icon.png so content fills the frame at small display sizes
- style.css: reworked .scale-status-indicator CSS for emoji+badge
kiosk:
- SetupActivity: use device's real LAN IP for scale_gateway_url
(was hardcoded 127.0.0.1 — only worked if server and kiosk run on
the same machine); added getDeviceLanIp() helper (prefers wlan/eth)
- activity_setup.xml: reduce welcome step padding/margins so step 1
fits on screen without scrolling; text sizes slightly reduced
- activity_setup.xml: fix feature bullet 'Bilancia Bluetooth via
Gateway app' → 'Bilancia BLE integrata (nessuna app esterna)'
- strings.xml (en + it): rewrite all wizard_gateway_* strings to
reflect integrated BLE service instead of external gateway APK
- ic_logo.png: regenerated at all densities from cropped source
This commit is contained in:
@@ -805,6 +805,23 @@ function _scaleUpdateStatus(state) {
|
||||
el.title = labels[state] || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Show a brief toast with the current scale connection status when the icon is tapped.
|
||||
*/
|
||||
function _scaleShowInfo() {
|
||||
const state = _scaleConnected ? 'connected' : 'disconnected';
|
||||
const msgs = {
|
||||
connected: `⚖️ ${t('scale.status_connected')}${_scaleDevice ? ': ' + _scaleDevice : ''}${_scaleBattery != null ? ' 🔋' + _scaleBattery + '%' : ''}`,
|
||||
searching: `⚖️ ${t('scale.status_searching')}`,
|
||||
disconnected: `⚖️ ${t('scale.status_disconnected')}`,
|
||||
error: `⚖️ ${t('scale.status_error')}`,
|
||||
};
|
||||
const el = document.getElementById('scale-status-indicator');
|
||||
const cls = el ? [...el.classList].find(c => c.startsWith('scale-status-') && c !== 'scale-status-indicator') : null;
|
||||
const key = cls ? cls.replace('scale-status-', '') : state;
|
||||
showToast(msgs[key] || msgs[state], key === 'connected' ? 'success' : 'info');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the scale reading modal and wait for a stable weight, then populate the input.
|
||||
* @param {string} targetInputId — ID of the <input> to fill
|
||||
|
||||
Reference in New Issue
Block a user