mirror of
https://github.com/p-stream/p-stream.git
synced 2026-01-11 20:10:32 +00:00
add more fed regions
This commit is contained in:
parent
e660a859e0
commit
0be7d9f75b
2 changed files with 31 additions and 13 deletions
|
|
@ -7,11 +7,15 @@ export function RegionSelectorPart() {
|
|||
const { region, setRegion } = useRegionStore();
|
||||
|
||||
const regionOptions = [
|
||||
{ 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)" },
|
||||
{ id: "dallas", name: "Dallas, TX" },
|
||||
{ id: "portland", name: "Portland, OR" },
|
||||
{ id: "new-york", name: "New York, NY" },
|
||||
{ id: "paris", name: "Paris, France" },
|
||||
{ id: "hong-kong", name: "Hong Kong" },
|
||||
{ id: "kansas", name: "Kansas City, MO" },
|
||||
{ id: "sydney", name: "Sydney, Australia" },
|
||||
{ id: "singapore", name: "Singapore" },
|
||||
{ id: "mumbai", name: "Mumbai, India" },
|
||||
];
|
||||
|
||||
return (
|
||||
|
|
@ -28,10 +32,10 @@ export function RegionSelectorPart() {
|
|||
<Dropdown
|
||||
options={regionOptions}
|
||||
selectedItem={{
|
||||
id: region || "east",
|
||||
id: region || "new-york",
|
||||
name:
|
||||
regionOptions.find((r) => r.id === region)?.name ||
|
||||
"Unknown (US East)",
|
||||
"Unknown (New York, NY)",
|
||||
}}
|
||||
setSelectedItem={(item) => setRegion(item.id as Region, true)}
|
||||
direction="up"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,17 @@
|
|||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
|
||||
export type Region = "east" | "west" | "south" | "asia" | "europe" | "unknown";
|
||||
export type Region =
|
||||
| "dallas"
|
||||
| "portland"
|
||||
| "new-york"
|
||||
| "paris"
|
||||
| "hong-kong"
|
||||
| "kansas"
|
||||
| "sydney"
|
||||
| "singapore"
|
||||
| "mumbai"
|
||||
| "unknown";
|
||||
|
||||
interface RegionStore {
|
||||
region: Region | null;
|
||||
|
|
@ -33,11 +43,15 @@ export const useRegionStore = create<RegionStore>()(
|
|||
|
||||
// Coordinates for each proxy server region
|
||||
const regionCoordinates = [
|
||||
{ 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
|
||||
{ region: "dallas" as Region, lat: 32.7767, lon: -96.797 }, // Dallas, TX, US
|
||||
{ region: "portland" as Region, lat: 45.5152, lon: -122.6784 }, // Portland, OR, US
|
||||
{ region: "new-york" as Region, lat: 40.7128, lon: -74.006 }, // New York, NY, US
|
||||
{ region: "paris" as Region, lat: 48.8566, lon: 2.3522 }, // Paris, France
|
||||
{ region: "hong-kong" as Region, lat: 22.3193, lon: 114.1694 }, // Hong Kong
|
||||
{ region: "kansas" as Region, lat: 39.0997, lon: -94.5786 }, // Kansas City, MO, US
|
||||
{ region: "sydney" as Region, lat: -33.8688, lon: 151.2093 }, // Sydney, Australia
|
||||
{ region: "singapore" as Region, lat: 1.3521, lon: 103.8198 }, // Singapore
|
||||
{ region: "mumbai" as Region, lat: 19.076, lon: 72.8777 }, // Mumbai, India
|
||||
];
|
||||
|
||||
// Haversine formula
|
||||
|
|
|
|||
Loading…
Reference in a new issue