diff --git a/collector/dash/src/ui.tsx b/collector/dash/src/ui.tsx index 3fb8c95..3bc88b1 100644 --- a/collector/dash/src/ui.tsx +++ b/collector/dash/src/ui.tsx @@ -76,21 +76,16 @@ export function Stat({ label, value, tone }: { label: string; value: ComponentCh ); } -/* Every state gets an icon — device states and job states alike. - Device states are read across a whole shelf at a glance; job states are read - down a long Jobs table, where a column of identical circles differing only - inside is faster to scan than five words of similar length. The word stays - in every pill, so the icon is never the only thing carrying the meaning. */ -const PILL_ICON: Partial> = { - online: "online", - stale: "stale", - offline: "offline", - queued: "queued", - claimed: "claimed", - done: "done", - failed: "failed", - cancelled: "cancelled", -}; +/* Device states get an icon; job states do not. Online/stale/offline are + read across a whole shelf at a glance, job status is read one row at a time. + + icons.tsx does carry a matching set for the job states (queued, claimed, + done, failed, cancelled) — one circle differing only inside, drawn for a + design pass that proposed putting them here. They are deliberately not wired + up: the rule above is the older and the better-argued one, and a pill that + is already a coloured word does not get more legible for gaining a picture. + Add them here if a long Jobs table ever proves otherwise. */ +const PILL_ICON: Partial> = { online: "online", stale: "stale", offline: "offline" }; export const Pill = ({ kind, children }: { kind: string; children?: ComponentChildren }) => { const icon = PILL_ICON[kind]; diff --git a/runner-android/app/src/main/AndroidManifest.xml b/runner-android/app/src/main/AndroidManifest.xml index 515f4ca..81456b9 100644 --- a/runner-android/app/src/main/AndroidManifest.xml +++ b/runner-android/app/src/main/AndroidManifest.xml @@ -18,8 +18,9 @@ diff --git a/runner-android/app/src/main/java/com/taylab/fleetrunner/MainActivity.kt b/runner-android/app/src/main/java/com/taylab/fleetrunner/MainActivity.kt index 2c0a02b..7240462 100644 --- a/runner-android/app/src/main/java/com/taylab/fleetrunner/MainActivity.kt +++ b/runner-android/app/src/main/java/com/taylab/fleetrunner/MainActivity.kt @@ -4,13 +4,20 @@ import android.Manifest import android.os.Build import android.os.Bundle import android.provider.Settings +import android.view.View import android.widget.Button import android.widget.EditText import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat +import androidx.lifecycle.Lifecycle import androidx.lifecycle.lifecycleScope +import com.taylab.fleetrunner.telemetry.Telemetry +import com.taylab.fleetrunner.ui.PulseTraceView +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.isActive import kotlinx.coroutines.launch // Loopback by default, so a fresh clone works over `adb reverse` and an @@ -23,6 +30,26 @@ class MainActivity : AppCompatActivity() { private val prefs by lazy { getSharedPreferences("fleet", MODE_PRIVATE) } + private lateinit var pulse: PulseTraceView + private lateinit var headline: TextView + private lateinit var subtitle: TextView + private lateinit var beaconAge: TextView + private lateinit var liveDot: View + private lateinit var liveLabel: TextView + private lateinit var batteryValue: TextView + private lateinit var batteryMeter: View + private lateinit var thermalValue: TextView + private lateinit var thermalSteps: List + private lateinit var networkValue: TextView + private lateinit var jobCard: View + private lateinit var jobLabel: TextView + private lateinit var jobPill: TextView + private lateinit var jobWorkload: TextView + private lateinit var jobId: TextView + private lateinit var jobElapsed: TextView + private lateinit var urlField: EditText + private lateinit var idField: EditText + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) @@ -45,9 +72,7 @@ class MainActivity : AppCompatActivity() { } } - val urlField = findViewById(R.id.collector_url) - val idField = findViewById(R.id.device_id) - val statusView = findViewById(R.id.status) + bindViews() // `--es base_url http://host:port` lets enrollment point a device at a // collector without rebuilding the app — the whole shelf can be moved @@ -64,9 +89,7 @@ class MainActivity : AppCompatActivity() { } findViewById