mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-02-09 15:36:17 +00:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a707fb423 | ||
|
|
8cda76cc43 | ||
|
|
89d7df0ba2 | ||
|
|
ba0c10d2e4 | ||
|
|
996c88d839 | ||
|
|
80e998cf79 | ||
|
|
d2bcb89fa1 | ||
|
|
922f296f17 | ||
|
|
71dc20c933 | ||
|
|
80f7d34d3d | ||
|
|
113fe1c695 | ||
|
|
5550844912 | ||
|
|
0228e68a1d | ||
|
|
3424667af1 | ||
|
|
6c7b28a6c1 | ||
|
|
3988079cd3 | ||
|
|
f5d407fee0 |
40
CHANGELOG.md
40
CHANGELOG.md
@@ -2,6 +2,46 @@
|
||||
|
||||
<!-- changelog -->
|
||||
|
||||
## [v1.93.0](https://github.com/wanderer-industries/wanderer/compare/v1.92.0...v1.93.0) (2026-02-08)
|
||||
|
||||
|
||||
|
||||
|
||||
### Features:
|
||||
|
||||
* subscriptions: Added an ability to withdraw from map to user balance
|
||||
|
||||
## [v1.92.0](https://github.com/wanderer-industries/wanderer/compare/v1.91.11...v1.92.0) (2026-01-14)
|
||||
|
||||
|
||||
|
||||
|
||||
### Features:
|
||||
|
||||
* Added ability to select a range of wh classes for k162.
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* core: Show c1/c2/c3 or c4/c5 or link signature modal
|
||||
|
||||
## [v1.91.11](https://github.com/wanderer-industries/wanderer/compare/v1.91.10...v1.91.11) (2026-01-13)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* allow sig api when map relay is off
|
||||
|
||||
## [v1.91.10](https://github.com/wanderer-industries/wanderer/compare/v1.91.9...v1.91.10) (2026-01-07)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* remove actor context requirement from sig api
|
||||
|
||||
## [v1.91.9](https://github.com/wanderer-industries/wanderer/compare/v1.91.8...v1.91.9) (2026-01-06)
|
||||
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
|
||||
import { useSystemInfo } from '@/hooks/Mapper/components/hooks';
|
||||
import {
|
||||
SOLAR_SYSTEM_CLASS_IDS,
|
||||
SOLAR_SYSTEM_CLASSES_TO_CLASS_GROUPS,
|
||||
WORMHOLES_ADDITIONAL_INFO_BY_SHORT_NAME,
|
||||
SOLAR_SYSTEM_CLASS_IDS,
|
||||
SOLAR_SYSTEM_CLASSES_TO_CLASS_GROUPS,
|
||||
WORMHOLES_ADDITIONAL_INFO_BY_SHORT_NAME,
|
||||
} from '@/hooks/Mapper/components/map/constants.ts';
|
||||
import { SystemSignaturesContent } from '@/hooks/Mapper/components/mapInterface/widgets/SystemSignatures/SystemSignaturesContent';
|
||||
import { K162_TYPES_MAP } from '@/hooks/Mapper/constants.ts';
|
||||
@@ -91,7 +91,7 @@ export const SystemLinkSignatureDialog = ({ data, setVisible }: SystemLinkSignat
|
||||
|
||||
if (k162TypeInfo) {
|
||||
// Check if the k162Type matches our target system class
|
||||
return customInfo.k162Type === targetSystemClassGroup;
|
||||
return k162TypeInfo.value.includes(targetSystemClassGroup);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,26 @@ export const renderK162Type = (option: K162Type) => {
|
||||
return renderNoValue();
|
||||
}
|
||||
|
||||
if (['c1_c2_c3', 'c4_c5'].includes(value)) {
|
||||
const arr = whClassName.split('_');
|
||||
|
||||
return (
|
||||
<div className="flex gap-1 items-center">
|
||||
{arr.map(x => (
|
||||
<WHClassView
|
||||
key={x}
|
||||
classNameWh="!text-[11px] !font-bold"
|
||||
hideWhClassName
|
||||
hideTooltip
|
||||
whClassName={x}
|
||||
noOffset
|
||||
useShortTitle
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<WHClassView
|
||||
classNameWh="!text-[11px] !font-bold"
|
||||
|
||||
@@ -88,6 +88,16 @@ export const K162_TYPES: K162Type[] = [
|
||||
value: 'ns',
|
||||
whClassName: 'C248',
|
||||
},
|
||||
{
|
||||
label: 'C1/C2/C3',
|
||||
value: 'c1_c2_c3',
|
||||
whClassName: 'E004_D382_L477',
|
||||
},
|
||||
{
|
||||
label: 'C4/C5',
|
||||
value: 'c4_c5',
|
||||
whClassName: 'M001_L614',
|
||||
},
|
||||
{
|
||||
label: 'C1',
|
||||
value: 'c1',
|
||||
|
||||
@@ -78,7 +78,8 @@ defmodule WandererApp.Map.Operations.Signatures do
|
||||
)
|
||||
when is_integer(solar_system_id) do
|
||||
with {:ok, validated_char_uuid} <- validate_character_eve_id(params, char_id),
|
||||
{:ok, system} <- MapSystem.by_map_id_and_solar_system_id(map_id, solar_system_id) do
|
||||
{:ok, system} <-
|
||||
MapSystem.read_by_map_and_solar_system(%{map_id: map_id, solar_system_id: solar_system_id}) do
|
||||
attrs =
|
||||
params
|
||||
|> Map.put("system_id", system.id)
|
||||
|
||||
@@ -167,6 +167,9 @@ defmodule WandererApp.Map.Server.SignaturesImpl do
|
||||
updated_count: length(updated_ids),
|
||||
removed_count: length(removed_ids)
|
||||
})
|
||||
|
||||
# Always return :ok - external event failures should not affect the main operation
|
||||
:ok
|
||||
end
|
||||
|
||||
defp remove_signature(map_id, sig, system, delete_conn?) do
|
||||
|
||||
@@ -11,6 +11,7 @@ defmodule WandererAppWeb.Maps.MapBalanceComponent do
|
||||
{:ok,
|
||||
assign(socket,
|
||||
is_topping_up?: false,
|
||||
is_withdrawing?: false,
|
||||
error: nil
|
||||
)}
|
||||
end
|
||||
@@ -61,12 +62,102 @@ defmodule WandererAppWeb.Maps.MapBalanceComponent do
|
||||
{"ALL", nil}
|
||||
]
|
||||
)
|
||||
|> assign(is_topping_up?: true)}
|
||||
|> assign(is_topping_up?: true, is_withdrawing?: false)}
|
||||
|
||||
@impl true
|
||||
def handle_event("hide_topup", _, socket),
|
||||
do: {:noreply, socket |> assign(is_topping_up?: false)}
|
||||
|
||||
@impl true
|
||||
def handle_event("show_withdraw", _, socket),
|
||||
do:
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(
|
||||
:withdraw_amounts,
|
||||
[
|
||||
{"50M", 50_000_000},
|
||||
{"100M", 100_000_000},
|
||||
{"250M", 250_000_000},
|
||||
{"500M", 500_000_000},
|
||||
{"1B", 1_000_000_000},
|
||||
{"2.5B", 2_500_000_000},
|
||||
{"5B", 5_000_000_000},
|
||||
{"10B", 10_000_000_000},
|
||||
{"ALL", nil}
|
||||
]
|
||||
)
|
||||
|> assign(is_withdrawing?: true, is_topping_up?: false)}
|
||||
|
||||
@impl true
|
||||
def handle_event("hide_withdraw", _, socket),
|
||||
do: {:noreply, socket |> assign(is_withdrawing?: false)}
|
||||
|
||||
@impl true
|
||||
def handle_event(
|
||||
"withdraw",
|
||||
%{"amount" => amount} = _event,
|
||||
%{assigns: %{current_user: current_user, map: map, map_id: map_id}} = socket
|
||||
) do
|
||||
user =
|
||||
current_user.id
|
||||
|> WandererApp.User.load()
|
||||
|
||||
{:ok, map_balance} = WandererApp.Map.SubscriptionManager.get_balance(map)
|
||||
|
||||
amount =
|
||||
if amount == "" do
|
||||
map_balance
|
||||
else
|
||||
amount |> Decimal.new() |> Decimal.to_float()
|
||||
end
|
||||
|
||||
case amount <= map_balance do
|
||||
true ->
|
||||
{:ok, _t} =
|
||||
WandererApp.Api.MapTransaction.create(%{
|
||||
map_id: map_id,
|
||||
user_id: current_user.id,
|
||||
amount: amount,
|
||||
type: :out
|
||||
})
|
||||
|
||||
{:ok, user_balance} =
|
||||
user
|
||||
|> WandererApp.User.get_balance()
|
||||
|
||||
{:ok, _user} =
|
||||
user
|
||||
|> WandererApp.Api.User.update_balance(%{
|
||||
balance: (user_balance || 0.0) + amount
|
||||
})
|
||||
|
||||
{:ok, user_balance} =
|
||||
current_user.id
|
||||
|> WandererApp.User.load()
|
||||
|> WandererApp.User.get_balance()
|
||||
|
||||
{:ok, map_balance} = WandererApp.Map.SubscriptionManager.get_balance(map)
|
||||
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(
|
||||
is_withdrawing?: false,
|
||||
map_balance: map_balance,
|
||||
user_balance: user_balance
|
||||
)}
|
||||
|
||||
_ ->
|
||||
notify_to(
|
||||
socket.assigns.notify_to,
|
||||
socket.assigns.event_name,
|
||||
{:flash, :error, "Not enough ISK in map balance!"}
|
||||
)
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_event(
|
||||
"topup",
|
||||
@@ -142,7 +233,7 @@ defmodule WandererAppWeb.Maps.MapBalanceComponent do
|
||||
<div class="stat">
|
||||
<div class="stat-figure text-primary">
|
||||
<.button
|
||||
:if={not @is_topping_up?}
|
||||
:if={not @is_topping_up? and not @is_withdrawing?}
|
||||
class="mt-2"
|
||||
type="button"
|
||||
phx-click="show_topup"
|
||||
@@ -150,6 +241,15 @@ defmodule WandererAppWeb.Maps.MapBalanceComponent do
|
||||
>
|
||||
Top Up
|
||||
</.button>
|
||||
<.button
|
||||
:if={not @is_topping_up? and not @is_withdrawing?}
|
||||
class="mt-2"
|
||||
type="button"
|
||||
phx-click="show_withdraw"
|
||||
phx-target={@myself}
|
||||
>
|
||||
Withdraw
|
||||
</.button>
|
||||
</div>
|
||||
<div class="stat-title">Map balance</div>
|
||||
<div class="stat-value text-white">
|
||||
@@ -210,6 +310,32 @@ defmodule WandererAppWeb.Maps.MapBalanceComponent do
|
||||
</.button>
|
||||
</div>
|
||||
</.form>
|
||||
|
||||
<.form
|
||||
:let={f}
|
||||
:if={@is_withdrawing?}
|
||||
for={@topup_form}
|
||||
class="mt-2"
|
||||
phx-submit="withdraw"
|
||||
phx-target={@myself}
|
||||
>
|
||||
<.input
|
||||
type="select"
|
||||
field={f[:amount]}
|
||||
class="select h-8 min-h-[10px] !pt-1 !pb-1 text-sm bg-neutral-900"
|
||||
label="Withdraw amount"
|
||||
placeholder="Select withdraw amount"
|
||||
options={@withdraw_amounts}
|
||||
/>
|
||||
<div class="modal-action">
|
||||
<.button class="mt-2" type="button" phx-click="hide_withdraw" phx-target={@myself}>
|
||||
Cancel
|
||||
</.button>
|
||||
<.button class="mt-2" type="submit">
|
||||
Withdraw
|
||||
</.button>
|
||||
</div>
|
||||
</.form>
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user