Load nearby stations before opening intraday analysis
This commit is contained in:
@@ -29,8 +29,10 @@ function normalizeCityName(cityName: string) {
|
||||
return encodeURIComponent(String(cityName).replace(/\s/g, "-"));
|
||||
}
|
||||
|
||||
function normalizeDetailDepth(depth?: "panel" | "full") {
|
||||
return depth === "full" ? "full" : "panel";
|
||||
function normalizeDetailDepth(depth?: "panel" | "nearby" | "full") {
|
||||
if (depth === "full") return "full";
|
||||
if (depth === "nearby") return "nearby";
|
||||
return "panel";
|
||||
}
|
||||
|
||||
async function fetchJson<T>(url: string): Promise<T> {
|
||||
@@ -161,7 +163,7 @@ export const dashboardClient = {
|
||||
|
||||
async getCityDetail(
|
||||
cityName: string,
|
||||
options?: { force?: boolean; depth?: "panel" | "full" },
|
||||
options?: { force?: boolean; depth?: "panel" | "nearby" | "full" },
|
||||
) {
|
||||
const force = options?.force ?? false;
|
||||
const depth = normalizeDetailDepth(options?.depth);
|
||||
|
||||
@@ -327,7 +327,7 @@ export interface AiAnalysisStructured {
|
||||
export interface CityDetail {
|
||||
name: string;
|
||||
display_name: string;
|
||||
detail_depth?: "panel" | "full";
|
||||
detail_depth?: "panel" | "nearby" | "full";
|
||||
lat: number;
|
||||
lon: number;
|
||||
temp_symbol: string;
|
||||
|
||||
Reference in New Issue
Block a user