12 Commits

18 changed files with 869 additions and 232 deletions

32
package-lock.json generated
View File

@@ -22,7 +22,7 @@
"chart.js": "^4.4.7", "chart.js": "^4.4.7",
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"eslint": "8.42.0", "eslint": "8.42.0",
"luxon": "^3.3.0", "luxon": "^3.6.1",
"next": "^14.2.23", "next": "^14.2.23",
"next-plausible": "^3.12.0", "next-plausible": "^3.12.0",
"react": "^18.3.1", "react": "^18.3.1",
@@ -37,7 +37,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/crypto-js": "^4.1.1", "@types/crypto-js": "^4.1.1",
"@types/luxon": "^3.3.0", "@types/luxon": "^3.6.1",
"@types/react-color": "^3.0.7", "@types/react-color": "^3.0.7",
"@types/three": "^0.152.1", "@types/three": "^0.152.1",
"eslint-config-next": "^14.2.23", "eslint-config-next": "^14.2.23",
@@ -2516,10 +2516,11 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/luxon": { "node_modules/@types/luxon": {
"version": "3.3.0", "version": "3.6.1",
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.0.tgz", "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.6.1.tgz",
"integrity": "sha512-uKRI5QORDnrGFYgcdAVnHvEIvEZ8noTpP/Bg+HeUzZghwinDlIS87DEenV5r1YoOF9G4x600YsUXLWZ19rmTmg==", "integrity": "sha512-GEo4k1yY5PBaPLqEbk+vp2LhVCKPa/TQlTjuCf3exvx6fjB+jVuDa/Zopi8eznEkJf8yeZRzSK/kzG14g5aXPQ==",
"dev": true "dev": true,
"license": "MIT"
}, },
"node_modules/@types/mysql": { "node_modules/@types/mysql": {
"version": "2.15.26", "version": "2.15.26",
@@ -6459,9 +6460,10 @@
} }
}, },
"node_modules/luxon": { "node_modules/luxon": {
"version": "3.3.0", "version": "3.6.1",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz", "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
"integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==", "integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ==",
"license": "MIT",
"engines": { "engines": {
"node": ">=12" "node": ">=12"
} }
@@ -10963,9 +10965,9 @@
"dev": true "dev": true
}, },
"@types/luxon": { "@types/luxon": {
"version": "3.3.0", "version": "3.6.1",
"resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.0.tgz", "resolved": "https://registry.npmjs.org/@types/luxon/-/luxon-3.6.1.tgz",
"integrity": "sha512-uKRI5QORDnrGFYgcdAVnHvEIvEZ8noTpP/Bg+HeUzZghwinDlIS87DEenV5r1YoOF9G4x600YsUXLWZ19rmTmg==", "integrity": "sha512-GEo4k1yY5PBaPLqEbk+vp2LhVCKPa/TQlTjuCf3exvx6fjB+jVuDa/Zopi8eznEkJf8yeZRzSK/kzG14g5aXPQ==",
"dev": true "dev": true
}, },
"@types/mysql": { "@types/mysql": {
@@ -13688,9 +13690,9 @@
} }
}, },
"luxon": { "luxon": {
"version": "3.3.0", "version": "3.6.1",
"resolved": "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz", "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.6.1.tgz",
"integrity": "sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==" "integrity": "sha512-tJLxrKJhO2ukZ5z0gyjY1zPh3Rh88Ej9P7jNrZiHMUXHae1yvI2imgOZtL1TO8TW6biMMKfTtAOoEJANgtWBMQ=="
}, },
"magic-string": { "magic-string": {
"version": "0.30.17", "version": "0.30.17",

View File

@@ -24,7 +24,7 @@
"chart.js": "^4.4.7", "chart.js": "^4.4.7",
"crypto-js": "^4.1.1", "crypto-js": "^4.1.1",
"eslint": "8.42.0", "eslint": "8.42.0",
"luxon": "^3.3.0", "luxon": "^3.6.1",
"next": "^14.2.23", "next": "^14.2.23",
"next-plausible": "^3.12.0", "next-plausible": "^3.12.0",
"react": "^18.3.1", "react": "^18.3.1",
@@ -39,7 +39,7 @@
}, },
"devDependencies": { "devDependencies": {
"@types/crypto-js": "^4.1.1", "@types/crypto-js": "^4.1.1",
"@types/luxon": "^3.3.0", "@types/luxon": "^3.6.1",
"@types/react-color": "^3.0.7", "@types/react-color": "^3.0.7",
"@types/three": "^0.152.1", "@types/three": "^0.152.1",
"eslint-config-next": "^14.2.23", "eslint-config-next": "^14.2.23",

View File

@@ -3,7 +3,7 @@ import { Box, Stack, Typography, useTheme, Paper, IconButton } from "@mui/materi
import { CharacterRow } from "../Characters/CharacterRow"; import { CharacterRow } from "../Characters/CharacterRow";
import { PlanetaryInteractionRow } from "../PlanetaryInteraction/PlanetaryInteractionRow"; import { PlanetaryInteractionRow } from "../PlanetaryInteraction/PlanetaryInteractionRow";
import { SessionContext } from "@/app/context/Context"; import { SessionContext } from "@/app/context/Context";
import { useContext, useState } from "react"; import { useContext, useState, useEffect } from "react";
import { PlanRow } from "./PlanRow"; import { PlanRow } from "./PlanRow";
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown'; import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp'; import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
@@ -60,12 +60,17 @@ const calculateAccountTotals = (characters: AccessToken[], piPrices: EvePraisalR
}; };
}; };
export const AccountCard = ({ characters }: { characters: AccessToken[] }) => { export const AccountCard = ({ characters, isCollapsed: propIsCollapsed }: { characters: AccessToken[], isCollapsed?: boolean }) => {
const theme = useTheme(); const theme = useTheme();
const [isCollapsed, setIsCollapsed] = useState(false); const [localIsCollapsed, setLocalIsCollapsed] = useState(false);
const { planMode, piPrices } = useContext(SessionContext); const { planMode, piPrices } = useContext(SessionContext);
const { monthlyEstimate, storageValue } = calculateAccountTotals(characters, piPrices); const { monthlyEstimate, storageValue } = calculateAccountTotals(characters, piPrices);
// Update local collapse state when prop changes
useEffect(() => {
setLocalIsCollapsed(propIsCollapsed ?? false);
}, [propIsCollapsed]);
return ( return (
<Paper <Paper
elevation={2} elevation={2}
@@ -134,16 +139,16 @@ export const AccountCard = ({ characters }: { characters: AccessToken[] }) => {
</Box> </Box>
<IconButton <IconButton
size="small" size="small"
onClick={() => setIsCollapsed(!isCollapsed)} onClick={() => setLocalIsCollapsed(!localIsCollapsed)}
sx={{ sx={{
transform: isCollapsed ? 'rotate(-90deg)' : 'rotate(0deg)', transform: localIsCollapsed ? 'rotate(-90deg)' : 'rotate(0deg)',
transition: 'transform 0.2s ease-in-out' transition: 'transform 0.2s ease-in-out'
}} }}
> >
{isCollapsed ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />} {localIsCollapsed ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
</IconButton> </IconButton>
</Box> </Box>
{!isCollapsed && characters.map((c) => ( {!localIsCollapsed && characters.map((c) => (
<Stack <Stack
key={c.character.characterId} key={c.character.characterId}
direction="row" direction="row"

View File

@@ -5,6 +5,7 @@ import {
Grid, Grid,
ThemeProvider, ThemeProvider,
createTheme, createTheme,
Button,
} from "@mui/material"; } from "@mui/material";
import { AccountCard } from "./Account/AccountCard"; import { AccountCard } from "./Account/AccountCard";
import { AccessToken } from "@/types"; import { AccessToken } from "@/types";
@@ -12,6 +13,8 @@ import { CharacterContext, SessionContext } from "../context/Context";
import ResponsiveAppBar from "./AppBar/AppBar"; import ResponsiveAppBar from "./AppBar/AppBar";
import { Summary } from "./Summary/Summary"; import { Summary } from "./Summary/Summary";
import { DragDropContext, Droppable, Draggable, DropResult } from "@hello-pangea/dnd"; import { DragDropContext, Droppable, Draggable, DropResult } from "@hello-pangea/dnd";
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
interface Grouped { interface Grouped {
[key: string]: AccessToken[]; [key: string]: AccessToken[];
@@ -41,6 +44,7 @@ declare module "@mui/material/styles" {
export const MainGrid = () => { export const MainGrid = () => {
const { characters, updateCharacter } = useContext(CharacterContext); const { characters, updateCharacter } = useContext(CharacterContext);
const [accountOrder, setAccountOrder] = useState<string[]>([]); const [accountOrder, setAccountOrder] = useState<string[]>([]);
const [allCollapsed, setAllCollapsed] = useState(false);
// Initialize account order when characters change // Initialize account order when characters change
useEffect(() => { useEffect(() => {
@@ -134,6 +138,15 @@ export const MainGrid = () => {
<Box sx={{ flexGrow: 1 }}> <Box sx={{ flexGrow: 1 }}>
<ResponsiveAppBar /> <ResponsiveAppBar />
{compactMode ? <></> : <Summary characters={characters} />} {compactMode ? <></> : <Summary characters={characters} />}
<Box sx={{ display: 'flex', justifyContent: 'flex-start', padding: 1 }}>
<Button
startIcon={allCollapsed ? <KeyboardArrowDownIcon /> : <KeyboardArrowUpIcon />}
onClick={() => setAllCollapsed(!allCollapsed)}
size="small"
>
{allCollapsed ? 'Expand All' : 'Collapse All'}
</Button>
</Box>
<DragDropContextComponent onDragEnd={handleDragEnd}> <DragDropContextComponent onDragEnd={handleDragEnd}>
<DroppableComponent droppableId="accounts"> <DroppableComponent droppableId="accounts">
{(provided: any) => ( {(provided: any) => (
@@ -165,7 +178,10 @@ export const MainGrid = () => {
}} }}
> >
{groupByAccount[account] && groupByAccount[account].length > 0 && ( {groupByAccount[account] && groupByAccount[account].length > 0 && (
<AccountCard characters={groupByAccount[account]} /> <AccountCard
characters={groupByAccount[account]}
isCollapsed={allCollapsed}
/>
)} )}
</Grid> </Grid>
)} )}

View File

@@ -3,8 +3,6 @@ import { planetCalculations } from "@/planets";
import { AccessToken, PlanetWithInfo } from "@/types"; import { AccessToken, PlanetWithInfo } from "@/types";
import { import {
Card, Card,
Checkbox,
FormControlLabel,
Table, Table,
TableBody, TableBody,
TableCell, TableCell,
@@ -20,12 +18,6 @@ import Image from "next/image";
import { ColorContext, SessionContext } from "@/app/context/Context"; import { ColorContext, SessionContext } from "@/app/context/Context";
import { useContext } from "react"; import { useContext } from "react";
export type PlanetConfig = {
characterId: number;
planetId: number;
excludeFromTotals: boolean;
};
export const PlanetConfigDialog = ({ export const PlanetConfigDialog = ({
planet, planet,
character, character,
@@ -35,14 +27,9 @@ export const PlanetConfigDialog = ({
}) => { }) => {
const theme = useTheme(); const theme = useTheme();
const { colors } = useContext(ColorContext); const { colors } = useContext(ColorContext);
const { piPrices, readPlanetConfig, updatePlanetConfig } = const { piPrices } = useContext(SessionContext);
useContext(SessionContext);
const { extractors, localProduction, localImports, localExports } = const { extractors, localProduction, localImports, localExports } =
planetCalculations(planet); planetCalculations(planet);
const planetConfig = readPlanetConfig({
characterId: character.character.characterId,
planetId: planet.planet_id,
});
return ( return (
<Card style={{ padding: "1rem", margin: "1rem" }}> <Card style={{ padding: "1rem", margin: "1rem" }}>
@@ -189,23 +176,6 @@ export const PlanetConfigDialog = ({
</TableRow> </TableRow>
</TableBody> </TableBody>
</Table> </Table>
<Card style={{ marginTop: "1rem" }}>
<Typography>Planet configuration</Typography>
<FormControlLabel
control={
<Checkbox
checked={planetConfig.excludeFromTotals}
onChange={() =>
updatePlanetConfig({
...planetConfig,
excludeFromTotals: !planetConfig.excludeFromTotals,
})
}
/>
}
label="Consumed by production chain"
/>
</Card>
</Card> </Card>
); );
}; };

View File

@@ -65,6 +65,7 @@ export interface ProductionNode {
quantity: number; quantity: number;
}>; }>;
cycleTime: number; cycleTime: number;
factoryCount: number;
} }
export interface ProductionChainBalance { export interface ProductionChainBalance {

View File

@@ -1,7 +1,6 @@
import React from 'react'; import React from 'react';
import { Box, Paper, Typography, Stack } from '@mui/material'; import { Box, Paper, Typography, Stack } from '@mui/material';
import { Line } from 'react-chartjs-2'; import { Line } from 'react-chartjs-2';
import { useTheme } from '@mui/material';
import { getProgramOutputPrediction, ProductionNode } from './ExtractionSimulation'; import { getProgramOutputPrediction, ProductionNode } from './ExtractionSimulation';
import { PI_TYPES_MAP } from '@/const'; import { PI_TYPES_MAP } from '@/const';
import { ProductionChainVisualization } from './ProductionChainVisualization'; import { ProductionChainVisualization } from './ProductionChainVisualization';
@@ -15,6 +14,8 @@ import {
Tooltip, Tooltip,
Legend Legend
} from 'chart.js'; } from 'chart.js';
import { DateTime } from 'luxon';
import Countdown from 'react-countdown';
ChartJS.register( ChartJS.register(
CategoryScale, CategoryScale,
@@ -43,6 +44,7 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
extractors, extractors,
productionNodes productionNodes
}) => { }) => {
const CYCLE_TIME = 30 * 60; // 30 minutes in seconds const CYCLE_TIME = 30 * 60; // 30 minutes in seconds
// Calculate program duration and cycles for each extractor // Calculate program duration and cycles for each extractor
@@ -57,6 +59,7 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
}; };
}); });
const maxCycles = Math.max(...extractorPrograms.map(e => e.cycles)); const maxCycles = Math.max(...extractorPrograms.map(e => e.cycles));
// Get output predictions for each extractor // Get output predictions for each extractor
@@ -156,10 +159,14 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
const installedSchematicIds = Array.from(new Set(productionNodes.map(node => node.schematicId))); const installedSchematicIds = Array.from(new Set(productionNodes.map(node => node.schematicId)));
// Create factories array with correct counts // Create factories array with correct counts
const factories = installedSchematicIds.map(schematicId => ({ const factories = installedSchematicIds.map(schematicId => {
schematic_id: schematicId, const node = productionNodes.find(n => n.schematicId === schematicId);
count: productionNodes.filter(node => node.schematicId === schematicId).length if (!node) return { schematic_id: schematicId, count: 0 };
})); return {
schematic_id: schematicId,
count: node.factoryCount
};
});
return ( return (
<Box> <Box>
@@ -191,6 +198,12 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
<Typography variant="body2" component="div" sx={{ pl: 2 }}> <Typography variant="body2" component="div" sx={{ pl: 2 }}>
Expiry Time: {new Date(expiryTime).toLocaleString()} Expiry Time: {new Date(expiryTime).toLocaleString()}
</Typography> </Typography>
<Typography variant="body2" component="div" sx={{ pl: 2 }}>
Factory Count: {factories.find(f => f.schematic_id === typeId)?.count ?? 0}
</Typography>
<Typography variant="body2" component="div" sx={{ pl: 2 }}>
Expires in: <Countdown overtime={true} date={DateTime.fromISO(expiryTime).toMillis()} />
</Typography>
</Stack> </Stack>
))} ))}
</Box> </Box>
@@ -204,7 +217,8 @@ export const ExtractionSimulationDisplay: React.FC<ExtractionSimulationDisplayPr
extractors={extractors.map(e => ({ extractors={extractors.map(e => ({
typeId: e.typeId, typeId: e.typeId,
baseValue: e.baseValue, baseValue: e.baseValue,
cycleTime: CYCLE_TIME cycleTime: CYCLE_TIME,
expiryTime: e.expiryTime
}))} }))}
factories={factories} factories={factories}
extractorTotals={extractorTotals} extractorTotals={extractorTotals}

View File

@@ -0,0 +1,210 @@
import React from 'react';
import { Box, Paper, Typography, Stack } from '@mui/material';
import { Line } from 'react-chartjs-2';
import { getProgramOutputPrediction } from './ExtractionSimulation';
import { PI_TYPES_MAP } from '@/const';
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend
} from 'chart.js';
import { DateTime } from 'luxon';
import Countdown from 'react-countdown';
ChartJS.register(
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend
);
interface ExtractorConfig {
typeId: number;
baseValue: number;
cycleTime: number;
installTime: string;
expiryTime: string;
}
interface ExtractionSimulationTooltipProps {
extractors: ExtractorConfig[];
}
export const ExtractionSimulationTooltip: React.FC<ExtractionSimulationTooltipProps> = ({
extractors
}) => {
const CYCLE_TIME = 30 * 60; // 30 minutes in seconds
// Calculate program duration and cycles for each extractor
const extractorPrograms = extractors.map(extractor => {
const installDate = new Date(extractor.installTime);
const expiryDate = new Date(extractor.expiryTime);
const programDuration = (expiryDate.getTime() - installDate.getTime()) / 1000; // Convert to seconds
return {
...extractor,
programDuration,
cycles: Math.floor(programDuration / CYCLE_TIME)
};
});
const maxCycles = Math.max(...extractorPrograms.map(e => e.cycles));
// Get output predictions for each extractor
const extractorOutputs = extractorPrograms.map(extractor => ({
typeId: extractor.typeId,
cycleTime: CYCLE_TIME,
cycles: extractor.cycles,
prediction: getProgramOutputPrediction(
extractor.baseValue,
CYCLE_TIME,
extractor.cycles
)
}));
// Create datasets for the chart
const datasets = extractorOutputs.map((output, index) => {
const hue = (360 / extractors.length) * index;
return {
label: `${PI_TYPES_MAP[output.typeId]?.name ?? `Resource ${output.typeId}`}`,
data: output.prediction,
borderColor: `hsl(${hue}, 70%, 50%)`,
backgroundColor: `hsl(${hue}, 70%, 80%)`,
tension: 0.4
};
});
const chartData = {
labels: Array.from({ length: maxCycles }, (_, i) => {
return (i % 4 === 0) ? `Cycle ${i + 1}` : '';
}),
datasets
};
const chartOptions = {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'top' as const,
},
title: {
display: true,
text: 'Extraction Output Prediction'
},
tooltip: {
callbacks: {
title: (context: any) => `Cycle ${context[0].dataIndex + 1}`,
label: (context: any) => `Output: ${context.raw.toFixed(1)} units`
}
}
},
scales: {
y: {
beginAtZero: true,
title: {
display: true,
text: 'Units per Cycle'
}
},
x: {
ticks: {
autoSkip: true,
maxTicksLimit: 24
}
}
}
};
return (
<Paper sx={{ p: 1, bgcolor: 'background.paper', minWidth: 800 }}>
<Stack direction="row" spacing={2} sx={{ width: '100%' }}>
<Box sx={{ flex: 1, minWidth: 0 }}>
<div style={{ height: '200px' }}>
<Line data={chartData} options={chartOptions} />
</div>
</Box>
<Box sx={{ flex: 1, minWidth: 0 }}>
<Stack spacing={1}>
{extractorPrograms.map(({ typeId, cycleTime, cycles, installTime, expiryTime }, idx) => {
const prediction = getProgramOutputPrediction(
extractors[idx].baseValue,
CYCLE_TIME,
cycles
);
const totalOutput = prediction.reduce((sum, val) => sum + val, 0);
return (
<Paper key={typeId} sx={{ p: 1, bgcolor: 'background.default' }}>
<Typography variant="subtitle2">
{PI_TYPES_MAP[typeId]?.name}
</Typography>
<Stack spacing={0.5}>
<Typography variant="body2">
Total Output: {totalOutput.toFixed(1)} units per program
</Typography>
<Typography variant="body2">
Cycle Time: {(cycleTime / 60).toFixed(1)} minutes
</Typography>
<Typography variant="body2">
Program Cycles: {cycles}
</Typography>
<Typography variant="body2">
Average per Cycle: {(totalOutput / cycles).toFixed(1)} units
</Typography>
<Typography variant="body2">
Average per hour: {(totalOutput / cycles * 2).toFixed(1)} units
</Typography>
<Typography variant="body2">
Expires in: <Countdown overtime={true} date={DateTime.fromISO(expiryTime).toMillis()} />
</Typography>
</Stack>
</Paper>
);
})}
{extractors.length === 2 && (
<Paper sx={{ p: 1, bgcolor: 'background.default' }}>
<Typography variant="subtitle2" color="error">
Balance
</Typography>
<Stack spacing={0.5}>
{extractors.map((extractor, index) => {
const averagePerHour = (extractor.baseValue * 3600) / extractor.cycleTime;
return (
<Typography key={index} variant="body2">
{PI_TYPES_MAP[extractor.typeId]?.name}: {averagePerHour.toFixed(1)} u/h
</Typography>
);
})}
<Typography
variant="body2"
color="error"
sx={{
mt: 1,
fontWeight: 'bold',
borderTop: '1px solid',
borderColor: 'divider',
pt: 1
}}
>
Difference: {Math.abs(
(extractors[0].baseValue * 3600 / extractors[0].cycleTime) -
(extractors[1].baseValue * 3600 / extractors[1].cycleTime)
).toFixed(1)} u/h
</Typography>
</Stack>
</Paper>
)}
</Stack>
</Box>
</Stack>
</Paper>
);
};

View File

@@ -1,31 +1,21 @@
import { Stack, Typography, styled, useTheme } from "@mui/material"; import { Stack, Typography, styled, useTheme, Tooltip } from "@mui/material";
import Image from "next/image"; import Image from "next/image";
import { import {
AccessToken, AccessToken,
Planet,
PlanetInfo,
PlanetInfoUniverse,
PlanetWithInfo, PlanetWithInfo,
} from "@/types"; } from "@/types";
import React, { forwardRef, useContext, useEffect, useState } from "react"; import React, { useContext } from "react";
import { DateTime } from "luxon"; import { DateTime } from "luxon";
import { EXTRACTOR_TYPE_IDS } from "@/const"; import { EXTRACTOR_TYPE_IDS } from "@/const";
import Countdown from "react-countdown"; import Countdown from "react-countdown";
import PinsCanvas3D from "./PinsCanvas3D"; import { getProgramOutputPrediction } from "./ExtractionSimulation";
import Slide from "@mui/material/Slide";
import { TransitionProps } from "@mui/material/transitions";
import Dialog from "@mui/material/Dialog";
import AppBar from "@mui/material/AppBar";
import Toolbar from "@mui/material/Toolbar";
import IconButton from "@mui/material/IconButton";
import CloseIcon from "@mui/icons-material/Close";
import Button from "@mui/material/Button";
import { import {
alertModeVisibility, alertModeVisibility,
extractorsHaveExpired, extractorsHaveExpired,
timeColor, timeColor,
} from "./timeColors"; } from "./timeColors";
import { ColorContext, SessionContext } from "@/app/context/Context"; import { ColorContext, SessionContext } from "@/app/context/Context";
import { ExtractionSimulationTooltip } from "./ExtractionSimulationTooltip";
const StackItem = styled(Stack)(({ theme }) => ({ const StackItem = styled(Stack)(({ theme }) => ({
...theme.typography.body2, ...theme.typography.body2,
@@ -36,15 +26,6 @@ const StackItem = styled(Stack)(({ theme }) => ({
alignItems: "center", alignItems: "center",
})); }));
const Transition = forwardRef(function Transition(
props: TransitionProps & {
children: React.ReactElement;
},
ref: React.Ref<unknown>,
) {
return <Slide direction="up" ref={ref} {...props} />;
});
export const PlanetCard = ({ export const PlanetCard = ({
character, character,
planet, planet,
@@ -57,18 +38,8 @@ export const PlanetCard = ({
const planetInfo = planet.info; const planetInfo = planet.info;
const planetInfoUniverse = planet.infoUniverse; const planetInfoUniverse = planet.infoUniverse;
const [planetRenderOpen, setPlanetRenderOpen] = useState(false);
const theme = useTheme(); const theme = useTheme();
const handle3DrenderOpen = () => {
setPlanetRenderOpen(true);
};
const handle3DrenderClose = () => {
setPlanetRenderOpen(false);
};
const extractorsExpiryTime = const extractorsExpiryTime =
(planetInfo && (planetInfo &&
planetInfo.pins planetInfo.pins
@@ -79,7 +50,75 @@ export const PlanetCard = ({
const { colors } = useContext(ColorContext); const { colors } = useContext(ColorContext);
const expired = extractorsHaveExpired(extractorsExpiryTime); const expired = extractorsHaveExpired(extractorsExpiryTime);
const CYCLE_TIME = 30 * 60; // 30 minutes in seconds
const extractors = planetInfo?.pins
.filter((p) => EXTRACTOR_TYPE_IDS.some((e) => e === p.type_id))
.map((p) => ({
typeId: p.type_id,
baseValue: p.extractor_details?.qty_per_cycle || 0,
cycleTime: p.extractor_details?.cycle_time || 3600,
installTime: p.install_time || "",
expiryTime: p.expiry_time || "",
installedSchematicId: p.extractor_details?.product_type_id || undefined
})) || [];
// Calculate program duration and cycles for each extractor
const extractorPrograms = extractors.map(extractor => {
const installDate = new Date(extractor.installTime);
const expiryDate = new Date(extractor.expiryTime);
const programDuration = (expiryDate.getTime() - installDate.getTime()) / 1000; // Convert to seconds
return {
...extractor,
programDuration,
cycles: Math.floor(programDuration / CYCLE_TIME)
};
});
// Get output predictions for each extractor
const extractorOutputs = extractorPrograms.map(extractor => ({
typeId: extractor.typeId,
cycleTime: CYCLE_TIME,
cycles: extractor.cycles,
prediction: getProgramOutputPrediction(
extractor.baseValue,
CYCLE_TIME,
extractor.cycles
)
}));
// Calculate average per hour for each extractor
const extractorAverages = extractorOutputs.map(extractor => {
const totalOutput = extractor.prediction.reduce((sum, val) => sum + val, 0);
const programDuration = extractor.cycles * CYCLE_TIME;
const averagePerHour = (totalOutput / programDuration) * 3600;
return {
typeId: extractor.typeId,
averagePerHour
};
});
return ( return (
<Tooltip
title={
<ExtractionSimulationTooltip
extractors={extractors}
/>
}
componentsProps={{
tooltip: {
sx: {
bgcolor: 'background.paper',
'& .MuiTooltip-arrow': {
color: 'background.paper',
},
maxWidth: 'none',
width: 'fit-content'
}
}
}}
>
<StackItem <StackItem
alignItems="flex-start" alignItems="flex-start"
height="100%" height="100%"
@@ -87,15 +126,32 @@ export const PlanetCard = ({
minHeight={theme.custom.cardMinHeight} minHeight={theme.custom.cardMinHeight}
visibility={alertModeVisibility(alertMode, expired)} visibility={alertModeVisibility(alertMode, expired)}
> >
<Image
unoptimized <div style={{ position: 'relative' }}>
src={`/${planet.planet_type}.png`} <Image
alt="" unoptimized
width={theme.custom.cardImageSize} src={`/${planet.planet_type}.png`}
height={theme.custom.cardImageSize} alt=""
style={{ borderRadius: 8, marginRight: 4 }} width={theme.custom.cardImageSize}
onClick={handle3DrenderOpen} height={theme.custom.cardImageSize}
/> style={{
borderRadius: 8,
marginRight: 4,
position: 'relative',
zIndex: 0
}}
/>
<div style={{
position: 'absolute',
top: 0,
left: 0,
width: theme.custom.cardImageSize,
height: theme.custom.cardImageSize,
backgroundColor: 'rgba(0, 0, 0, 0.8)',
borderRadius: 8,
}} />
</div>
{expired && ( {expired && (
<Image <Image
width={32} width={32}
@@ -109,55 +165,41 @@ export const PlanetCard = ({
<Typography fontSize={theme.custom.smallText}> <Typography fontSize={theme.custom.smallText}>
{planetInfoUniverse?.name} {planetInfoUniverse?.name}
</Typography> </Typography>
<Typography fontSize={theme.custom.smallText}> {extractorsExpiryTime.map((e, idx) => {
L{planet.upgrade_level} const extractor = extractors[idx];
</Typography> const average = extractorAverages[idx];
return (
<div key={`${e}-${idx}-${character.character.characterId}`}>
<Typography
color={timeColor(e, colors)}
fontSize={theme.custom.smallText}
>
{!expired && e && <Countdown
overtime={true}
date={DateTime.fromISO(e).toMillis()}
/>
}
</Typography>
{!expired && extractor && average && (
<div style={{ display: 'flex', alignItems: 'center', gap: 4 }}>
<Image
unoptimized
src={`https://images.evetech.net/types/${extractor.installedSchematicId}/icon?size=32`}
alt=""
width={16}
height={16}
style={{ borderRadius: 4 }}
/>
<Typography fontSize={theme.custom.smallText}>
{average.averagePerHour.toFixed(1)}/h
</Typography>
</div>
)}
</div>
);
})}
</div> </div>
{extractorsExpiryTime.map((e, idx) => {
return (
<Typography
key={`${e}-${idx}-${character.character.characterId}`}
color={timeColor(e, colors)}
fontSize={theme.custom.smallText}
>
{e ? (
<Countdown
overtime={true}
date={DateTime.fromISO(e).toMillis()}
/>
) : (
"STOPPED"
)}
</Typography>
);
})}
<Dialog
fullScreen
open={planetRenderOpen}
onClose={handle3DrenderClose}
TransitionComponent={Transition}
>
<AppBar sx={{ position: "relative" }}>
<Toolbar>
<IconButton
edge="start"
color="inherit"
onClick={handle3DrenderClose}
aria-label="close"
>
<CloseIcon />
</IconButton>
<Typography sx={{ ml: 2, flex: 1 }} variant="h6" component="div">
{planetInfoUniverse?.name}
</Typography>
<Button autoFocus color="inherit" onClick={handle3DrenderClose}>
Close
</Button>
</Toolbar>
</AppBar>
<PinsCanvas3D planetInfo={planetInfo} />
</Dialog>
</StackItem> </StackItem>
</Tooltip>
); );
}; };

View File

@@ -4,7 +4,7 @@ import { planetCalculations } from "@/planets";
import { AccessToken, PlanetWithInfo } from "@/types"; import { AccessToken, PlanetWithInfo } from "@/types";
import CloseIcon from "@mui/icons-material/Close"; import CloseIcon from "@mui/icons-material/Close";
import MoreVertIcon from '@mui/icons-material/MoreVert'; import MoreVertIcon from '@mui/icons-material/MoreVert';
import { Button, Tooltip, Typography, useTheme, Menu, MenuItem, IconButton } from "@mui/material"; import { Button, Tooltip, Typography, useTheme, Menu, MenuItem, IconButton, Checkbox, FormControlLabel } from "@mui/material";
import AppBar from "@mui/material/AppBar"; import AppBar from "@mui/material/AppBar";
import Dialog from "@mui/material/Dialog"; import Dialog from "@mui/material/Dialog";
import Slide from "@mui/material/Slide"; import Slide from "@mui/material/Slide";
@@ -20,10 +20,9 @@ import { PlanetConfigDialog } from "../PlanetConfig/PlanetConfigDialog";
import PinsCanvas3D from "./PinsCanvas3D"; import PinsCanvas3D from "./PinsCanvas3D";
import { alertModeVisibility, timeColor } from "./timeColors"; import { alertModeVisibility, timeColor } from "./timeColors";
import { ExtractionSimulationDisplay } from './ExtractionSimulationDisplay'; import { ExtractionSimulationDisplay } from './ExtractionSimulationDisplay';
import { ExtractionSimulationTooltip } from './ExtractionSimulationTooltip';
import { ProductionNode } from './ExtractionSimulation'; import { ProductionNode } from './ExtractionSimulation';
import { Collapse, Box, Stack } from "@mui/material"; import { Collapse, Box, Stack } from "@mui/material";
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import ExpandLessIcon from '@mui/icons-material/ExpandLess';
const Transition = forwardRef(function Transition( const Transition = forwardRef(function Transition(
props: TransitionProps & { props: TransitionProps & {
@@ -72,14 +71,15 @@ export const PlanetTableRow = ({
setPlanetConfigOpen(false); setPlanetConfigOpen(false);
}; };
const { piPrices, alertMode } = useContext(SessionContext); const { piPrices, alertMode, updatePlanetConfig, readPlanetConfig, balanceThreshold } = useContext(SessionContext);
const planetInfo = planet.info; const planetInfo = planet.info;
const planetInfoUniverse = planet.infoUniverse; const planetInfoUniverse = planet.infoUniverse;
const { expired, extractors, localProduction, localImports, localExports } = const { expired, extractors, localProduction, localImports, localExports } =
planetCalculations(planet); planetCalculations(planet);
const planetConfig = character.planetConfig.find( const planetConfig = readPlanetConfig({
(p) => p.planetId === planet.planet_id, characterId: character.character.characterId,
); planetId: planet.planet_id,
});
const { colors } = useContext(ColorContext); const { colors } = useContext(ColorContext);
// Convert local production to ProductionNode array for simulation // Convert local production to ProductionNode array for simulation
const productionNodes: ProductionNode[] = Array.from(localProduction).map(([schematicId, schematic]) => ({ const productionNodes: ProductionNode[] = Array.from(localProduction).map(([schematicId, schematic]) => ({
@@ -94,9 +94,25 @@ export const PlanetTableRow = ({
typeId: output.type_id, typeId: output.type_id,
quantity: output.quantity quantity: output.quantity
})), })),
cycleTime: schematic.cycle_time cycleTime: schematic.cycle_time,
factoryCount: schematic.count || 1
})); }));
// Calculate extractor averages and check for large differences
const extractorAverages = extractors
.filter(e => e.extractor_details?.product_type_id && e.extractor_details?.qty_per_cycle)
.map(e => {
const cycleTime = e.extractor_details?.cycle_time || 3600;
const qtyPerCycle = e.extractor_details?.qty_per_cycle || 0;
return {
typeId: e.extractor_details!.product_type_id!,
averagePerHour: (qtyPerCycle * 3600) / cycleTime
};
});
const hasLargeExtractorDifference = extractorAverages.length === 2 &&
Math.abs(extractorAverages[0].averagePerHour - extractorAverages[1].averagePerHour) > balanceThreshold;
const storageFacilities = planetInfo.pins.filter(pin => const storageFacilities = planetInfo.pins.filter(pin =>
STORAGE_IDS().some(storage => storage.type_id === pin.type_id) STORAGE_IDS().some(storage => storage.type_id === pin.type_id)
); );
@@ -130,13 +146,33 @@ export const PlanetTableRow = ({
}; };
}; };
const handleExcludeChange = (event: React.ChangeEvent<HTMLInputElement>) => {
updatePlanetConfig({
...planetConfig,
excludeFromTotals: event.target.checked,
});
};
return ( return (
<> <>
<TableRow <TableRow
style={{ visibility: alertModeVisibility(alertMode, expired) }} style={{ visibility: alertModeVisibility(alertMode, expired) }}
sx={{ "&:last-child td, &:last-child th": { border: 0 } }} sx={{
"&:last-child td, &:last-child th": { border: 0 },
cursor: 'pointer',
'&:hover': {
backgroundColor: 'action.hover'
}
}}
onClick={(e) => {
// Only trigger if clicking a cell with the clickable-cell class
if (!(e.target as HTMLElement).closest('.clickable-cell')) return;
if (extractors.length > 0) {
setSimulationOpen(!simulationOpen);
}
}}
> >
<TableCell component="th" scope="row"> <TableCell component="th" scope="row" className="clickable-cell">
<Tooltip <Tooltip
title={`${ title={`${
planet.planet_type.charAt(0).toUpperCase() + planet.planet_type.charAt(0).toUpperCase() +
@@ -151,12 +187,57 @@ export const PlanetTableRow = ({
height={theme.custom.cardImageSize / 6} height={theme.custom.cardImageSize / 6}
style={{ marginRight: "5px" }} style={{ marginRight: "5px" }}
/> />
{planetInfoUniverse?.name} <Tooltip
placement="right"
title={
<ExtractionSimulationTooltip
extractors={extractors
.filter(e => e.extractor_details?.product_type_id && e.extractor_details?.qty_per_cycle)
.map(e => ({
typeId: e.extractor_details!.product_type_id!,
baseValue: e.extractor_details!.qty_per_cycle!,
cycleTime: e.extractor_details!.cycle_time || 3600,
installTime: e.install_time ?? "",
expiryTime: e.expiry_time ?? ""
}))}
/>
}
componentsProps={{
tooltip: {
sx: {
bgcolor: 'background.paper',
'& .MuiTooltip-arrow': {
color: 'background.paper',
},
maxWidth: 'none',
width: 'fit-content'
}
}
}}
>
<Stack spacing={0}>
<Typography
fontSize={theme.custom.smallText}
color={hasLargeExtractorDifference ? 'error' : 'inherit'}
>
{planetInfoUniverse?.name}
</Typography>
{hasLargeExtractorDifference && (
<Typography
fontSize={theme.custom.smallText}
color="error"
sx={{ opacity: 0.7 }}
>
off-balance
</Typography>
)}
</Stack>
</Tooltip>
</div> </div>
</Tooltip> </Tooltip>
</TableCell> </TableCell>
<TableCell>{planet.upgrade_level}</TableCell> <TableCell className="clickable-cell">{planet.upgrade_level}</TableCell>
<TableCell> <TableCell className="clickable-cell">
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{extractors.map((e, idx) => { {extractors.map((e, idx) => {
return ( return (
@@ -189,7 +270,7 @@ export const PlanetTableRow = ({
})} })}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell className="clickable-cell">
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{Array.from(localProduction).map((schematic, idx) => { {Array.from(localProduction).map((schematic, idx) => {
return ( return (
@@ -203,7 +284,7 @@ export const PlanetTableRow = ({
})} })}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell className="clickable-cell">
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{localImports.map((i) => ( {localImports.map((i) => (
<Typography <Typography
@@ -215,7 +296,7 @@ export const PlanetTableRow = ({
))} ))}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell className="clickable-cell">
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{localExports.map((exports) => ( {localExports.map((exports) => (
<Typography <Typography
@@ -230,16 +311,21 @@ export const PlanetTableRow = ({
<TableCell> <TableCell>
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{localExports.map((exports) => ( {localExports.map((exports) => (
<Typography <FormControlLabel
key={`export-excluded-${character.character.characterId}-${planet.planet_id}-${exports.typeId}`} key={`export-excluded-${character.character.characterId}-${planet.planet_id}-${exports.typeId}`}
fontSize={theme.custom.smallText} control={
> <Checkbox
{planetConfig?.excludeFromTotals ? "ex" : ""} checked={planetConfig.excludeFromTotals}
</Typography> onChange={handleExcludeChange}
size="small"
/>
}
label=""
/>
))} ))}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell className="clickable-cell">
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{localExports.map((exports) => ( {localExports.map((exports) => (
<Typography <Typography
@@ -251,7 +337,7 @@ export const PlanetTableRow = ({
))} ))}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell className="clickable-cell">
<div <div
style={{ style={{
display: "flex", display: "flex",
@@ -284,7 +370,7 @@ export const PlanetTableRow = ({
})} })}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell className="clickable-cell">
<div style={{ display: "flex", flexDirection: "column" }}> <div style={{ display: "flex", flexDirection: "column" }}>
{storageFacilities {storageFacilities
.sort((a, b) => { .sort((a, b) => {
@@ -326,7 +412,7 @@ export const PlanetTableRow = ({
})} })}
</div> </div>
</TableCell> </TableCell>
<TableCell> <TableCell className="menu-cell">
<IconButton <IconButton
aria-label="more" aria-label="more"
aria-controls="planet-menu" aria-controls="planet-menu"
@@ -348,14 +434,6 @@ export const PlanetTableRow = ({
}}> }}>
Configure Planet Configure Planet
</MenuItem> </MenuItem>
{extractors.length > 0 && (
<MenuItem onClick={() => {
setSimulationOpen(!simulationOpen);
handleMenuClose();
}}>
{simulationOpen ? 'Hide Extraction Simulation' : 'Show Extraction Simulation'}
</MenuItem>
)}
<MenuItem onClick={() => { <MenuItem onClick={() => {
handle3DrenderOpen(); handle3DrenderOpen();
handleMenuClose(); handleMenuClose();
@@ -366,7 +444,7 @@ export const PlanetTableRow = ({
</TableCell> </TableCell>
</TableRow> </TableRow>
<TableRow> <TableRow>
<TableCell colSpan={6} style={{ paddingBottom: 0, paddingTop: 0 }}> <TableCell colSpan={6} style={{ paddingBottom: 0, paddingTop: 0, border: 'none' }}>
<Collapse in={simulationOpen} timeout="auto" unmountOnExit> <Collapse in={simulationOpen} timeout="auto" unmountOnExit>
<Box sx={{ my: 2 }}> <Box sx={{ my: 2 }}>
<ExtractionSimulationDisplay <ExtractionSimulationDisplay

View File

@@ -1,5 +1,5 @@
import { AccessToken } from "@/types"; import { AccessToken } from "@/types";
import { Stack, Tooltip, Typography, styled, useTheme } from "@mui/material"; import { Icon, IconButton, Stack, Tooltip, Typography, styled, useTheme } from "@mui/material";
import { PlanetCard } from "./PlanetCard"; import { PlanetCard } from "./PlanetCard";
import { NoPlanetCard } from "./NoPlanetCard"; import { NoPlanetCard } from "./NoPlanetCard";
import Table from "@mui/material/Table"; import Table from "@mui/material/Table";
@@ -10,7 +10,7 @@ import TableHead from "@mui/material/TableHead";
import TableRow from "@mui/material/TableRow"; import TableRow from "@mui/material/TableRow";
import Paper from "@mui/material/Paper"; import Paper from "@mui/material/Paper";
import { PlanetTableRow } from "./PlanetTableRow"; import { PlanetTableRow } from "./PlanetTableRow";
import Image from "next/image"; import { Settings } from "@mui/icons-material";
const StackItem = styled(Stack)(({ theme }) => ({ const StackItem = styled(Stack)(({ theme }) => ({
...theme.typography.body2, ...theme.typography.body2,
@@ -102,6 +102,13 @@ const PlanetaryIteractionTable = ({
</Typography> </Typography>
</Tooltip> </Tooltip>
</TableCell> </TableCell>
<TableCell>
<Tooltip title="Planet settings">
<IconButton aria-label="settings">
<Settings fontSize="small" />
</IconButton>
</Tooltip>
</TableCell>
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>

View File

@@ -1,7 +1,10 @@
import React from 'react'; import React from 'react';
import { Box, Paper, Typography, Grid, Stack, Divider } from '@mui/material'; import { Box, Paper, Typography, Grid, Stack } from '@mui/material';
import { EVE_IMAGE_URL } from '@/const'; import { EVE_IMAGE_URL } from '@/const';
import { PI_TYPES_MAP } from '@/const'; import { PI_TYPES_MAP } from '@/const';
import { DateTime } from 'luxon';
import Countdown from 'react-countdown';
import Image from 'next/image';
interface Factory { interface Factory {
schematic_id: number; schematic_id: number;
@@ -29,6 +32,7 @@ interface ProductionChainVisualizationProps {
typeId: number; typeId: number;
baseValue: number; baseValue: number;
cycleTime: number; cycleTime: number;
expiryTime: string;
}>; }>;
factories: Factory[]; factories: Factory[];
extractorTotals: Map<number, number>; extractorTotals: Map<number, number>;
@@ -39,8 +43,10 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
extractedTypeIds, extractedTypeIds,
factories, factories,
extractorTotals, extractorTotals,
productionNodes productionNodes,
extractors
}) => { }) => {
// Get all type IDs involved in the production chain // Get all type IDs involved in the production chain
const allTypeIds = new Set<number>(); const allTypeIds = new Set<number>();
const requiredInputs = new Set<number>(); const requiredInputs = new Set<number>();
@@ -214,9 +220,15 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
// Get factory count for a type // Get factory count for a type
const getFactoryCount = (typeId: number): number => { const getFactoryCount = (typeId: number): number => {
const node = nodesByOutput.get(typeId); // First find the node that produces this type
if (!node) return 0; const producingNode = productionNodes.find(node =>
return factories.find(f => f.schematic_id === node.schematicId)?.count ?? 0; node.outputs.some(output => output.typeId === typeId)
);
if (!producingNode) return 0;
// Then find the factory count for this schematic
return factories.find(f => f.schematic_id === producingNode.schematicId)?.count ?? 0;
}; };
// Get input requirements for a type // Get input requirements for a type
@@ -232,6 +244,11 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
return node?.cycleTime; return node?.cycleTime;
}; };
// Get extractor expiry time for a type
const getExtractorExpiryTime = (typeId: number): string | undefined => {
return extractors.find(e => e.typeId === typeId)?.expiryTime;
};
return ( return (
<Paper sx={{ p: 2, my: 2 }}> <Paper sx={{ p: 2, my: 2 }}>
<Typography variant="h6" gutterBottom> <Typography variant="h6" gutterBottom>
@@ -258,6 +275,7 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
const consumption = consumptionTotals.get(typeId) ?? 0; const consumption = consumptionTotals.get(typeId) ?? 0;
const inputs = getInputRequirements(typeId); const inputs = getInputRequirements(typeId);
const cycleTime = getSchematicCycleTime(typeId); const cycleTime = getSchematicCycleTime(typeId);
const expiryTime = getExtractorExpiryTime(typeId);
return ( return (
<Grid item key={typeId} xs={12} sm={6} md={4}> <Grid item key={typeId} xs={12} sm={6} md={4}>
@@ -274,7 +292,7 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
}} }}
> >
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}> <Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
<img <Image
src={`${EVE_IMAGE_URL}/types/${typeId}/icon`} src={`${EVE_IMAGE_URL}/types/${typeId}/icon`}
alt={type?.name ?? `Type ${typeId}`} alt={type?.name ?? `Type ${typeId}`}
width={48} width={48}
@@ -292,19 +310,49 @@ export const ProductionChainVisualization: React.FC<ProductionChainVisualization
</Box> </Box>
</Box> </Box>
<Stack spacing={0.5}> <Stack spacing={0.5}>
{production > 0 && ( {factoryCount > 0 && (
<> <Typography variant="caption" color="info.main">
<Typography variant="caption" color="success.main"> Factories: {factoryCount}
Production: {production.toFixed(1)} units total </Typography>
)}
{inputs.length > 0 && (
<Box>
<Typography variant="caption" color="text.secondary">
Inputs:
</Typography> </Typography>
</> {inputs.map(input => (
<Typography
key={input.typeId}
variant="caption"
sx={{ display: 'block', ml: 1 }}
>
{PI_TYPES_MAP[input.typeId]?.name}: {input.quantity * factoryCount}/cycle
</Typography>
))}
</Box>
)}
{expiryTime && (
<Box>
<Typography variant="caption" color="text.secondary">
Extractor expires in:
</Typography>
<Typography variant="caption" sx={{ ml: 1 }}>
<Countdown
overtime={true}
date={DateTime.fromISO(expiryTime).toMillis()}
/>
</Typography>
</Box>
)}
{production > 0 && (
<Typography variant="caption" color="success.main">
Production: {production.toFixed(1)} units total
</Typography>
)} )}
{consumption > 0 && ( {consumption > 0 && (
<> <Typography variant="caption" color="error.main">
<Typography variant="caption" color="error.main"> Consumption: {consumption.toFixed(1)} units total
Consumption: {consumption.toFixed(1)} units total </Typography>
</Typography>
</>
)} )}
{isImported && ( {isImported && (
<> <>

View File

@@ -1,6 +1,7 @@
import { import {
ColorContext, ColorContext,
ColorSelectionType, ColorSelectionType,
SessionContext,
} from "@/app/context/Context"; } from "@/app/context/Context";
import { import {
Button, Button,
@@ -10,14 +11,16 @@ import {
DialogTitle, DialogTitle,
Tooltip, Tooltip,
Typography, Typography,
TextField,
Box,
} from "@mui/material"; } from "@mui/material";
import { ColorChangeHandler, ColorResult, CompactPicker } from "react-color"; import { ColorChangeHandler, ColorResult, CompactPicker } from "react-color";
import React from "react"; import React, { useState, useContext } from "react";
import { useContext } from "react";
export const SettingsButton = () => { export const SettingsButton = () => {
const { colors, setColors } = useContext(ColorContext); const { colors, setColors } = useContext(ColorContext);
const [open, setOpen] = React.useState(false); const { balanceThreshold, setBalanceThreshold } = useContext(SessionContext);
const [open, setOpen] = useState(false);
const handleClickOpen = () => { const handleClickOpen = () => {
setOpen(true); setOpen(true);
@@ -26,6 +29,7 @@ export const SettingsButton = () => {
const handleClose = () => { const handleClose = () => {
setOpen(false); setOpen(false);
}; };
const handleColorSelection = (key: string, currentColors: ColorSelectionType) => (selection: ColorResult) => { const handleColorSelection = (key: string, currentColors: ColorSelectionType) => (selection: ColorResult) => {
console.log(key, selection.hex) console.log(key, selection.hex)
setColors({ setColors({
@@ -34,20 +38,44 @@ export const SettingsButton = () => {
}) })
}; };
const handleBalanceThresholdChange = (event: React.ChangeEvent<HTMLInputElement>) => {
const value = parseInt(event.target.value);
if (!isNaN(value) && value >= 0 && value <= 100000) {
setBalanceThreshold(value);
}
};
return ( return (
<Tooltip title="Toggle settings dialog"> <Tooltip title="Toggle settings dialog">
<> <>
<Button onClick={handleClickOpen}>Settings</Button> <Button onClick={handleClickOpen} color="inherit">
Settings
</Button>
<Dialog <Dialog
open={open} open={open}
onClose={handleClose} onClose={handleClose}
aria-labelledby="alert-dialog-title" aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description" aria-describedby="alert-dialog-description"
> >
<DialogTitle id="alert-dialog-title"> <DialogTitle id="alert-dialog-title">
{"Override default timer colors"} {"Settings"}
</DialogTitle> </DialogTitle>
<DialogContent style={{ paddingTop: "1rem" }}> <DialogContent style={{ paddingTop: "1rem" }}>
<Box sx={{ mt: 2 }}>
<Typography variant="subtitle1">Balance Threshold</Typography>
<TextField
type="number"
value={balanceThreshold}
onChange={handleBalanceThresholdChange}
fullWidth
margin="normal"
inputProps={{ min: 0, max: 100000 }}
helperText="Set the threshold for balance alerts (0-100,000)"
error={balanceThreshold < 0 || balanceThreshold > 100000}
/>
</Box>
{Object.keys(colors).map((key) => { {Object.keys(colors).map((key) => {
return ( return (
<div key={`color-row-${key}`}> <div key={`color-row-${key}`}>
@@ -59,6 +87,7 @@ export const SettingsButton = () => {
</div> </div>
); );
})} })}
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
<Button onClick={handleClose}>Close</Button> <Button onClick={handleClose}>Close</Button>

View File

@@ -1,5 +1,5 @@
import { SessionContext } from "@/app/context/Context"; import { SessionContext } from "@/app/context/Context";
import { PI_TYPES_MAP } from "@/const"; import { PI_TYPES_MAP, STORAGE_IDS } from "@/const";
import { planetCalculations } from "@/planets"; import { planetCalculations } from "@/planets";
import { AccessToken } from "@/types"; import { AccessToken } from "@/types";
import { import {
@@ -19,10 +19,12 @@ import {
AccordionSummary, AccordionSummary,
AccordionDetails, AccordionDetails,
TableSortLabel, TableSortLabel,
Box,
TextField,
} from "@mui/material"; } from "@mui/material";
import { useContext, useState } from "react"; import { useContext, useState, useEffect } from "react";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import { argv0 } from "process"; import { DateTime } from "luxon";
const StackItem = styled(Stack)(({ theme }) => ({ const StackItem = styled(Stack)(({ theme }) => ({
...theme.typography.body2, ...theme.typography.body2,
@@ -41,13 +43,35 @@ const displayValue = (valueInMillions: number): string =>
? `${(valueInMillions / 1000).toFixed(2)} B` ? `${(valueInMillions / 1000).toFixed(2)} B`
: `${valueInMillions.toFixed(2)} M`; : `${valueInMillions.toFixed(2)} M`;
type SortBy = "name" | "perHour" | "price"; type SortBy = "name" | "perHour" | "storage" | "price" | "storagePrice" | "progress";
type SortDirection = "asc" | "desc"; type SortDirection = "asc" | "desc";
export const Summary = ({ characters }: { characters: AccessToken[] }) => { export const Summary = ({ characters }: { characters: AccessToken[] }) => {
const { piPrices } = useContext(SessionContext); const { piPrices } = useContext(SessionContext);
const [sortDirection, setSortDirection] = useState<SortDirection>("asc"); const [sortDirection, setSortDirection] = useState<SortDirection>("asc");
const [sortBy, setSortBy] = useState<SortBy>("name"); const [sortBy, setSortBy] = useState<SortBy>("name");
const [startDate, setStartDate] = useState<string>(DateTime.now().startOf('day').toISO());
const [activityPercentage, setActivityPercentage] = useState<number>(() => {
const saved = localStorage.getItem('activityPercentage');
return saved ? parseFloat(saved) : 100;
});
useEffect(() => {
const savedDate = localStorage.getItem('productionStartDate');
if (savedDate) {
setStartDate(savedDate);
}
}, []);
useEffect(() => {
localStorage.setItem('productionStartDate', startDate);
}, [startDate]);
useEffect(() => {
localStorage.setItem('activityPercentage', activityPercentage.toString());
}, [activityPercentage]);
// Calculate exports and storage amounts
const exports = characters.flatMap((char) => { const exports = characters.flatMap((char) => {
return char.planets return char.planets
.filter( .filter(
@@ -62,6 +86,28 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
}); });
}); });
// Calculate storage amounts
const storageAmounts = characters.reduce<Grouped>((totals, character) => {
character.planets
.filter(
(p) =>
!character.planetConfig.some(
(c) => c.planetId == p.planet_id && c.excludeFromTotals,
),
)
.forEach((planet) => {
planet.info.pins
.filter(pin => STORAGE_IDS().some(storage => storage.type_id === pin.type_id))
.forEach(storage => {
storage.contents?.forEach(content => {
const current = totals[content.type_id] || 0;
totals[content.type_id] = current + content.amount;
});
});
});
return totals;
}, {});
const groupedByMaterial = exports.reduce<Grouped>((totals, material) => { const groupedByMaterial = exports.reduce<Grouped>((totals, material) => {
const { typeId, amount } = material; const { typeId, amount } = material;
const newTotal = isNaN(totals[typeId]) ? amount : totals[typeId] + amount; const newTotal = isNaN(totals[typeId]) ? amount : totals[typeId] + amount;
@@ -69,27 +115,44 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
return totals; return totals;
}, {}); }, {});
const startDateTime = DateTime.fromISO(startDate);
const hoursSinceStart = DateTime.now().diff(startDateTime, 'hours').hours;
const withProductNameAndPrice = Object.keys(groupedByMaterial).map( const withProductNameAndPrice = Object.keys(groupedByMaterial).map(
(typeIdString) => { (typeIdString) => {
const typeId = parseInt(typeIdString); const typeId = parseInt(typeIdString);
const amount = groupedByMaterial[typeId]; const amount = groupedByMaterial[typeId];
const storageAmount = storageAmounts[typeId] || 0;
const adjustedAmount = amount * (activityPercentage / 100);
const valueInMillions = const valueInMillions =
(((piPrices?.appraisal.items.find((a) => a.typeID === typeId)?.prices (((piPrices?.appraisal.items.find((a) => a.typeID === typeId)?.prices
.sell.min ?? 0) * .sell.min ?? 0) *
amount) / adjustedAmount) /
1000000) * 1000000) *
24 * 24 *
30; 30;
const storageValueInMillions =
((piPrices?.appraisal.items.find((a) => a.typeID === typeId)?.prices
.sell.min ?? 0) *
storageAmount) /
1000000;
// Calculate expected production and progress
const expectedProduction = adjustedAmount * hoursSinceStart;
const progress = hoursSinceStart > 0 ? (storageAmount / expectedProduction) * 100 : 0;
return { return {
typeId, typeId,
amount, amount: adjustedAmount,
storageAmount,
materialName: PI_TYPES_MAP[typeId].name, materialName: PI_TYPES_MAP[typeId].name,
price: valueInMillions, price: valueInMillions,
storageValue: storageValueInMillions,
progress,
}; };
}, },
); );
const theme = useTheme();
return ( return (
<StackItem width="100%"> <StackItem width="100%">
@@ -98,14 +161,48 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
<h2>Totals</h2> <h2>Totals</h2>
</AccordionSummary> </AccordionSummary>
<AccordionDetails> <AccordionDetails>
<Box sx={{ display: 'flex', alignItems: 'center', gap: 2, mb: 2 }}>
<TextField
label="Production Start Date"
type="date"
value={DateTime.fromISO(startDate).toFormat('yyyy-MM-dd')}
onChange={(e) => {
const newDate = DateTime.fromFormat(e.target.value, 'yyyy-MM-dd').startOf('day').toISO();
if (newDate) setStartDate(newDate);
}}
InputLabelProps={{
shrink: true,
}}
size="small"
/>
<TextField
label="Activity %"
type="number"
value={activityPercentage}
onChange={(e) => {
const value = Math.min(100, Math.max(0, parseFloat(e.target.value) || 0));
setActivityPercentage(value);
}}
InputLabelProps={{
shrink: true,
}}
inputProps={{
min: 0,
max: 100,
step: 1,
}}
size="small"
sx={{ width: '100px' }}
/>
</Box>
<TableContainer component={Paper}> <TableContainer component={Paper}>
<Table size="small" aria-label="a dense table"> <Table size="small" aria-label="a dense table">
<TableHead> <TableHead>
<TableRow> <TableRow>
<TableCell width="40%"> <TableCell width="20%">
<Tooltip title="What exports factories are producing"> <Tooltip title="What exports factories are producing">
<TableSortLabel <TableSortLabel
active={true} active={sortBy === "name"}
direction={sortDirection} direction={sortDirection}
onClick={() => { onClick={() => {
setSortDirection( setSortDirection(
@@ -118,10 +215,10 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
</TableSortLabel> </TableSortLabel>
</Tooltip> </Tooltip>
</TableCell> </TableCell>
<TableCell width="10%"> <TableCell width="10%" align="right">
<Tooltip title="How many units per hour factories are producing"> <Tooltip title={`Adjusted production rate (${activityPercentage}% activity)`}>
<TableSortLabel <TableSortLabel
active={true} active={sortBy === "perHour"}
direction={sortDirection} direction={sortDirection}
onClick={() => { onClick={() => {
setSortDirection( setSortDirection(
@@ -135,9 +232,41 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
</Tooltip> </Tooltip>
</TableCell> </TableCell>
<TableCell width="10%" align="right"> <TableCell width="10%" align="right">
<Tooltip title="How many million ISK per month this planet is exporting (Jita sell min)"> <Tooltip title="Amount currently in storage">
<TableSortLabel <TableSortLabel
active={true} active={sortBy === "storage"}
direction={sortDirection}
onClick={() => {
setSortDirection(
sortDirection === "asc" ? "desc" : "asc",
);
setSortBy("storage");
}}
>
Units in storage
</TableSortLabel>
</Tooltip>
</TableCell>
<TableCell width="15%" align="right">
<Tooltip title="Current ISK value of storage">
<TableSortLabel
active={sortBy === "storagePrice"}
direction={sortDirection}
onClick={() => {
setSortDirection(
sortDirection === "asc" ? "desc" : "asc",
);
setSortBy("storagePrice");
}}
>
Produced ISK value
</TableSortLabel>
</Tooltip>
</TableCell>
<TableCell width="15%" align="right">
<Tooltip title="Monthly ISK value from production">
<TableSortLabel
active={sortBy === "price"}
direction={sortDirection} direction={sortDirection}
onClick={() => { onClick={() => {
setSortDirection( setSortDirection(
@@ -146,7 +275,23 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
setSortBy("price"); setSortBy("price");
}} }}
> >
ISK/M Maximum possible ISK/M
</TableSortLabel>
</Tooltip>
</TableCell>
<TableCell width="15%" align="right">
<Tooltip title="Progress towards monthly production target">
<TableSortLabel
active={sortBy === "progress"}
direction={sortDirection}
onClick={() => {
setSortDirection(
sortDirection === "asc" ? "desc" : "asc",
);
setSortBy("progress");
}}
>
Progress from start date
</TableSortLabel> </TableSortLabel>
</Tooltip> </Tooltip>
</TableCell> </TableCell>
@@ -167,12 +312,30 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
if (sortDirection === "desc") if (sortDirection === "desc")
return a.amount > b.amount ? -1 : 1; return a.amount > b.amount ? -1 : 1;
} }
if (sortBy === "storage") {
if (sortDirection === "asc")
return a.storageAmount > b.storageAmount ? 1 : -1;
if (sortDirection === "desc")
return a.storageAmount > b.storageAmount ? -1 : 1;
}
if (sortBy === "price") { if (sortBy === "price") {
if (sortDirection === "asc") if (sortDirection === "asc")
return a.price > b.price ? 1 : -1; return a.price > b.price ? 1 : -1;
if (sortDirection === "desc") if (sortDirection === "desc")
return a.price > b.price ? -1 : 1; return a.price > b.price ? -1 : 1;
} }
if (sortBy === "storagePrice") {
if (sortDirection === "asc")
return a.storageValue > b.storageValue ? 1 : -1;
if (sortDirection === "desc")
return a.storageValue > b.storageValue ? -1 : 1;
}
if (sortBy === "progress") {
if (sortDirection === "asc")
return a.progress > b.progress ? 1 : -1;
if (sortDirection === "desc")
return a.progress > b.progress ? -1 : 1;
}
return 0; return 0;
}) })
.map((product) => ( .map((product) => (
@@ -180,7 +343,10 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
key={product.materialName} key={product.materialName}
material={product.materialName} material={product.materialName}
amount={product.amount} amount={product.amount}
storageAmount={product.storageAmount}
price={product.price} price={product.price}
storageValue={product.storageValue}
progress={product.progress}
/> />
))} ))}
<SummaryRow <SummaryRow
@@ -189,6 +355,10 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
(amount, p) => amount + p.price, (amount, p) => amount + p.price,
0, 0,
)} )}
storageValue={withProductNameAndPrice.reduce(
(amount, p) => amount + p.storageValue,
0,
)}
/> />
</TableBody> </TableBody>
</Table> </Table>
@@ -202,17 +372,32 @@ export const Summary = ({ characters }: { characters: AccessToken[] }) => {
const SummaryRow = ({ const SummaryRow = ({
material, material,
amount, amount,
storageAmount,
price, price,
storageValue,
progress,
}: { }: {
material: string; material: string;
amount?: number; amount?: number;
storageAmount?: number;
price: number; price: number;
storageValue?: number;
progress?: number;
}) => ( }) => (
<TableRow> <TableRow>
<TableCell component="th" scope="row"> <TableCell component="th" scope="row">
{material} {material}
</TableCell> </TableCell>
<TableCell>{amount}</TableCell> <TableCell align="right">{amount?.toFixed(1)}</TableCell>
<TableCell align="right">{storageAmount?.toFixed(1)}</TableCell>
<TableCell align="right">{storageValue !== undefined && displayValue(storageValue)}</TableCell>
<TableCell align="right">{displayValue(price)}</TableCell> <TableCell align="right">{displayValue(price)}</TableCell>
<TableCell align="right">
{progress !== undefined && (
<Typography color={progress >= 100 ? 'success.main' : progress >= 75 ? 'warning.main' : 'error.main'}>
{progress.toFixed(1)}%
</Typography>
)}
</TableCell>
</TableRow> </TableRow>
); );

View File

@@ -1,7 +1,6 @@
import { EvePraisalResult } from "@/eve-praisal"; import { EvePraisalResult } from "@/eve-praisal";
import { AccessToken, CharacterUpdate } from "@/types"; import { AccessToken, CharacterUpdate, PlanetConfig } from "@/types";
import { Dispatch, SetStateAction, createContext } from "react"; import { Dispatch, SetStateAction, createContext } from "react";
import { PlanetConfig } from "../components/PlanetConfig/PlanetConfigDialog";
export const CharacterContext = createContext<{ export const CharacterContext = createContext<{
characters: AccessToken[]; characters: AccessToken[];
@@ -36,6 +35,8 @@ export const SessionContext = createContext<{
characterId: number; characterId: number;
planetId: number; planetId: number;
}) => PlanetConfig; }) => PlanetConfig;
balanceThreshold: number;
setBalanceThreshold: Dispatch<SetStateAction<number>>;
}>({ }>({
sessionReady: false, sessionReady: false,
refreshSession: () => {}, refreshSession: () => {},
@@ -59,6 +60,8 @@ export const SessionContext = createContext<{
}) => { }) => {
return { characterId, planetId, excludeFromTotals: true }; return { characterId, planetId, excludeFromTotals: true };
}, },
balanceThreshold: 1000,
setBalanceThreshold: () => {},
}); });
export type ColorSelectionType = { export type ColorSelectionType = {
defaultColor: string; defaultColor: string;

View File

@@ -17,7 +17,7 @@ import {
import { useSearchParams } from "next/navigation"; import { useSearchParams } from "next/navigation";
import { EvePraisalResult, fetchAllPrices } from "@/eve-praisal"; import { EvePraisalResult, fetchAllPrices } from "@/eve-praisal";
import { getPlanet, getPlanetUniverse, getPlanets } from "@/planets"; import { getPlanet, getPlanetUniverse, getPlanets } from "@/planets";
import { PlanetConfig } from "./components/PlanetConfig/PlanetConfigDialog"; import { PlanetConfig } from "@/types";
const Home = () => { const Home = () => {
const searchParams = useSearchParams(); const searchParams = useSearchParams();
@@ -29,6 +29,7 @@ const Home = () => {
const [piPrices, setPiPrices] = useState<EvePraisalResult | undefined>( const [piPrices, setPiPrices] = useState<EvePraisalResult | undefined>(
undefined, undefined,
); );
const [balanceThreshold, setBalanceThreshold] = useState(1000);
const [colors, setColors] = useState<ColorSelectionType>(defaultColors); const [colors, setColors] = useState<ColorSelectionType>(defaultColors);
const [alertMode, setAlertMode] = useState(false); const [alertMode, setAlertMode] = useState(false);
@@ -199,6 +200,17 @@ const Home = () => {
setAlertMode(JSON.parse(storedAlertMode)); setAlertMode(JSON.parse(storedAlertMode));
}, []); }, []);
useEffect(() => {
const storedBalanceThreshold = localStorage.getItem("balanceThreshold");
if (storedBalanceThreshold) {
setBalanceThreshold(parseInt(storedBalanceThreshold));
}
}, []);
useEffect(() => {
localStorage.setItem("balanceThreshold", balanceThreshold.toString());
}, [balanceThreshold]);
useEffect(() => { useEffect(() => {
localStorage.setItem("compactMode", compactMode ? "true" : "false"); localStorage.setItem("compactMode", compactMode ? "true" : "false");
}, [compactMode]); }, [compactMode]);
@@ -264,6 +276,8 @@ const Home = () => {
toggleAlertMode, toggleAlertMode,
updatePlanetConfig, updatePlanetConfig,
readPlanetConfig, readPlanetConfig,
balanceThreshold,
setBalanceThreshold,
}} }}
> >
<CharacterContext.Provider <CharacterContext.Provider

View File

@@ -61,10 +61,19 @@ export const planetCalculations = (planet: PlanetWithInfo) => {
const schematic = PI_SCHEMATICS.find( const schematic = PI_SCHEMATICS.find(
(s) => s.schematic_id == f.schematic_id, (s) => s.schematic_id == f.schematic_id,
); );
if (schematic) acc.set(f.schematic_id, schematic); if (schematic) {
const existing = acc.get(f.schematic_id);
if (existing) {
// If we already have this schematic, increment its count
existing.count = (existing.count || 0) + 1;
} else {
// First time seeing this schematic, set count to 1
acc.set(f.schematic_id, { ...schematic, count: 1 });
}
}
} }
return acc; return acc;
}, new Map<SchematicId, (typeof PI_SCHEMATICS)[number]>()); }, new Map<SchematicId, (typeof PI_SCHEMATICS)[number] & { count: number }>());
const locallyProduced = Array.from(localProduction) const locallyProduced = Array.from(localProduction)
.flatMap((p) => p[1].outputs) .flatMap((p) => p[1].outputs)

View File

@@ -1,5 +1,3 @@
import { PlanetConfig } from "./app/components/PlanetConfig/PlanetConfigDialog";
export interface AccessToken { export interface AccessToken {
access_token: string; access_token: string;
expires_at: number; expires_at: number;
@@ -119,3 +117,9 @@ export interface Pin {
amount: number; amount: number;
}>; }>;
} }
export interface PlanetConfig {
characterId: number;
planetId: number;
excludeFromTotals: boolean;
}