Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6858798b14 | ||
|
|
c3ad730677 | ||
|
|
0dcfcbfb6f | ||
|
|
31789df35c | ||
|
|
8e45241ddc | ||
|
|
78e9004624 | ||
|
|
2dcea91a63 | ||
|
|
d240b543eb | ||
|
|
1a35ec064c |
@@ -56,17 +56,19 @@ public class GaugeControl : FrameworkElement
|
|||||||
CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
|
CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
|
||||||
new Typeface(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Bold, FontStretches.Normal),
|
new Typeface(new FontFamily("Segoe UI"), FontStyles.Normal, FontWeights.Bold, FontStretches.Normal),
|
||||||
14, new SolidColorBrush(textColor), dpi);
|
14, new SolidColorBrush(textColor), dpi);
|
||||||
dc.DrawText(pctText, new Point(cx - pctText.Width / 2, cy - pctText.Height - 1));
|
|
||||||
|
|
||||||
var sub = new FormattedText(
|
var sub = new FormattedText(
|
||||||
"Updated\nnow",
|
"used",
|
||||||
CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
|
CultureInfo.CurrentCulture, FlowDirection.LeftToRight,
|
||||||
new Typeface("Segoe UI"), 7,
|
new Typeface("Segoe UI"), 8,
|
||||||
new SolidColorBrush(subColor), dpi)
|
new SolidColorBrush(subColor), dpi)
|
||||||
{
|
{
|
||||||
TextAlignment = TextAlignment.Center
|
TextAlignment = TextAlignment.Center
|
||||||
};
|
};
|
||||||
dc.DrawText(sub, new Point(cx - sub.Width / 2, cy + 2));
|
|
||||||
|
var totalHeight = pctText.Height + 2 + sub.Height;
|
||||||
|
var startY = cy - totalHeight / 2;
|
||||||
|
dc.DrawText(pctText, new Point(cx - pctText.Width / 2, startY));
|
||||||
|
dc.DrawText(sub, new Point(cx - sub.Width / 2, startY + pctText.Height + 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawArc(DrawingContext dc, double cx, double cy, double r,
|
private static void DrawArc(DrawingContext dc, double cx, double cy, double r,
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ public partial class LoginWindow : Window
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const u=await(await fetch('/api/organizations/'+id+'/usage',h)).json();
|
const u=await(await fetch('/api/organizations/'+id+'/usage',h)).json();
|
||||||
const rawU=JSON.stringify(u).slice(0,300);
|
const rawU=JSON.stringify(u).slice(0,400);
|
||||||
window.chrome.webview.postMessage({email:e,orgId:id,usage:u,debug:'src:'+orgSrc+'|ukeys:'+Object.keys(u||{}).join(',')+'|raw:'+rawB});
|
window.chrome.webview.postMessage({email:e,orgId:id,usage:u,debug:'src:'+orgSrc+'|ukeys:'+Object.keys(u||{}).join(',')+'|rawU:'+rawU+'|rawB:'+rawB});
|
||||||
}catch(ex){window.chrome.webview.postMessage({error:String(ex)});}})()";
|
}catch(ex){window.chrome.webview.postMessage({error:String(ex)});}})()";
|
||||||
|
|
||||||
await Browser.CoreWebView2.ExecuteScriptAsync(script);
|
await Browser.CoreWebView2.ExecuteScriptAsync(script);
|
||||||
|
|||||||
+2
-2
@@ -21,8 +21,8 @@ public class AgentLimit
|
|||||||
|
|
||||||
public class UsageResponse
|
public class UsageResponse
|
||||||
{
|
{
|
||||||
[JsonPropertyName("claude_ai_default_5h")] public WindowData? FiveHour { get; set; }
|
[JsonPropertyName("five_hour")] public WindowData? FiveHour { get; set; }
|
||||||
[JsonPropertyName("claude_ai_default")] public WindowData? SevenDay { get; set; }
|
[JsonPropertyName("seven_day")] public WindowData? SevenDay { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WindowData
|
public class WindowData
|
||||||
|
|||||||
@@ -66,16 +66,7 @@
|
|||||||
|
|
||||||
<!-- Cards scroll area -->
|
<!-- Cards scroll area -->
|
||||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||||
<StackPanel Margin="0,4,0,4">
|
<StackPanel x:Name="CardsPanel" Margin="0,4,0,4"/>
|
||||||
<Border x:Name="DebugBanner" Visibility="Collapsed"
|
|
||||||
Background="{DynamicResource CardBrush}"
|
|
||||||
BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
|
|
||||||
CornerRadius="6" Margin="12,4,12,4" Padding="12,8">
|
|
||||||
<TextBlock x:Name="DebugBannerText" FontSize="10" FontFamily="Consolas"
|
|
||||||
Foreground="{DynamicResource SecondaryBrush}" TextWrapping="Wrap"/>
|
|
||||||
</Border>
|
|
||||||
<StackPanel x:Name="CardsPanel"/>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|
||||||
@@ -194,10 +185,6 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<TextBlock x:Name="DebugText" FontSize="10" Foreground="{DynamicResource SecondaryBrush}"
|
|
||||||
TextWrapping="Wrap" Margin="0,12,0,0" FontFamily="Consolas"
|
|
||||||
Visibility="Collapsed"/>
|
|
||||||
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|||||||
@@ -283,20 +283,6 @@ public partial class PopupWindow : Window
|
|||||||
|
|
||||||
SignOutButton.Visibility = VM.IsSignedIn ? Visibility.Visible : Visibility.Collapsed;
|
SignOutButton.Visibility = VM.IsSignedIn ? Visibility.Visible : Visibility.Collapsed;
|
||||||
SignInButton.Content = VM.IsSignedIn ? "Re-authenticate" : "Sign In";
|
SignInButton.Content = VM.IsSignedIn ? "Re-authenticate" : "Sign In";
|
||||||
|
|
||||||
var dbg = AppSettings.Default.DebugInfo;
|
|
||||||
if (!string.IsNullOrEmpty(dbg))
|
|
||||||
{
|
|
||||||
DebugText.Text = dbg;
|
|
||||||
DebugText.Visibility = Visibility.Visible;
|
|
||||||
DebugBannerText.Text = dbg;
|
|
||||||
DebugBanner.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DebugText.Visibility = Visibility.Collapsed;
|
|
||||||
DebugBanner.Visibility = Visibility.Collapsed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Event handlers ───────────────────────────────────────────────
|
// ── Event handlers ───────────────────────────────────────────────
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
## What's new in beta.30
|
## What's new in beta.33
|
||||||
|
|
||||||
- Fix: removed WebView2 from periodic refresh — it was spawning a full Chromium process every 2 minutes and not cleaning up, causing ~1.5GB memory growth
|
- Fix: gauge percentage text is now vertically centered within the dial
|
||||||
- Fix: added Origin, Referer, sec-fetch-* and sec-ch-ua headers to HttpClient so the API accepts requests as browser fetches
|
- Remove: debug banner no longer appears on the main panel
|
||||||
- Periodic refresh now uses HttpClient only, falling back to data cached at login time
|
|
||||||
- To get limits showing: sign out and sign back in once so SaveAndClose can fetch usage with the corrected org ID path
|
|
||||||
|
|||||||
@@ -267,9 +267,10 @@ public class UsageViewModel : INotifyPropertyChanged
|
|||||||
await Application.Current.Dispatcher.InvokeAsync(() =>
|
await Application.Current.Dispatcher.InvokeAsync(() =>
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(email)) UserEmail = email;
|
if (!string.IsNullOrEmpty(email)) UserEmail = email;
|
||||||
if (limits.Count > 0) Limits = limits;
|
// Always show cards — real data if available, placeholders if not
|
||||||
|
Limits = limits.Count > 0 ? limits : LoadPlaceholderLimits();
|
||||||
IsSignedIn = true;
|
IsSignedIn = true;
|
||||||
ErrorMessage = limits.Count == 0 ? "Signed in — refreshing data…" : null;
|
ErrorMessage = null;
|
||||||
LastUpdated = limits.Count > 0 ? DateTime.Now : LastUpdated;
|
LastUpdated = limits.Count > 0 ? DateTime.Now : LastUpdated;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -470,16 +471,18 @@ public class UsageViewModel : INotifyPropertyChanged
|
|||||||
return $"{diff.Hours}h {diff.Minutes}m";
|
return $"{diff.Hours}h {diff.Minutes}m";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadPlaceholders()
|
private static List<AgentLimit> LoadPlaceholderLimits()
|
||||||
{
|
{
|
||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
Limits =
|
return
|
||||||
[
|
[
|
||||||
new() { Window = WindowKind.FiveHour, UsedPercent = 0, TimeRemaining = "—", ResetDate = now.AddHours(1) },
|
new() { Window = WindowKind.FiveHour, UsedPercent = 0, TimeRemaining = "—", ResetDate = now.AddHours(1) },
|
||||||
new() { Window = WindowKind.SevenDay, UsedPercent = 0, TimeRemaining = "—", ResetDate = now.AddDays(7) },
|
new() { Window = WindowKind.SevenDay, UsedPercent = 0, TimeRemaining = "—", ResetDate = now.AddDays(7) },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LoadPlaceholders() => Limits = LoadPlaceholderLimits();
|
||||||
|
|
||||||
private void LoadBurnHistory()
|
private void LoadBurnHistory()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user