feat: Implement new dashboard panel sections, utilities, and a future forecast modal.
This commit is contained in:
@@ -715,69 +715,6 @@ export function FutureForecastModal() {
|
||||
{settlementBucketLabel}
|
||||
</strong>
|
||||
</div>
|
||||
|
||||
<div className="market-edge-box">
|
||||
<div className="market-edge-header">
|
||||
<span>
|
||||
📊 {locale === "en-US" ? "Core Edge" : "核心测算"}
|
||||
</span>
|
||||
<strong
|
||||
className={clsx(
|
||||
"market-edge-val",
|
||||
Number(marketScan?.edge_percent) > 0
|
||||
? "positive"
|
||||
: "negative",
|
||||
)}
|
||||
>
|
||||
({marketEdge})
|
||||
</strong>
|
||||
</div>
|
||||
<div className="market-edge-compare">
|
||||
<div className="edge-stat">
|
||||
<span className="edge-label">
|
||||
{locale === "en-US" ? "Model Prob:" : "模型概率:"}
|
||||
</span>
|
||||
<strong className="edge-value">
|
||||
{modelProbability}
|
||||
</strong>
|
||||
</div>
|
||||
<div className="edge-stat">
|
||||
<span className="edge-label">
|
||||
{locale === "en-US"
|
||||
? "Market Prob:"
|
||||
: "市场概率:"}
|
||||
</span>
|
||||
<strong className="edge-value">
|
||||
{marketMidpoint}
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Layer 2: Order Book */}
|
||||
<div className="market-layer-book">
|
||||
<div className="market-sub-title">
|
||||
📈 {locale === "en-US" ? "Order Book" : "订单簿报价"}
|
||||
</div>
|
||||
<div className="market-book-row">
|
||||
<span className="book-label">YES:</span>
|
||||
<span className="book-quote">
|
||||
<strong>{marketYesBuy}</strong> /{" "}
|
||||
<strong>{marketYesSell}</strong>
|
||||
</span>
|
||||
<span className="book-spread">
|
||||
({locale === "en-US" ? "Spread" : "价差"}{" "}
|
||||
{marketSpread})
|
||||
</span>
|
||||
</div>
|
||||
<div className="market-book-row">
|
||||
<span className="book-label">NO:</span>
|
||||
<span className="book-quote">
|
||||
<strong>{marketNoBuy}</strong> /{" "}
|
||||
<strong>{marketNoSell}</strong>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Layer 3: Context */}
|
||||
|
||||
@@ -552,8 +552,8 @@ export function ModelForecast({
|
||||
}) {
|
||||
const { locale, t } = useI18n();
|
||||
const view = getModelView(detail, targetDate);
|
||||
const modelEntries = Object.entries(view.models).filter(([, value]) =>
|
||||
Number.isFinite(Number(value)),
|
||||
const modelEntries = Object.entries(view.models).filter(
|
||||
([, value]) => value !== null && value !== undefined && Number.isFinite(Number(value)),
|
||||
);
|
||||
const numericValues = modelEntries.map(([, value]) => Number(value));
|
||||
const comparisonValues =
|
||||
@@ -567,9 +567,7 @@ export function ModelForecast({
|
||||
const range = Math.max(maxValue - minValue, 1);
|
||||
const getModelDisplayName = (name: string) => {
|
||||
if (String(name).trim().toLowerCase() === "meteoblue") {
|
||||
return locale === "en-US"
|
||||
? "Meteoblue (Daily Max)"
|
||||
: "Meteoblue (日最高温)";
|
||||
return "Meteoblue";
|
||||
}
|
||||
return name;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user