mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-03-11 06:06:09 +00:00
Compare commits
14 Commits
v1.96.2
...
feat-conte
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18d50329bc | ||
|
|
d8fb980a3b | ||
|
|
b8b3bc60ad | ||
|
|
80d5dd1eb1 | ||
|
|
1ab0e96cbb | ||
|
|
e3a13b9554 | ||
|
|
1f3387e4ff | ||
|
|
95d2fa232a | ||
|
|
eed1d8bc27 | ||
|
|
c451735559 | ||
|
|
aa586b7994 | ||
|
|
39317831f9 | ||
|
|
b71bc94d4f | ||
|
|
0e920a58e6 |
27
CHANGELOG.md
27
CHANGELOG.md
@@ -2,6 +2,33 @@
|
||||
|
||||
<!-- changelog -->
|
||||
|
||||
## [v1.96.5](https://github.com/wanderer-industries/wanderer/compare/v1.96.4...v1.96.5) (2026-02-27)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* core: Fixed access token refresh issues
|
||||
|
||||
## [v1.96.4](https://github.com/wanderer-industries/wanderer/compare/v1.96.3...v1.96.4) (2026-02-17)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Change character token validity status. Now we will see red frame and icon for tracked characters which token was expired.
|
||||
|
||||
## [v1.96.3](https://github.com/wanderer-industries/wanderer/compare/v1.96.2...v1.96.3) (2026-02-15)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* tracking: Fixed character tracking issues
|
||||
|
||||
## [v1.96.2](https://github.com/wanderer-industries/wanderer/compare/v1.96.1...v1.96.2) (2026-02-13)
|
||||
|
||||
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
import { emitMapEvent } from '@/hooks/Mapper/events';
|
||||
import { isDocked } from '@/hooks/Mapper/helpers/isDocked.ts';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { CharacterTypeRaw } from '@/hooks/Mapper/types';
|
||||
import { Commands, OutCommand } from '@/hooks/Mapper/types/mapHandlers.ts';
|
||||
import { useAutoAnimate } from '@formkit/auto-animate/react';
|
||||
import clsx from 'clsx';
|
||||
import { PrimeIcons } from 'primereact/api';
|
||||
import { useCallback } from 'react';
|
||||
import classes from './Characters.module.scss';
|
||||
import {
|
||||
TooltipPosition,
|
||||
WdEveEntityPortrait,
|
||||
WdEveEntityPortraitSize,
|
||||
WdTooltipWrapper,
|
||||
} from '@/hooks/Mapper/components/ui-kit';
|
||||
import { WdCharStateWrapper } from '@/hooks/Mapper/components/characters/components/WdCharStateWrapper.tsx';
|
||||
|
||||
interface CharactersProps {
|
||||
data: CharacterTypeRaw[];
|
||||
}
|
||||
@@ -17,7 +22,7 @@ export const Characters = ({ data }: CharactersProps) => {
|
||||
|
||||
const {
|
||||
outCommand,
|
||||
data: { mainCharacterEveId, followingCharacterEveId },
|
||||
data: { mainCharacterEveId, followingCharacterEveId, expiredCharacters },
|
||||
} = useMapRootState();
|
||||
|
||||
const handleSelect = useCallback(async (character: CharacterTypeRaw) => {
|
||||
@@ -35,61 +40,48 @@ export const Characters = ({ data }: CharactersProps) => {
|
||||
});
|
||||
}, []);
|
||||
|
||||
const items = data.map(character => (
|
||||
<li
|
||||
key={character.eve_id}
|
||||
className="flex flex-col items-center justify-center"
|
||||
onClick={() => handleSelect(character)}
|
||||
>
|
||||
<div
|
||||
className={clsx(
|
||||
'overflow-hidden relative',
|
||||
'flex w-[35px] h-[35px] rounded-[4px] border-[1px] border-solid bg-transparent cursor-pointer',
|
||||
'transition-colors duration-250 hover:bg-stone-300/90',
|
||||
{
|
||||
['border-stone-800/90']: !character.online,
|
||||
['border-lime-600/70']: character.online,
|
||||
},
|
||||
)}
|
||||
title={character.name}
|
||||
>
|
||||
{mainCharacterEveId === character.eve_id && (
|
||||
<span
|
||||
className={clsx(
|
||||
'absolute top-[2px] left-[22px] w-[9px] h-[9px]',
|
||||
'text-yellow-500 text-[9px] rounded-[1px] z-10',
|
||||
'pi',
|
||||
PrimeIcons.STAR_FILL,
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
const items = data.map(character => {
|
||||
const isExpired = expiredCharacters.includes(character.eve_id);
|
||||
|
||||
{followingCharacterEveId === character.eve_id && (
|
||||
<span
|
||||
className={clsx(
|
||||
'absolute top-[23px] left-[22px] w-[10px] h-[10px]',
|
||||
'text-sky-300 text-[10px] rounded-[1px] z-10',
|
||||
'pi pi-angle-double-right',
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
{isDocked(character.location) && <div className={classes.Docked} />}
|
||||
<div
|
||||
className={clsx(
|
||||
'flex w-full h-full bg-transparent cursor-pointer',
|
||||
'bg-center bg-no-repeat bg-[length:100%]',
|
||||
'transition-opacity',
|
||||
'shadow-[inset_0_1px_6px_1px_#000000]',
|
||||
{
|
||||
['opacity-60']: !character.online,
|
||||
['opacity-100']: character.online,
|
||||
},
|
||||
)}
|
||||
style={{ backgroundImage: `url(https://images.evetech.net/characters/${character.eve_id}/portrait)` }}
|
||||
></div>
|
||||
</div>
|
||||
</li>
|
||||
));
|
||||
return (
|
||||
<li
|
||||
key={character.eve_id}
|
||||
className="flex flex-col items-center justify-center"
|
||||
onClick={() => handleSelect(character)}
|
||||
>
|
||||
<WdTooltipWrapper
|
||||
position={TooltipPosition.bottom}
|
||||
content={isExpired ? `Token is expired for ${character.name}` : character.name}
|
||||
>
|
||||
<WdCharStateWrapper
|
||||
eve_id={character.eve_id}
|
||||
location={character.location}
|
||||
isExpired={isExpired}
|
||||
isMain={mainCharacterEveId === character.eve_id}
|
||||
isFollowing={followingCharacterEveId === character.eve_id}
|
||||
isOnline={character.online}
|
||||
>
|
||||
<WdEveEntityPortrait
|
||||
eveId={character.eve_id}
|
||||
size={WdEveEntityPortraitSize.w33}
|
||||
className={clsx(
|
||||
'flex w-full h-full bg-transparent cursor-pointer',
|
||||
'bg-center bg-no-repeat bg-[length:100%]',
|
||||
'transition-opacity',
|
||||
'shadow-[inset_0_1px_6px_1px_#000000]',
|
||||
{
|
||||
['opacity-60']: !isExpired && !character.online,
|
||||
['opacity-100']: !isExpired && character.online,
|
||||
['opacity-50']: isExpired,
|
||||
},
|
||||
'!border-0',
|
||||
)}
|
||||
/>
|
||||
</WdCharStateWrapper>
|
||||
</WdTooltipWrapper>
|
||||
</li>
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<ul className="flex gap-1 characters" id="characters" ref={parent}>
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import clsx from 'clsx';
|
||||
import { PrimeIcons } from 'primereact/api';
|
||||
import { isDocked } from '@/hooks/Mapper/helpers/isDocked.ts';
|
||||
import classes from './WdCharStateWrapper.module.scss';
|
||||
import { WithChildren } from '@/hooks/Mapper/types/common.ts';
|
||||
import { LocationRaw } from '@/hooks/Mapper/types';
|
||||
|
||||
type WdCharStateWrapperProps = {
|
||||
eve_id: string;
|
||||
isExpired?: boolean;
|
||||
isMain?: boolean;
|
||||
isFollowing?: boolean;
|
||||
location: LocationRaw | null;
|
||||
isOnline: boolean;
|
||||
} & WithChildren;
|
||||
|
||||
export const WdCharStateWrapper = ({
|
||||
location,
|
||||
isOnline,
|
||||
isMain,
|
||||
isFollowing,
|
||||
isExpired,
|
||||
children,
|
||||
}: WdCharStateWrapperProps) => {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
'overflow-hidden relative',
|
||||
'flex w-[35px] h-[35px] rounded-[4px] border-[1px] border-solid bg-transparent cursor-pointer',
|
||||
'transition-colors duration-250 hover:bg-stone-300/90',
|
||||
{
|
||||
['border-stone-800/90']: !isExpired && !isOnline,
|
||||
['border-lime-600/70']: !isExpired && isOnline,
|
||||
['border-red-600/70']: isExpired,
|
||||
},
|
||||
)}
|
||||
>
|
||||
{isMain && (
|
||||
<span
|
||||
className={clsx(
|
||||
'absolute top-[2px] left-[22px] w-[9px] h-[9px]',
|
||||
'text-yellow-500 text-[9px] rounded-[1px] z-10',
|
||||
'pi',
|
||||
PrimeIcons.STAR_FILL,
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
{isFollowing && (
|
||||
<span
|
||||
className={clsx(
|
||||
'absolute top-[23px] left-[22px] w-[10px] h-[10px]',
|
||||
'text-sky-300 text-[10px] rounded-[1px] z-10',
|
||||
'pi pi-angle-double-right',
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
{isDocked(location) && <div className={classes.Docked} />}
|
||||
{isExpired && (
|
||||
<span
|
||||
className={clsx(
|
||||
'absolute top-[4px] left-[4px] w-[10px] h-[10px]',
|
||||
'text-red-400 text-[10px] rounded-[1px] z-10',
|
||||
'pi pi-exclamation-triangle',
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from './WdCharStateWrapper.tsx';
|
||||
@@ -1,11 +1,3 @@
|
||||
import {
|
||||
MASS_STATE_NAMES,
|
||||
MASS_STATE_NAMES_ORDER,
|
||||
SHIP_SIZES_NAMES,
|
||||
SHIP_SIZES_NAMES_ORDER,
|
||||
SHIP_SIZES_NAMES_SHORT,
|
||||
SHIP_SIZES_SIZE,
|
||||
} from '@/hooks/Mapper/components/map/constants.ts';
|
||||
import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeStatus } from '@/hooks/Mapper/types';
|
||||
import clsx from 'clsx';
|
||||
import { PrimeIcons } from 'primereact/api';
|
||||
@@ -14,6 +6,8 @@ import { MenuItem } from 'primereact/menuitem';
|
||||
import React, { RefObject, useMemo } from 'react';
|
||||
import { Edge } from 'reactflow';
|
||||
import { LifetimeActionsWrapper } from '@/hooks/Mapper/components/map/components/ContextMenuConnection/LifetimeActionsWrapper.tsx';
|
||||
import { MassStatusActionsWrapper } from '@/hooks/Mapper/components/map/components/ContextMenuConnection/MassStatusActionsWrapper.tsx';
|
||||
import { ShipSizeActionsWrapper } from '@/hooks/Mapper/components/map/components/ContextMenuConnection/ShipSizeActionsWrapper.tsx';
|
||||
import classes from './ContextMenuConnection.module.scss';
|
||||
import { getSystemStaticInfo } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic.ts';
|
||||
import { isNullsecSpace } from '@/hooks/Mapper/components/map/helpers/isKnownSpace.ts';
|
||||
@@ -86,16 +80,28 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
||||
return <LifetimeActionsWrapper lifetime={edge.data?.time_status} onChangeLifetime={onChangeTimeState} />;
|
||||
},
|
||||
},
|
||||
...(!isFrigateSize
|
||||
? [
|
||||
{
|
||||
className: clsx(classes.FastActions, '!h-[54px]'),
|
||||
template: () => {
|
||||
return (
|
||||
<MassStatusActionsWrapper
|
||||
massStatus={edge.data?.mass_status}
|
||||
onChangeMassStatus={onChangeMassState}
|
||||
/>
|
||||
);
|
||||
},
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
label: `Frigate`,
|
||||
className: clsx({
|
||||
[classes.ConnectionFrigate]: isFrigateSize,
|
||||
}),
|
||||
icon: PrimeIcons.CLOUD,
|
||||
command: () =>
|
||||
onChangeShipSizeStatus(
|
||||
edge.data?.ship_size_type === ShipSizeStatus.small ? ShipSizeStatus.large : ShipSizeStatus.small,
|
||||
),
|
||||
className: clsx(classes.FastActions, '!h-[64px]'),
|
||||
template: () => {
|
||||
return (
|
||||
<ShipSizeActionsWrapper shipSize={edge.data?.ship_size_type} onChangeShipSize={onChangeShipSizeStatus} />
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `Save mass`,
|
||||
@@ -105,41 +111,6 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
||||
icon: PrimeIcons.LOCK,
|
||||
command: () => onToggleMassSave(!edge.data?.locked),
|
||||
},
|
||||
...(!isFrigateSize
|
||||
? [
|
||||
{
|
||||
label: `Mass status`,
|
||||
icon: PrimeIcons.CHART_PIE,
|
||||
items: MASS_STATE_NAMES_ORDER.map(x => ({
|
||||
label: MASS_STATE_NAMES[x],
|
||||
className: clsx({
|
||||
[classes.SelectedItem]: edge.data?.mass_status === x,
|
||||
}),
|
||||
command: () => onChangeMassState(x),
|
||||
})),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
label: `Ship Size`,
|
||||
icon: PrimeIcons.CLOUD,
|
||||
items: SHIP_SIZES_NAMES_ORDER.map(x => ({
|
||||
label: (
|
||||
<div className="grid grid-cols-[20px_120px_1fr_40px] gap-2 items-center">
|
||||
<div className="text-[12px] font-bold text-stone-400">{SHIP_SIZES_NAMES_SHORT[x]}</div>
|
||||
<div>{SHIP_SIZES_NAMES[x]}</div>
|
||||
<div></div>
|
||||
<div className="flex justify-end whitespace-nowrap text-[12px] font-bold text-stone-500">
|
||||
{SHIP_SIZES_SIZE[x]} t.
|
||||
</div>
|
||||
</div>
|
||||
) as unknown as string, // TODO my lovely kostyl
|
||||
className: clsx({
|
||||
[classes.SelectedItem]: edge.data?.ship_size_type === x,
|
||||
}),
|
||||
command: () => onChangeShipSizeStatus(x),
|
||||
})),
|
||||
},
|
||||
...(bothNullsec
|
||||
? [
|
||||
{
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { LayoutEventBlocker } from '@/hooks/Mapper/components/ui-kit';
|
||||
import {
|
||||
WdMassStatusSelector,
|
||||
WdMassStatusSelectorProps,
|
||||
} from '@/hooks/Mapper/components/ui-kit/WdMassStatusSelector.tsx';
|
||||
|
||||
export const MassStatusActionsWrapper = (props: WdMassStatusSelectorProps) => {
|
||||
return (
|
||||
<LayoutEventBlocker className="flex flex-col gap-1 w-[100%] h-full px-2 pt-[4px]">
|
||||
<div className="text-[12px] text-stone-500 font-semibold">Mass status:</div>
|
||||
|
||||
<WdMassStatusSelector {...props} />
|
||||
</LayoutEventBlocker>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import { LayoutEventBlocker } from '@/hooks/Mapper/components/ui-kit';
|
||||
import { WdShipSizeSelector, WdShipSizeSelectorProps } from '@/hooks/Mapper/components/ui-kit/WdShipSizeSelector.tsx';
|
||||
|
||||
export const ShipSizeActionsWrapper = (props: WdShipSizeSelectorProps) => {
|
||||
return (
|
||||
<LayoutEventBlocker className="flex flex-col gap-1 w-[100%] h-full px-2 pt-[4px]">
|
||||
<div className="text-[12px] text-stone-500 font-semibold">Ship size:</div>
|
||||
|
||||
<WdShipSizeSelector {...props} />
|
||||
</LayoutEventBlocker>
|
||||
);
|
||||
};
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
import { SystemsSettingsProvider } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/Provider.tsx';
|
||||
import { WdButton } from '@/hooks/Mapper/components/ui-kit';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { OutCommand, SignatureGroup, SystemSignature, TimeStatus } from '@/hooks/Mapper/types';
|
||||
import { MassState, OutCommand, SignatureGroup, SystemSignature, TimeStatus } from '@/hooks/Mapper/types';
|
||||
import { Dialog } from 'primereact/dialog';
|
||||
import { InputText } from 'primereact/inputtext';
|
||||
import { useCallback, useEffect } from 'react';
|
||||
@@ -15,6 +15,7 @@ type SystemSignaturePrepared = Omit<SystemSignature, 'linked_system'> & {
|
||||
linked_system: string;
|
||||
k162Type: string;
|
||||
time_status: TimeStatus;
|
||||
mass_status: MassState;
|
||||
};
|
||||
|
||||
export interface MapSettingsProps {
|
||||
@@ -59,6 +60,7 @@ export const SignatureSettings = ({ systemId, show, onHide, signatureData }: Map
|
||||
custom_info: JSON.stringify({
|
||||
k162Type: values.k162Type,
|
||||
time_status: values.time_status,
|
||||
mass_status: values.mass_status,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -139,16 +141,19 @@ export const SignatureSettings = ({ systemId, show, onHide, signatureData }: Map
|
||||
|
||||
let k162Type = null;
|
||||
let time_status = TimeStatus._24h;
|
||||
let mass_status = MassState.normal;
|
||||
if (custom_info) {
|
||||
const customInfo = JSON.parse(custom_info);
|
||||
k162Type = customInfo.k162Type;
|
||||
time_status = customInfo.time_status;
|
||||
mass_status = customInfo.mass_status ?? MassState.normal;
|
||||
}
|
||||
|
||||
signatureForm.reset({
|
||||
linked_system: linked_system?.solar_system_id.toString() ?? undefined,
|
||||
k162Type: k162Type,
|
||||
time_status: time_status,
|
||||
mass_status: mass_status,
|
||||
...rest,
|
||||
});
|
||||
}, [signatureForm, signatureData]);
|
||||
|
||||
@@ -5,6 +5,7 @@ import { SignatureK162TypeSelect } from '@/hooks/Mapper/components/mapRootConten
|
||||
import { SignatureLeadsToSelect } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureLeadsToSelect';
|
||||
import { SignatureLifetimeSelect } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureLifetimeSelect.tsx';
|
||||
import { SignatureTempName } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureTempName.tsx';
|
||||
import { SignatureMassStatusSelect } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureMassStatusSelect.tsx';
|
||||
|
||||
export const SignatureGroupContentWormholes = () => {
|
||||
const { watch } = useFormContext<SystemSignature>();
|
||||
@@ -34,6 +35,11 @@ export const SignatureGroupContentWormholes = () => {
|
||||
<SignatureLifetimeSelect name="time_status" />
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-[100px_250px_1fr] gap-2 items-center text-[14px]">
|
||||
<span>Mass status:</span>
|
||||
<SignatureMassStatusSelect name="mass_status" />
|
||||
</div>
|
||||
|
||||
<label className="grid grid-cols-[100px_250px_1fr] gap-2 items-center text-[14px]">
|
||||
<span>Temp. Name:</span>
|
||||
<SignatureTempName />
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import { Controller, useFormContext } from 'react-hook-form';
|
||||
import { MassState, SystemSignature } from '@/hooks/Mapper/types';
|
||||
import { WdMassStatusSelector } from '@/hooks/Mapper/components/ui-kit/WdMassStatusSelector.tsx';
|
||||
|
||||
export interface SignatureMassStatusSelectProps {
|
||||
name: string;
|
||||
defaultValue?: MassState;
|
||||
}
|
||||
|
||||
export const SignatureMassStatusSelect = ({
|
||||
name,
|
||||
defaultValue = MassState.normal,
|
||||
}: SignatureMassStatusSelectProps) => {
|
||||
const { control } = useFormContext<SystemSignature>();
|
||||
|
||||
return (
|
||||
<div className="my-1">
|
||||
<Controller
|
||||
// @ts-ignore
|
||||
name={name}
|
||||
control={control}
|
||||
defaultValue={defaultValue}
|
||||
render={({ field }) => {
|
||||
// @ts-ignore
|
||||
return <WdMassStatusSelector massStatus={field.value} onChangeMassStatus={e => field.onChange(e)} />;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -2,3 +2,4 @@ export * from './SignatureGroupSelect';
|
||||
export * from './SignatureGroupContent';
|
||||
export * from './SignatureK162TypeSelect';
|
||||
export * from './SignatureLifetimeSelect';
|
||||
export * from './SignatureMassStatusSelect';
|
||||
|
||||
@@ -4,12 +4,16 @@ import { DataTable } from 'primereact/datatable';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { TrackingCharacter } from '@/hooks/Mapper/types';
|
||||
import { useTracking } from '@/hooks/Mapper/components/mapRootContent/components/TrackingDialog/TrackingProvider.tsx';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
|
||||
export const TrackingCharactersList = () => {
|
||||
const [selected, setSelected] = useState<TrackingCharacter[]>([]);
|
||||
const { trackingCharacters, main, following, updateTracking } = useTracking();
|
||||
const refVars = useRef({ trackingCharacters });
|
||||
refVars.current = { trackingCharacters };
|
||||
const {
|
||||
data: { expiredCharacters },
|
||||
} = useMapRootState();
|
||||
|
||||
useEffect(() => {
|
||||
setSelected(trackingCharacters.filter(x => x.tracked));
|
||||
@@ -66,7 +70,9 @@ export const TrackingCharactersList = () => {
|
||||
bodyClassName="text-ellipsis overflow-hidden whitespace-nowrap"
|
||||
headerClassName="[&_div]:ml-2"
|
||||
body={row => {
|
||||
return <CharacterCard showCorporationLogo showTicker isOwn {...row.character} />;
|
||||
const isExpired = expiredCharacters.includes(row.character.eve_id);
|
||||
|
||||
return <CharacterCard showCorporationLogo showTicker isOwn isExpired={isExpired} {...row.character} />;
|
||||
}}
|
||||
/>
|
||||
</DataTable>
|
||||
|
||||
@@ -38,7 +38,7 @@ const TrackingDialogComp = ({ visible, onHide }: TrackingDialogProps) => {
|
||||
resizable={false}
|
||||
visible={visible}
|
||||
onHide={onHide}
|
||||
className="w-[640px] h-[400px] text-text-color min-h-0"
|
||||
className="w-[640px] h-[600px] text-text-color min-h-0"
|
||||
>
|
||||
<TabView
|
||||
className="vertical-tabs-container h-full [&_.p-tabview-panels]:!pr-0"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createContext, useCallback, useContext, useRef, useState, useEffect } from 'react';
|
||||
import { createContext, useCallback, useContext, useRef, useState } from 'react';
|
||||
import { Commands, OutCommand, TrackingCharacter } from '@/hooks/Mapper/types';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { IncomingEvent, WithChildren } from '@/hooks/Mapper/types/common.ts';
|
||||
|
||||
@@ -17,6 +17,7 @@ import { useCallback } from 'react';
|
||||
import classes from './CharacterCard.module.scss';
|
||||
import { ZKB_ICON } from '@/hooks/Mapper/icons';
|
||||
import { charEveWhoLink, charZKBLink } from '@/hooks/Mapper/helpers/linkHelpers.ts';
|
||||
import { WdCharStateWrapper } from '../../characters/components';
|
||||
|
||||
export type CharacterCardProps = {
|
||||
compact?: boolean;
|
||||
@@ -29,6 +30,9 @@ export type CharacterCardProps = {
|
||||
showAllyLogo?: boolean;
|
||||
showAllyLogoPlaceholder?: boolean;
|
||||
simpleMode?: boolean;
|
||||
isExpired?: boolean;
|
||||
isMain?: boolean;
|
||||
isFollowing?: boolean;
|
||||
} & WithIsOwnCharacter &
|
||||
WithClassName;
|
||||
|
||||
@@ -55,6 +59,10 @@ export const CharacterCard = ({
|
||||
showTicker,
|
||||
useSystemsCache,
|
||||
className,
|
||||
isExpired,
|
||||
isMain,
|
||||
isFollowing,
|
||||
|
||||
...char
|
||||
}: CharacterCardInnerProps) => {
|
||||
const handleSelect = useCallback(() => {
|
||||
@@ -204,7 +212,22 @@ export const CharacterCard = ({
|
||||
<div className={clsx('w-full text-xs box-border')} onClick={handleSelect}>
|
||||
<div className="w-full flex items-center gap-2">
|
||||
<div className="flex items-center gap-1">
|
||||
<WdEveEntityPortrait eveId={char.eve_id} size={WdEveEntityPortraitSize.w33} />
|
||||
<WdCharStateWrapper
|
||||
eve_id={char.eve_id}
|
||||
location={char.location}
|
||||
isExpired={isExpired}
|
||||
isOnline={char.online}
|
||||
isMain={isMain}
|
||||
isFollowing={isFollowing}
|
||||
>
|
||||
<WdEveEntityPortrait
|
||||
eveId={char.eve_id}
|
||||
size={WdEveEntityPortraitSize.w33}
|
||||
className={clsx({
|
||||
['border-red-600/50']: isExpired,
|
||||
})}
|
||||
/>
|
||||
</WdCharStateWrapper>
|
||||
|
||||
{showCorporationLogo && (
|
||||
<WdTooltipWrapper position={TooltipPosition.top} content={char.corporation_name}>
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
import { WdButton } from '@/hooks/Mapper/components/ui-kit/WdButton.tsx';
|
||||
import { MassState } from '@/hooks/Mapper/types';
|
||||
import clsx from 'clsx';
|
||||
import { BUILT_IN_TOOLTIP_OPTIONS } from './constants.ts';
|
||||
|
||||
const MASS_STATUS = [
|
||||
{
|
||||
id: MassState.verge,
|
||||
label: 'Verge',
|
||||
className: 'bg-red-400 hover:!bg-red-400',
|
||||
inactiveClassName: 'bg-red-400/30',
|
||||
description: 'Mass status: Verge of collapse',
|
||||
},
|
||||
{
|
||||
id: MassState.half,
|
||||
label: 'Half',
|
||||
className: 'bg-orange-300 hover:!bg-orange-300',
|
||||
inactiveClassName: 'bg-orange-300/30',
|
||||
description: 'Mass status: Half',
|
||||
},
|
||||
{
|
||||
id: MassState.normal,
|
||||
label: 'Normal',
|
||||
className: 'bg-indigo-300 hover:!bg-indigo-300',
|
||||
inactiveClassName: 'bg-indigo-300/30',
|
||||
description: 'Mass status: Normal',
|
||||
},
|
||||
];
|
||||
|
||||
export interface WdMassStatusSelectorProps {
|
||||
massStatus?: MassState;
|
||||
onChangeMassStatus(massStatus: MassState): void;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const WdMassStatusSelector = ({
|
||||
massStatus = MassState.normal,
|
||||
onChangeMassStatus,
|
||||
className,
|
||||
}: WdMassStatusSelectorProps) => {
|
||||
return (
|
||||
<form>
|
||||
<div className={clsx('grid grid-cols-[auto_auto_auto] gap-1', className)}>
|
||||
{MASS_STATUS.map(x => (
|
||||
<WdButton
|
||||
key={x.id}
|
||||
outlined={false}
|
||||
value={x.label}
|
||||
tooltip={x.description}
|
||||
tooltipOptions={BUILT_IN_TOOLTIP_OPTIONS}
|
||||
size="small"
|
||||
className={clsx(
|
||||
`py-[1px] justify-center min-w-auto w-auto border-0 text-[12px] font-bold leading-[20px]`,
|
||||
{ [x.inactiveClassName]: massStatus !== x.id },
|
||||
x.className,
|
||||
)}
|
||||
onClick={() => onChangeMassStatus(x.id)}
|
||||
>
|
||||
{x.label}
|
||||
</WdButton>
|
||||
))}
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
import { WdButton } from '@/hooks/Mapper/components/ui-kit/WdButton.tsx';
|
||||
import { ShipSizeStatus } from '@/hooks/Mapper/types';
|
||||
import clsx from 'clsx';
|
||||
import { BUILT_IN_TOOLTIP_OPTIONS } from './constants.ts';
|
||||
import {
|
||||
SHIP_SIZES_DESCRIPTION,
|
||||
SHIP_SIZES_NAMES,
|
||||
SHIP_SIZES_NAMES_ORDER,
|
||||
SHIP_SIZES_NAMES_SHORT,
|
||||
SHIP_SIZES_SIZE,
|
||||
} from '@/hooks/Mapper/components/map/constants.ts';
|
||||
|
||||
const SHIP_SIZE_STYLES: Record<ShipSizeStatus, { className: string; inactiveClassName: string }> = {
|
||||
[ShipSizeStatus.small]: {
|
||||
className: 'bg-indigo-400 hover:!bg-indigo-400',
|
||||
inactiveClassName: 'bg-indigo-400/30',
|
||||
},
|
||||
[ShipSizeStatus.medium]: {
|
||||
className: 'bg-cyan-500 hover:!bg-cyan-500',
|
||||
inactiveClassName: 'bg-cyan-500/30',
|
||||
},
|
||||
[ShipSizeStatus.large]: {
|
||||
className: 'bg-indigo-300 hover:!bg-indigo-300',
|
||||
inactiveClassName: 'bg-indigo-300/30',
|
||||
},
|
||||
[ShipSizeStatus.freight]: {
|
||||
className: 'bg-indigo-300 hover:!bg-indigo-300',
|
||||
inactiveClassName: 'bg-indigo-300/30',
|
||||
},
|
||||
[ShipSizeStatus.capital]: {
|
||||
className: 'bg-indigo-300 hover:!bg-indigo-300',
|
||||
inactiveClassName: 'bg-indigo-300/30',
|
||||
},
|
||||
};
|
||||
|
||||
export interface WdShipSizeSelectorProps {
|
||||
shipSize?: ShipSizeStatus;
|
||||
onChangeShipSize(shipSize: ShipSizeStatus): void;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export const WdShipSizeSelector = ({
|
||||
shipSize = ShipSizeStatus.large,
|
||||
onChangeShipSize,
|
||||
className,
|
||||
}: WdShipSizeSelectorProps) => {
|
||||
return (
|
||||
<form>
|
||||
<div className={clsx('grid grid-cols-[1fr_1fr_1fr_1fr_1fr] gap-1', className)}>
|
||||
{SHIP_SIZES_NAMES_ORDER.map(size => {
|
||||
const style = SHIP_SIZE_STYLES[size];
|
||||
const tooltip = `${SHIP_SIZES_NAMES[size]} • ${SHIP_SIZES_SIZE[size]} t. ${SHIP_SIZES_DESCRIPTION[size]}`;
|
||||
|
||||
return (
|
||||
<WdButton
|
||||
key={size}
|
||||
outlined={false}
|
||||
value={SHIP_SIZES_NAMES_SHORT[size]}
|
||||
tooltip={tooltip}
|
||||
tooltipOptions={BUILT_IN_TOOLTIP_OPTIONS}
|
||||
size="small"
|
||||
className={clsx(
|
||||
`py-[1px] justify-center min-w-auto w-auto border-0 text-[11px] font-bold leading-[20px]`,
|
||||
{ [style.inactiveClassName]: shipSize !== size },
|
||||
style.className,
|
||||
)}
|
||||
onClick={() => onChangeShipSize(size)}
|
||||
>
|
||||
<span className="text-[11px] font-bold">{SHIP_SIZES_NAMES_SHORT[size]}</span>
|
||||
</WdButton>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
@@ -56,6 +56,7 @@ export type MapRootData = MapUnionTypes & {
|
||||
trackingCharactersData: TrackingCharacter[];
|
||||
loadingPublicRoutes: boolean;
|
||||
map_slug: string | null;
|
||||
expiredCharacters: string[];
|
||||
};
|
||||
|
||||
const INITIAL_DATA: MapRootData = {
|
||||
@@ -102,6 +103,7 @@ const INITIAL_DATA: MapRootData = {
|
||||
pings: [],
|
||||
loadingPublicRoutes: false,
|
||||
map_slug: null,
|
||||
expiredCharacters: [],
|
||||
};
|
||||
|
||||
export enum InterfaceStoredSettingsProps {
|
||||
|
||||
@@ -29,6 +29,7 @@ export const useMapInit = () => {
|
||||
following_character_eve_id,
|
||||
user_hubs,
|
||||
map_slug,
|
||||
expired_characters,
|
||||
} = props;
|
||||
|
||||
const updateData: Partial<MapRootData> = {};
|
||||
@@ -108,6 +109,10 @@ export const useMapInit = () => {
|
||||
updateData.map_slug = map_slug;
|
||||
}
|
||||
|
||||
if ('expired_characters' in props) {
|
||||
updateData.expiredCharacters = expired_characters;
|
||||
}
|
||||
|
||||
update(updateData);
|
||||
},
|
||||
[update, addSystemStatic],
|
||||
|
||||
@@ -108,6 +108,7 @@ export type CommandInit = {
|
||||
main_character_eve_id?: string | null;
|
||||
following_character_eve_id?: string | null;
|
||||
map_slug?: string;
|
||||
expired_characters: string[];
|
||||
};
|
||||
|
||||
export type CommandAddSystems = SolarSystemRawType[];
|
||||
|
||||
@@ -31,6 +31,7 @@ export type SignatureCustomInfo = {
|
||||
k162Type?: string;
|
||||
time_status?: number;
|
||||
isCrit?: boolean;
|
||||
mass_status?: number;
|
||||
};
|
||||
|
||||
export type SystemSignature = {
|
||||
|
||||
@@ -265,6 +265,10 @@ defmodule WandererApp.Character.Tracker do
|
||||
end
|
||||
|
||||
_ ->
|
||||
Logger.debug(fn ->
|
||||
"[Tracker] update_online skipped for character #{character_id} - no valid access token"
|
||||
end)
|
||||
|
||||
{:error, :skipped}
|
||||
end
|
||||
end
|
||||
@@ -601,6 +605,10 @@ defmodule WandererApp.Character.Tracker do
|
||||
end
|
||||
|
||||
_ ->
|
||||
Logger.debug(fn ->
|
||||
"[Tracker] update_location skipped for character #{character_id} - no valid access token"
|
||||
end)
|
||||
|
||||
{:error, :skipped}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -833,20 +833,44 @@ defmodule WandererApp.Esi.ApiClient do
|
||||
|
||||
defp handle_refresh_token_result(
|
||||
{:error, %OAuth2.Error{} = error},
|
||||
character,
|
||||
_character,
|
||||
character_id,
|
||||
expires_at,
|
||||
scopes
|
||||
_scopes
|
||||
) do
|
||||
invalidate_character_tokens(character, character_id, expires_at, scopes)
|
||||
Logger.warning("Failed to refresh token for #{character_id}: #{inspect(error)}")
|
||||
{:error, :invalid_grant}
|
||||
time_since_expiry = DateTime.diff(DateTime.utc_now(), DateTime.from_unix!(expires_at), :second)
|
||||
|
||||
Logger.warning("TOKEN_REFRESH_FAILED: Transient OAuth2 error during token refresh",
|
||||
character_id: character_id,
|
||||
error: inspect(error),
|
||||
time_since_expiry_seconds: time_since_expiry
|
||||
)
|
||||
|
||||
:telemetry.execute([:wanderer_app, :token, :refresh_failed], %{count: 1}, %{
|
||||
character_id: character_id,
|
||||
error_type: "oauth2_error",
|
||||
time_since_expiry: time_since_expiry
|
||||
})
|
||||
|
||||
{:error, :token_refresh_failed}
|
||||
end
|
||||
|
||||
defp handle_refresh_token_result(error, character, character_id, expires_at, scopes) do
|
||||
Logger.warning("Failed to refresh token for #{character_id}: #{inspect(error)}")
|
||||
invalidate_character_tokens(character, character_id, expires_at, scopes)
|
||||
{:error, :failed}
|
||||
defp handle_refresh_token_result(error, _character, character_id, expires_at, _scopes) do
|
||||
time_since_expiry = DateTime.diff(DateTime.utc_now(), DateTime.from_unix!(expires_at), :second)
|
||||
|
||||
Logger.warning("TOKEN_REFRESH_FAILED: Unexpected error during token refresh",
|
||||
character_id: character_id,
|
||||
error: inspect(error),
|
||||
time_since_expiry_seconds: time_since_expiry
|
||||
)
|
||||
|
||||
:telemetry.execute([:wanderer_app, :token, :refresh_failed], %{count: 1}, %{
|
||||
character_id: character_id,
|
||||
error_type: "unexpected_error",
|
||||
time_since_expiry: time_since_expiry
|
||||
})
|
||||
|
||||
{:error, :token_refresh_failed}
|
||||
end
|
||||
|
||||
defp invalidate_character_tokens(character, character_id, expires_at, scopes) do
|
||||
@@ -854,7 +878,6 @@ defmodule WandererApp.Esi.ApiClient do
|
||||
|
||||
with {:ok, _} <- WandererApp.Api.Character.update(character, attrs) do
|
||||
WandererApp.Character.update_character(character_id, attrs)
|
||||
:ok
|
||||
else
|
||||
error ->
|
||||
Logger.error("Failed to clear tokens for #{character_id}: #{inspect(error)}")
|
||||
@@ -865,5 +888,7 @@ defmodule WandererApp.Esi.ApiClient do
|
||||
"character:#{character_id}",
|
||||
:character_token_invalid
|
||||
)
|
||||
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
||||
@@ -314,10 +314,10 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|
||||
settings
|
||||
|> Enum.each(fn s ->
|
||||
Logger.info(fn ->
|
||||
"[CharacterCleanup] Map #{map_id} - destroying settings and removing character #{s.character_id}"
|
||||
"[CharacterCleanup] Map #{map_id} - untracking settings and removing character #{s.character_id}"
|
||||
end)
|
||||
|
||||
WandererApp.MapCharacterSettingsRepo.destroy!(s)
|
||||
WandererApp.MapCharacterSettingsRepo.untrack!(%{map_id: s.map_id, character_id: s.character_id})
|
||||
remove_character(map_id, s.character_id)
|
||||
end)
|
||||
|
||||
@@ -780,10 +780,14 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|
||||
old_alliance_id = Map.get(cached_values, alliance_key)
|
||||
|
||||
if character.alliance_id != old_alliance_id do
|
||||
{
|
||||
[{:character_alliance, %{alliance_id: character.alliance_id}} | updates],
|
||||
Map.put(cache_updates, alliance_key, character.alliance_id)
|
||||
}
|
||||
cache_updates = Map.put(cache_updates, alliance_key, character.alliance_id)
|
||||
|
||||
if is_nil(old_alliance_id) do
|
||||
# Initial cache population, not a real change - just update cache
|
||||
{updates, cache_updates}
|
||||
else
|
||||
{[{:character_alliance, %{alliance_id: character.alliance_id}} | updates], cache_updates}
|
||||
end
|
||||
else
|
||||
{updates, cache_updates}
|
||||
end
|
||||
@@ -802,10 +806,15 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|
||||
old_corporation_id = Map.get(cached_values, corporation_key)
|
||||
|
||||
if character.corporation_id != old_corporation_id do
|
||||
{
|
||||
[{:character_corporation, %{corporation_id: character.corporation_id}} | updates],
|
||||
Map.put(cache_updates, corporation_key, character.corporation_id)
|
||||
}
|
||||
cache_updates = Map.put(cache_updates, corporation_key, character.corporation_id)
|
||||
|
||||
if is_nil(old_corporation_id) do
|
||||
# Initial cache population, not a real change - just update cache
|
||||
{updates, cache_updates}
|
||||
else
|
||||
{[{:character_corporation, %{corporation_id: character.corporation_id}} | updates],
|
||||
cache_updates}
|
||||
end
|
||||
else
|
||||
{updates, cache_updates}
|
||||
end
|
||||
@@ -952,12 +961,28 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|
||||
{:ok, character} =
|
||||
WandererApp.Character.get_character(character_id)
|
||||
|
||||
add_character(map_id, character, true)
|
||||
case WandererApp.Api.MapCharacterSettings.read_by_map_and_character(%{
|
||||
map_id: map_id,
|
||||
character_id: character_id
|
||||
}) do
|
||||
{:ok, %{tracked: false}} ->
|
||||
# Was explicitly untracked (e.g., by permission cleanup) - don't re-enable
|
||||
Logger.debug(fn ->
|
||||
"[CharactersImpl] Skipping re-track for character #{character_id} on map #{map_id} - " <>
|
||||
"character was explicitly untracked"
|
||||
end)
|
||||
|
||||
WandererApp.Character.TrackerManager.update_track_settings(character_id, %{
|
||||
map_id: map_id,
|
||||
track: true
|
||||
})
|
||||
add_character(map_id, character, false)
|
||||
|
||||
_ ->
|
||||
# New character or already tracked - enable tracking
|
||||
add_character(map_id, character, true)
|
||||
|
||||
WandererApp.Character.TrackerManager.update_track_settings(character_id, %{
|
||||
map_id: map_id,
|
||||
track: true
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
# Broadcasts permission update to trigger LiveView refresh for the character's user.
|
||||
|
||||
@@ -385,14 +385,6 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
|
||||
end
|
||||
end
|
||||
|
||||
defp handle_tracking_event(:invalid_token_message, socket, _map_id) do
|
||||
socket
|
||||
|> put_flash(
|
||||
:error,
|
||||
"One of your characters has expired token. Please refresh it on characters page."
|
||||
)
|
||||
end
|
||||
|
||||
defp handle_tracking_event(:map_character_limit, socket, _map_id) do
|
||||
socket
|
||||
|> put_flash(
|
||||
|
||||
@@ -553,23 +553,14 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
{:ok, map_character_ids} <-
|
||||
WandererApp.Cache.lookup("map_#{map_id}:presence_character_ids", []) do
|
||||
events =
|
||||
case tracked_characters |> Enum.any?(&(&1.access_token == nil)) do
|
||||
case track_character && not has_tracked_characters? do
|
||||
true ->
|
||||
[:invalid_token_message]
|
||||
[:empty_tracked_characters]
|
||||
|
||||
_ ->
|
||||
[]
|
||||
end
|
||||
|
||||
events =
|
||||
case track_character && not has_tracked_characters? do
|
||||
true ->
|
||||
events ++ [:empty_tracked_characters]
|
||||
|
||||
_ ->
|
||||
events
|
||||
end
|
||||
|
||||
character_limit_reached? = map_character_ids |> Enum.count() >= characters_limit
|
||||
|
||||
events =
|
||||
@@ -623,6 +614,8 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
nil
|
||||
end
|
||||
|
||||
expired_characters = tracked_characters |> Enum.filter(&(&1.access_token == nil)) |> Enum.map(& &1.eve_id)
|
||||
|
||||
initial_data =
|
||||
%{
|
||||
kills: kills_data,
|
||||
@@ -630,6 +623,7 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
map_character_ids
|
||||
|> WandererApp.Character.get_character_eve_ids!(),
|
||||
user_characters: tracked_characters |> Enum.map(& &1.eve_id),
|
||||
expired_characters: expired_characters,
|
||||
system_static_infos: nil,
|
||||
wormholes: nil,
|
||||
effects: nil,
|
||||
|
||||
@@ -55,16 +55,6 @@ defmodule WandererAppWeb.MapLive do
|
||||
{:noreply, socket |> push_navigate(to: ~p"/#{map_slug}")}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_info(:character_token_invalid, socket),
|
||||
do:
|
||||
{:noreply,
|
||||
socket
|
||||
|> put_flash(
|
||||
:error,
|
||||
"One of your characters has expired token. Please refresh it on characters page."
|
||||
)}
|
||||
|
||||
def handle_info(:no_main_character_set, socket),
|
||||
do:
|
||||
{:noreply,
|
||||
|
||||
Reference in New Issue
Block a user