OpenWeather reports no remaining quota (only 429 when over), so add an in-app gauge that counts the calls PilotVault itself makes and shows them against the plan's per-minute limit. - Plugin: process-wide usage store bucketed per API key (hashed) into the current minute and UTC day; a do() wrapper counts each request that reaches OpenWeather (transport errors consume no quota, so uncounted). Health and Invoke both route through it. - New callsPerMinute config field (default 60) that cascades global -> org -> user; plugin contract gains plugins.HealthUsage on Health. - Web App: a "Calls per minute limit" field and an "API call usage" meter in the OpenWeather card, shown after Test connection and cached. - Counts reset on restart and cover only PilotVault's own calls (noted in the UI); the account dashboard stays authoritative. - Tests for per-key counting and minute/day rollover; rebuilt frontend. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
45 lines
1.8 KiB
HTML
45 lines
1.8 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<link rel="icon" type="image/svg+xml" href="./favicon.svg" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
<link
|
|
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap"
|
|
rel="stylesheet"
|
|
/>
|
|
<script>
|
|
// Apply saved theme + font size before first paint (light is the brand default).
|
|
(function () {
|
|
var GROUND = { light: '#EEF0F3', dark: '#0B1730' }
|
|
var FONT = { sm: 15, md: 16, lg: 18 }
|
|
var html = document.documentElement
|
|
var mode = 'light', prefs = {}
|
|
try {
|
|
mode = localStorage.getItem('pv_theme') || 'light'
|
|
} catch (e) {}
|
|
try {
|
|
prefs = JSON.parse(localStorage.getItem('pv_prefs') || '{}') || {}
|
|
} catch (e) {}
|
|
var t = mode
|
|
if (mode === 'system') {
|
|
t = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
|
|
}
|
|
html.setAttribute('data-theme', t)
|
|
html.style.backgroundColor = GROUND[t] || GROUND.light
|
|
html.style.fontSize = (FONT[prefs.fontSize] || 16) + 'px'
|
|
if (prefs.reduceMotion) html.classList.add('reduce-motion')
|
|
})()
|
|
</script>
|
|
<title>PilotVault — Control Panel</title>
|
|
<script type="module" crossorigin src="./assets/index-B-DwId4e.js"></script>
|
|
<link rel="stylesheet" crossorigin href="./assets/index-Dr5W1RO_.css">
|
|
</head>
|
|
<body>
|
|
<div id="app"></div>
|
|
</body>
|
|
</html>
|