mirror of
https://github.com/wanderer-industries/wanderer
synced 2025-12-09 09:15:42 +00:00
Compare commits
49 Commits
v1.26.1
...
all-system
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9196b42fc5 | ||
|
|
3f6364c9ea | ||
|
|
0d11b12282 | ||
|
|
a5020b58f2 | ||
|
|
f039a74a8f | ||
|
|
0e6bb7390b | ||
|
|
b52b4eecca | ||
|
|
8186977d1d | ||
|
|
86adcfe4d7 | ||
|
|
ce2dd872c4 | ||
|
|
aadc53c90e | ||
|
|
cbc1b6b5c8 | ||
|
|
1aed7a9232 | ||
|
|
b549189644 | ||
|
|
35279d17b4 | ||
|
|
bb403aa0c5 | ||
|
|
04327c288b | ||
|
|
94d60e40d0 | ||
|
|
8505fcb6b7 | ||
|
|
9aec57166d | ||
|
|
a3739f2950 | ||
|
|
3d3b152758 | ||
|
|
0e03730543 | ||
|
|
97e07a6511 | ||
|
|
a77a51ba15 | ||
|
|
42e706e1c2 | ||
|
|
025dd06053 | ||
|
|
bcb421d879 | ||
|
|
66056ab54b | ||
|
|
bb92f76ceb | ||
|
|
84076b340b | ||
|
|
48caae5c0e | ||
|
|
77dd23795a | ||
|
|
2771d6304e | ||
|
|
9946edffa4 | ||
|
|
50bf2fd9d3 | ||
|
|
bdcde168aa | ||
|
|
5807142e20 | ||
|
|
ec2d9565b9 | ||
|
|
a18a71c73d | ||
|
|
93a6bd1156 | ||
|
|
581a410aef | ||
|
|
ab02fe988c | ||
|
|
b8d20fb21b | ||
|
|
12fa1a0be8 | ||
|
|
85a84f7507 | ||
|
|
2385313013 | ||
|
|
c7ce727571 | ||
|
|
8b165ff478 |
134
CHANGELOG.md
134
CHANGELOG.md
@@ -2,6 +2,140 @@
|
||||
|
||||
<!-- changelog -->
|
||||
|
||||
## [v1.31.0](https://github.com/wanderer-industries/wanderer/compare/v1.30.2...v1.31.0) (2024-12-20)
|
||||
|
||||
|
||||
|
||||
|
||||
### Features:
|
||||
|
||||
* Core: Show tracking for new users by default. Auto link characters to account fix. Add character loading indicators.
|
||||
|
||||
## [v1.30.2](https://github.com/wanderer-industries/wanderer/compare/v1.30.1...v1.30.2) (2024-12-17)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Map: Fixed problem with ship size change.
|
||||
|
||||
## [v1.30.1](https://github.com/wanderer-industries/wanderer/compare/v1.30.0...v1.30.1) (2024-12-17)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Map: Little rework Signatures header: change System Signatures to Signatures, and show selected system name instead.
|
||||
|
||||
* Map: update default size of connections
|
||||
|
||||
* Map: add ability set the size of wormhole and mark connection with label
|
||||
|
||||
## [v1.30.0](https://github.com/wanderer-industries/wanderer/compare/v1.29.5...v1.30.0) (2024-12-16)
|
||||
|
||||
|
||||
|
||||
|
||||
### Features:
|
||||
|
||||
* Map: Fixed incorrect wrapping labels of checkboxes in System Signatures, Local and Routes. Also changed dotlan links for k-spacem now it leads to region map before, for wh all stay as it was. Added ability to chane to softer background and remove dots on background of map. Also some small design issues. #2
|
||||
|
||||
* Map: Fixed incorrect wrapping labels of checkboxes in System Signatures, Local and Routes. Also changed dotlan links for k-spacem now it leads to region map before, for wh all stay as it was. Added ability to chane to softer background and remove dots on background of map. Also some small design issues.
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Map: fixed U210, K346 for C4 shattered systems
|
||||
|
||||
* Map: fixed U210, K346 for shattered systems. Fixed mass of mediums chains. Fixed size of some capital chains from 3M to 3.3M. Based on https://whtype.info/ data.
|
||||
|
||||
* Map: removed unnecessary log
|
||||
|
||||
* Map: Uncomment what should not be commented
|
||||
|
||||
## [v1.29.5](https://github.com/wanderer-industries/wanderer/compare/v1.29.4...v1.29.5) (2024-12-14)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Core: Fix character trackers cleanup
|
||||
|
||||
## [v1.29.4](https://github.com/wanderer-industries/wanderer/compare/v1.29.3...v1.29.4) (2024-12-10)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Core: Small fixes
|
||||
|
||||
## [v1.29.3](https://github.com/wanderer-industries/wanderer/compare/v1.29.2...v1.29.3) (2024-12-07)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Core: Increased eve DB data download timeout
|
||||
|
||||
## [v1.29.2](https://github.com/wanderer-industries/wanderer/compare/v1.29.1...v1.29.2) (2024-12-07)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Core: Fix unpkg CDN issues, fix Abyssals sites adding as systems on map
|
||||
|
||||
## [v1.29.1](https://github.com/wanderer-industries/wanderer/compare/v1.29.0...v1.29.1) (2024-12-05)
|
||||
|
||||
|
||||
|
||||
|
||||
## [v1.29.0](https://github.com/wanderer-industries/wanderer/compare/v1.28.1...v1.29.0) (2024-12-05)
|
||||
|
||||
|
||||
|
||||
|
||||
### Features:
|
||||
|
||||
* Signatures: Show 'Unsplashed' signatures on the map (optionally)
|
||||
|
||||
## [v1.28.1](https://github.com/wanderer-industries/wanderer/compare/v1.28.0...v1.28.1) (2024-12-04)
|
||||
|
||||
|
||||
|
||||
|
||||
## [v1.28.0](https://github.com/wanderer-industries/wanderer/compare/v1.27.1...v1.28.0) (2024-12-04)
|
||||
|
||||
|
||||
|
||||
|
||||
### Features:
|
||||
|
||||
* Map: Added an option to show 'Offline characters' to map admins & managers only
|
||||
|
||||
## [v1.27.1](https://github.com/wanderer-industries/wanderer/compare/v1.27.0...v1.27.1) (2024-12-04)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Map: Fix 'On the map' visibility
|
||||
|
||||
## [v1.27.0](https://github.com/wanderer-industries/wanderer/compare/v1.26.1...v1.27.0) (2024-12-03)
|
||||
|
||||
|
||||
|
||||
|
||||
### Features:
|
||||
|
||||
* Map: Hide 'On the map' list for 'Viewer' role
|
||||
|
||||
## [v1.26.1](https://github.com/wanderer-industries/wanderer/compare/v1.26.0...v1.26.1) (2024-12-03)
|
||||
|
||||
|
||||
|
||||
@@ -870,3 +870,63 @@ body {
|
||||
}
|
||||
}
|
||||
/* Map refresh END */
|
||||
|
||||
.inputContainer {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
align-items: center;
|
||||
}
|
||||
.inputContainer > span:nth-child(1),
|
||||
.inputContainer > label:nth-child(1) {
|
||||
color: var(--gray-200);
|
||||
font-size: 13px;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.inputContainer > :nth-child(2) {
|
||||
border-bottom: 2px dotted #3f3f3f;
|
||||
height: 1px;
|
||||
margin: 0 12px;
|
||||
}
|
||||
|
||||
.smallInputSwitch {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.smallInputSwitch .p-inputswitch {
|
||||
height: 1rem;
|
||||
width: 2rem;
|
||||
}
|
||||
.smallInputSwitch .p-inputswitch.p-inputswitch-checked .p-inputswitch-slider::before {
|
||||
transform: translateX(1rem);
|
||||
}
|
||||
.smallInputSwitch .p-inputswitch.p-highlight .p-inputswitch-slider:before {
|
||||
transform: translateX(1rem);
|
||||
}
|
||||
.smallInputSwitch .p-inputswitch .p-inputswitch-slider::before {
|
||||
width: 0.8rem;
|
||||
height: 0.8rem;
|
||||
margin-top: -0.4rem;
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
.checkboxRoot.sizeXS {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
.checkboxRoot.sizeXS .p-checkbox-box,
|
||||
.checkboxRoot.sizeXS .p-checkbox-input {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
.checkboxRoot.sizeM {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
.checkboxRoot.sizeM .p-checkbox-box,
|
||||
.checkboxRoot.sizeM .p-checkbox-input {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useWaypointMenu } from '@/hooks/Mapper/components/contexts/hooks';
|
||||
import { FastSystemActions } from '@/hooks/Mapper/components/contexts/components';
|
||||
import { useMapCheckPermissions } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
||||
import { UserPermission } from '@/hooks/Mapper/types/permissions.ts';
|
||||
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace.ts';
|
||||
|
||||
export const useContextMenuSystemItems = ({
|
||||
onDeleteSystem,
|
||||
@@ -44,6 +45,8 @@ export const useContextMenuSystemItems = ({
|
||||
<FastSystemActions
|
||||
systemId={systemId}
|
||||
systemName={system.system_static_info.solar_system_name}
|
||||
regionName={system.system_static_info.region_name}
|
||||
isWH={isWormholeSpace(system.system_static_info.system_class)}
|
||||
showEdit
|
||||
onOpenSettings={onOpenSettings}
|
||||
/>
|
||||
|
||||
@@ -10,6 +10,7 @@ import { WaypointSetContextHandler } from '@/hooks/Mapper/components/contexts/ty
|
||||
import { FastSystemActions } from '@/hooks/Mapper/components/contexts/components';
|
||||
import { useJumpPlannerMenu } from '@/hooks/Mapper/components/contexts/hooks';
|
||||
import { Route } from '@/hooks/Mapper/types/routes.ts';
|
||||
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace.ts';
|
||||
|
||||
export interface ContextMenuSystemInfoProps {
|
||||
systemStatics: Map<number, SolarSystemStaticInfoRaw>;
|
||||
@@ -48,7 +49,6 @@ export const ContextMenuSystemInfo: React.FC<ContextMenuSystemInfoProps> = ({
|
||||
if (!systemId || !system) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
{
|
||||
className: classes.FastActions,
|
||||
@@ -57,6 +57,8 @@ export const ContextMenuSystemInfo: React.FC<ContextMenuSystemInfoProps> = ({
|
||||
<FastSystemActions
|
||||
systemId={systemId}
|
||||
systemName={system.solar_system_name}
|
||||
regionName={system.region_name}
|
||||
isWH={isWormholeSpace(system.system_class)}
|
||||
onOpenSettings={onOpenSettings}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -9,13 +9,22 @@ import { PrimeIcons } from 'primereact/api';
|
||||
export interface FastSystemActionsProps {
|
||||
systemId: string;
|
||||
systemName: string;
|
||||
regionName: string;
|
||||
isWH: boolean;
|
||||
showEdit?: boolean;
|
||||
onOpenSettings(): void;
|
||||
}
|
||||
|
||||
export const FastSystemActions = ({ systemId, systemName, onOpenSettings, showEdit }: FastSystemActionsProps) => {
|
||||
const ref = useRef({ systemId, systemName });
|
||||
ref.current = { systemId, systemName };
|
||||
export const FastSystemActions = ({
|
||||
systemId,
|
||||
systemName,
|
||||
regionName,
|
||||
isWH,
|
||||
onOpenSettings,
|
||||
showEdit,
|
||||
}: FastSystemActionsProps) => {
|
||||
const ref = useRef({ systemId, systemName, regionName, isWH });
|
||||
ref.current = { systemId, systemName, regionName, isWH };
|
||||
|
||||
const handleOpenZKB = useCallback(
|
||||
() => window.open(`https://zkillboard.com/system/${ref.current.systemId}`, '_blank'),
|
||||
@@ -27,10 +36,17 @@ export const FastSystemActions = ({ systemId, systemName, onOpenSettings, showEd
|
||||
[],
|
||||
);
|
||||
|
||||
const handleOpenDotlan = useCallback(
|
||||
() => window.open(`https://evemaps.dotlan.net/system/${ref.current.systemName}`, '_blank'),
|
||||
[],
|
||||
);
|
||||
const handleOpenDotlan = useCallback(() => {
|
||||
if (ref.current.isWH) {
|
||||
window.open(`https://evemaps.dotlan.net/system/${ref.current.systemName}`, '_blank');
|
||||
return;
|
||||
}
|
||||
|
||||
return window.open(
|
||||
`https://evemaps.dotlan.net/map/${ref.current.regionName.replace(/ /gim, '_')}/${ref.current.systemName}#jumps`,
|
||||
'_blank',
|
||||
);
|
||||
}, []);
|
||||
|
||||
const copySystemNameToClipboard = useCallback(async () => {
|
||||
try {
|
||||
@@ -43,9 +59,9 @@ export const FastSystemActions = ({ systemId, systemName, onOpenSettings, showEd
|
||||
return (
|
||||
<LayoutEventBlocker className={clsx('flex px-2 gap-2 justify-between items-center h-full')}>
|
||||
<div className={clsx('flex gap-2 items-center h-full', classes.Links)}>
|
||||
<WdImgButton source={ZKB_ICON} onClick={handleOpenZKB} />
|
||||
<WdImgButton source={ANOIK_ICON} onClick={handleOpenAnoikis} />
|
||||
<WdImgButton source={DOTLAN_ICON} onClick={handleOpenDotlan} />
|
||||
<WdImgButton tooltip={{ content: 'Open zkillboard' }} source={ZKB_ICON} onClick={handleOpenZKB} />
|
||||
<WdImgButton tooltip={{ content: 'Open Anoikis' }} source={ANOIK_ICON} onClick={handleOpenAnoikis} />
|
||||
<WdImgButton tooltip={{ content: 'Open Dotlan' }} source={DOTLAN_ICON} onClick={handleOpenDotlan} />
|
||||
</div>
|
||||
|
||||
<div className="flex gap-2 items-center pl-1">
|
||||
|
||||
@@ -2,3 +2,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.BackgroundAlternateColor {
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import { SESSION_KEY } from '@/hooks/Mapper/constants.ts';
|
||||
import { SolarSystemConnection, SolarSystemRawType } from '@/hooks/Mapper/types';
|
||||
import { ctxManager } from '@/hooks/Mapper/utils/contextManager.ts';
|
||||
import { NodeSelectionMouseHandler } from '@/hooks/Mapper/components/contexts/types.ts';
|
||||
import clsx from 'clsx';
|
||||
|
||||
const DEFAULT_VIEW_PORT = { zoom: 1, x: 0, y: 0 };
|
||||
|
||||
@@ -97,6 +98,8 @@ interface MapCompProps {
|
||||
onSystemContextMenu: (event: MouseEvent<Element>, systemId: string) => void;
|
||||
showKSpaceBG?: boolean;
|
||||
isThickConnections?: boolean;
|
||||
isShowBackgroundPattern?: boolean;
|
||||
isSoftBackground?: boolean;
|
||||
}
|
||||
|
||||
const MapComp = ({
|
||||
@@ -111,6 +114,8 @@ const MapComp = ({
|
||||
isShowMinimap,
|
||||
showKSpaceBG,
|
||||
isThickConnections,
|
||||
isShowBackgroundPattern,
|
||||
isSoftBackground,
|
||||
}: MapCompProps) => {
|
||||
const { getNode } = useReactFlow();
|
||||
const [nodes, , onNodesChange] = useNodesState<Node<SolarSystemRawType>>(initialNodes);
|
||||
@@ -216,7 +221,7 @@ const MapComp = ({
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={classes.MapRoot}>
|
||||
<div className={clsx(classes.MapRoot, { ['bg-neutral-900']: isSoftBackground })}>
|
||||
<ReactFlow
|
||||
nodes={nodes}
|
||||
edges={edges}
|
||||
@@ -263,7 +268,7 @@ const MapComp = ({
|
||||
selectionMode={SelectionMode.Partial}
|
||||
>
|
||||
{isShowMinimap && <MiniMap pannable zoomable ariaLabel="Mini map" className={minimapClasses} />}
|
||||
<Background />
|
||||
{isShowBackgroundPattern && <Background />}
|
||||
</ReactFlow>
|
||||
{/* <button className="z-auto btn btn-primary absolute top-20 right-20" onClick={handleGetPassages}>
|
||||
Test // DON NOT REMOVE
|
||||
|
||||
@@ -6,7 +6,14 @@ import { Edge } from '@reactflow/core/dist/esm/types/edges';
|
||||
import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeStatus } from '@/hooks/Mapper/types';
|
||||
import clsx from 'clsx';
|
||||
import classes from './ContextMenuConnection.module.scss';
|
||||
import { MASS_STATE_NAMES, MASS_STATE_NAMES_ORDER } from '@/hooks/Mapper/components/map/constants.ts';
|
||||
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';
|
||||
|
||||
export interface ContextMenuConnectionProps {
|
||||
contextMenuRef: RefObject<ContextMenu>;
|
||||
@@ -48,10 +55,6 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
||||
icon: PrimeIcons.CLOCK,
|
||||
command: onChangeTimeState,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(isWormhole
|
||||
? [
|
||||
{
|
||||
label: `Frigate`,
|
||||
className: clsx({
|
||||
@@ -60,13 +63,9 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
||||
icon: PrimeIcons.CLOUD,
|
||||
command: () =>
|
||||
onChangeShipSizeStatus(
|
||||
edge.data?.ship_size_type === ShipSizeStatus.small ? ShipSizeStatus.normal : ShipSizeStatus.small,
|
||||
edge.data?.ship_size_type === ShipSizeStatus.small ? ShipSizeStatus.large : ShipSizeStatus.small,
|
||||
),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(isWormhole
|
||||
? [
|
||||
{
|
||||
label: `Save mass`,
|
||||
className: clsx({
|
||||
@@ -75,19 +74,40 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
||||
icon: PrimeIcons.LOCK,
|
||||
command: () => onToggleMassSave(!edge.data?.locked),
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(isWormhole && !isFrigateSize
|
||||
? [
|
||||
...(!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: `Mass status`,
|
||||
icon: PrimeIcons.CHART_PIE,
|
||||
items: MASS_STATE_NAMES_ORDER.map(x => ({
|
||||
label: MASS_STATE_NAMES[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?.mass_status === x,
|
||||
[classes.SelectedItem]: edge.data?.ship_size_type === x,
|
||||
}),
|
||||
command: () => onChangeMassState(x),
|
||||
command: () => onChangeShipSizeStatus(x),
|
||||
})),
|
||||
},
|
||||
]
|
||||
@@ -98,7 +118,7 @@ export const ContextMenuConnection: React.FC<ContextMenuConnectionProps> = ({
|
||||
command: onDeleteConnection,
|
||||
},
|
||||
];
|
||||
}, [edge, onChangeTimeState, onDeleteConnection, onChangeMassState, onChangeShipSizeStatus]);
|
||||
}, [edge, onChangeTimeState, onDeleteConnection, onChangeShipSizeStatus, onToggleMassSave, onChangeMassState]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -97,14 +97,16 @@ export const useContextMenuConnectionHandlers = () => {
|
||||
},
|
||||
});
|
||||
|
||||
outCommand({
|
||||
type: OutCommand.updateConnectionMassStatus,
|
||||
data: {
|
||||
source: edge.source,
|
||||
target: edge.target,
|
||||
value: MassState.normal,
|
||||
},
|
||||
});
|
||||
if (status === ShipSizeStatus.small) {
|
||||
outCommand({
|
||||
type: OutCommand.updateConnectionMassStatus,
|
||||
data: {
|
||||
source: edge.source,
|
||||
target: edge.target,
|
||||
value: MassState.normal,
|
||||
},
|
||||
});
|
||||
}
|
||||
}, []);
|
||||
|
||||
const onToggleMassSave = useCallback((locked: boolean) => {
|
||||
|
||||
@@ -8,6 +8,7 @@ import { ConnectionType, MassState, ShipSizeStatus, SolarSystemConnection, TimeS
|
||||
import { PrimeIcons } from 'primereact/api';
|
||||
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
||||
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider.tsx';
|
||||
import { SHIP_SIZES_DESCRIPTION, SHIP_SIZES_NAMES_SHORT } from '@/hooks/Mapper/components/map/constants.ts';
|
||||
|
||||
const MAP_TRANSLATES: Record<string, string> = {
|
||||
[Position.Top]: 'translate(-48%, 0%)',
|
||||
@@ -30,6 +31,14 @@ const MAP_OFFSETS: Record<string, { x: number; y: number }> = {
|
||||
[Position.Right]: { x: 0, y: 0 },
|
||||
};
|
||||
|
||||
export const SHIP_SIZES_COLORS = {
|
||||
[ShipSizeStatus.small]: 'bg-indigo-400',
|
||||
[ShipSizeStatus.medium]: 'bg-cyan-500',
|
||||
[ShipSizeStatus.large]: '',
|
||||
[ShipSizeStatus.freight]: 'bg-lime-400',
|
||||
[ShipSizeStatus.capital]: 'bg-red-400',
|
||||
};
|
||||
|
||||
export const SolarSystemEdge = ({ id, source, target, markerEnd, style, data }: EdgeProps<SolarSystemConnection>) => {
|
||||
const sourceNode = useStore(useCallback(store => store.nodeInternals.get(source), [source]));
|
||||
const targetNode = useStore(useCallback(store => store.nodeInternals.get(target), [target]));
|
||||
@@ -137,6 +146,19 @@ export const SolarSystemEdge = ({ id, source, target, markerEnd, style, data }:
|
||||
<span className={clsx(PrimeIcons.LOCK, classes.icon)} />
|
||||
</WdTooltipWrapper>
|
||||
)}
|
||||
|
||||
{isWormhole && data.ship_size_type !== ShipSizeStatus.large && (
|
||||
<WdTooltipWrapper
|
||||
content={SHIP_SIZES_DESCRIPTION[data.ship_size_type]}
|
||||
className={clsx(
|
||||
classes.LinkLabel,
|
||||
'pointer-events-auto rounded opacity-100 cursor-auto text-neutral-900 font-bold',
|
||||
SHIP_SIZES_COLORS[data.ship_size_type],
|
||||
)}
|
||||
>
|
||||
{SHIP_SIZES_NAMES_SHORT[data.ship_size_type]}
|
||||
</WdTooltipWrapper>
|
||||
)}
|
||||
</div>
|
||||
</EdgeLabelRenderer>
|
||||
</>
|
||||
|
||||
@@ -6,7 +6,7 @@ $pastel-green: #88b04b;
|
||||
$pastel-yellow: #ffdd59;
|
||||
$dark-bg: #2d2d2d;
|
||||
$text-color: #ffffff;
|
||||
$tooltip-bg: #202020; // Темный фон для подсказок
|
||||
$tooltip-bg: #202020; // Dark background for tooltips
|
||||
|
||||
.RootCustomNode {
|
||||
display: flex;
|
||||
@@ -136,7 +136,7 @@ $tooltip-bg: #202020; // Темный фон для подсказок
|
||||
.Bookmarks {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
z-index: 0;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
left: 4px;
|
||||
|
||||
@@ -182,6 +182,42 @@ $tooltip-bg: #202020; // Темный фон для подсказок
|
||||
}
|
||||
}
|
||||
|
||||
.Unsplashed {
|
||||
position: absolute;
|
||||
width: calc(50% - 4px);
|
||||
z-index: -1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 2px;
|
||||
left: 2px;
|
||||
|
||||
&--right {
|
||||
left: calc(50% + 6px);
|
||||
}
|
||||
|
||||
& > .Signature {
|
||||
width: 13px;
|
||||
height: 4px;
|
||||
position: relative;
|
||||
top: 3px;
|
||||
border-radius: 5px;
|
||||
color: #ffffff;
|
||||
font-size: 8px;
|
||||
text-align: center;
|
||||
padding-top: 2px;
|
||||
font-weight: bolder;
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
display: block;
|
||||
|
||||
background-color: #833ca4;
|
||||
|
||||
&:not(:first-child) {
|
||||
box-shadow: inset 4px -3px 4px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
@@ -276,7 +312,6 @@ $tooltip-bg: #202020; // Темный фон для подсказок
|
||||
position: relative;
|
||||
top: -1px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.Handlers {
|
||||
|
||||
@@ -3,6 +3,8 @@ import { Handle, Position, WrapNodeProps } from 'reactflow';
|
||||
import { MapSolarSystemType } from '../../map.types';
|
||||
import classes from './SolarSystemNode.module.scss';
|
||||
import clsx from 'clsx';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
|
||||
import {
|
||||
EFFECT_BACKGROUND_STYLES,
|
||||
LABELS_INFO,
|
||||
@@ -12,8 +14,9 @@ import {
|
||||
} from '@/hooks/Mapper/components/map/constants.ts';
|
||||
import { isWormholeSpace } from '@/hooks/Mapper/components/map/helpers/isWormholeSpace.ts';
|
||||
import { WormholeClassComp } from '@/hooks/Mapper/components/map/components/WormholeClassComp';
|
||||
import { UnsplashedSignature } from '@/hooks/Mapper/components/map/components/UnsplashedSignature';
|
||||
import { useMapState } from '@/hooks/Mapper/components/map/MapProvider.tsx';
|
||||
import { getSystemClassStyles } from '@/hooks/Mapper/components/map/helpers';
|
||||
import { getSystemClassStyles, prepareUnsplashedChunks } from '@/hooks/Mapper/components/map/helpers';
|
||||
import { sortWHClasses } from '@/hooks/Mapper/helpers';
|
||||
import { PrimeIcons } from 'primereact/api';
|
||||
import { LabelsManager } from '@/hooks/Mapper/utils/labelsManager.ts';
|
||||
@@ -50,6 +53,9 @@ export const getActivityType = (count: number) => {
|
||||
|
||||
// eslint-disable-next-line react/display-name
|
||||
export const SolarSystemNode = memo(({ data, selected }: WrapNodeProps<MapSolarSystemType>) => {
|
||||
const { interfaceSettings } = useMapRootState();
|
||||
const { isShowUnsplashedSignatures } = interfaceSettings;
|
||||
|
||||
const {
|
||||
system_class,
|
||||
security,
|
||||
@@ -63,6 +69,8 @@ export const SolarSystemNode = memo(({ data, selected }: WrapNodeProps<MapSolarS
|
||||
solar_system_name,
|
||||
} = data.system_static_info;
|
||||
|
||||
const signatures = data.system_signatures;
|
||||
|
||||
const { locked, name, tag, status, labels, id } = data || {};
|
||||
|
||||
const customName = solar_system_name !== name ? name : undefined;
|
||||
@@ -128,6 +136,22 @@ export const SolarSystemNode = memo(({ data, selected }: WrapNodeProps<MapSolarS
|
||||
const space = showKSpaceBG ? REGIONS_MAP[region_id] : '';
|
||||
const regionClass = showKSpaceBG ? SpaceToClass[space] : null;
|
||||
|
||||
const [unsplashedLeft, unsplashedRight] = useMemo(() => {
|
||||
if (!isShowUnsplashedSignatures) {
|
||||
return [[], []];
|
||||
}
|
||||
|
||||
return prepareUnsplashedChunks(
|
||||
signatures
|
||||
.filter(s => s.group === 'Wormhole' && !s.linked_system)
|
||||
.map(s => ({
|
||||
eve_id: s.eve_id,
|
||||
type: s.type,
|
||||
custom_info: s.custom_info,
|
||||
})),
|
||||
);
|
||||
}, [isShowUnsplashedSignatures, signatures]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{visible && (
|
||||
@@ -237,6 +261,22 @@ export const SolarSystemNode = memo(({ data, selected }: WrapNodeProps<MapSolarS
|
||||
)}
|
||||
</div>
|
||||
|
||||
{visible && isShowUnsplashedSignatures && (
|
||||
<div className={classes.Unsplashed}>
|
||||
{unsplashedLeft.map(x => (
|
||||
<UnsplashedSignature key={x.sig_id} signature={x} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{visible && isShowUnsplashedSignatures && (
|
||||
<div className={clsx([classes.Unsplashed, classes['Unsplashed--right']])}>
|
||||
{unsplashedRight.map(x => (
|
||||
<UnsplashedSignature key={x.sig_id} signature={x} />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div onMouseDownCapture={dbClick} className={classes.Handlers}>
|
||||
<Handle
|
||||
type="source"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
@import '@/hooks/Mapper/components/map/styles/eve-common-variables';
|
||||
|
||||
.Signature {
|
||||
position: relative;
|
||||
top: 3px;
|
||||
display: block;
|
||||
|
||||
& > .Box {
|
||||
width: 13px;
|
||||
height: 4px;
|
||||
border-radius: 4px;
|
||||
color: #ffffff;
|
||||
font-size: 8px;
|
||||
text-align: center;
|
||||
font-weight: bolder;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
||||
import { InfoDrawer } from '@/hooks/Mapper/components/ui-kit';
|
||||
|
||||
import classes from './UnsplashedSignature.module.scss';
|
||||
import { SystemSignature } from '@/hooks/Mapper/types/signatures';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { WORMHOLE_CLASS_STYLES, WORMHOLES_ADDITIONAL_INFO } from '@/hooks/Mapper/components/map/constants.ts';
|
||||
import { useMemo } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { renderInfoColumn } from '@/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/renders';
|
||||
|
||||
import { k162Types } from '@/hooks/Mapper/components/mapRootContent/components/SignatureSettings/components/SignatureK162TypeSelect';
|
||||
|
||||
interface UnsplashedSignatureProps {
|
||||
signature: SystemSignature;
|
||||
}
|
||||
export const UnsplashedSignature = ({ signature }: UnsplashedSignatureProps) => {
|
||||
const {
|
||||
data: { wormholesData },
|
||||
} = useMapRootState();
|
||||
|
||||
const whData = useMemo(() => wormholesData[signature.type], [signature.type, wormholesData]);
|
||||
const whClass = useMemo(() => (whData ? WORMHOLES_ADDITIONAL_INFO[whData.dest] : null), [whData]);
|
||||
|
||||
const k162TypeOption = useMemo(() => {
|
||||
if (!signature.custom_info) {
|
||||
return null;
|
||||
}
|
||||
const customInfo = JSON.parse(signature.custom_info);
|
||||
if (!customInfo.k162Type) {
|
||||
return null;
|
||||
}
|
||||
return k162Types.find(x => x.value === customInfo.k162Type);
|
||||
}, [signature]);
|
||||
|
||||
const whClassStyle = useMemo(() => {
|
||||
if (signature.type === 'K162' && k162TypeOption) {
|
||||
const k162Data = wormholesData[k162TypeOption.whClassName];
|
||||
const k162Class = k162Data ? WORMHOLES_ADDITIONAL_INFO[k162Data.dest] : null;
|
||||
return k162Class ? WORMHOLE_CLASS_STYLES[k162Class.wormholeClassID] : '';
|
||||
}
|
||||
return whClass ? WORMHOLE_CLASS_STYLES[whClass.wormholeClassID] : '';
|
||||
}, [signature, whClass, k162TypeOption, wormholesData]);
|
||||
|
||||
return (
|
||||
<WdTooltipWrapper
|
||||
className={clsx(classes.Signature)}
|
||||
content={
|
||||
(
|
||||
<div className="flex flex-col gap-1">
|
||||
<InfoDrawer title={<b className="text-slate-50">{signature.eve_id}</b>}>
|
||||
{renderInfoColumn(signature)}
|
||||
</InfoDrawer>
|
||||
</div>
|
||||
) as React.ReactNode
|
||||
}
|
||||
>
|
||||
<div className={clsx(classes.Box, whClassStyle)}>
|
||||
<svg width="13" height="4" viewBox="0 0 13 4" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="13" height="4" rx="2" className={whClassStyle} fill="currentColor" />
|
||||
</svg>
|
||||
</div>
|
||||
</WdTooltipWrapper>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
export * from './UnsplashedSignature.tsx';
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ConnectionType, MassState } from '@/hooks/Mapper/types';
|
||||
import { ConnectionType, MassState, ShipSizeStatus } from '@/hooks/Mapper/types';
|
||||
|
||||
export enum SOLAR_SYSTEM_CLASS_IDS {
|
||||
ccp1 = -1,
|
||||
@@ -727,16 +727,41 @@ export const MASS_STATE_NAMES = {
|
||||
[MassState.verge]: 'Verge of collapse',
|
||||
};
|
||||
|
||||
// export const SHIP_SIZES_NAMES_ORDER = [
|
||||
// ShipSizeStatus.small,
|
||||
// ShipSizeStatus.normal,
|
||||
// // ShipSizeStatus.large,
|
||||
// // ShipSizeStatus.capital,
|
||||
// ];
|
||||
//
|
||||
// export const SHIP_SIZES_NAMES = {
|
||||
// [ShipSizeStatus.small]: 'Frigate',
|
||||
// [ShipSizeStatus.normal]: 'Normal',
|
||||
// // [ShipSizeStatus.large]: 'Normal',
|
||||
// // [ShipSizeStatus.capital]: 'Normal',
|
||||
// };
|
||||
export const SHIP_SIZES_NAMES_ORDER = [
|
||||
ShipSizeStatus.small,
|
||||
ShipSizeStatus.medium,
|
||||
ShipSizeStatus.large,
|
||||
ShipSizeStatus.freight,
|
||||
ShipSizeStatus.capital,
|
||||
];
|
||||
|
||||
export const SHIP_SIZES_NAMES = {
|
||||
[ShipSizeStatus.small]: 'Frigate',
|
||||
[ShipSizeStatus.medium]: 'Medium',
|
||||
[ShipSizeStatus.large]: 'Normal',
|
||||
[ShipSizeStatus.freight]: 'Huge',
|
||||
[ShipSizeStatus.capital]: 'Capital',
|
||||
};
|
||||
export const SHIP_SIZES_SIZE = {
|
||||
[ShipSizeStatus.small]: '5K',
|
||||
[ShipSizeStatus.medium]: '62K',
|
||||
[ShipSizeStatus.large]: '375K',
|
||||
[ShipSizeStatus.freight]: '1M',
|
||||
[ShipSizeStatus.capital]: '2M',
|
||||
};
|
||||
|
||||
export const SHIP_SIZES_DESCRIPTION = {
|
||||
[ShipSizeStatus.small]: 'Frigate wormhole - up to Destroyer | 5K t.',
|
||||
[ShipSizeStatus.medium]: 'Cruise wormhole - up to Battlecruiser | 62K t.',
|
||||
[ShipSizeStatus.large]: 'Large wormhole - up to Battleship | 375K t.',
|
||||
[ShipSizeStatus.freight]: 'Huge wormhole - up to Freighter | 1M t.',
|
||||
[ShipSizeStatus.capital]: 'Capital wormhole - up to Capital | 2M t.',
|
||||
};
|
||||
|
||||
export const SHIP_SIZES_NAMES_SHORT = {
|
||||
[ShipSizeStatus.small]: 'S',
|
||||
[ShipSizeStatus.medium]: 'M',
|
||||
[ShipSizeStatus.large]: 'L',
|
||||
[ShipSizeStatus.freight]: 'H',
|
||||
[ShipSizeStatus.capital]: 'XL',
|
||||
};
|
||||
|
||||
@@ -3,3 +3,4 @@ export * from './convertSystem2Node';
|
||||
export * from './getSystemClassStyles';
|
||||
export * from './getShapeClass';
|
||||
export * from './getBackgroundClass';
|
||||
export * from './prepareUnsplashedChunks';
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// Helper function to split an array into chunks of size
|
||||
const chunkArray = (array: any[], size: number) => {
|
||||
const chunks = [];
|
||||
for (let i = 0; i < array.length; i += size) {
|
||||
chunks.push(array.slice(i, i + size));
|
||||
}
|
||||
return chunks;
|
||||
};
|
||||
|
||||
export const prepareUnsplashedChunks = (items: any[]) => {
|
||||
// Split the items into chunks of 4
|
||||
const chunks = chunkArray(items, 4);
|
||||
|
||||
// Get the column elements
|
||||
const leftColumn: any[] = [];
|
||||
const rightColumn: any[] = [];
|
||||
|
||||
chunks.forEach((chunk, index) => {
|
||||
const column = index % 2 === 0 ? leftColumn : rightColumn;
|
||||
|
||||
chunk.forEach(item => {
|
||||
column.push(item);
|
||||
});
|
||||
});
|
||||
|
||||
return [leftColumn, rightColumn];
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useCallback, useMemo } from 'react';
|
||||
import { useCallback, useMemo, useRef } from 'react';
|
||||
import { Widget } from '@/hooks/Mapper/components/mapInterface/components';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { VirtualScroller, VirtualScrollerTemplateOptions } from 'primereact/virtualscroller';
|
||||
@@ -8,6 +8,10 @@ import { CharacterTypeRaw, WithIsOwnCharacter } from '@/hooks/Mapper/types';
|
||||
import { CharacterCard, LayoutEventBlocker, WdCheckbox } from '@/hooks/Mapper/components/ui-kit';
|
||||
import { sortCharacters } from '@/hooks/Mapper/components/mapInterface/helpers/sortCharacters.ts';
|
||||
import useLocalStorageState from 'use-local-storage-state';
|
||||
import { useMapCheckPermissions, useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
||||
import { UserPermission } from '@/hooks/Mapper/types/permissions.ts';
|
||||
import useMaxWidth from '@/hooks/Mapper/hooks/useMaxWidth.ts';
|
||||
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
||||
|
||||
type CharItemProps = {
|
||||
compact: boolean;
|
||||
@@ -62,6 +66,14 @@ export const LocalCharacters = () => {
|
||||
|
||||
const [systemId] = selectedSystems;
|
||||
|
||||
const restrictOfflineShowing = useMapGetOption('restrict_offline_showing');
|
||||
const isAdminOrManager = useMapCheckPermissions([UserPermission.MANAGE_MAP]);
|
||||
|
||||
const showOffline = useMemo(
|
||||
() => !restrictOfflineShowing || isAdminOrManager,
|
||||
[isAdminOrManager, restrictOfflineShowing],
|
||||
);
|
||||
|
||||
const itemTemplate = useItemTemplate();
|
||||
|
||||
const sorted = useMemo(() => {
|
||||
@@ -70,32 +82,39 @@ export const LocalCharacters = () => {
|
||||
.map(x => ({ ...x, isOwn: userCharacters.includes(x.eve_id), compact: settings.compact }))
|
||||
.sort(sortCharacters);
|
||||
|
||||
if (!settings.showOffline) {
|
||||
if (!showOffline || !settings.showOffline) {
|
||||
return sorted.filter(c => c.online);
|
||||
}
|
||||
|
||||
return sorted;
|
||||
// eslint-disable-next-line
|
||||
}, [characters, settings.showOffline, settings.compact, systemId, userCharacters, presentCharacters]);
|
||||
}, [showOffline, characters, settings.showOffline, settings.compact, systemId, userCharacters, presentCharacters]);
|
||||
|
||||
const isNobodyHere = sorted.length === 0;
|
||||
const isNotSelectedSystem = selectedSystems.length !== 1;
|
||||
const showList = sorted.length > 0 && selectedSystems.length === 1;
|
||||
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const compact = useMaxWidth(ref, 145);
|
||||
|
||||
return (
|
||||
<Widget
|
||||
label={
|
||||
<div className="flex justify-between items-center text-xs w-full">
|
||||
<div className="flex justify-between items-center text-xs w-full" ref={ref}>
|
||||
<span className="select-none">Local{showList ? ` [${sorted.length}]` : ''}</span>
|
||||
<LayoutEventBlocker className="flex items-center gap-2">
|
||||
<WdCheckbox
|
||||
size="xs"
|
||||
labelSide="left"
|
||||
label={'Show offline'}
|
||||
value={settings.showOffline}
|
||||
classNameLabel="text-stone-400 hover:text-stone-200 transition duration-300"
|
||||
onChange={() => setSettings(() => ({ ...settings, showOffline: !settings.showOffline }))}
|
||||
/>
|
||||
{showOffline && (
|
||||
<WdTooltipWrapper content="Show offline characters in system">
|
||||
<WdCheckbox
|
||||
size="xs"
|
||||
labelSide="left"
|
||||
label={compact ? '' : 'Show offline'}
|
||||
value={settings.showOffline}
|
||||
classNameLabel="text-stone-400 hover:text-stone-200 transition duration-300"
|
||||
onChange={() => setSettings(() => ({ ...settings, showOffline: !settings.showOffline }))}
|
||||
/>
|
||||
</WdTooltipWrapper>
|
||||
)}
|
||||
|
||||
<span
|
||||
className={clsx('w-4 h-4 cursor-pointer', {
|
||||
@@ -115,7 +134,9 @@ export const LocalCharacters = () => {
|
||||
)}
|
||||
|
||||
{isNobodyHere && !isNotSelectedSystem && (
|
||||
<div className="w-full h-full flex justify-center items-center select-none text-stone-400/80 text-sm">Nobody here</div>
|
||||
<div className="w-full h-full flex justify-center items-center select-none text-stone-400/80 text-sm">
|
||||
Nobody here
|
||||
</div>
|
||||
)}
|
||||
|
||||
{showList && (
|
||||
|
||||
@@ -19,6 +19,8 @@ import { PrimeIcons } from 'primereact/api';
|
||||
import { RoutesSettingsDialog } from './RoutesSettingsDialog';
|
||||
import { RoutesProvider, useRouteProvider } from './RoutesProvider.tsx';
|
||||
import { ContextMenuSystemInfo, useContextMenuSystemInfoHandlers } from '@/hooks/Mapper/components/contexts';
|
||||
import useMaxWidth from '@/hooks/Mapper/hooks/useMaxWidth.ts';
|
||||
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
||||
|
||||
const sortByDist = (a: Route, b: Route) => {
|
||||
const distA = a.has_connection ? a.systems?.length || 0 : Infinity;
|
||||
@@ -170,20 +172,25 @@ export const RoutesWidgetComp = () => {
|
||||
});
|
||||
}, [data, update]);
|
||||
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const compact = useMaxWidth(ref, 155);
|
||||
|
||||
return (
|
||||
<Widget
|
||||
label={
|
||||
<div className="flex justify-between items-center text-xs w-full">
|
||||
<div className="flex justify-between items-center text-xs w-full" ref={ref}>
|
||||
<span className="select-none">Routes</span>
|
||||
<LayoutEventBlocker className="flex items-center gap-2">
|
||||
<WdCheckbox
|
||||
size="xs"
|
||||
labelSide="left"
|
||||
label={'Show shortest'}
|
||||
value={!isSecure}
|
||||
onChange={handleSecureChange}
|
||||
classNameLabel={clsx('text-red-400')}
|
||||
/>
|
||||
<WdTooltipWrapper content="Show shortest route">
|
||||
<WdCheckbox
|
||||
size="xs"
|
||||
labelSide="left"
|
||||
label={compact ? '' : 'Show shortest'}
|
||||
value={!isSecure}
|
||||
onChange={handleSecureChange}
|
||||
classNameLabel={clsx('text-red-400')}
|
||||
/>
|
||||
</WdTooltipWrapper>
|
||||
<WdImgButton className={PrimeIcons.SLIDERS_H} onClick={() => setRouteSettingsVisible(true)} />
|
||||
</LayoutEventBlocker>
|
||||
</div>
|
||||
|
||||
@@ -2,30 +2,33 @@ import { Widget } from '@/hooks/Mapper/components/mapInterface/components';
|
||||
import {
|
||||
InfoDrawer,
|
||||
LayoutEventBlocker,
|
||||
SystemView,
|
||||
TooltipPosition,
|
||||
WdImgButton,
|
||||
WdCheckbox,
|
||||
WdImgButton,
|
||||
} from '@/hooks/Mapper/components/ui-kit';
|
||||
import { SystemSignaturesContent } from './SystemSignaturesContent';
|
||||
import {
|
||||
Setting,
|
||||
SystemSignatureSettingsDialog,
|
||||
COSMIC_SIGNATURE,
|
||||
COSMIC_ANOMALY,
|
||||
COSMIC_SIGNATURE,
|
||||
DEPLOYABLE,
|
||||
STRUCTURE,
|
||||
STARBASE,
|
||||
SHIP,
|
||||
DRONE,
|
||||
Setting,
|
||||
SHIP,
|
||||
STARBASE,
|
||||
STRUCTURE,
|
||||
SystemSignatureSettingsDialog,
|
||||
} from './SystemSignatureSettingsDialog';
|
||||
import { SignatureGroup } from '@/hooks/Mapper/types';
|
||||
|
||||
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { PrimeIcons } from 'primereact/api';
|
||||
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { CheckboxChangeEvent } from 'primereact/checkbox';
|
||||
import useMaxWidth from '@/hooks/Mapper/hooks/useMaxWidth.ts';
|
||||
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
||||
|
||||
const SIGNATURE_SETTINGS_KEY = 'wanderer_system_signature_settings_v5_2';
|
||||
export const SHOW_DESCRIPTION_COLUMN_SETTING = 'show_description_column_setting';
|
||||
@@ -96,21 +99,33 @@ export const SystemSignatures = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
const compact = useMaxWidth(ref, 260);
|
||||
|
||||
return (
|
||||
<Widget
|
||||
label={
|
||||
<div className="flex justify-between items-center text-xs w-full h-full">
|
||||
<div className="flex gap-1">System Signatures</div>
|
||||
<div className="flex justify-between items-center text-xs w-full h-full" ref={ref}>
|
||||
<div className="flex justify-between items-center gap-1">
|
||||
{!compact && (
|
||||
<div className="flex whitespace-nowrap text-ellipsis overflow-hidden text-stone-400">
|
||||
Signatures {isNotSelectedSystem ? '' : 'in'}
|
||||
</div>
|
||||
)}
|
||||
{!isNotSelectedSystem && <SystemView systemId={systemId} className="select-none text-center" hideRegion />}
|
||||
</div>
|
||||
|
||||
<LayoutEventBlocker className="flex gap-2.5">
|
||||
<WdCheckbox
|
||||
size="xs"
|
||||
labelSide="left"
|
||||
label={'Lazy delete'}
|
||||
value={lazyDeleteValue}
|
||||
classNameLabel="text-stone-400 hover:text-stone-200 transition duration-300"
|
||||
onChange={(event: CheckboxChangeEvent) => handleLazyDeleteChange(!!event.checked)}
|
||||
/>
|
||||
<WdTooltipWrapper content="Enable Lazy delete">
|
||||
<WdCheckbox
|
||||
size="xs"
|
||||
labelSide="left"
|
||||
label={compact ? '' : 'Lazy delete'}
|
||||
value={lazyDeleteValue}
|
||||
classNameLabel="text-stone-400 hover:text-stone-200 transition duration-300 whitespace-nowrap text-ellipsis overflow-hidden"
|
||||
onChange={(event: CheckboxChangeEvent) => handleLazyDeleteChange(!!event.checked)}
|
||||
/>
|
||||
</WdTooltipWrapper>
|
||||
|
||||
<WdImgButton
|
||||
className={PrimeIcons.QUESTION_CIRCLE}
|
||||
|
||||
@@ -373,7 +373,6 @@ export const SystemSignaturesContent = ({
|
||||
></Column>
|
||||
<Column
|
||||
field="info"
|
||||
// header="Info"
|
||||
bodyClassName="text-ellipsis overflow-hidden whitespace-nowrap"
|
||||
body={renderInfoColumn}
|
||||
style={{ maxWidth: nameColumnWidth }}
|
||||
|
||||
@@ -5,6 +5,8 @@ import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrap
|
||||
import { TooltipPosition } from '@/hooks/Mapper/components/ui-kit';
|
||||
import { OutCommand } from '@/hooks/Mapper/types';
|
||||
import { MenuItem } from 'primereact/menuitem';
|
||||
import { useMapCheckPermissions } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
||||
import { UserPermission } from '@/hooks/Mapper/types/permissions.ts';
|
||||
|
||||
export interface MapContextMenuProps {
|
||||
onShowOnTheMap?: () => void;
|
||||
@@ -14,6 +16,8 @@ export interface MapContextMenuProps {
|
||||
export const MapContextMenu = ({ onShowOnTheMap, onShowMapSettings }: MapContextMenuProps) => {
|
||||
const { outCommand, setInterfaceSettings } = useMapRootState();
|
||||
|
||||
const canTrackCharacters = useMapCheckPermissions([UserPermission.TRACK_CHARACTER]);
|
||||
|
||||
const menuRight = useRef<Menu>(null);
|
||||
|
||||
const handleAddCharacter = useCallback(() => {
|
||||
@@ -24,34 +28,40 @@ export const MapContextMenu = ({ onShowOnTheMap, onShowMapSettings }: MapContext
|
||||
}, [outCommand]);
|
||||
|
||||
const items = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
label: 'Tracking',
|
||||
icon: 'pi pi-user-plus',
|
||||
command: handleAddCharacter,
|
||||
},
|
||||
{
|
||||
label: 'On the map',
|
||||
icon: 'pi pi-hashtag',
|
||||
command: onShowOnTheMap,
|
||||
},
|
||||
{ separator: true },
|
||||
{
|
||||
label: 'Settings',
|
||||
icon: `pi pi-cog`,
|
||||
command: onShowMapSettings,
|
||||
},
|
||||
{
|
||||
label: 'Dock menu',
|
||||
icon: 'pi pi-window-maximize',
|
||||
command: () =>
|
||||
setInterfaceSettings(x => ({
|
||||
...x,
|
||||
isShowMenu: !x.isShowMenu,
|
||||
})),
|
||||
},
|
||||
] as MenuItem[];
|
||||
}, [handleAddCharacter, onShowMapSettings, onShowOnTheMap, setInterfaceSettings]);
|
||||
return (
|
||||
[
|
||||
{
|
||||
label: 'Tracking',
|
||||
icon: 'pi pi-user-plus',
|
||||
command: handleAddCharacter,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
label: 'On the map',
|
||||
icon: 'pi pi-hashtag',
|
||||
command: onShowOnTheMap,
|
||||
visible: canTrackCharacters,
|
||||
},
|
||||
{ separator: true, visible: true },
|
||||
{
|
||||
label: 'Settings',
|
||||
icon: `pi pi-cog`,
|
||||
command: onShowMapSettings,
|
||||
visible: true,
|
||||
},
|
||||
{
|
||||
label: 'Dock menu',
|
||||
icon: 'pi pi-window-maximize',
|
||||
command: () =>
|
||||
setInterfaceSettings(x => ({
|
||||
...x,
|
||||
isShowMenu: !x.isShowMenu,
|
||||
})),
|
||||
visible: true,
|
||||
},
|
||||
] as MenuItem[]
|
||||
).filter(item => item.visible);
|
||||
}, [canTrackCharacters, handleAddCharacter, onShowMapSettings, onShowOnTheMap, setInterfaceSettings]);
|
||||
|
||||
return (
|
||||
<div className="ml-1">
|
||||
|
||||
@@ -53,15 +53,18 @@ const SYSTEMS_CHECKBOXES_PROPS: CheckboxesList = [
|
||||
|
||||
const SIGNATURES_CHECKBOXES_PROPS: CheckboxesList = [
|
||||
{ prop: UserSettingsRemoteProps.link_signature_on_splash, label: 'Link signature on splash' },
|
||||
{ prop: InterfaceStoredSettingsProps.isShowUnsplashedSignatures, label: 'Show unsplashed signatures' },
|
||||
];
|
||||
|
||||
const CONNECTIONS_CHECKBOXES_PROPS: CheckboxesList = [
|
||||
{ prop: UserSettingsRemoteProps.delete_connection_with_sigs, label: 'Delete connections to linked signatures' },
|
||||
{ prop: InterfaceStoredSettingsProps.isThickConnections, label: 'Thicker connections' },
|
||||
];
|
||||
|
||||
const UI_CHECKBOXES_PROPS: CheckboxesList = [
|
||||
{ prop: InterfaceStoredSettingsProps.isShowMenu, label: 'Enable compact map menu bar' },
|
||||
{ prop: InterfaceStoredSettingsProps.isThickConnections, label: 'Thicker connections' },
|
||||
{ prop: InterfaceStoredSettingsProps.isShowBackgroundPattern, label: 'Show background pattern' },
|
||||
{ prop: InterfaceStoredSettingsProps.isSoftBackground, label: 'Enable soft background' },
|
||||
];
|
||||
|
||||
export const MapSettings = ({ show, onHide }: MapSettingsProps) => {
|
||||
@@ -128,7 +131,7 @@ export const MapSettings = ({ show, onHide }: MapSettingsProps) => {
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
header="Map settings"
|
||||
header="Map user settings"
|
||||
visible={show}
|
||||
draggable={false}
|
||||
style={{ width: '550px' }}
|
||||
|
||||
@@ -8,6 +8,8 @@ import clsx from 'clsx';
|
||||
import { CharacterTypeRaw, WithIsOwnCharacter } from '@/hooks/Mapper/types';
|
||||
import { CharacterCard, WdCheckbox } from '@/hooks/Mapper/components/ui-kit';
|
||||
import useLocalStorageState from 'use-local-storage-state';
|
||||
import { useMapCheckPermissions, useMapGetOption } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
||||
import { UserPermission } from '@/hooks/Mapper/types/permissions.ts';
|
||||
|
||||
type WindowLocalSettingsType = {
|
||||
compact: boolean;
|
||||
@@ -50,14 +52,22 @@ export const OnTheMap = ({ show, onHide }: OnTheMapProps) => {
|
||||
defaultValue: STORED_DEFAULT_VALUES,
|
||||
});
|
||||
|
||||
const restrictOfflineShowing = useMapGetOption('restrict_offline_showing');
|
||||
const isAdminOrManager = useMapCheckPermissions([UserPermission.MANAGE_MAP]);
|
||||
|
||||
const showOffline = useMemo(
|
||||
() => !restrictOfflineShowing || isAdminOrManager,
|
||||
[isAdminOrManager, restrictOfflineShowing],
|
||||
);
|
||||
|
||||
const sorted = useMemo(() => {
|
||||
const out = characters.map(x => ({ ...x, isOwn: userCharacters.includes(x.eve_id) })).sort(sortCharacters);
|
||||
if (!settings.hideOffline) {
|
||||
if (showOffline && !settings.hideOffline) {
|
||||
return out;
|
||||
}
|
||||
|
||||
return out.filter(x => x.online);
|
||||
}, [characters, settings.hideOffline, userCharacters]);
|
||||
}, [showOffline, characters, settings.hideOffline, userCharacters]);
|
||||
|
||||
return (
|
||||
<Sidebar
|
||||
@@ -70,14 +80,16 @@ export const OnTheMap = ({ show, onHide }: OnTheMapProps) => {
|
||||
>
|
||||
<div className={clsx(classes.SidebarContent, '')}>
|
||||
<div className={'flex justify-end items-center gap-2 px-3'}>
|
||||
<WdCheckbox
|
||||
size="m"
|
||||
labelSide="left"
|
||||
label={'Hide offline'}
|
||||
value={settings.hideOffline}
|
||||
classNameLabel="text-stone-400 hover:text-stone-200 transition duration-300"
|
||||
onChange={() => setSettings(() => ({ ...settings, hideOffline: !settings.hideOffline }))}
|
||||
/>
|
||||
{showOffline && (
|
||||
<WdCheckbox
|
||||
size="m"
|
||||
labelSide="left"
|
||||
label={'Hide offline'}
|
||||
value={settings.hideOffline}
|
||||
classNameLabel="text-stone-400 hover:text-stone-200 transition duration-300"
|
||||
onChange={() => setSettings(() => ({ ...settings, hideOffline: !settings.hideOffline }))}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<VirtualScroller
|
||||
|
||||
@@ -6,6 +6,9 @@ import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { WdTooltipWrapper } from '@/hooks/Mapper/components/ui-kit/WdTooltipWrapper';
|
||||
import { TooltipPosition } from '@/hooks/Mapper/components/ui-kit';
|
||||
|
||||
import { useMapCheckPermissions } from '@/hooks/Mapper/mapRootProvider/hooks/api';
|
||||
import { UserPermission } from '@/hooks/Mapper/types/permissions.ts';
|
||||
|
||||
interface RightBarProps {
|
||||
onShowOnTheMap?: () => void;
|
||||
onShowMapSettings?: () => void;
|
||||
@@ -14,6 +17,8 @@ interface RightBarProps {
|
||||
export const RightBar = ({ onShowOnTheMap, onShowMapSettings }: RightBarProps) => {
|
||||
const { outCommand, interfaceSettings, setInterfaceSettings } = useMapRootState();
|
||||
|
||||
const canTrackCharacters = useMapCheckPermissions([UserPermission.TRACK_CHARACTER]);
|
||||
|
||||
const isShowMinimap = interfaceSettings.isShowMinimap === undefined ? true : interfaceSettings.isShowMinimap;
|
||||
|
||||
const handleAddCharacter = useCallback(() => {
|
||||
@@ -64,19 +69,21 @@ export const RightBar = ({ onShowOnTheMap, onShowMapSettings }: RightBarProps) =
|
||||
</button>
|
||||
</WdTooltipWrapper>
|
||||
|
||||
<WdTooltipWrapper content="Show on the map" position={TooltipPosition.left}>
|
||||
<button
|
||||
className="btn bg-transparent text-gray-400 hover:text-white border-transparent hover:bg-transparent py-2 h-auto min-h-auto"
|
||||
type="button"
|
||||
onClick={onShowOnTheMap}
|
||||
>
|
||||
<i className="pi pi-hashtag"></i>
|
||||
</button>
|
||||
</WdTooltipWrapper>
|
||||
{canTrackCharacters && (
|
||||
<WdTooltipWrapper content="Show on the map" position={TooltipPosition.left}>
|
||||
<button
|
||||
className="btn bg-transparent text-gray-400 hover:text-white border-transparent hover:bg-transparent py-2 h-auto min-h-auto"
|
||||
type="button"
|
||||
onClick={onShowOnTheMap}
|
||||
>
|
||||
<i className="pi pi-hashtag"></i>
|
||||
</button>
|
||||
</WdTooltipWrapper>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col items-center mb-2 gap-1">
|
||||
<WdTooltipWrapper content="User settings" position={TooltipPosition.left}>
|
||||
<WdTooltipWrapper content="Map user settings" position={TooltipPosition.left}>
|
||||
<button
|
||||
className="btn bg-transparent text-gray-400 hover:text-white border-transparent hover:bg-transparent py-2 h-auto min-h-auto"
|
||||
type="button"
|
||||
|
||||
@@ -17,7 +17,17 @@ const getPossibleWormholes = (systemStatic: SolarSystemStaticInfoRaw, wormholes:
|
||||
|
||||
// @ts-ignore
|
||||
const spawnClassGroup = SOLAR_SYSTEM_CLASSES_TO_CLASS_GROUPS[whType];
|
||||
const possibleWHTypes = wormholes.filter(x => x.src.includes(spawnClassGroup));
|
||||
const possibleWHTypes = wormholes.filter(x => {
|
||||
return x.src.some(x => {
|
||||
const [group, type] = x.split('-');
|
||||
|
||||
if (type === 'shattered') {
|
||||
return systemStatic.is_shattered && group === spawnClassGroup;
|
||||
}
|
||||
|
||||
return group === spawnClassGroup;
|
||||
});
|
||||
});
|
||||
|
||||
return {
|
||||
statics: possibleWHTypes
|
||||
|
||||
@@ -34,6 +34,8 @@ export const MapWrapper = () => {
|
||||
isShowMinimap = STORED_INTERFACE_DEFAULT_VALUES.isShowMinimap,
|
||||
isShowKSpace,
|
||||
isThickConnections,
|
||||
isShowBackgroundPattern,
|
||||
isSoftBackground,
|
||||
},
|
||||
} = useMapRootState();
|
||||
const { deleteSystems } = useDeleteSystems();
|
||||
@@ -135,6 +137,8 @@ export const MapWrapper = () => {
|
||||
showKSpaceBG={isShowKSpace}
|
||||
onManualDelete={handleManualDelete}
|
||||
isThickConnections={isThickConnections}
|
||||
isShowBackgroundPattern={isShowBackgroundPattern}
|
||||
isSoftBackground={isSoftBackground}
|
||||
/>
|
||||
|
||||
{openSettings != null && (
|
||||
|
||||
@@ -18,7 +18,7 @@ const Topbar = ({ children }: WithChildren) => {
|
||||
<nav
|
||||
className={clsx(
|
||||
'px-2 flex items-center justify-center min-w-0 h-12 pointer-events-auto',
|
||||
'border-b border-gray-900 bg-gray-800 bg-opacity-5',
|
||||
'border-b border-stone-800 bg-gray-800 bg-opacity-5',
|
||||
'bg-opacity-70 bg-neutral-900',
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -41,8 +41,6 @@ export const WHClassView = ({
|
||||
data: { wormholesData },
|
||||
} = useMapRootState();
|
||||
|
||||
console.log(whClassName);
|
||||
|
||||
const whData = useMemo(() => wormholesData[whClassName], [whClassName, wormholesData]);
|
||||
const whClass = useMemo(() => WORMHOLES_ADDITIONAL_INFO[whData.dest], [whData.dest]);
|
||||
const whClassStyle = WORMHOLE_CLASS_STYLES[whClass?.wormholeClassID] ?? '';
|
||||
|
||||
@@ -26,6 +26,7 @@ const INITIAL_DATA: MapRootData = {
|
||||
selectedSystems: [],
|
||||
selectedConnections: [],
|
||||
userPermissions: {},
|
||||
options: {},
|
||||
};
|
||||
|
||||
export enum InterfaceStoredSettingsProps {
|
||||
@@ -33,6 +34,9 @@ export enum InterfaceStoredSettingsProps {
|
||||
isShowMinimap = 'isShowMinimap',
|
||||
isShowKSpace = 'isShowKSpace',
|
||||
isThickConnections = 'isThickConnections',
|
||||
isShowUnsplashedSignatures = 'isShowUnsplashedSignatures',
|
||||
isShowBackgroundPattern = 'isShowBackgroundPattern',
|
||||
isSoftBackground = 'isSoftBackground',
|
||||
}
|
||||
|
||||
export type InterfaceStoredSettings = {
|
||||
@@ -40,6 +44,9 @@ export type InterfaceStoredSettings = {
|
||||
isShowMinimap: boolean;
|
||||
isShowKSpace: boolean;
|
||||
isThickConnections: boolean;
|
||||
isShowUnsplashedSignatures: boolean;
|
||||
isShowBackgroundPattern: boolean;
|
||||
isSoftBackground: boolean;
|
||||
};
|
||||
|
||||
export const STORED_INTERFACE_DEFAULT_VALUES: InterfaceStoredSettings = {
|
||||
@@ -47,6 +54,9 @@ export const STORED_INTERFACE_DEFAULT_VALUES: InterfaceStoredSettings = {
|
||||
isShowMinimap: true,
|
||||
isShowKSpace: false,
|
||||
isThickConnections: false,
|
||||
isShowUnsplashedSignatures: false,
|
||||
isShowBackgroundPattern: true,
|
||||
isSoftBackground: false,
|
||||
};
|
||||
|
||||
export interface MapRootContextProps {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export * from './useMapInit';
|
||||
export * from './useMapUpdated';
|
||||
export * from './useMapCheckPermissions';
|
||||
export * from './useMapGetOption';
|
||||
export * from './useRoutes';
|
||||
export * from './useCommandsConnections';
|
||||
export * from './useCommandsSystems';
|
||||
|
||||
@@ -2,11 +2,14 @@ import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
import { useCallback, useRef } from 'react';
|
||||
import { CommandAddSystems, CommandRemoveSystems, CommandUpdateSystems } from '@/hooks/Mapper/types';
|
||||
import { useLoadSystemStatic } from '@/hooks/Mapper/mapRootProvider/hooks/useLoadSystemStatic.ts';
|
||||
|
||||
import { OutCommand } from '@/hooks/Mapper/types/mapHandlers.ts';
|
||||
import { emitMapEvent } from '@/hooks/Mapper/events';
|
||||
import { Commands } from '@/hooks/Mapper/types/mapHandlers.ts';
|
||||
export const useCommandsSystems = () => {
|
||||
const {
|
||||
update,
|
||||
data: { systems },
|
||||
outCommand,
|
||||
} = useMapRootState();
|
||||
|
||||
const { addSystemStatic } = useLoadSystemStatic({ systems: [] });
|
||||
@@ -56,5 +59,29 @@ export const useCommandsSystems = () => {
|
||||
update({ systems: out }, true);
|
||||
}, []);
|
||||
|
||||
return { addSystems, removeSystems, updateSystems };
|
||||
const updateSystemSignatures = useCallback(
|
||||
async (systemId: string) => {
|
||||
const { update, systems } = ref.current;
|
||||
|
||||
const { signatures } = await outCommand({
|
||||
type: OutCommand.getSignatures,
|
||||
data: { system_id: `${systemId}` },
|
||||
});
|
||||
|
||||
const out = systems.map(current => {
|
||||
if (current.id === `${systemId}`) {
|
||||
return { ...current, system_signatures: signatures };
|
||||
}
|
||||
|
||||
return current;
|
||||
});
|
||||
|
||||
update({ systems: out }, true);
|
||||
|
||||
emitMapEvent({ name: Commands.updateSystems, data: out });
|
||||
},
|
||||
[outCommand],
|
||||
);
|
||||
|
||||
return { addSystems, removeSystems, updateSystems, updateSystemSignatures };
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { useMemo } from 'react';
|
||||
import { useMapRootState } from '@/hooks/Mapper/mapRootProvider';
|
||||
|
||||
export const useMapGetOption = (option: string) => {
|
||||
const {
|
||||
data: { options },
|
||||
} = useMapRootState();
|
||||
|
||||
return useMemo(() => options[option], [option, options]);
|
||||
};
|
||||
@@ -20,6 +20,7 @@ export const useMapInit = () => {
|
||||
present_characters,
|
||||
hubs,
|
||||
user_permissions,
|
||||
options,
|
||||
}: CommandInit) => {
|
||||
const updateData: Partial<MapRootData> = {};
|
||||
|
||||
@@ -60,6 +61,10 @@ export const useMapInit = () => {
|
||||
updateData.hubs = hubs;
|
||||
}
|
||||
|
||||
if (options) {
|
||||
updateData.options = options;
|
||||
}
|
||||
|
||||
if (system_static_infos) {
|
||||
system_static_infos.forEach(static_info => {
|
||||
addSystemStatic(static_info);
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
CommandRemoveSystems,
|
||||
CommandRoutes,
|
||||
Commands,
|
||||
CommandSignaturesUpdated,
|
||||
CommandUpdateConnection,
|
||||
CommandUpdateSystems,
|
||||
MapHandlers,
|
||||
@@ -31,7 +32,7 @@ import { emitMapEvent } from '@/hooks/Mapper/events';
|
||||
|
||||
export const useMapRootHandlers = (ref: ForwardedRef<MapHandlers>) => {
|
||||
const mapInit = useMapInit();
|
||||
const { addSystems, removeSystems, updateSystems } = useCommandsSystems();
|
||||
const { addSystems, removeSystems, updateSystems, updateSystemSignatures } = useCommandsSystems();
|
||||
const { addConnections, removeConnections, updateConnection } = useCommandsConnections();
|
||||
const { charactersUpdated, characterAdded, characterRemoved, characterUpdated, presentCharacters } =
|
||||
useCommandsCharacters();
|
||||
@@ -88,7 +89,7 @@ export const useMapRootHandlers = (ref: ForwardedRef<MapHandlers>) => {
|
||||
break;
|
||||
|
||||
case Commands.signaturesUpdated: // USED
|
||||
// do nothing here
|
||||
updateSystemSignatures(data as CommandSignaturesUpdated);
|
||||
break;
|
||||
|
||||
case Commands.linkSignatureToSystem: // USED
|
||||
|
||||
@@ -14,16 +14,12 @@ export enum TimeStatus {
|
||||
eol,
|
||||
}
|
||||
|
||||
// export enum ShipSizeStatus {
|
||||
// small, // frigates, destroyers - less than 5K t
|
||||
// medium, // less than 20K t
|
||||
// large, // less than 375K t
|
||||
// capital, // less than 1.8M t
|
||||
// }
|
||||
|
||||
export enum ShipSizeStatus {
|
||||
small, // frigates, destroyers - less than 5K t
|
||||
normal,
|
||||
small = 0, // frigates, destroyers - less than 5K t
|
||||
medium = 1, // less than 62K t
|
||||
large = 2, // less than 375K t
|
||||
freight = 3, // less than 1M t
|
||||
capital = 4, // less than 1.8M t
|
||||
}
|
||||
|
||||
export type SolarSystemConnection = {
|
||||
|
||||
@@ -62,6 +62,7 @@ export type CommandInit = {
|
||||
user_permissions: UserPermissions;
|
||||
hubs: string[];
|
||||
routes: RoutesList;
|
||||
options: Record<string, string | boolean>;
|
||||
reset?: boolean;
|
||||
};
|
||||
export type CommandAddSystems = SolarSystemRawType[];
|
||||
|
||||
@@ -19,4 +19,5 @@ export type MapUnionTypes = {
|
||||
kills: Record<number, number>;
|
||||
connections: SolarSystemConnection[];
|
||||
userPermissions: Partial<UserPermissions>;
|
||||
options: Record<string, string | boolean>;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { XYPosition } from 'reactflow';
|
||||
|
||||
import { SystemSignature } from '@/hooks/Mapper/types/signatures';
|
||||
|
||||
export enum SolarSystemStaticInfoRawNames {
|
||||
regionId = 'region_id',
|
||||
constellationId = 'constellation_id',
|
||||
@@ -116,4 +118,5 @@ export type SolarSystemRawType = {
|
||||
name: string | null;
|
||||
|
||||
system_static_info: SolarSystemStaticInfoRaw;
|
||||
system_signatures: SystemSignature[];
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@ import CopyToClipboard from './copyToClipboard';
|
||||
import DownloadJson from './downloadJson';
|
||||
import NewVersionUpdate from './newVersionUpdate';
|
||||
import MapAction from './maps/mapAction';
|
||||
import ShowCharactersAddAlert from './showCharactersAddAlert';
|
||||
|
||||
export default {
|
||||
DownloadJson,
|
||||
@@ -20,4 +21,5 @@ export default {
|
||||
Ping,
|
||||
CopyToClipboard,
|
||||
NewVersionUpdate,
|
||||
ShowCharactersAddAlert,
|
||||
};
|
||||
|
||||
11
assets/js/hooks/showCharactersAddAlert.ts
Normal file
11
assets/js/hooks/showCharactersAddAlert.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
mounted() {
|
||||
this.pushEvent('restore_show_characters_add_alert', {
|
||||
value: localStorage.getItem('wanderer:hide_characters_add_alert') !== 'true',
|
||||
});
|
||||
|
||||
document.getElementById('characters-add-alert-hide')?.addEventListener('click', e => {
|
||||
localStorage.setItem('wanderer:hide_characters_add_alert', 'true');
|
||||
});
|
||||
},
|
||||
};
|
||||
@@ -12,11 +12,16 @@ defmodule WandererApp.Api.MapCharacterSettings do
|
||||
|
||||
code_interface do
|
||||
define(:create, action: :create)
|
||||
define(:destroy, action: :destroy)
|
||||
|
||||
define(:read_by_map,
|
||||
action: :read_by_map
|
||||
)
|
||||
|
||||
define(:by_map_filtered,
|
||||
action: :by_map_filtered
|
||||
)
|
||||
|
||||
define(:tracked_by_map_filtered,
|
||||
action: :tracked_by_map_filtered
|
||||
)
|
||||
@@ -38,6 +43,13 @@ defmodule WandererApp.Api.MapCharacterSettings do
|
||||
|
||||
defaults [:create, :read, :update, :destroy]
|
||||
|
||||
read :by_map_filtered do
|
||||
argument(:map_id, :string, allow_nil?: false)
|
||||
argument(:character_ids, {:array, :uuid}, allow_nil?: false)
|
||||
|
||||
filter(expr(map_id == ^arg(:map_id) and character_id in ^arg(:character_ids)))
|
||||
end
|
||||
|
||||
read :tracked_by_map_filtered do
|
||||
argument(:map_id, :string, allow_nil?: false)
|
||||
argument(:character_ids, {:array, :uuid}, allow_nil?: false)
|
||||
|
||||
@@ -128,11 +128,13 @@ defmodule WandererApp.Api.MapConnection do
|
||||
allow_nil?(true)
|
||||
end
|
||||
|
||||
# where 0 - Frigate
|
||||
# where 1 - Medium and Large
|
||||
# where 2 - Capital
|
||||
# where 0 - Frigate (small
|
||||
# where 1 - Medium
|
||||
# where 2 - Large
|
||||
# where 3 - Freight
|
||||
# where 4 - Capital
|
||||
attribute :ship_size_type, :integer do
|
||||
default(1)
|
||||
default(2)
|
||||
|
||||
allow_nil?(true)
|
||||
end
|
||||
|
||||
@@ -41,6 +41,10 @@ defmodule WandererApp.Api.MapSystem do
|
||||
action: :read_by_map_and_solar_system
|
||||
)
|
||||
|
||||
define(:search_by_map,
|
||||
action: :search_by_map
|
||||
)
|
||||
|
||||
define(:update_name, action: :update_name)
|
||||
define(:update_description, action: :update_description)
|
||||
define(:update_locked, action: :update_locked)
|
||||
@@ -73,6 +77,20 @@ defmodule WandererApp.Api.MapSystem do
|
||||
filter(expr(map_id == ^arg(:map_id) and visible == true))
|
||||
end
|
||||
|
||||
read :search_by_map do
|
||||
argument(:map_id, :string, allow_nil?: false)
|
||||
argument(:text, :string, allow_nil?: false)
|
||||
|
||||
filter(
|
||||
expr(
|
||||
(map_id == ^arg(:map_id) and
|
||||
contains(string_downcase(name), string_downcase(^arg(:text)))) or
|
||||
contains(string_downcase(custom_name), string_downcase(^arg(:text))) or
|
||||
contains(string_downcase(description), string_downcase(^arg(:text)))
|
||||
)
|
||||
)
|
||||
end
|
||||
|
||||
read :read_by_map_and_solar_system do
|
||||
argument(:map_id, :string, allow_nil?: false)
|
||||
argument(:solar_system_id, :integer, allow_nil?: false)
|
||||
|
||||
@@ -446,8 +446,13 @@ defmodule WandererApp.Character.Tracker do
|
||||
|> Map.merge(%{alliance_id: alliance_id, corporation_id: corporation_id})
|
||||
|> maybe_update_alliance()
|
||||
|
||||
_error ->
|
||||
Logger.warning("Failed to get corporation info for #{corporation_id}")
|
||||
error ->
|
||||
Logger.warning(
|
||||
"Failed to get corporation info for character #{character_id}: #{inspect(error)}",
|
||||
character_id: character_id,
|
||||
corporation_id: corporation_id
|
||||
)
|
||||
|
||||
state
|
||||
end
|
||||
end
|
||||
|
||||
@@ -49,7 +49,7 @@ defmodule WandererApp.EveDataService do
|
||||
end)
|
||||
end)
|
||||
|
||||
Task.await_many(tasks, :timer.minutes(1))
|
||||
Task.await_many(tasks, :timer.minutes(30))
|
||||
end
|
||||
|
||||
def download_file(file_name) do
|
||||
|
||||
@@ -14,6 +14,7 @@ defmodule WandererApp.Map do
|
||||
hubs: [],
|
||||
connections: Map.new(),
|
||||
acls: [],
|
||||
options: Map.new(),
|
||||
characters_limit: nil,
|
||||
hubs_limit: nil
|
||||
|
||||
@@ -69,6 +70,9 @@ defmodule WandererApp.Map do
|
||||
def get_characters_limit(map_id),
|
||||
do: {:ok, map_id |> get_map!() |> Map.get(:characters_limit, 100)}
|
||||
|
||||
def get_options(map_id),
|
||||
do: {:ok, map_id |> get_map!() |> Map.get(:options, Map.new())}
|
||||
|
||||
@doc """
|
||||
Returns a full list of characters in the map
|
||||
"""
|
||||
@@ -187,7 +191,7 @@ defmodule WandererApp.Map do
|
||||
case characters |> Enum.member?(character_id) do
|
||||
true ->
|
||||
map_id
|
||||
|> update_map(%{characters: Enum.reject(characters, fn id -> id == character_id end)})
|
||||
|> update_map(%{characters: characters |> Enum.reject(fn id -> id == character_id end)})
|
||||
|
||||
:ok
|
||||
|
||||
@@ -251,6 +255,13 @@ defmodule WandererApp.Map do
|
||||
map
|
||||
end
|
||||
|
||||
def update_options!(%{map_id: map_id} = map, options) do
|
||||
map_id
|
||||
|> update_map(%{options: options})
|
||||
|
||||
map
|
||||
end
|
||||
|
||||
def add_systems!(map, []), do: map
|
||||
|
||||
def add_systems!(%{map_id: map_id} = map, [system | rest]) do
|
||||
|
||||
@@ -277,15 +277,11 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
}
|
||||
end
|
||||
|
||||
def handle_event({:options_updated, options}, state),
|
||||
do: %{
|
||||
state
|
||||
| map_opts: [
|
||||
layout: options |> Map.get("layout", "left_to_right"),
|
||||
store_custom_labels:
|
||||
options |> Map.get("store_custom_labels", "false") |> String.to_existing_atom()
|
||||
]
|
||||
}
|
||||
def handle_event({:options_updated, options}, %{map: map} = state) do
|
||||
map |> WandererApp.Map.update_options!(options)
|
||||
|
||||
%{state | map_opts: map_options(options)}
|
||||
end
|
||||
|
||||
def handle_event({ref, _result}, %{map_id: _map_id} = state) do
|
||||
Process.demonitor(ref, [:flush])
|
||||
@@ -319,6 +315,16 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
map |> Map.put_new(attribute, get_in(update, [Access.key(attribute)]))
|
||||
end)}
|
||||
|
||||
defp map_options(options) do
|
||||
[
|
||||
layout: options |> Map.get("layout", "left_to_right"),
|
||||
store_custom_labels:
|
||||
options |> Map.get("store_custom_labels", "false") |> String.to_existing_atom(),
|
||||
restrict_offline_showing:
|
||||
options |> Map.get("restrict_offline_showing", "false") |> String.to_existing_atom()
|
||||
]
|
||||
end
|
||||
|
||||
defp save_map_state(%{map_id: map_id} = _state) do
|
||||
systems_last_activity =
|
||||
map_id
|
||||
@@ -389,22 +395,17 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
systems,
|
||||
connections
|
||||
) do
|
||||
{:ok, options} = WandererApp.MapRepo.options_to_form_data(initial_map)
|
||||
|
||||
map =
|
||||
initial_map
|
||||
|> WandererApp.Map.new()
|
||||
|> WandererApp.Map.update_options!(options)
|
||||
|> WandererApp.Map.update_subscription_settings!(subscription_settings)
|
||||
|> WandererApp.Map.add_systems!(systems)
|
||||
|> WandererApp.Map.add_connections!(connections)
|
||||
|> WandererApp.Map.add_characters!(characters)
|
||||
|
||||
{:ok, map_options} = WandererApp.MapRepo.options_to_form_data(initial_map)
|
||||
|
||||
map_opts = [
|
||||
layout: map_options |> Map.get("layout", "left_to_right"),
|
||||
store_custom_labels:
|
||||
map_options |> Map.get("store_custom_labels", "false") |> String.to_existing_atom()
|
||||
]
|
||||
|
||||
character_ids =
|
||||
map_id
|
||||
|> WandererApp.Map.get_map!()
|
||||
@@ -412,7 +413,7 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
|
||||
WandererApp.Cache.insert("map_#{map_id}:invalidate_character_ids", character_ids)
|
||||
|
||||
%{state | map: map, map_opts: map_opts}
|
||||
%{state | map: map, map_opts: map_options(options)}
|
||||
end
|
||||
|
||||
def maybe_import_systems(state, %{"systems" => systems} = _settings, user_id, character_id) do
|
||||
|
||||
@@ -89,6 +89,11 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|
||||
[]
|
||||
)
|
||||
|
||||
acls =
|
||||
map_id
|
||||
|> WandererApp.Map.get_map!()
|
||||
|> Map.get(:acls, [])
|
||||
|
||||
invalidate_character_ids
|
||||
|> Task.async_stream(
|
||||
fn character_id ->
|
||||
@@ -96,11 +101,6 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|
||||
|> WandererApp.Character.get_character()
|
||||
|> case do
|
||||
{:ok, character} ->
|
||||
acls =
|
||||
map_id
|
||||
|> WandererApp.Map.get_map!()
|
||||
|> Map.get(:acls, [])
|
||||
|
||||
[character_permissions] =
|
||||
WandererApp.Permissions.check_characters_access([character], acls)
|
||||
|
||||
@@ -157,12 +157,12 @@ defmodule WandererApp.Map.Server.CharactersImpl do
|
||||
|> untrack_characters(character_ids)
|
||||
|
||||
map_id
|
||||
|> WandererApp.MapCharacterSettingsRepo.get_tracked_by_map_filtered(character_ids)
|
||||
|> WandererApp.MapCharacterSettingsRepo.get_by_map_filtered(character_ids)
|
||||
|> case do
|
||||
{:ok, settings} ->
|
||||
settings
|
||||
|> Enum.each(fn s ->
|
||||
WandererApp.MapCharacterSettingsRepo.untrack(s)
|
||||
WandererApp.MapCharacterSettingsRepo.destroy!(s)
|
||||
remove_character(map_id, s.character_id)
|
||||
end)
|
||||
|
||||
|
||||
@@ -356,8 +356,6 @@ defmodule WandererApp.Map.Server.ConnectionsImpl do
|
||||
|
||||
def can_add_location(_scope, nil), do: false
|
||||
|
||||
def can_add_location(:all, _solar_system_id), do: true
|
||||
|
||||
def can_add_location(:none, _solar_system_id), do: false
|
||||
|
||||
def can_add_location(scope, solar_system_id) do
|
||||
@@ -380,6 +378,9 @@ defmodule WandererApp.Map.Server.ConnectionsImpl do
|
||||
not (@prohibited_system_classes |> Enum.member?(system_static_info.system_class)) and
|
||||
@known_space |> Enum.member?(system_static_info.system_class)
|
||||
|
||||
:all ->
|
||||
not (@prohibited_system_classes |> Enum.member?(system_static_info.system_class))
|
||||
|
||||
_ ->
|
||||
false
|
||||
end
|
||||
|
||||
@@ -486,7 +486,7 @@ defmodule WandererApp.Map.Server.SystemsImpl do
|
||||
state
|
||||
else
|
||||
error ->
|
||||
Logger.error("Fail ed to update system: #{inspect(error, pretty: true)}")
|
||||
Logger.error("Failed to update system: #{inspect(error, pretty: true)}")
|
||||
state
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,6 +11,13 @@ defmodule WandererApp.MapCharacterSettingsRepo do
|
||||
character_ids: character_ids
|
||||
})
|
||||
|
||||
def get_by_map_filtered(map_id, character_ids),
|
||||
do:
|
||||
WandererApp.Api.MapCharacterSettings.by_map_filtered(%{
|
||||
map_id: map_id,
|
||||
character_ids: character_ids
|
||||
})
|
||||
|
||||
def get_all_by_map(map_id),
|
||||
do: WandererApp.Api.MapCharacterSettings.read_by_map(%{map_id: map_id})
|
||||
|
||||
@@ -22,4 +29,6 @@ defmodule WandererApp.MapCharacterSettingsRepo do
|
||||
|
||||
def track!(settings), do: settings |> WandererApp.Api.MapCharacterSettings.track!()
|
||||
def untrack!(settings), do: settings |> WandererApp.Api.MapCharacterSettings.untrack!()
|
||||
|
||||
def destroy!(settings), do: settings |> WandererApp.Api.MapCharacterSettings.destroy!()
|
||||
end
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
defmodule WandererApp.MapRepo do
|
||||
use WandererApp, :repository
|
||||
|
||||
@default_map_options %{"layout" => "left_to_right", "store_custom_labels" => "false"}
|
||||
@default_map_options %{
|
||||
"layout" => "left_to_right",
|
||||
"store_custom_labels" => "false",
|
||||
"restrict_offline_showing" => "false"
|
||||
}
|
||||
|
||||
def get(map_id, relationships \\ []) do
|
||||
map_id
|
||||
|
||||
@@ -143,15 +143,10 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
def server_status(assigns) do
|
||||
~H"""
|
||||
<div
|
||||
class="flex flex-col p-4 items-center absolute bottom-16 left-1 gap-2 tooltip tooltip-right"
|
||||
class="flex flex-col p-4 items-center absolute bottom-16 left-2 gap-2 tooltip tooltip-right"
|
||||
data-tip="server: Tranquility"
|
||||
>
|
||||
<div
|
||||
:if={@online}
|
||||
class="absolute block w-4 h-4 rounded-full shadow-inner bg-green-500 animate-ping"
|
||||
>
|
||||
</div>
|
||||
<div class={"block w-4 h-4 rounded-full shadow-inner #{if @online, do: " bg-green-500", else: "bg-red-500"}"}>
|
||||
<div class={"block w-2 h-2 rounded-full shadow-inner #{if @online, do: " bg-green-500", else: "bg-red-500"}"}>
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
@@ -336,6 +331,7 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
"""
|
||||
attr(:id, :any, default: nil)
|
||||
attr(:class, :string, default: nil)
|
||||
attr(:wrapper_class, :string, default: nil)
|
||||
attr(:name, :any)
|
||||
attr(:label, :string, default: nil)
|
||||
attr(:prefix, :string, default: nil)
|
||||
@@ -381,21 +377,62 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
end)
|
||||
|
||||
~H"""
|
||||
<div phx-feedback-for={@name} class="form-control mt-8">
|
||||
<label class="label cursor-pointer gap-2">
|
||||
<span class="label-text"><%= @label %></span>
|
||||
<input type="hidden" name={@name} value="false" />
|
||||
<input
|
||||
type="checkbox"
|
||||
id={@id}
|
||||
name={@name}
|
||||
value="true"
|
||||
checked={@checked}
|
||||
class="checkbox"
|
||||
{@rest}
|
||||
/>
|
||||
<div phx-feedback-for={@name} class="form-control mt-2">
|
||||
<label class="inputContainer" for={@name}>
|
||||
<span><%= @label %></span>
|
||||
<div></div>
|
||||
<div class="smallInputSwitch">
|
||||
<div class="flex items-center">
|
||||
<div
|
||||
class={[
|
||||
"checkboxRoot sizeM p-checkbox p-component",
|
||||
classes("p-highlight": @checked)
|
||||
]}
|
||||
data-p-highlight={@checked}
|
||||
data-p-disabled="false"
|
||||
data-pc-name="checkbox"
|
||||
data-pc-section="root"
|
||||
>
|
||||
<input
|
||||
id={@id}
|
||||
name={@name}
|
||||
type="checkbox"
|
||||
class="p-checkbox-input"
|
||||
aria-invalid="false"
|
||||
data-pc-section="input"
|
||||
value="true"
|
||||
checked={@checked}
|
||||
{@rest}
|
||||
/>
|
||||
<div
|
||||
class="p-checkbox-box"
|
||||
data-p-highlight={@checked}
|
||||
data-p-disabled="false"
|
||||
data-pc-section="box"
|
||||
>
|
||||
<svg
|
||||
:if={@checked}
|
||||
width="14"
|
||||
height="14"
|
||||
viewBox="0 0 14 14"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
class="p-icon p-checkbox-icon"
|
||||
aria-hidden="true"
|
||||
data-pc-section="icon"
|
||||
>
|
||||
<path
|
||||
d="M4.86199 11.5948C4.78717 11.5923 4.71366 11.5745 4.64596 11.5426C4.57826 11.5107 4.51779 11.4652 4.46827 11.4091L0.753985 7.69483C0.683167 7.64891 0.623706 7.58751 0.580092 7.51525C0.536478 7.44299 0.509851 7.36177 0.502221 7.27771C0.49459 7.19366 0.506156 7.10897 0.536046 7.03004C0.565935 6.95111 0.613367 6.88 0.674759 6.82208C0.736151 6.76416 0.8099 6.72095 0.890436 6.69571C0.970973 6.67046 1.05619 6.66385 1.13966 6.67635C1.22313 6.68886 1.30266 6.72017 1.37226 6.76792C1.44186 6.81567 1.4997 6.8786 1.54141 6.95197L4.86199 10.2503L12.6397 2.49483C12.7444 2.42694 12.8689 2.39617 12.9932 2.40745C13.1174 2.41873 13.2343 2.47141 13.3251 2.55705C13.4159 2.64268 13.4753 2.75632 13.4938 2.87973C13.5123 3.00315 13.4888 3.1292 13.4271 3.23768L5.2557 11.4091C5.20618 11.4652 5.14571 11.5107 5.07801 11.5426C5.01031 11.5745 4.9368 11.5923 4.86199 11.5948Z"
|
||||
fill="currentColor"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<label for={@name} class="select-none ml-1.5"></label>
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
<.error :for={msg <- @errors}><%= msg %></.error>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
@@ -403,24 +440,28 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
def input(%{type: "range"} = assigns) do
|
||||
~H"""
|
||||
<div phx-feedback-for={@name}>
|
||||
<label class="form-control w-full">
|
||||
<div class="form-control w-full">
|
||||
<.label for={@id}>
|
||||
<span class="label-text"><%= @label %></span>
|
||||
<span class="label-value"><%= @value %></span>
|
||||
<span><%= @label %></span>
|
||||
<div></div>
|
||||
<%= @value %>
|
||||
</.label>
|
||||
<input
|
||||
type="range"
|
||||
id={@id}
|
||||
name={@name}
|
||||
value={@value}
|
||||
class={[
|
||||
"p-component w-full",
|
||||
@class,
|
||||
@errors != [] && "border-rose-400 focus:border-rose-400"
|
||||
]}
|
||||
{@rest}
|
||||
/>
|
||||
</label>
|
||||
|
||||
<div>
|
||||
<input
|
||||
type="range"
|
||||
id={@id}
|
||||
name={@name}
|
||||
value={@value}
|
||||
class={[
|
||||
"p-component w-full",
|
||||
@class,
|
||||
@errors != [] && "border-rose-400 focus:border-rose-400"
|
||||
]}
|
||||
{@rest}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<.error :for={msg <- @errors}><%= msg %></.error>
|
||||
</div>
|
||||
"""
|
||||
@@ -428,13 +469,20 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
|
||||
def input(%{type: "select"} = assigns) do
|
||||
~H"""
|
||||
<div phx-feedback-for={@name}>
|
||||
<div
|
||||
phx-feedback-for={@name}
|
||||
class={[
|
||||
"inputContainer",
|
||||
@wrapper_class
|
||||
]}
|
||||
>
|
||||
<.label :if={@label} for={@id}><%= @label %></.label>
|
||||
<div :if={@label}></div>
|
||||
<select
|
||||
id={@id}
|
||||
name={@name}
|
||||
class={[
|
||||
"w-full",
|
||||
"p-component",
|
||||
@class
|
||||
]}
|
||||
multiple={@multiple}
|
||||
@@ -503,9 +551,9 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
|
||||
def label(assigns) do
|
||||
~H"""
|
||||
<div for={@for} class="label">
|
||||
<label for={@for} class="inputContainer">
|
||||
<%= render_slot(@inner_block) %>
|
||||
</div>
|
||||
</label>
|
||||
"""
|
||||
end
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
>
|
||||
<%= @inner_content %>
|
||||
</main>
|
||||
<aside class="h-full w-14 left-0 absolute bg-gray-400 bg-opacity-5 text-gray-200 shadow-lg border-r border-gray-900 bg-opacity-70 bg-neutral-900">
|
||||
<aside class="h-full w-14 left-0 absolute bg-gray-400 bg-opacity-5 text-gray-200 shadow-lg border-r border-stone-800 bg-opacity-70 bg-neutral-900">
|
||||
<.sidebar_nav_links
|
||||
active_tab={@active_tab}
|
||||
show_admin={@show_admin}
|
||||
|
||||
@@ -32,14 +32,22 @@
|
||||
/>
|
||||
<script
|
||||
crossorigin="anonymous"
|
||||
src="https://unpkg.com/react@18/umd/react.production.min.js"
|
||||
integrity={integrity_hash("https://unpkg.com/react@18/umd/react.production.min.js")}
|
||||
src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"
|
||||
integrity={
|
||||
integrity_hash(
|
||||
"https://cdn.jsdelivr.net/npm/react-dom@16/umd/react-dom.development.js https://unpkg.com/react@18/umd/react.production.min.js"
|
||||
)
|
||||
}
|
||||
>
|
||||
</script>
|
||||
<script
|
||||
crossorigin="anonymous"
|
||||
src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"
|
||||
integrity={integrity_hash("https://unpkg.com/react-dom@18/umd/react-dom.production.min.js")}
|
||||
src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"
|
||||
integrity={
|
||||
integrity_hash(
|
||||
"https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"
|
||||
)
|
||||
}
|
||||
>
|
||||
</script>
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ defmodule WandererAppWeb.MapPicker do
|
||||
:if={maps}
|
||||
type="select"
|
||||
field={f[:map_slug]}
|
||||
class="select h-8 min-h-[0px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
placeholder="Select a map..."
|
||||
options={Enum.map(@maps.result, fn map -> {map.label, map.value} end)}
|
||||
/>
|
||||
|
||||
@@ -8,7 +8,8 @@ defmodule WandererAppWeb.UserActivity do
|
||||
end
|
||||
|
||||
@impl true
|
||||
def update(assigns,
|
||||
def update(
|
||||
assigns,
|
||||
socket
|
||||
) do
|
||||
{:ok,
|
||||
@@ -116,7 +117,6 @@ defmodule WandererAppWeb.UserActivity do
|
||||
<h6 class="text-base leading-[150%] font-semibold dark:text-white">
|
||||
<%= _get_event_data(@event_type, Jason.decode!(@event_data) |> Map.drop(["character_id"])) %>
|
||||
</h6>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
@@ -125,7 +125,6 @@ defmodule WandererAppWeb.UserActivity do
|
||||
@impl true
|
||||
def handle_event("undo", %{"event-data" => event_data} = _params, socket) do
|
||||
# notify_to(socket.assigns.notify_to, socket.assigns.event_name, map_slug)
|
||||
IO.inspect(event_data)
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
||||
@@ -93,13 +93,9 @@ defmodule WandererAppWeb.AuthController do
|
||||
|> redirect(to: ~p"/")
|
||||
end
|
||||
|
||||
def maybe_update_character_user_id(character, user_id) do
|
||||
case character.user_id do
|
||||
nil ->
|
||||
WandererApp.Api.Character.assign_user!(character, %{user_id: user_id})
|
||||
|
||||
_ ->
|
||||
Logger.debug("character already has user_id")
|
||||
end
|
||||
def maybe_update_character_user_id(character, user_id) when not is_nil(user_id) do
|
||||
WandererApp.Api.Character.assign_user!(character, %{user_id: user_id})
|
||||
end
|
||||
|
||||
def maybe_update_character_user_id(_character, _user_id), do: :ok
|
||||
end
|
||||
|
||||
@@ -136,8 +136,10 @@
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:owner_id]}
|
||||
class="p-dropdown p-component p-inputwrapper mt-8"
|
||||
placeholder="Select a map owner"
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
wrapper_class="mt-2"
|
||||
label="Owner"
|
||||
placeholder="Select an owner"
|
||||
options={Enum.map(@characters, fn character -> {character.label, character.id} end)}
|
||||
/>
|
||||
<div class="modal-action">
|
||||
|
||||
@@ -39,7 +39,8 @@ defmodule WandererAppWeb.AclMember do
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:role]}
|
||||
class="select h-8 min-h-[0px] !pt-1 !pb-1 text-sm bg-neutral-900 w-[70px]"
|
||||
class="select h-8 min-h-[0px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
wrapper_class="w-[60px] mr-16"
|
||||
placeholder="Select a role..."
|
||||
options={Enum.map(@roles, fn role -> {role.label, role.value} end)}
|
||||
/>
|
||||
|
||||
@@ -28,6 +28,7 @@ defmodule WandererAppWeb.CharactersLive do
|
||||
{:ok,
|
||||
socket
|
||||
|> assign(
|
||||
show_characters_add_alert: true,
|
||||
mode: :blocks,
|
||||
wallet_tracking_enabled?: WandererApp.Env.wallet_tracking_enabled?(),
|
||||
characters: characters |> Enum.sort_by(& &1.name, :asc) |> Enum.map(&map_ui_character/1),
|
||||
@@ -45,6 +46,13 @@ defmodule WandererAppWeb.CharactersLive do
|
||||
{:noreply, apply_action(socket, socket.assigns.live_action, params)}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_event("restore_show_characters_add_alert", %{"value" => value}, socket) do
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(show_characters_add_alert: value)}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_event("authorize", form, socket) do
|
||||
track_wallet = form |> Map.get("track_wallet", false)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<nav class="px-6 flex items-center justify-between w-full h-12 pointer-events-auto border-b border-gray-900 bg-opacity-70 bg-neutral-900">
|
||||
<nav class="px-6 flex items-center justify-between w-full h-12 pointer-events-auto border-b border-stone-800 bg-opacity-70 bg-neutral-900">
|
||||
<span className="w-full"></span>
|
||||
<span className="mr-2"></span>
|
||||
<div class="flex gap-2">
|
||||
@@ -29,9 +29,45 @@
|
||||
id="characters-list"
|
||||
class="w-full h-full col-span-2 lg:col-span-1 p-4 pl-20 pb-20 overflow-auto"
|
||||
>
|
||||
<div
|
||||
:if={@show_characters_add_alert}
|
||||
role="alert"
|
||||
class="alert"
|
||||
id="characters-add-alert"
|
||||
phx-hook="ShowCharactersAddAlert"
|
||||
phx-ignore
|
||||
data-key="show_characters_add_alert"
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
class="h-6 w-6 shrink-0 stroke-current"
|
||||
>
|
||||
<path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
|
||||
>
|
||||
</path>
|
||||
</svg>
|
||||
<span>
|
||||
All added characters will be automatically linked to your user account. You can't have same characters linked to several accounts.
|
||||
</span>
|
||||
<div>
|
||||
<button
|
||||
class="btn btn-sm"
|
||||
id="characters-add-alert-hide"
|
||||
phx-click={JS.toggle_class("hidden", to: "#characters-add-alert")}
|
||||
>
|
||||
Hide
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
:if={@mode == :blocks}
|
||||
class="gap-4 grid grid-cols-1 lg:grid-cols-5 md:grid-cols-3 sm:grid-cols-2 "
|
||||
class="gap-4 grid grid-cols-1 lg:grid-cols-5 md:grid-cols-3 sm:grid-cols-2 mt-4"
|
||||
>
|
||||
<.link patch={~p"/characters/authorize"}>
|
||||
<div class="card card-side rounded-none h-full items-center hover:text-white bg-gradient-to-l from-stone-950 to-stone-900 transform transition duration-500">
|
||||
@@ -51,9 +87,24 @@
|
||||
<div class="absolute left-0 bottom-0 w-full h-30 bg-opacity-60 bg-gray-900">
|
||||
<h2 class="absolute w-full flex justify-between px-4 left-0 top-10 text-xs">
|
||||
Corporation:
|
||||
<span
|
||||
:if={
|
||||
is_nil(
|
||||
character
|
||||
|> get(
|
||||
path(:corporation_name),
|
||||
nil
|
||||
)
|
||||
)
|
||||
}
|
||||
class="loading loading-dots loading-xs"
|
||||
/>
|
||||
<span>
|
||||
<%= character
|
||||
|> get(path(:corporation_name), "-") %>
|
||||
|> get(
|
||||
path(:corporation_name),
|
||||
""
|
||||
) %>
|
||||
</span>
|
||||
</h2>
|
||||
<h2 class="absolute w-full flex justify-between px-4 left-0 top-16 text-xs">
|
||||
@@ -65,9 +116,21 @@
|
||||
</h2>
|
||||
<h2 class="absolute left-0 bottom-12 px-4 text-xs w-full flex justify-between">
|
||||
Location:
|
||||
<span
|
||||
:if={
|
||||
is_nil(
|
||||
character
|
||||
|> get(
|
||||
path(:location / :solar_system_info / :solar_system_name, :map),
|
||||
nil
|
||||
)
|
||||
)
|
||||
}
|
||||
class="loading loading-dots loading-xs"
|
||||
/>
|
||||
<span>
|
||||
<%= character
|
||||
|> get(path(:location / :solar_system_info / :solar_system_name, :map), "-") %>
|
||||
|> get(path(:location / :solar_system_info / :solar_system_name, :map), "") %>
|
||||
</span>
|
||||
</h2>
|
||||
<h2
|
||||
@@ -126,7 +189,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :if={@mode == :table} class="flex flex-col gap-4">
|
||||
<div :if={@mode == :table} class="flex flex-col gap-4 mt-4">
|
||||
<.link patch={~p"/characters/authorize"}>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -66,35 +66,9 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
|
||||
def handle_ui_event(
|
||||
"add_character",
|
||||
_,
|
||||
%{
|
||||
assigns: %{
|
||||
current_user: current_user,
|
||||
map_id: map_id,
|
||||
user_permissions: %{track_character: true}
|
||||
}
|
||||
} = socket
|
||||
) do
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(show_tracking?: true)
|
||||
|> assign_async(:characters, fn ->
|
||||
{:ok, map} =
|
||||
map_id
|
||||
|> WandererApp.MapRepo.get([:acls])
|
||||
|
||||
{:ok, character_settings} =
|
||||
case WandererApp.MapCharacterSettingsRepo.get_all_by_map(map_id) do
|
||||
{:ok, settings} -> {:ok, settings}
|
||||
_ -> {:ok, []}
|
||||
end
|
||||
|
||||
map
|
||||
|> WandererApp.Maps.load_characters(
|
||||
character_settings,
|
||||
current_user.id
|
||||
)
|
||||
end)}
|
||||
end
|
||||
socket
|
||||
),
|
||||
do: {:noreply, socket |> add_character()}
|
||||
|
||||
def handle_ui_event(
|
||||
"add_character",
|
||||
@@ -222,6 +196,38 @@ defmodule WandererAppWeb.MapCharactersEventHandler do
|
||||
def handle_ui_event(event, body, socket),
|
||||
do: MapCoreEventHandler.handle_ui_event(event, body, socket)
|
||||
|
||||
def add_character(
|
||||
%{
|
||||
assigns: %{
|
||||
current_user: current_user,
|
||||
map_id: map_id,
|
||||
user_permissions: %{track_character: true}
|
||||
}
|
||||
} = socket
|
||||
),
|
||||
do:
|
||||
socket
|
||||
|> assign(show_tracking?: true)
|
||||
|> assign_async(:characters, fn ->
|
||||
{:ok, map} =
|
||||
map_id
|
||||
|> WandererApp.MapRepo.get([:acls])
|
||||
|
||||
{:ok, character_settings} =
|
||||
case WandererApp.MapCharacterSettingsRepo.get_all_by_map(map_id) do
|
||||
{:ok, settings} -> {:ok, settings}
|
||||
_ -> {:ok, []}
|
||||
end
|
||||
|
||||
map
|
||||
|> WandererApp.Maps.load_characters(
|
||||
character_settings,
|
||||
current_user.id
|
||||
)
|
||||
end)
|
||||
|
||||
def add_character(socket), do: socket
|
||||
|
||||
def has_tracked_characters?([]), do: false
|
||||
def has_tracked_characters?(_user_characters), do: true
|
||||
|
||||
|
||||
@@ -221,8 +221,9 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
socket
|
||||
|> put_flash(
|
||||
:error,
|
||||
"You should enable tracking for at least one character."
|
||||
)}
|
||||
"You should enable tracking for at least one character!"
|
||||
)
|
||||
|> MapCharactersEventHandler.add_character()}
|
||||
|
||||
def handle_ui_event(event, body, socket) do
|
||||
Logger.warning(fn -> "unhandled map ui event: #{event} #{inspect(body)}" end)
|
||||
@@ -434,28 +435,49 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
socket
|
||||
|> handle_map_start_events(map_id, events)
|
||||
|
||||
map_characters = map_id |> WandererApp.Map.list_characters()
|
||||
{:ok, options} =
|
||||
map_id
|
||||
|> WandererApp.Map.get_options()
|
||||
|
||||
socket
|
||||
|> assign(
|
||||
map_loaded?: true,
|
||||
map_user_settings: map_user_settings,
|
||||
user_characters: user_character_eve_ids,
|
||||
has_tracked_characters?:
|
||||
MapCharactersEventHandler.has_tracked_characters?(user_character_eve_ids)
|
||||
)
|
||||
|> MapEventHandler.push_map_event(
|
||||
"init",
|
||||
user_permissions =
|
||||
initial_data
|
||||
|> Map.put(
|
||||
:characters,
|
||||
map_characters |> Enum.map(&MapCharactersEventHandler.map_ui_character/1)
|
||||
|> Map.get(:user_permissions)
|
||||
|
||||
map_characters =
|
||||
map_id
|
||||
|> WandererApp.Map.list_characters()
|
||||
|> filter_map_characters(user_character_eve_ids, user_permissions, options)
|
||||
|> Enum.map(&MapCharactersEventHandler.map_ui_character/1)
|
||||
|
||||
has_tracked_characters? =
|
||||
MapCharactersEventHandler.has_tracked_characters?(user_character_eve_ids)
|
||||
|
||||
socket =
|
||||
socket
|
||||
|> assign(
|
||||
map_loaded?: true,
|
||||
map_user_settings: map_user_settings,
|
||||
user_characters: user_character_eve_ids,
|
||||
has_tracked_characters?: has_tracked_characters?
|
||||
)
|
||||
)
|
||||
|> push_event("js-exec", %{
|
||||
to: "#map-loader",
|
||||
attr: "data-loaded"
|
||||
})
|
||||
|> MapEventHandler.push_map_event(
|
||||
"init",
|
||||
initial_data
|
||||
|> Map.put(:characters, map_characters)
|
||||
)
|
||||
|> push_event("js-exec", %{
|
||||
to: "#map-loader",
|
||||
attr: "data-loaded"
|
||||
})
|
||||
|
||||
case not has_tracked_characters? && user_permissions.track_character do
|
||||
true ->
|
||||
socket
|
||||
|> MapCharactersEventHandler.add_character()
|
||||
|
||||
_ ->
|
||||
socket
|
||||
end
|
||||
end
|
||||
|
||||
defp handle_map_start_events(socket, map_id, events) do
|
||||
@@ -478,10 +500,6 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
|
||||
:empty_tracked_characters ->
|
||||
socket
|
||||
|> put_flash(
|
||||
:info,
|
||||
"You should enable tracking for at least one character to work with map."
|
||||
)
|
||||
|
||||
:map_character_limit ->
|
||||
socket
|
||||
@@ -500,13 +518,15 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
{:ok, hubs} = map_id |> WandererApp.Map.list_hubs()
|
||||
{:ok, connections} = map_id |> WandererApp.Map.list_connections()
|
||||
{:ok, systems} = map_id |> WandererApp.Map.list_systems()
|
||||
{:ok, options} = map_id |> WandererApp.Map.get_options()
|
||||
|
||||
%{
|
||||
systems:
|
||||
systems
|
||||
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system, include_static_data?) end),
|
||||
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system) end),
|
||||
hubs: hubs,
|
||||
connections: connections |> Enum.map(&MapEventHandler.map_ui_connection/1)
|
||||
connections: connections |> Enum.map(&MapEventHandler.map_ui_connection/1),
|
||||
options: options
|
||||
}
|
||||
end
|
||||
|
||||
@@ -525,6 +545,26 @@ defmodule WandererAppWeb.MapCoreEventHandler do
|
||||
end
|
||||
end
|
||||
|
||||
defp filter_map_characters(
|
||||
characters,
|
||||
user_character_eve_ids,
|
||||
%{
|
||||
manage_map: manage_map_permission
|
||||
} = _user_permissions,
|
||||
options
|
||||
) do
|
||||
restrict_offline_showing =
|
||||
options |> Map.get("restrict_offline_showing", "false") |> String.to_existing_atom()
|
||||
|
||||
show_offline? = not restrict_offline_showing or manage_map_permission
|
||||
|
||||
characters
|
||||
|> Enum.filter(fn character ->
|
||||
show_offline? || character.online ||
|
||||
user_character_eve_ids |> Enum.member?(character.eve_id)
|
||||
end)
|
||||
end
|
||||
|
||||
defp map_system(
|
||||
%{
|
||||
solar_system_name: solar_system_name,
|
||||
|
||||
@@ -312,7 +312,7 @@ defmodule WandererAppWeb.MapSignaturesEventHandler do
|
||||
def handle_ui_event(event, body, socket),
|
||||
do: MapCoreEventHandler.handle_ui_event(event, body, socket)
|
||||
|
||||
defp get_system_signatures(system_id),
|
||||
def get_system_signatures(system_id),
|
||||
do:
|
||||
system_id
|
||||
|> WandererApp.Api.MapSystemSignature.by_system_id!()
|
||||
|
||||
@@ -267,6 +267,28 @@ defmodule WandererAppWeb.MapSystemsEventHandler do
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
||||
def handle_ui_event(
|
||||
"get_all_systems",
|
||||
_event,
|
||||
%{
|
||||
assigns: %{
|
||||
map_id: map_id
|
||||
}
|
||||
} =
|
||||
socket
|
||||
) do
|
||||
{:ok, systems} = WandererApp.MapSystemRepo.get_all_by_map(map_id)
|
||||
|
||||
systems =
|
||||
systems
|
||||
|> Enum.map(fn system -> MapEventHandler.map_ui_system(system, false) end)
|
||||
|
||||
{:reply,
|
||||
%{
|
||||
systems: systems
|
||||
}, socket}
|
||||
end
|
||||
|
||||
def handle_ui_event(
|
||||
"get_system_static_infos",
|
||||
%{"solar_system_ids" => solar_system_ids} = _event,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
<nav class="fixed top-0 z-100 px-6 pl-20 flex items-center justify-between w-full h-12 pointer-events-auto border-b border-gray-900 bg-opacity-70 bg-neutral-900">
|
||||
<nav class="fixed top-0 z-100 px-6 pl-20 flex items-center justify-between w-full h-12 pointer-events-auto border-b border-stone-800 bg-opacity-70 bg-neutral-900">
|
||||
<span className="w-full font-medium text-sm">
|
||||
<.link navigate={~p"/#{@map_slug}"} class="text-neutral-100">
|
||||
<%= @map_name %>
|
||||
|
||||
@@ -41,6 +41,7 @@ defmodule WandererAppWeb.MapEventHandler do
|
||||
"add_system",
|
||||
"delete_systems",
|
||||
"manual_add_system",
|
||||
"get_all_systems",
|
||||
"get_system_static_infos",
|
||||
"update_system_position",
|
||||
"update_system_positions",
|
||||
@@ -234,6 +235,7 @@ defmodule WandererAppWeb.MapEventHandler do
|
||||
|
||||
def map_ui_system(
|
||||
%{
|
||||
id: system_id,
|
||||
solar_system_id: solar_system_id,
|
||||
name: name,
|
||||
description: description,
|
||||
@@ -245,16 +247,31 @@ defmodule WandererAppWeb.MapEventHandler do
|
||||
status: status,
|
||||
visible: visible
|
||||
} = _system,
|
||||
_include_static_data? \\ true
|
||||
include_signatures? \\ true
|
||||
) do
|
||||
system_static_info = get_system_static_info(solar_system_id)
|
||||
|
||||
system_signatures =
|
||||
include_signatures?
|
||||
|> case do
|
||||
true ->
|
||||
system_id
|
||||
|> WandererAppWeb.MapSignaturesEventHandler.get_system_signatures()
|
||||
|> Enum.filter(fn signature ->
|
||||
is_nil(signature.linked_system) && signature.group == "Wormhole"
|
||||
end)
|
||||
|
||||
_ ->
|
||||
[]
|
||||
end
|
||||
|
||||
%{
|
||||
id: "#{solar_system_id}",
|
||||
position: %{x: position_x, y: position_y},
|
||||
description: description,
|
||||
name: name,
|
||||
system_static_info: system_static_info,
|
||||
system_signatures: system_signatures,
|
||||
labels: labels,
|
||||
locked: locked,
|
||||
status: status,
|
||||
|
||||
@@ -6,7 +6,7 @@ defmodule WandererAppWeb.MapLive do
|
||||
|
||||
@impl true
|
||||
def mount(%{"slug" => map_slug} = _params, _session, socket) when is_connected?(socket) do
|
||||
Process.send_after(self(), %{event: :load_map}, Enum.random(10..500))
|
||||
Process.send_after(self(), %{event: :load_map}, Enum.random(10..800))
|
||||
|
||||
{:ok,
|
||||
socket
|
||||
@@ -76,13 +76,15 @@ defmodule WandererAppWeb.MapLive do
|
||||
|
||||
def handle_info(:not_all_characters_tracked, %{assigns: %{map_slug: map_slug}} = socket),
|
||||
do:
|
||||
{:noreply,
|
||||
socket
|
||||
|> put_flash(
|
||||
:error,
|
||||
"You should enable tracking for all characters that have access to this map first!"
|
||||
)
|
||||
|> push_navigate(to: ~p"/tracking/#{map_slug}")}
|
||||
WandererAppWeb.MapEventHandler.handle_ui_event(
|
||||
%{event: "add_character"},
|
||||
nil,
|
||||
socket
|
||||
|> put_flash(
|
||||
:error,
|
||||
"You should enable tracking for all characters that have access to this map first!"
|
||||
)
|
||||
)
|
||||
|
||||
@impl true
|
||||
def handle_info(info, socket),
|
||||
|
||||
@@ -92,12 +92,12 @@
|
||||
<.modal
|
||||
:if={assigns |> Map.get(:show_tracking?, false)}
|
||||
id="map-tracking-modal"
|
||||
title="Characters tracking"
|
||||
title="Track Characters"
|
||||
show
|
||||
on_cancel={JS.push("hide_tracking")}
|
||||
>
|
||||
<.async_result :let={characters} assign={@characters}>
|
||||
<:loading><span class="loading loading-dots loading-xs" />.</:loading>
|
||||
<:loading><span class="loading loading-dots loading-xs" /></:loading>
|
||||
<:failed :let={reason}><%= reason %></:failed>
|
||||
|
||||
<.table
|
||||
@@ -106,7 +106,7 @@
|
||||
class="h-[400px] !overflow-y-auto"
|
||||
rows={characters}
|
||||
>
|
||||
<:col :let={character} label="Tracked">
|
||||
<:col :let={character} label="Track">
|
||||
<label class="flex items-center gap-3">
|
||||
<input
|
||||
type="checkbox"
|
||||
|
||||
@@ -197,11 +197,13 @@ defmodule WandererAppWeb.MapsLive do
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
||||
def handle_event("validate", %{"form" => params} = _params, socket) do
|
||||
def handle_event("validate", %{"form" => form} = _params, socket) do
|
||||
form =
|
||||
AshPhoenix.Form.validate(
|
||||
socket.assigns.form,
|
||||
params |> Map.put("acls", params["acls"] || [])
|
||||
form
|
||||
|> Map.put("acls", form["acls"] || [])
|
||||
|> Map.put("only_tracked_characters", form["only_tracked_characters"] || false)
|
||||
)
|
||||
|
||||
{:noreply, socket |> assign(form: form)}
|
||||
@@ -280,14 +282,17 @@ defmodule WandererAppWeb.MapsLive do
|
||||
do:
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(:amounts, [
|
||||
%{label: "150M", value: 150_000_000},
|
||||
%{label: "300M", value: 300_000_000},
|
||||
%{label: "600M", value: 600_000_000},
|
||||
%{label: "1.2B", value: 1_200_000_000},
|
||||
%{label: "2.4B", value: 2_400_000_000},
|
||||
%{label: "5B", value: 5_000_000_000}
|
||||
])
|
||||
|> assign(
|
||||
:amounts,
|
||||
[
|
||||
{"150M", 150_000_000},
|
||||
{"300M", 300_000_000},
|
||||
{"600M", 600_000_000},
|
||||
{"1.2B", 1_200_000_000},
|
||||
{"2.4B", 2_400_000_000},
|
||||
{"5B", 5_000_000_000}
|
||||
]
|
||||
)
|
||||
|> assign(is_topping_up?: true)}
|
||||
|
||||
@impl true
|
||||
@@ -654,7 +659,7 @@ defmodule WandererAppWeb.MapsLive do
|
||||
) do
|
||||
options =
|
||||
options_form
|
||||
|> Map.take(["layout", "store_custom_labels"])
|
||||
|> Map.take(["layout", "store_custom_labels", "restrict_offline_showing"])
|
||||
|
||||
{:ok, updated_map} = WandererApp.MapRepo.update_options(map, options)
|
||||
|
||||
|
||||
@@ -139,14 +139,18 @@
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:owner_id]}
|
||||
class="p-dropdown p-component p-inputwrapper mt-8"
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
wrapper_class="mt-2"
|
||||
label="Map owner"
|
||||
placeholder="Select a map owner"
|
||||
options={Enum.map(@characters, fn character -> {character.label, character.id} end)}
|
||||
/>
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:scope]}
|
||||
class="p-dropdown p-component p-inputwrapper mt-8"
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
wrapper_class="mt-2"
|
||||
label="Map scope"
|
||||
placeholder="Select a map scope"
|
||||
options={Enum.map(@scopes, fn scope -> {scope, scope} end)}
|
||||
/>
|
||||
@@ -182,203 +186,411 @@
|
||||
<.modal
|
||||
:if={@live_action in [:settings]}
|
||||
title="Map Settings"
|
||||
class="!w-[800px]"
|
||||
class="!min-w-[700px]"
|
||||
id="map-settings-modal"
|
||||
show
|
||||
on_cancel={JS.patch(~p"/maps")}
|
||||
>
|
||||
<div role="tablist" class="tabs tabs-bordered">
|
||||
<a
|
||||
role="tab"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="general"
|
||||
class={[
|
||||
"tab",
|
||||
classes("tab-active": @active_settings_tab == "general")
|
||||
]}
|
||||
>
|
||||
<.icon name="hero-wrench-screwdriver-solid" class="w-4 h-4" /> General
|
||||
</a>
|
||||
<a
|
||||
role="tab"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="import"
|
||||
class={[
|
||||
"tab",
|
||||
classes("tab-active": @active_settings_tab == "import")
|
||||
]}
|
||||
>
|
||||
<.icon name="hero-document-arrow-down-solid" class="w-4 h-4" /> Import/Export
|
||||
</a>
|
||||
<a
|
||||
:if={@map_subscriptions_enabled?}
|
||||
role="tab"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="balance"
|
||||
class={[
|
||||
"tab",
|
||||
classes("tab-active": @active_settings_tab == "balance")
|
||||
]}
|
||||
>
|
||||
<.icon name="hero-banknotes-solid" class="w-4 h-4" /> Balance
|
||||
</a>
|
||||
<a
|
||||
:if={@map_subscriptions_enabled?}
|
||||
role="tab"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="subscription"
|
||||
class={[
|
||||
"tab",
|
||||
classes("tab-active": @active_settings_tab == "subscription")
|
||||
]}
|
||||
>
|
||||
<.icon name="hero-check-badge-solid" class="w-4 h-4" /> Subscription
|
||||
</a>
|
||||
</div>
|
||||
<.header :if={@active_settings_tab == "general"} class="bordered border-1 border-zinc-800">
|
||||
<:actions>
|
||||
<.form
|
||||
:let={f}
|
||||
:if={assigns |> Map.get(:options_form, false)}
|
||||
for={@options_form}
|
||||
phx-change="update_options"
|
||||
>
|
||||
<div>
|
||||
<div class="stat-title">Map systems layout</div>
|
||||
<div class="stat-value text-white">
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:layout]}
|
||||
class="p-dropdown p-component p-inputwrapper"
|
||||
placeholder="Map default layout"
|
||||
options={@layout_options}
|
||||
/>
|
||||
<div class="flex flex-col gap-3">
|
||||
<div class="flex flex-col gap-2">
|
||||
<div class="_verticalTabsContainer_1o01l_2">
|
||||
<div class="p-tabview p-component" data-pc-name="tabview" data-pc-section="root">
|
||||
<div class="p-tabview-nav-container" data-pc-section="navcontainer">
|
||||
<div class="p-tabview-nav-content" data-pc-section="navcontent">
|
||||
<ul class="p-tabview-nav" role="tablist" data-pc-section="nav">
|
||||
<li
|
||||
class={[
|
||||
"p-unselectable-text",
|
||||
classes("p-tabview-selected p-highlight": @active_settings_tab == "general")
|
||||
]}
|
||||
role="presentation"
|
||||
data-pc-name=""
|
||||
data-pc-section="header"
|
||||
>
|
||||
<a
|
||||
role="tab"
|
||||
class="p-tabview-nav-link flex p-[10px]"
|
||||
tabindex="0"
|
||||
aria-controls="pr_id_330_content"
|
||||
aria-selected="true"
|
||||
aria-disabled="false"
|
||||
data-pc-section="headeraction"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="general"
|
||||
>
|
||||
<span class="p-tabview-title" data-pc-section="headertitle">
|
||||
<.icon name="hero-wrench-screwdriver-solid" class="w-4 h-4" /> General
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li
|
||||
:if={@map_subscriptions_enabled?}
|
||||
class={[
|
||||
"p-unselectable-text",
|
||||
classes("p-tabview-selected p-highlight": @active_settings_tab == "balance")
|
||||
]}
|
||||
role="presentation"
|
||||
data-pc-name=""
|
||||
data-pc-section="header"
|
||||
>
|
||||
<a
|
||||
role="tab"
|
||||
class="p-tabview-nav-link flex p-[10px]"
|
||||
tabindex="-1"
|
||||
aria-controls="pr_id_332_content"
|
||||
aria-selected="false"
|
||||
aria-disabled="false"
|
||||
data-pc-section="headeraction"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="balance"
|
||||
>
|
||||
<span class="p-tabview-title" data-pc-section="headertitle">
|
||||
<.icon name="hero-banknotes-solid" class="w-4 h-4" /> Balance
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li
|
||||
:if={@map_subscriptions_enabled?}
|
||||
class={[
|
||||
"p-unselectable-text",
|
||||
classes(
|
||||
"p-tabview-selected p-highlight": @active_settings_tab == "subscription"
|
||||
)
|
||||
]}
|
||||
role="presentation"
|
||||
data-pc-name=""
|
||||
data-pc-section="header"
|
||||
>
|
||||
<a
|
||||
role="tab"
|
||||
class="p-tabview-nav-link flex p-[10px]"
|
||||
tabindex="-1"
|
||||
aria-controls="pr_id_334_content"
|
||||
aria-selected="false"
|
||||
aria-disabled="false"
|
||||
data-pc-section="headeraction"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="subscription"
|
||||
>
|
||||
<span class="p-tabview-title" data-pc-section="headertitle">
|
||||
<.icon name="hero-check-badge-solid" class="w-4 h-4" /> Subscription
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li
|
||||
class={[
|
||||
"p-unselectable-text",
|
||||
classes("p-tabview-selected p-highlight": @active_settings_tab == "import")
|
||||
]}
|
||||
role="presentation"
|
||||
data-pc-name=""
|
||||
data-pc-section="header"
|
||||
>
|
||||
<a
|
||||
role="tab"
|
||||
class="p-tabview-nav-link flex p-[10px]"
|
||||
tabindex="-1"
|
||||
aria-controls="pr_id_331_content"
|
||||
aria-selected="false"
|
||||
aria-disabled="false"
|
||||
data-pc-section="headeraction"
|
||||
phx-click="change_settings_tab"
|
||||
phx-value-tab="import"
|
||||
>
|
||||
<span class="p-tabview-title" data-pc-section="headertitle">
|
||||
<.icon name="hero-document-arrow-down-solid" class="w-4 h-4" /> Import/Export
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li
|
||||
aria-hidden="true"
|
||||
role="presentation"
|
||||
class="p-tabview-ink-bar"
|
||||
data-pc-section="inkbar"
|
||||
style="width: 146px; left: 0px;"
|
||||
>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-tabview-panels" data-pc-section="panelcontainer">
|
||||
<div
|
||||
id="pr_id_330_content"
|
||||
class="p-tabview-panel"
|
||||
role="tabpanel"
|
||||
aria-labelledby="pr_id_33_header_0"
|
||||
data-pc-name=""
|
||||
data-pc-section="content"
|
||||
>
|
||||
<div :if={@active_settings_tab == "general"}>
|
||||
<.form
|
||||
:let={f}
|
||||
:if={assigns |> Map.get(:options_form, false)}
|
||||
for={@options_form}
|
||||
phx-change="update_options"
|
||||
>
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:layout]}
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
label="Map systems layout"
|
||||
placeholder="Map default layout"
|
||||
options={@layout_options}
|
||||
/>
|
||||
<.input
|
||||
type="checkbox"
|
||||
field={f[:store_custom_labels]}
|
||||
label="Store system custom labels"
|
||||
/>
|
||||
<.input
|
||||
type="checkbox"
|
||||
field={f[:restrict_offline_showing]}
|
||||
label="Show offline characters to admins & managers only"
|
||||
/>
|
||||
</.form>
|
||||
</div>
|
||||
|
||||
<div :if={@active_settings_tab == "import"}>
|
||||
<.form
|
||||
:if={assigns |> Map.get(:import_form, false)}
|
||||
for={@import_form}
|
||||
phx-change="import"
|
||||
>
|
||||
<div phx-drop-target="{@uploads.settings.ref}">
|
||||
<.live_file_input upload={@uploads.settings} />
|
||||
</div>
|
||||
</.form>
|
||||
<progress :if={@importing} class="progress w-56"></progress>
|
||||
<.button
|
||||
id="export-settings-btn"
|
||||
class="mt-8"
|
||||
type="button"
|
||||
disabled={@importing}
|
||||
phx-hook="DownloadJson"
|
||||
data-name={@map_slug}
|
||||
data-content={Jason.encode!(assigns[:export_settings] || %{})}
|
||||
>
|
||||
<.icon name="hero-document-arrow-down-solid" class="w-4 h-4" /> Export Settings
|
||||
</.button>
|
||||
</div>
|
||||
|
||||
<div :if={@active_settings_tab == "balance"}>
|
||||
<div class="stats w-full bg-primary text-primary-content">
|
||||
<div class="stat">
|
||||
<div class="stat-figure text-primary">
|
||||
<.button
|
||||
:if={not @is_topping_up?}
|
||||
class="mt-2"
|
||||
type="button"
|
||||
phx-click="show_topup"
|
||||
>
|
||||
<.icon name="hero-banknotes-solid" class="w-4 h-4" /> Top Up
|
||||
</.button>
|
||||
</div>
|
||||
<div class="stat-title">Map balance</div>
|
||||
<div class="stat-value text-white">
|
||||
ISK <%= @map_balance
|
||||
|> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
</div>
|
||||
<div class="stat-actions text-end"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<.form
|
||||
:let={f}
|
||||
:if={@is_topping_up?}
|
||||
for={@topup_form}
|
||||
class="mt-2"
|
||||
phx-change="validate_topup"
|
||||
phx-submit="topup"
|
||||
>
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:amount]}
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
label="Topup amount"
|
||||
placeholder="Select topup amount"
|
||||
options={@amounts}
|
||||
/>
|
||||
<div class="modal-action">
|
||||
<.button class="mt-2" type="button" phx-click="hide_topup">
|
||||
Cancel
|
||||
</.button>
|
||||
<.button class="mt-2" type="submit">
|
||||
Top Up
|
||||
</.button>
|
||||
</div>
|
||||
</.form>
|
||||
</div>
|
||||
|
||||
<.table
|
||||
:if={@active_settings_tab == "subscription"}
|
||||
class="!max-h-[300px] !overflow-y-auto"
|
||||
empty_label="No active subscriptions, using alpha plan by default."
|
||||
id="active-subscriptions-tbl"
|
||||
rows={@map_subscriptions}
|
||||
>
|
||||
<:col :let={subscription} label="Subscription Plan">
|
||||
<%= subscription.plan %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Status">
|
||||
<%= subscription.status %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Characters Limit">
|
||||
<%= subscription.characters_limit %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Hubs Limit">
|
||||
<%= subscription.hubs_limit %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Active Till">
|
||||
<.local_time
|
||||
:if={subscription.active_till}
|
||||
id={"subscription-active-till-#{subscription.id}"}
|
||||
at={subscription.active_till}
|
||||
>
|
||||
<%= subscription.active_till %>
|
||||
</.local_time>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Auto Renew">
|
||||
<%= if subscription.auto_renew?, do: "Yes", else: "No" %>
|
||||
</:col>
|
||||
<:action :let={subscription}>
|
||||
<div class="tooltip tooltip-left" data-tip="Edit subscription">
|
||||
<button
|
||||
:if={subscription.status == :active && subscription.plan != :alpha}
|
||||
phx-click="edit-subscription"
|
||||
phx-value-id={subscription.id}
|
||||
>
|
||||
<.icon name="hero-pencil-square-solid" class="w-4 h-4 hover:text-white" />
|
||||
</button>
|
||||
</div>
|
||||
</:action>
|
||||
<:action :let={subscription}>
|
||||
<div class="tooltip tooltip-left" data-tip="Cancel subscription">
|
||||
<button
|
||||
:if={subscription.status == :active && subscription.plan != :alpha}
|
||||
phx-click="cancel-subscription"
|
||||
phx-value-id={subscription.id}
|
||||
data={[confirm: "Please confirm to cancel subscription!"]}
|
||||
>
|
||||
<.icon name="hero-trash-solid" class="w-4 h-4 hover:text-white" />
|
||||
</button>
|
||||
</div>
|
||||
</:action>
|
||||
</.table>
|
||||
|
||||
<.header
|
||||
:if={@active_settings_tab == "subscription" && @is_adding_subscription?}
|
||||
class="bordered border-1 flex flex-col gap-4"
|
||||
>
|
||||
<div :if={is_nil(@selected_subscription)}>
|
||||
Add subscription
|
||||
<div class="badge badge-secondary">Limited time offer: 50%</div>
|
||||
</div>
|
||||
<div :if={not is_nil(@selected_subscription)}>
|
||||
Edit subscription
|
||||
<div class="badge badge-secondary">Limited time offer: 50%</div>
|
||||
</div>
|
||||
<.form
|
||||
:let={f}
|
||||
for={@subscription_form}
|
||||
phx-change="validate_subscription"
|
||||
phx-submit={
|
||||
if is_nil(@selected_subscription),
|
||||
do: "subscribe",
|
||||
else: "update_subscription"
|
||||
}
|
||||
>
|
||||
<.input
|
||||
:if={is_nil(@selected_subscription)}
|
||||
type="select"
|
||||
field={f[:period]}
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
label="Subscription period"
|
||||
options={@subscription_periods}
|
||||
/>
|
||||
<.input
|
||||
field={f[:characters_limit]}
|
||||
label="Characters limit"
|
||||
show_value={true}
|
||||
type="range"
|
||||
min="300"
|
||||
max="5000"
|
||||
step="100"
|
||||
class="range range-xs"
|
||||
/>
|
||||
<.input
|
||||
field={f[:hubs_limit]}
|
||||
label="Hubs limit"
|
||||
show_value={true}
|
||||
type="range"
|
||||
min="20"
|
||||
max="50"
|
||||
step="10"
|
||||
class="range range-xs"
|
||||
/>
|
||||
<.input field={f[:auto_renew?]} label="Auto Renew" type="checkbox" />
|
||||
<div
|
||||
:if={is_nil(@selected_subscription)}
|
||||
class="stats w-full bg-primary text-primary-content mt-2"
|
||||
>
|
||||
<div class="stat">
|
||||
<div class="stat-figure text-primary">
|
||||
<.button type="submit">
|
||||
Subscribe
|
||||
</.button>
|
||||
</div>
|
||||
<div class="flex gap-8">
|
||||
<div>
|
||||
<div class="stat-title">Estimated price</div>
|
||||
<div class="stat-value text-white">
|
||||
ISK <%= (@estimated_price - @discount)
|
||||
|> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="stat-title">Discount</div>
|
||||
<div class="stat-value text-white relative">
|
||||
ISK <%= @discount
|
||||
|> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
<span class="absolute top-0 right-0 text-xs text-white discount" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
:if={not is_nil(@selected_subscription)}
|
||||
class="stats w-full bg-primary text-primary-content"
|
||||
>
|
||||
<div class="stat">
|
||||
<div class="stat-figure text-primary">
|
||||
<.button type="button" phx-click="cancel_edit_subscription">
|
||||
Cancel
|
||||
</.button>
|
||||
<.button type="submit">
|
||||
Update
|
||||
</.button>
|
||||
</div>
|
||||
<div class="stat-title">Additional price (mounthly)</div>
|
||||
<div class="stat-value text-white">
|
||||
ISK <%= @additional_price
|
||||
|> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
</div>
|
||||
<div class="stat-actions text-end"></div>
|
||||
</div>
|
||||
</div>
|
||||
</.form>
|
||||
</.header>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<.input
|
||||
type="checkbox"
|
||||
field={f[:store_custom_labels]}
|
||||
label="Store system custom labels"
|
||||
/>
|
||||
</.form>
|
||||
</:actions>
|
||||
</.header>
|
||||
<.header :if={@active_settings_tab == "import"} class="bordered border-1 border-zinc-800">
|
||||
Import/Export Map Settings
|
||||
<:actions>
|
||||
<.form :if={assigns |> Map.get(:import_form, false)} for={@import_form} phx-change="import">
|
||||
<div phx-drop-target="{@uploads.settings.ref}">
|
||||
<.live_file_input upload={@uploads.settings} />
|
||||
</div>
|
||||
</.form>
|
||||
<progress :if={@importing} class="progress w-56"></progress>
|
||||
<.button
|
||||
id="export-settings-btn"
|
||||
class="mt-8"
|
||||
type="button"
|
||||
disabled={@importing}
|
||||
phx-hook="DownloadJson"
|
||||
data-name={@map_slug}
|
||||
data-content={Jason.encode!(assigns[:export_settings] || %{})}
|
||||
>
|
||||
<.icon name="hero-document-arrow-down-solid" class="w-4 h-4" /> Export Settings
|
||||
</.button>
|
||||
</:actions>
|
||||
</.header>
|
||||
<.header :if={@active_settings_tab == "balance"} class="bordered border-1 border-zinc-800">
|
||||
<div class="stats w-full bg-primary text-primary-content">
|
||||
<div class="stat">
|
||||
<div class="stat-figure text-primary">
|
||||
<.button :if={not @is_topping_up?} class="mt-2" type="button" phx-click="show_topup">
|
||||
<.icon name="hero-banknotes-solid" class="w-4 h-4" /> Top Up
|
||||
</.button>
|
||||
</div>
|
||||
<div class="stat-title">Map balance</div>
|
||||
<div class="stat-value text-white">
|
||||
ISK <%= @map_balance |> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
</div>
|
||||
<div class="stat-actions text-end"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<.form
|
||||
:let={f}
|
||||
:if={@is_topping_up?}
|
||||
for={@topup_form}
|
||||
phx-change="validate_topup"
|
||||
phx-submit="topup"
|
||||
>
|
||||
<.live_select
|
||||
field={f[:amount]}
|
||||
update_min_len={0}
|
||||
options={@amounts}
|
||||
placeholder="Select topup amount"
|
||||
/>
|
||||
<div class="modal-action">
|
||||
<.button class="mt-2" type="button" phx-click="hide_topup">
|
||||
Cancel
|
||||
</.button>
|
||||
<.button class="mt-2" type="submit">
|
||||
Top Up
|
||||
</.button>
|
||||
</div>
|
||||
</.form>
|
||||
</.header>
|
||||
<.table
|
||||
:if={@active_settings_tab == "subscription"}
|
||||
class="!max-h-[20vh] !overflow-y-auto"
|
||||
empty_label="No active subscriptions, using alpha plan by default."
|
||||
id="active-subscriptions-tbl"
|
||||
rows={@map_subscriptions}
|
||||
>
|
||||
<:col :let={subscription} label="Subscription Plan">
|
||||
<%= subscription.plan %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Status">
|
||||
<%= subscription.status %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Characters Limit">
|
||||
<%= subscription.characters_limit %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Hubs Limit">
|
||||
<%= subscription.hubs_limit %>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Active Till">
|
||||
<.local_time
|
||||
:if={subscription.active_till}
|
||||
id={"subscription-active-till-#{subscription.id}"}
|
||||
at={subscription.active_till}
|
||||
>
|
||||
<%= subscription.active_till %>
|
||||
</.local_time>
|
||||
</:col>
|
||||
<:col :let={subscription} label="Auto Renew">
|
||||
<%= if subscription.auto_renew?, do: "Yes", else: "No" %>
|
||||
</:col>
|
||||
<:action :let={subscription}>
|
||||
<div class="tooltip tooltip-left" data-tip="Edit subscription">
|
||||
<button
|
||||
:if={subscription.status == :active && subscription.plan != :alpha}
|
||||
phx-click="edit-subscription"
|
||||
phx-value-id={subscription.id}
|
||||
>
|
||||
<.icon name="hero-pencil-square-solid" class="w-4 h-4 hover:text-white" />
|
||||
</button>
|
||||
</div>
|
||||
</:action>
|
||||
<:action :let={subscription}>
|
||||
<div class="tooltip tooltip-left" data-tip="Cancel subscription">
|
||||
<button
|
||||
:if={subscription.status == :active && subscription.plan != :alpha}
|
||||
phx-click="cancel-subscription"
|
||||
phx-value-id={subscription.id}
|
||||
data={[confirm: "Please confirm to cancel subscription!"]}
|
||||
>
|
||||
<.icon name="hero-trash-solid" class="w-4 h-4 hover:text-white" />
|
||||
</button>
|
||||
</div>
|
||||
</:action>
|
||||
</.table>
|
||||
</div>
|
||||
|
||||
<div class="modal-action">
|
||||
<div
|
||||
@@ -402,102 +614,4 @@
|
||||
</.button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<.header
|
||||
:if={@active_settings_tab == "subscription" && @is_adding_subscription?}
|
||||
class="bordered border-1 flex flex-col gap-4"
|
||||
>
|
||||
<div :if={is_nil(@selected_subscription)}>
|
||||
Add subscription
|
||||
<div class="badge badge-secondary">Limited time offer: 50%</div>
|
||||
</div>
|
||||
<div :if={not is_nil(@selected_subscription)}>
|
||||
Edit subscription
|
||||
<div class="badge badge-secondary">Limited time offer: 50%</div>
|
||||
</div>
|
||||
<.form
|
||||
:let={f}
|
||||
for={@subscription_form}
|
||||
phx-change="validate_subscription"
|
||||
phx-submit={if is_nil(@selected_subscription), do: "subscribe", else: "update_subscription"}
|
||||
>
|
||||
<.input
|
||||
:if={is_nil(@selected_subscription)}
|
||||
type="select"
|
||||
field={f[:period]}
|
||||
class="p-dropdown p-component p-inputwrapper"
|
||||
placeholder="Subscription period"
|
||||
options={@subscription_periods}
|
||||
/>
|
||||
<.input
|
||||
field={f[:characters_limit]}
|
||||
label="Characters limit"
|
||||
show_value={true}
|
||||
type="range"
|
||||
min="300"
|
||||
max="5000"
|
||||
step="100"
|
||||
class="range range-xs"
|
||||
/>
|
||||
<.input
|
||||
field={f[:hubs_limit]}
|
||||
label="Hubs limit"
|
||||
show_value={true}
|
||||
type="range"
|
||||
min="20"
|
||||
max="50"
|
||||
step="10"
|
||||
class="range range-xs"
|
||||
/>
|
||||
<.input field={f[:auto_renew?]} label="Auto Renew" type="checkbox" />
|
||||
<div
|
||||
:if={is_nil(@selected_subscription)}
|
||||
class="stats w-full bg-primary text-primary-content"
|
||||
>
|
||||
<div class="stat">
|
||||
<div class="stat-figure text-primary">
|
||||
<.button type="submit">
|
||||
Subscribe
|
||||
</.button>
|
||||
</div>
|
||||
<div class="flex gap-8">
|
||||
<div>
|
||||
<div class="stat-title">Estimated price</div>
|
||||
<div class="stat-value text-white">
|
||||
ISK <%= (@estimated_price - @discount)
|
||||
|> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="stat-title">Discount</div>
|
||||
<div class="stat-value text-white relative">
|
||||
ISK <%= @discount |> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
<span class="absolute top-0 right-0 text-xs text-white discount" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
:if={not is_nil(@selected_subscription)}
|
||||
class="stats w-full bg-primary text-primary-content"
|
||||
>
|
||||
<div class="stat">
|
||||
<div class="stat-figure text-primary">
|
||||
<.button type="button" phx-click="cancel_edit_subscription">
|
||||
Cancel
|
||||
</.button>
|
||||
<.button type="submit">
|
||||
Update
|
||||
</.button>
|
||||
</div>
|
||||
<div class="stat-title">Additional price (mounthly)</div>
|
||||
<div class="stat-value text-white">
|
||||
ISK <%= @additional_price |> Number.to_human(units: ["", "K", "M", "B", "T", "P"]) %>
|
||||
</div>
|
||||
<div class="stat-actions text-end"></div>
|
||||
</div>
|
||||
</div>
|
||||
</.form>
|
||||
</.header>
|
||||
</.modal>
|
||||
|
||||
@@ -57,6 +57,7 @@ defmodule WandererAppWeb.Router do
|
||||
@script_src,
|
||||
~w('unsafe-inline'),
|
||||
~w(https://unpkg.com),
|
||||
~w(https://cdn.jsdelivr.net),
|
||||
~w(https://w.appzi.io),
|
||||
~w(https://www.googletagmanager.com),
|
||||
~w(https://cdnjs.cloudflare.com)
|
||||
|
||||
9
m
9
m
@@ -15,6 +15,15 @@ case $COMMAND in
|
||||
deps)
|
||||
MIX_ENV=dev mix deps.get
|
||||
;;
|
||||
setup)
|
||||
MIX_ENV=dev mix setup
|
||||
;;
|
||||
createdb)
|
||||
MIX_ENV=dev mix ecto.create
|
||||
;;
|
||||
testdb)
|
||||
MIX_ENV=dev mix ash.codegen test111
|
||||
;;
|
||||
depsf)
|
||||
MIX_ENV=dev mix deps.compile syslog --force
|
||||
;;
|
||||
|
||||
2
mix.exs
2
mix.exs
@@ -2,7 +2,7 @@ defmodule WandererApp.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
@source_url "https://github.com/wanderer-industries/wanderer"
|
||||
@version "1.26.1"
|
||||
@version "1.31.0"
|
||||
|
||||
def project do
|
||||
[
|
||||
|
||||
@@ -31,10 +31,10 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
31,6,Shuttle,0,0,0,0,0,1
|
||||
32,1,Alliance,None,0,0,0,0,0
|
||||
38,7,Shield Extender,82,0,0,0,0,1
|
||||
39,7,Shield Recharger,83,0,0,0,0,1
|
||||
39,7,Shield Recharger,26451,0,0,0,0,1
|
||||
40,7,Shield Booster,84,0,0,0,0,1
|
||||
41,7,Remote Shield Booster,86,0,0,0,0,1
|
||||
43,7,Capacitor Recharger,90,0,0,0,0,1
|
||||
43,7,Capacitor Recharger,26457,0,0,0,0,1
|
||||
46,7,Propulsion Module,96,0,0,0,0,1
|
||||
47,7,Cargo Scanner,106,0,0,0,0,1
|
||||
48,7,Ship Scanner,107,0,0,0,0,1
|
||||
@@ -44,8 +44,8 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
54,7,Mining Laser,138,0,0,0,0,1
|
||||
55,7,Projectile Weapon,384,0,0,0,0,1
|
||||
56,7,Missile Launcher,168,0,0,0,0,0
|
||||
57,7,Shield Power Relay,0,0,0,0,0,1
|
||||
59,7,Gyrostabilizer,0,0,0,0,0,1
|
||||
57,7,Shield Power Relay,26450,0,0,0,0,1
|
||||
59,7,Gyrostabilizer,26452,0,0,0,0,1
|
||||
60,7,Damage Control,0,0,0,0,0,1
|
||||
61,7,Capacitor Battery,0,0,0,0,0,1
|
||||
62,7,Armor Repair Unit,0,1,0,0,0,1
|
||||
@@ -86,10 +86,10 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
110,9,Titan Blueprint,None,1,0,0,0,1
|
||||
111,9,Shuttle Blueprint,0,1,0,0,0,1
|
||||
118,9,Shield Extender Blueprint,82,1,0,0,0,1
|
||||
119,9,Shield Recharger Blueprint,83,1,0,0,0,1
|
||||
119,9,Shield Recharger Blueprint,26451,1,0,0,0,1
|
||||
120,9,Shield Booster Blueprint,84,1,0,0,0,1
|
||||
121,9,Remote Shield Booster Blueprint,86,1,0,0,0,1
|
||||
123,9,Capacitor Recharger Blueprint,90,1,0,0,0,1
|
||||
123,9,Capacitor Recharger Blueprint,26457,1,0,0,0,1
|
||||
126,9,Propulsion Module Blueprint,96,1,0,0,0,1
|
||||
127,9,Cargo Scanner Blueprint,106,1,0,0,0,1
|
||||
128,9,Ship Scanner Blueprint,107,1,0,0,0,1
|
||||
@@ -149,14 +149,14 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
201,7,ECM,0,0,0,0,0,1
|
||||
202,7,ECCM,0,0,0,0,0,1
|
||||
203,7,Sensor Backup Array,0,0,0,0,0,1
|
||||
205,7,Heat Sink,0,0,0,0,0,1
|
||||
205,7,Heat Sink,26453,0,0,0,0,1
|
||||
208,7,Sensor Dampener,105,0,0,0,0,1
|
||||
209,7,Remote Tracking Computer,3346,0,0,0,0,1
|
||||
210,7,Signal Amplifier,0,0,0,0,0,1
|
||||
211,7,Tracking Enhancer,0,0,0,0,0,1
|
||||
212,7,Sensor Booster,74,0,0,0,0,1
|
||||
213,7,Tracking Computer,3346,0,0,0,0,1
|
||||
218,9,Heat Sink Blueprint,0,1,0,0,0,1
|
||||
218,9,Heat Sink Blueprint,26453,1,0,0,0,1
|
||||
223,9,Sensor Booster Blueprint,0,1,0,0,0,1
|
||||
224,9,Tracking Computer Blueprint,0,1,0,0,0,1
|
||||
225,7,Cheat Module Group,0,0,0,0,0,0
|
||||
@@ -197,7 +197,7 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
299,18,Repair Drone,0,0,0,0,0,0
|
||||
300,20,Cyberimplant,0,1,0,0,0,1
|
||||
301,11,Concord Drone,0,0,0,0,0,0
|
||||
302,7,Magnetic Field Stabilizer,0,0,0,0,0,1
|
||||
302,7,Magnetic Field Stabilizer,26454,0,0,0,0,1
|
||||
303,20,Booster,0,0,0,0,0,1
|
||||
304,20,DNA Mutator,0,0,0,0,0,0
|
||||
305,2,Comet,0,0,0,0,0,0
|
||||
@@ -595,10 +595,10 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
764,7,Overdrive Injector System,0,0,0,0,0,1
|
||||
765,7,Expanded Cargohold,0,0,0,0,0,1
|
||||
766,7,Power Diagnostic System,0,0,0,0,0,1
|
||||
767,7,Capacitor Power Relay,0,0,0,0,0,1
|
||||
768,7,Capacitor Flux Coil,0,0,0,0,0,1
|
||||
767,7,Capacitor Power Relay,26455,0,0,0,0,1
|
||||
768,7,Capacitor Flux Coil,26456,0,0,0,0,1
|
||||
769,7,Reactor Control Unit,0,0,0,0,0,1
|
||||
770,7,Shield Flux Coil,0,0,0,0,0,1
|
||||
770,7,Shield Flux Coil,26449,0,0,0,0,1
|
||||
771,7,Missile Launcher Heavy Assault,3241,0,0,0,0,1
|
||||
772,8,Heavy Assault Missile,3237,0,0,0,1,1
|
||||
773,7,Rig Armor,0,0,0,0,0,1
|
||||
@@ -755,11 +755,11 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
944,9,Capital Industrial Ship Blueprint,None,1,0,0,0,1
|
||||
945,9,Industrial Command Ship Blueprint,None,1,0,0,0,1
|
||||
952,11,Mission Container,0,0,1,0,0,0
|
||||
954,32,Defensive Subsystem,None,0,0,0,0,1
|
||||
954,32,Defensive Subsystem,3631,0,0,0,0,1
|
||||
955,17,Depricated Subsystems,None,0,0,0,0,0
|
||||
956,32,Offensive Subsystem,None,0,0,0,0,1
|
||||
957,32,Propulsion Subsystem,None,0,0,0,0,1
|
||||
958,32,Core Subsystem,None,0,0,0,0,1
|
||||
956,32,Offensive Subsystem,3641,0,0,0,0,1
|
||||
957,32,Propulsion Subsystem,3646,0,0,0,0,1
|
||||
958,32,Core Subsystem,3636,0,0,0,0,1
|
||||
959,11,Deadspace Sleeper Sleepless Sentinel,0,0,0,0,0,0
|
||||
960,11,Deadspace Sleeper Awakened Sentinel,0,0,0,0,0,0
|
||||
961,11,Deadspace Sleeper Emergent Sentinel,0,0,0,0,0,0
|
||||
@@ -1322,7 +1322,7 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
1962,66,Structure QA Modules,None,0,0,0,0,0
|
||||
1964,17,Mutaplasmids,None,0,0,0,0,1
|
||||
1966,66,Structure Capacitor Battery,None,0,0,0,0,1
|
||||
1967,66,Structure Capacitor Power Relay,None,0,0,0,0,1
|
||||
1967,66,Structure Capacitor Power Relay,26455,0,0,0,0,1
|
||||
1968,66,Structure Armor Reinforcer,None,0,0,0,0,1
|
||||
1969,7,Abyssal Modules,None,0,0,0,0,0
|
||||
1971,2,Abyssal Hazards,None,0,0,0,0,0
|
||||
@@ -1523,6 +1523,14 @@ groupID,categoryID,groupName,iconID,useBasePrice,anchored,anchorable,fittableNon
|
||||
4802,11,Asteroid Sansha's Nation Officer Frigate,None,0,0,0,0,0
|
||||
4803,11,Asteroid Serpentis Officer Cruiser,None,0,0,0,0,0
|
||||
4804,11,Asteroid Serpentis Officer Frigate,None,0,0,0,0,0
|
||||
4807,7,Breacher Pod Launchers,None,0,0,0,0,1
|
||||
4808,8,SCARAB Breacher Pods,None,0,0,0,1,1
|
||||
4810,22,Mercenary Den,None,0,0,0,0,1
|
||||
4811,9,Mercenary Den Blueprint,None,1,0,0,0,1
|
||||
4820,9,Mutaplasmid Blueprint,None,1,0,0,0,1
|
||||
4821,17,Atavum,None,1,0,0,0,1
|
||||
4824,17,Infomorph Systems,None,1,0,0,0,1
|
||||
4825,2,Local Beacon,None,0,1,0,0,0
|
||||
350858,350001,Infantry Weapons,None,1,0,0,0,0
|
||||
351064,350001,Infantry Dropsuits,None,1,0,0,0,0
|
||||
351121,350001,Infantry Modules,None,1,0,0,0,0
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -4417,7 +4417,8 @@
|
||||
],
|
||||
"solarSystemID": 31002576,
|
||||
"statics": [
|
||||
"W237"
|
||||
"W237",
|
||||
"K346"
|
||||
],
|
||||
"systemName": "J010366",
|
||||
"effectName": null
|
||||
@@ -13395,7 +13396,6 @@
|
||||
],
|
||||
"solarSystemID": 31002559,
|
||||
"statics": [
|
||||
"D792",
|
||||
"K346",
|
||||
"M267"
|
||||
],
|
||||
@@ -13718,7 +13718,8 @@
|
||||
],
|
||||
"solarSystemID": 31002566,
|
||||
"statics": [
|
||||
"E175"
|
||||
"E175",
|
||||
"K346"
|
||||
],
|
||||
"systemName": "J012773",
|
||||
"effectName": "Wolf-Rayet Star"
|
||||
@@ -23262,7 +23263,8 @@
|
||||
],
|
||||
"solarSystemID": 31002568,
|
||||
"statics": [
|
||||
"U210"
|
||||
"U210",
|
||||
"H296"
|
||||
],
|
||||
"systemName": "J005663",
|
||||
"effectName": null
|
||||
@@ -37631,4 +37633,4 @@
|
||||
"systemName": "J130650",
|
||||
"effectName": "Cataclysmic Variable"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
"dest": "c2",
|
||||
"src": ["c1"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 1000000000,
|
||||
"name": "C125",
|
||||
@@ -127,7 +127,7 @@
|
||||
"static": false,
|
||||
"max_mass_per_jump": 1350000000,
|
||||
"lifetime": "24",
|
||||
"total_mass": 3000000000,
|
||||
"total_mass": 3300000000,
|
||||
"name": "C140",
|
||||
"respawn": ["wandering"]
|
||||
},
|
||||
@@ -149,7 +149,7 @@
|
||||
"static": false,
|
||||
"max_mass_per_jump": 1350000000,
|
||||
"lifetime": "24",
|
||||
"total_mass": 3000000000,
|
||||
"total_mass": 3300000000,
|
||||
"name": "C248",
|
||||
"respawn": ["wandering"]
|
||||
},
|
||||
@@ -160,7 +160,7 @@
|
||||
"static": false,
|
||||
"max_mass_per_jump": 1000000000,
|
||||
"lifetime": "48",
|
||||
"total_mass": 3000000000,
|
||||
"total_mass": 3300000000,
|
||||
"name": "C391",
|
||||
"respawn": ["wandering"]
|
||||
},
|
||||
@@ -301,7 +301,7 @@
|
||||
"dest": "thera",
|
||||
"src": ["c1"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 100000000,
|
||||
"name": "F353",
|
||||
@@ -334,7 +334,7 @@
|
||||
"dest": "c1",
|
||||
"src": ["c1"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "H121",
|
||||
@@ -378,7 +378,7 @@
|
||||
"dest": "ls",
|
||||
"src": ["c1"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "24",
|
||||
"total_mass": 1000000000,
|
||||
"name": "J244",
|
||||
@@ -409,7 +409,7 @@
|
||||
{
|
||||
"mass_regen": 0,
|
||||
"dest": "ns",
|
||||
"src": ["c3"],
|
||||
"src": ["c3", "c4-shattered", "c5-shattered", "c6-shattered"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 300000000,
|
||||
"lifetime": "16",
|
||||
@@ -455,7 +455,7 @@
|
||||
"dest": "c5",
|
||||
"src": ["c1", "ns"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "24",
|
||||
"total_mass": 1000000000,
|
||||
"name": "L614",
|
||||
@@ -510,7 +510,7 @@
|
||||
"dest": "c4",
|
||||
"src": ["c1"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 1000000000,
|
||||
"name": "M609",
|
||||
@@ -532,7 +532,7 @@
|
||||
"dest": "hs",
|
||||
"src": ["c1"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "24",
|
||||
"total_mass": 1000000000,
|
||||
"name": "N110",
|
||||
@@ -631,7 +631,7 @@
|
||||
"dest": "c3",
|
||||
"src": ["c1", "ns"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 1000000000,
|
||||
"name": "O883",
|
||||
@@ -642,7 +642,7 @@
|
||||
"dest": "c1",
|
||||
"src": ["c4"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "P060",
|
||||
@@ -664,7 +664,7 @@
|
||||
"dest": "hs",
|
||||
"src": ["thera"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "Q063",
|
||||
@@ -675,7 +675,7 @@
|
||||
"dest": "c1",
|
||||
"src": ["c6"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "Q317",
|
||||
@@ -763,7 +763,7 @@
|
||||
"dest": "c6",
|
||||
"src": ["c1", "ns"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "24",
|
||||
"total_mass": 1000000000,
|
||||
"name": "S804",
|
||||
@@ -796,7 +796,7 @@
|
||||
"dest": "thera",
|
||||
"src": ["hs"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "T458",
|
||||
@@ -805,7 +805,7 @@
|
||||
{
|
||||
"mass_regen": 0,
|
||||
"dest": "ls",
|
||||
"src": ["c3"],
|
||||
"src": ["c3", "c4-shattered", "c5-shattered"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 300000000,
|
||||
"lifetime": "24",
|
||||
@@ -862,7 +862,7 @@
|
||||
"dest": "c1",
|
||||
"src": ["c3", "thera"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "V301",
|
||||
@@ -972,7 +972,7 @@
|
||||
"dest": "c1",
|
||||
"src": ["c5"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "Y790",
|
||||
@@ -994,7 +994,7 @@
|
||||
"dest": "ns",
|
||||
"src": ["c1"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 1000000000,
|
||||
"name": "Z060",
|
||||
@@ -1027,7 +1027,7 @@
|
||||
"dest": "c1",
|
||||
"src": ["c2", "drifter"],
|
||||
"static": true,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 500000000,
|
||||
"name": "Z647",
|
||||
@@ -1038,7 +1038,7 @@
|
||||
"dest": "c1",
|
||||
"src": ["hs", "ls", "ns"],
|
||||
"static": false,
|
||||
"max_mass_per_jump": 20000000,
|
||||
"max_mass_per_jump": 62000000,
|
||||
"lifetime": "16",
|
||||
"total_mass": 100000000,
|
||||
"name": "Z971",
|
||||
|
||||
21
priv/repo/migrations/20241217103838_ship_size.exs
Normal file
21
priv/repo/migrations/20241217103838_ship_size.exs
Normal file
@@ -0,0 +1,21 @@
|
||||
defmodule WandererApp.Repo.Migrations.ShipSize do
|
||||
@moduledoc """
|
||||
Updates resources based on their most recent snapshots.
|
||||
|
||||
This file was autogenerated with `mix ash_postgres.generate_migrations`
|
||||
"""
|
||||
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table(:map_chain_v1) do
|
||||
modify :ship_size_type, :bigint, default: 2
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
alter table(:map_chain_v1) do
|
||||
modify :ship_size_type, :bigint, default: 1
|
||||
end
|
||||
end
|
||||
end
|
||||
178
priv/resource_snapshots/repo/map_chain_v1/20241217103838.json
Normal file
178
priv/resource_snapshots/repo/map_chain_v1/20241217103838.json
Normal file
@@ -0,0 +1,178 @@
|
||||
{
|
||||
"attributes": [
|
||||
{
|
||||
"allow_nil?": false,
|
||||
"default": "fragment(\"gen_random_uuid()\")",
|
||||
"generated?": false,
|
||||
"primary_key?": true,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "id",
|
||||
"type": "uuid"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "nil",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "solar_system_source",
|
||||
"type": "bigint"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "nil",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "solar_system_target",
|
||||
"type": "bigint"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "0",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "mass_status",
|
||||
"type": "bigint"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "0",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "time_status",
|
||||
"type": "bigint"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "2",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "ship_size_type",
|
||||
"type": "bigint"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "0",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "type",
|
||||
"type": "bigint"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "nil",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "wormhole_type",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "0",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "count_of_passage",
|
||||
"type": "bigint"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "nil",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "locked",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "nil",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "custom_info",
|
||||
"type": "text"
|
||||
},
|
||||
{
|
||||
"allow_nil?": false,
|
||||
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "inserted_at",
|
||||
"type": "utc_datetime_usec"
|
||||
},
|
||||
{
|
||||
"allow_nil?": false,
|
||||
"default": "fragment(\"(now() AT TIME ZONE 'utc')\")",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": null,
|
||||
"size": null,
|
||||
"source": "updated_at",
|
||||
"type": "utc_datetime_usec"
|
||||
},
|
||||
{
|
||||
"allow_nil?": true,
|
||||
"default": "nil",
|
||||
"generated?": false,
|
||||
"primary_key?": false,
|
||||
"references": {
|
||||
"deferrable": false,
|
||||
"destination_attribute": "id",
|
||||
"destination_attribute_default": null,
|
||||
"destination_attribute_generated": null,
|
||||
"index?": false,
|
||||
"match_type": null,
|
||||
"match_with": null,
|
||||
"multitenancy": {
|
||||
"attribute": null,
|
||||
"global": null,
|
||||
"strategy": null
|
||||
},
|
||||
"name": "map_chain_v1_map_id_fkey",
|
||||
"on_delete": null,
|
||||
"on_update": null,
|
||||
"primary_key?": true,
|
||||
"schema": "public",
|
||||
"table": "maps_v1"
|
||||
},
|
||||
"size": null,
|
||||
"source": "map_id",
|
||||
"type": "uuid"
|
||||
}
|
||||
],
|
||||
"base_filter": null,
|
||||
"check_constraints": [],
|
||||
"custom_indexes": [],
|
||||
"custom_statements": [],
|
||||
"has_create_action": true,
|
||||
"hash": "3495268959E42B3B8D31B5B154B416A5BEF80D57D684375296EA5C1711FE3521",
|
||||
"identities": [],
|
||||
"multitenancy": {
|
||||
"attribute": null,
|
||||
"global": null,
|
||||
"strategy": null
|
||||
},
|
||||
"repo": "Elixir.WandererApp.Repo",
|
||||
"schema": null,
|
||||
"table": "map_chain_v1"
|
||||
}
|
||||
Reference in New Issue
Block a user