diff --git a/public/functions/api/card.js b/public/functions/api/card.js index 6626bf7..1c0ec9a 100644 --- a/public/functions/api/card.js +++ b/public/functions/api/card.js @@ -2,6 +2,8 @@ export async function onRequest(event) { const url = new URL(event.request.url); const key = url.searchParams.get("key"); + const CURRENT_VERSION = "0.30"; + // SVG Headers const headers = { "Content-Type": "image/svg+xml", @@ -64,6 +66,8 @@ export async function onRequest(event) { .trip-dist { font-size: 9px; fill: ${labelColor}; font-family: monospace; } .line-path { fill: none; stroke: ${accentColor}; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } .separator { stroke: ${glassBorder}; stroke-width: 1; } + .version-badge { fill: #39C5BB; } + .version-text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; font-size: 9px; font-weight: bold; fill: #ffffff; } `; // Icon SVG (Lucide Train Standard) placed at top right @@ -88,6 +92,13 @@ export async function onRequest(event) { ${esc(username)}'s RailLOOP + + + + + v${CURRENT_VERSION} + + ${iconSvg} diff --git a/src/RailRound.jsx b/src/RailRound.jsx index 2d5fd1b..32ae439 100644 --- a/src/RailRound.jsx +++ b/src/RailRound.jsx @@ -17,6 +17,7 @@ import { api } from './services/api'; import { db } from './utils/db'; const CURRENT_VERSION = 0.30; +const LAST_MODIFIED = "2024-05-22"; const MIN_SUPPORTED_VERSION = 0.0; const GithubRegisterModal = ({ isOpen, onClose, regToken, onLoginSuccess }) => { @@ -1231,7 +1232,7 @@ const RecordsView = ({ trips, railwayData, setTrips, onEdit, onDelete, onAdd, se ); -const StatsView = ({ trips, railwayData ,geoData, user, userProfile, segmentGeometries, onOpenCard }) => { +const StatsView = ({ trips, railwayData ,geoData, user, userProfile, segmentGeometries, onOpenCard, companyDB }) => { const totalTrips = trips.length; const allSegments = trips.flatMap(t => t.segments || [{ lineKey: t.lineKey, fromId: t.fromId, toId: t.toId }]); const uniqueLines = new Set(allSegments.map(s => s.lineKey)).size; @@ -1300,6 +1301,23 @@ const StatsView = ({ trips, railwayData ,geoData, user, userProfile, segmentGeom
常乘路线排行
{Object.entries(allSegments.reduce((acc, s) => { acc[s.lineKey] = (acc[s.lineKey]||0)+1; return acc; }, {})).sort((a,b) => b[1]-a[1]).slice(0, 3).map(([line, count], idx) => { const icon = railwayData[line]?.meta?.icon; return (
{idx+1}{icon && }{line}
{count}
)})}
+ +
+ 加载了 {companyDB ? Object.keys(companyDB).length : 0} 家公司, + {railwayData ? Object.keys(railwayData).length : 0} 条线路, + {(() => { + let count = 0; + if (railwayData) { + const uniqueStations = new Set(); + Object.values(railwayData).forEach(line => { + if (line.stations) line.stations.forEach(s => uniqueStations.add(s.id)); + }); + count = uniqueStations.size; + } + return count; + })()} 个站点。
+ Last Updated: {LAST_MODIFIED} +
); }; @@ -2382,7 +2400,11 @@ export default function RailLOOPApp() {
-
RailLOOP
+
+ + RailLOOP + v{CURRENT_VERSION} +
{user ? (
@@ -2421,7 +2443,7 @@ export default function RailLOOPApp() {
{activeTab === 'records' && { setTripForm({ date: new Date().toISOString().split('T')[0], memo: '', segments: [{ id: Date.now().toString(), lineKey: '', fromId: '', toId: '' }] }); setIsTripEditing(true); }} />} - {activeTab === 'stats' && } + {activeTab === 'stats' && }