mirror of
https://github.com/efiten/coredrive-rx.git
synced 2026-11-24 13:27:59 +00:00
android: the deployment card says step by step what to do
Three testers asked what to enter under Settings > Deployment. Until a deployment is chosen the card now stands out (blue, title "First step: choose where your data goes") and lists the steps: open your CoreScope on another screen, open Coverage, scan its QR code or type the address under it. Once chosen it shrinks to one line naming where the app uploads.
This commit is contained in:
1 parent
4d388e0eb8
commit
fb34bd3725
5 files changed
+76
-7
No files matched your search
+19
-1
@@ -81,7 +81,25 @@ Your position never goes over the mesh. It is only sent to CoreScope over the in
|
||||
|
||||
Besides the web app there is an Android app. It works the same, but it does not need Chrome and
|
||||
keeps capturing in the background. On first start it asks for the address of your CoreDrive RX
|
||||
deployment: type it, or scan the QR code on the CoreScope **Coverage** page.
|
||||
deployment: see the next section.
|
||||
|
||||
### Choosing a deployment (Android app)
|
||||
|
||||
The web app always uploads to the CoreScope it came from. The Android app comes from Google Play
|
||||
and does not know which CoreScope you use, so on first start you tell it, under **Settings >
|
||||
Deployment**:
|
||||
|
||||
1. On a computer or another phone, open the CoreScope your MeshCore community uses in a browser.
|
||||
2. In its menu, open **Coverage**. That page shows a QR code with an address under it.
|
||||
3. In the app, tap **Scan QR code** and point the camera at it. With only one phone, type the
|
||||
address under the QR code into the field and tap **Use this deployment**.
|
||||
|
||||
The app checks that address before it switches. Scanning the deployment you already use changes
|
||||
nothing; switching to another one while connected asks first, because the app restarts and the
|
||||
companion disconnects.
|
||||
|
||||
No **Coverage** in the menu, or no QR code on that page? Then that CoreScope does not take
|
||||
CoreDrive data. Ask whoever runs it.
|
||||
|
||||
Use one of the two, not both. Only one app at a time can hold the Bluetooth link to the
|
||||
companion, and each keeps its own queue and login. If you installed the web app to the home
|
||||
|
||||
+22
-4
@@ -28,7 +28,15 @@
|
||||
--updchip-bg: #10283a;
|
||||
--updchip-border: #1d4a6b;
|
||||
--updchip-text: #8cc8ff;
|
||||
--setup-bg: #10283a;
|
||||
--setup-border: #2d6fa3;
|
||||
--setup-text: #cfe6ff;
|
||||
}
|
||||
.card.setup { background: var(--setup-bg); border: 2px solid var(--setup-border); }
|
||||
.card.setup label { color: var(--setup-text); font-size: 16px; font-weight: 600; }
|
||||
.deploysteps { color: var(--setup-text); font-size: 14px; line-height: 1.45; margin: 6px 0 4px; }
|
||||
.deploysteps ol { margin: 6px 0 0 20px; padding: 0; }
|
||||
.deploysteps li { margin: 4px 0; }
|
||||
.updchip { display: none; cursor: pointer; background: var(--updchip-bg); color: var(--updchip-text); border: 1px solid var(--updchip-border); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; overflow-wrap: anywhere; }
|
||||
.bgchip { display: none; cursor: pointer; background: var(--bgchip-bg); color: var(--bgchip-text); border: 1px solid var(--bgchip-border); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
|
||||
dialog.tip { max-width: 420px; width: calc(100% - 48px); box-sizing: border-box; background: var(--tip-bg); color: var(--tip-text); border: 1px solid var(--tip-border); border-radius: 10px; padding: 16px; font-size: 14px; line-height: 1.45; }
|
||||
@@ -156,12 +164,22 @@
|
||||
<div id="view-settings" style="display:none">
|
||||
<!-- Native app only (src/deployment.js): which CoreDrive RX deployment's
|
||||
config.json this app uses. The web app always uses its own. -->
|
||||
<!-- Until a deployment is chosen the card carries .setup and shows the steps; testers
|
||||
did not know what to enter here, and nobody opens the user guide for it. -->
|
||||
<div class="card" id="deployCard" style="display:none">
|
||||
<label for="deployUrl">Deployment</label>
|
||||
<input id="deployUrl" class="txt" type="url" inputmode="url" autocapitalize="off" spellcheck="false" placeholder="https://rx.example.org">
|
||||
<button id="btnDeploy" class="btn2" style="margin-top:8px">Use this deployment</button>
|
||||
<label for="deployUrl" id="deployTitle">Deployment: where your data goes</label>
|
||||
<div class="deploysteps" id="deploySteps" style="display:none">
|
||||
The app needs to know which CoreScope receives your data. You do this once:
|
||||
<ol>
|
||||
<li>On a computer or another phone, open the CoreScope of your MeshCore group in a browser.</li>
|
||||
<li>In its menu, open <b>Coverage</b>. That page shows a QR code with an address under it.</li>
|
||||
<li>Tap <b>Scan QR code</b> below and point the camera at it.<br>Only this phone? Type the address under the QR code into the field and tap <b>Use this deployment</b>.</li>
|
||||
</ol>
|
||||
</div>
|
||||
<button id="btnDeployScan" class="btn2" style="margin-top:8px">📷 Scan QR code</button>
|
||||
<div class="muted" id="deployInfo">The address of the CoreDrive RX web version you upload to. A CoreScope that takes CoreDrive data shows it as a QR code on its Coverage page.</div>
|
||||
<input id="deployUrl" class="txt" type="url" inputmode="url" autocapitalize="off" spellcheck="false" placeholder="https://rx.example.org" style="margin-top:8px">
|
||||
<button id="btnDeploy" class="btn2" style="margin-top:8px">Use this deployment</button>
|
||||
<div class="muted" id="deployInfo"></div>
|
||||
<div class="muted" id="deployMsg" style="color:#ff8b7a"></div>
|
||||
</div>
|
||||
<div class="card">
|
||||
|
||||
+6
-1
@@ -12,7 +12,7 @@ import { updateNotice, parseVersionJson } from './appupdate.js';
|
||||
import { needsBatteryTip, markBatteryTipSeen } from './batterytip.js';
|
||||
import { usableFix, startSpell, endSpell, spellText } from './background.js';
|
||||
import { scanDeployment } from './qrscan.js';
|
||||
import { normalizeDeploymentUrl, readDeployment, saveDeployment, fetchDeploymentConfigText, deploymentChoice, DEPLOY_CACHE_KEY } from './deployment.js';
|
||||
import { normalizeDeploymentUrl, readDeployment, saveDeployment, fetchDeploymentConfigText, deploymentChoice, deploymentCardText, DEPLOY_CACHE_KEY } from './deployment.js';
|
||||
import { parseFrame, PUSH_CODE_LOG_RX_DATA } from './frames.js';
|
||||
import { parsePacket, deriveHeardKey, bytesToHex, isFloodRoute, ADV_TYPE_REPEATER } from './meshpacket.js';
|
||||
import { requestSelfInfo, requestDeviceInfo, setPathHashMode } from './selfinfo.js';
|
||||
@@ -269,6 +269,11 @@ function setupDeployment() {
|
||||
const base = readDeployment(localStorage);
|
||||
els('deployCard').style.display = '';
|
||||
els('deployUrl').value = base;
|
||||
const t = deploymentCardText(base);
|
||||
els('deployCard').classList.toggle('setup', t.setup);
|
||||
els('deployTitle').textContent = t.title;
|
||||
els('deploySteps').style.display = t.setup ? '' : 'none';
|
||||
els('deployInfo').textContent = t.info;
|
||||
if (base) {
|
||||
setConfigSource(async () => {
|
||||
const r = await fetchDeploymentConfigText({ base, httpGet: nativeHttpGet, storage: localStorage });
|
||||
|
||||
@@ -33,6 +33,23 @@ export function readDeployment(storage) {
|
||||
try { return normalizeDeploymentUrl(storage.getItem(DEPLOY_KEY)); } catch (e) { return ''; }
|
||||
}
|
||||
|
||||
// deploymentCardText is what the Settings card says. Without a deployment the card
|
||||
// stands out and shows the steps (index.html #deploySteps); with one it is a single line.
|
||||
export function deploymentCardText(base) {
|
||||
if (!base) {
|
||||
return {
|
||||
setup: true,
|
||||
title: 'First step: choose where your data goes',
|
||||
info: 'No Coverage in the menu, or no QR code on it? Then that CoreScope does not take CoreDrive data: ask whoever runs it.',
|
||||
};
|
||||
}
|
||||
return {
|
||||
setup: false,
|
||||
title: 'Deployment: where your data goes',
|
||||
info: 'Uploads to ' + base + '. To change it, scan the QR code on another CoreScope\'s Coverage page.',
|
||||
};
|
||||
}
|
||||
|
||||
// deploymentChoice decides what choosing `next` does. Switching restarts the app, which
|
||||
// drops the companion link and clears the log, so the same deployment changes nothing
|
||||
// and a different one asks first while connected.
|
||||
|
||||
@@ -2,7 +2,7 @@ import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
normalizeDeploymentUrl, deploymentConfigUrl, readDeployment, saveDeployment,
|
||||
fetchDeploymentConfigText, deploymentChoice, DEPLOY_KEY, DEPLOY_CACHE_KEY,
|
||||
fetchDeploymentConfigText, deploymentChoice, deploymentCardText, DEPLOY_KEY, DEPLOY_CACHE_KEY,
|
||||
} from '../src/deployment.js';
|
||||
import { loadConfig, setConfig, setConfigSource } from '../src/config.js';
|
||||
|
||||
@@ -132,3 +132,14 @@ test('choosing the deployment already in use changes nothing', () => {
|
||||
assert.equal(deploymentChoice('https://rx.on8ar.eu/', 'https://rx.example.org/', false), 'switch');
|
||||
assert.equal(deploymentChoice('', 'https://rx.on8ar.eu/', false), 'switch'); // first choice
|
||||
});
|
||||
|
||||
// Testers did not know what to enter under Settings > Deployment (2026-11-12).
|
||||
test('the deployment card shows the steps until a deployment is chosen', () => {
|
||||
const none = deploymentCardText('');
|
||||
assert.equal(none.setup, true);
|
||||
assert.match(none.title, /First step/);
|
||||
assert.match(none.info, /Coverage/);
|
||||
const set = deploymentCardText('https://rx.on8ar.eu/');
|
||||
assert.equal(set.setup, false);
|
||||
assert.equal(set.info, "Uploads to https://rx.on8ar.eu/. To change it, scan the QR code on another CoreScope's Coverage page.");
|
||||
});
|
||||
Reference in new issue
Block a user