台北 Settlement 标签从 跑道实测 改为 CWA
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import {
|
||||
applyAuthResponseCookies,
|
||||
buildBackendRequestHeaders,
|
||||
} from "@/lib/backend-auth";
|
||||
import { buildProxyExceptionResponse } from "@/lib/api-proxy";
|
||||
|
||||
const API_BASE = process.env.POLYWEATHER_API_BASE_URL;
|
||||
|
||||
export async function GET(req: NextRequest) {
|
||||
if (!API_BASE) {
|
||||
return NextResponse.json(
|
||||
{ error: "POLYWEATHER_API_BASE_URL is not configured" },
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
const auth = await buildBackendRequestHeaders(req);
|
||||
const res = await fetch(`${API_BASE}/api/ops/online-users`, {
|
||||
headers: auth.headers,
|
||||
cache: "no-store",
|
||||
});
|
||||
const raw = await res.text();
|
||||
const response = new NextResponse(raw, {
|
||||
status: res.status,
|
||||
headers: {
|
||||
"Content-Type": res.headers.get("content-type") || "application/json",
|
||||
"Cache-Control": "no-store",
|
||||
},
|
||||
});
|
||||
return applyAuthResponseCookies(response, auth.response);
|
||||
} catch (error) {
|
||||
return buildProxyExceptionResponse(error, {
|
||||
publicMessage: "Failed to fetch online users",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1447,10 +1447,11 @@ export function LiveTemperatureThresholdChart({
|
||||
const isTokyo = normalizedKey === 'tokyo';
|
||||
const isSingapore = normalizedKey === 'singapore';
|
||||
const isParis = normalizedKey === 'paris';
|
||||
const isTaipei = normalizedKey === 'taipei';
|
||||
const stationSourceCode = hourly?.airportPrimary?.source_code || (row as any)?.station_source_code || '';
|
||||
const hasRealStationNetwork = /^(mgm|jma_amedas|fmi|knmi|cowin_obs|ims|ncm|aeroweb|madis_hfmetar|singapore_mss)$/.test(stationSourceCode);
|
||||
const isWeatherStation = !runwaySensorCities.has(normalizedKey)
|
||||
&& !isHKO && !isShenzhen && !isTokyo && !isSingapore && !isParis
|
||||
&& !isHKO && !isShenzhen && !isTokyo && !isSingapore && !isParis && !isTaipei
|
||||
&& hasRealStationNetwork;
|
||||
|
||||
const runwayHeaderLabel = isShenzhen ? '天文台实测 (10分钟)'
|
||||
@@ -1458,6 +1459,7 @@ export function LiveTemperatureThresholdChart({
|
||||
: isTokyo ? '机场气象站 (10分钟)'
|
||||
: isSingapore ? '航站楼温度'
|
||||
: isParis ? '官方机场观测 (15分钟)'
|
||||
: isTaipei ? 'CWA (10分钟)'
|
||||
: isWeatherStation ? '气象站实测'
|
||||
: '跑道实测 (1分钟)';
|
||||
|
||||
@@ -1469,6 +1471,7 @@ export function LiveTemperatureThresholdChart({
|
||||
: isTokyo ? '机场气象站'
|
||||
: isSingapore ? '航站楼'
|
||||
: isParis ? '官方机场观测'
|
||||
: isTaipei ? 'CWA'
|
||||
: isWeatherStation ? '气象站'
|
||||
: '跑道实测';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user