mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-20 22:12:05 +00:00
update region logic
This commit is contained in:
parent
00c701147b
commit
7b2cacc8fd
2 changed files with 6 additions and 12 deletions
|
|
@ -7,8 +7,8 @@ export function RegionSelectorPart() {
|
|||
const { region, setRegion } = useRegionStore();
|
||||
|
||||
const regionOptions = [
|
||||
{ id: "us-east", name: "US East (Ohio)" },
|
||||
{ id: "us-west", name: "US West (California)" },
|
||||
{ id: "east", name: "US East (Ohio)" },
|
||||
{ id: "west", name: "US West (California)" },
|
||||
{ id: "south", name: "South America (São Paulo)" },
|
||||
{ id: "asia", name: "Asia Pacific (Sydney)" },
|
||||
{ id: "europe", name: "Europe Central (London)" },
|
||||
|
|
@ -28,7 +28,7 @@ export function RegionSelectorPart() {
|
|||
<Dropdown
|
||||
options={regionOptions}
|
||||
selectedItem={{
|
||||
id: region || "us-east",
|
||||
id: region || "east",
|
||||
name:
|
||||
regionOptions.find((r) => r.id === region)?.name ||
|
||||
"Unknown (US East)",
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
|
||||
export type Region =
|
||||
| "us-east"
|
||||
| "us-west"
|
||||
| "south"
|
||||
| "asia"
|
||||
| "europe"
|
||||
| "unknown";
|
||||
export type Region = "east" | "west" | "south" | "asia" | "europe" | "unknown";
|
||||
|
||||
interface RegionStore {
|
||||
region: Region | null;
|
||||
|
|
@ -39,8 +33,8 @@ export const useRegionStore = create<RegionStore>()(
|
|||
|
||||
// Coordinates for each proxy server region
|
||||
const regionCoordinates = [
|
||||
{ region: "us-east" as Region, lat: 40.4173, lon: -82.9071 }, // Ohio, US
|
||||
{ region: "us-west" as Region, lat: 37.7749, lon: -122.4194 }, // California, US
|
||||
{ region: "east" as Region, lat: 40.4173, lon: -82.9071 }, // Ohio, US
|
||||
{ region: "west" as Region, lat: 37.7749, lon: -122.4194 }, // California, US
|
||||
{ region: "south" as Region, lat: -23.5505, lon: -46.6333 }, // São Paulo, BR
|
||||
{ region: "asia" as Region, lat: -33.8688, lon: 151.2093 }, // Sydney, Australia
|
||||
{ region: "europe" as Region, lat: 51.5074, lon: -0.1278 }, // London, UK
|
||||
|
|
|
|||
Loading…
Reference in a new issue