From a5842201c0f0c78611fed115e0bf0acce0905b0f Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Thu, 3 Sep 2026 10:36:52 +0200 Subject: [PATCH] The cards that open the charger get a card of their own Co-Authored-By: Claude Opus 5 --- Web App/web/src/i18n/da.json | 6 ++ Web App/web/src/i18n/en.json | 6 ++ Web App/web/src/i18n/pl.json | 6 ++ Web App/web/src/views/Charging.vue | 98 +++++++++++++++++++++++++++++- 4 files changed, 114 insertions(+), 2 deletions(-) diff --git a/Web App/web/src/i18n/da.json b/Web App/web/src/i18n/da.json index bb4d0aa..50ffda2 100644 --- a/Web App/web/src/i18n/da.json +++ b/Web App/web/src/i18n/da.json @@ -64,6 +64,12 @@ "idle": "Oplader ikke", "idleHint": "Tilslut ved en station for at starte en session." }, + "rfid": { + "title": "RFID-kortindstillinger", + "none": "Ingen kort er godkendt til denne lader.", + "unsupported": "Tjenesten, som denne lader kommer fra, rapporterer ikke RFID-kort.", + "readOnly": "Kort tilføjes og fjernes i Anker-appen. Ankers endpoints til det er udokumenterede, så DriverVault læser listen i stedet for at gætte sig til en skrivning." + }, "stations": { "heading": "I nærheden", "homeHeading": "Dine ladere", diff --git a/Web App/web/src/i18n/en.json b/Web App/web/src/i18n/en.json index 128b655..1511945 100644 --- a/Web App/web/src/i18n/en.json +++ b/Web App/web/src/i18n/en.json @@ -333,6 +333,12 @@ "rawTitle": "As the service reports it", "rawHint": "Every other field the service sent about this charger, under its own field names. They are undocumented, so they are shown as they arrive rather than renamed." }, + "rfid": { + "title": "RFID cards settings", + "none": "No cards are authorised on this charger.", + "unsupported": "The service this charger came from does not report RFID cards.", + "readOnly": "Cards are added and removed in the Anker app. Anker's endpoints for that are undocumented, so DriverVault reads the list rather than guessing at a write." + }, "stations": { "heading": "Nearby", "homeHeading": "Your chargers", diff --git a/Web App/web/src/i18n/pl.json b/Web App/web/src/i18n/pl.json index e93253c..6bea1cb 100644 --- a/Web App/web/src/i18n/pl.json +++ b/Web App/web/src/i18n/pl.json @@ -64,6 +64,12 @@ "idle": "Brak ładowania", "idleHint": "Podłącz na stacji, aby rozpocząć sesję." }, + "rfid": { + "title": "Ustawienia kart RFID", + "none": "Na tej ładowarce nie autoryzowano żadnej karty.", + "unsupported": "Usługa, z której pochodzi ta ładowarka, nie zgłasza kart RFID.", + "readOnly": "Karty dodaje się i usuwa w aplikacji Anker. Endpointy Ankera do tego są nieudokumentowane, więc DriverVault odczytuje listę, zamiast zgadywać zapis." + }, "stations": { "heading": "W pobliżu", "homeHeading": "Twoje ładowarki", diff --git a/Web App/web/src/views/Charging.vue b/Web App/web/src/views/Charging.vue index 504244f..735313e 100644 --- a/Web App/web/src/views/Charging.vue +++ b/Web App/web/src/views/Charging.vue @@ -177,7 +177,7 @@ const sessionMetrics = computed(() => // buttons just did: the limit that was applied, whether boost took. An account // that has already arranged this column gets it at the end instead, the same // rule a tab added in a later release follows, and one drag puts it anywhere. -const ALL_CHARGER_CARDS = ["control", "settings", "connection", "readings", "info"]; +const ALL_CHARGER_CARDS = ["control", "rfid", "settings", "connection", "readings", "info"]; const cardKeys = ref([...ALL_CHARGER_CARDS]); watch( @@ -187,7 +187,19 @@ watch( for (const key of order || []) { if (ALL_CHARGER_CARDS.includes(key) && !arranged.includes(key)) arranged.push(key); } - cardKeys.value = [...arranged, ...ALL_CHARGER_CARDS.filter((k) => !arranged.includes(k))]; + // A card added after this order was saved goes where the default order puts + // it — behind the neighbour it was written to sit under — rather than at the + // bottom of the column. Somebody who has arranged their cards once should not + // have to go looking for the new one. + for (const key of ALL_CHARGER_CARDS) { + if (arranged.includes(key)) continue; + const before = ALL_CHARGER_CARDS.slice(0, ALL_CHARGER_CARDS.indexOf(key)) + .reverse() + .find((k) => arranged.includes(k)); + const at = before ? arranged.indexOf(before) + 1 : 0; + arranged.splice(at, 0, key); + } + cardKeys.value = arranged; }, { immediate: true } ); @@ -1174,6 +1186,13 @@ const chargerDetailViews = computed(() => { })); }); +// The RFID cards authorised on the charger, out of the view that answers with +// them. A card of its own: a list of physical cards somebody holds in their hand +// is worth more than a block in a diagnostic dump. The information card keeps +// relaying this view as well — it relays every view the account answers, and a +// hole in that list would be the one thing it cannot say. +const rfidView = computed(() => chargerDetailViews.value.find((v) => v.id === "rfid") || null); + // Everything else the service said about this charger, under its own field // names. The rows above are the ones DriverVault has a name for; these are the // remainder — the service documents none of them, so its own key is the only @@ -1647,6 +1666,81 @@ onMounted(async () => { + +
+
+ + + +
+ +
+

{{ selectedHomeCharger.name }}

+ +

{{ t("charging.rfid.unsupported") }}

+

{{ rfidView.error }}

+

{{ t("charging.rfid.none") }}

+
+
+

{{ card.label }}

+
+ +
+
+
+

{{ t("charging.rfid.readOnly") }}

+
+
+