mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-08-28 08:46:48 +00:00
fix(core): Small fixes & improvements
This commit is contained in:
@@ -114,9 +114,11 @@ defmodule WandererApp.Api.AccessListMember do
|
||||
identity :uniq_acl_character_id, [:access_list_id, :eve_character_id] do
|
||||
pre_check?(true)
|
||||
end
|
||||
identity :uniq_acl_corporation_id, [:access_list_id, :eve_corporation_id] do
|
||||
|
||||
identity :uniq_acl_corporation_id, [:access_list_id, :eve_corporation_id] do
|
||||
pre_check?(true)
|
||||
end
|
||||
|
||||
identity :uniq_acl_alliance_id, [:access_list_id, :eve_alliance_id] do
|
||||
pre_check?(true)
|
||||
end
|
||||
|
||||
@@ -207,11 +207,11 @@ defmodule WandererApp.Character do
|
||||
|> Enum.map(fn task -> Task.await(task, 145_000) end)
|
||||
|> Enum.map(fn result ->
|
||||
case result do
|
||||
{:ok, result} -> map_function.(result)
|
||||
_ -> nil
|
||||
{:ok, result} -> map_function.(result)
|
||||
_ -> nil
|
||||
end
|
||||
end)
|
||||
|> Enum.filter(fn result -> not is_nil(result) end)}
|
||||
end)
|
||||
|> Enum.filter(fn result -> not is_nil(result) end)}
|
||||
|
||||
defp _map_alliance_info(info) do
|
||||
%{
|
||||
|
||||
@@ -191,7 +191,7 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
|
||||
state
|
||||
else
|
||||
{:error, error} ->
|
||||
{:error, _error} ->
|
||||
state
|
||||
end
|
||||
end
|
||||
@@ -205,7 +205,7 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
|
||||
state
|
||||
else
|
||||
{:error, error} ->
|
||||
{:error, _error} ->
|
||||
state
|
||||
end
|
||||
end
|
||||
@@ -797,7 +797,7 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
}
|
||||
end
|
||||
|
||||
def handle_event({ref, _result}, %{map_id: map_id} = state) do
|
||||
def handle_event({ref, _result}, %{map_id: _map_id} = state) do
|
||||
Process.demonitor(ref, [:flush])
|
||||
|
||||
state
|
||||
@@ -1657,32 +1657,33 @@ defmodule WandererApp.Map.Server.Impl do
|
||||
{:ok, solar_system_info} =
|
||||
WandererApp.Api.MapSolarSystem.by_solar_system_id(location.solar_system_id)
|
||||
|
||||
WandererApp.MapSystemRepo.create(%{
|
||||
map_id: map_id,
|
||||
solar_system_id: location.solar_system_id,
|
||||
name: solar_system_info.solar_system_name,
|
||||
position_x: position.x,
|
||||
position_y: position.y
|
||||
})
|
||||
|> case do
|
||||
{:ok, new_system} ->
|
||||
@ddrt.insert(
|
||||
{new_system.solar_system_id,
|
||||
WandererApp.Map.PositionCalculator.get_system_bounding_rect(new_system)},
|
||||
rtree_name
|
||||
)
|
||||
WandererApp.MapSystemRepo.create(%{
|
||||
map_id: map_id,
|
||||
solar_system_id: location.solar_system_id,
|
||||
name: solar_system_info.solar_system_name,
|
||||
position_x: position.x,
|
||||
position_y: position.y
|
||||
})
|
||||
|> case do
|
||||
{:ok, new_system} ->
|
||||
@ddrt.insert(
|
||||
{new_system.solar_system_id,
|
||||
WandererApp.Map.PositionCalculator.get_system_bounding_rect(new_system)},
|
||||
rtree_name
|
||||
)
|
||||
|
||||
WandererApp.Cache.put(
|
||||
"map_#{map_id}:system_#{new_system.id}:last_activity",
|
||||
DateTime.utc_now(),
|
||||
ttl: @system_inactive_timeout
|
||||
)
|
||||
WandererApp.Cache.put(
|
||||
"map_#{map_id}:system_#{new_system.id}:last_activity",
|
||||
DateTime.utc_now(),
|
||||
ttl: @system_inactive_timeout
|
||||
)
|
||||
|
||||
broadcast!(map_id, :add_system, new_system)
|
||||
WandererApp.Map.add_system(map_id, new_system)
|
||||
_ ->
|
||||
:ok
|
||||
end
|
||||
broadcast!(map_id, :add_system, new_system)
|
||||
WandererApp.Map.add_system(map_id, new_system)
|
||||
|
||||
_ ->
|
||||
:ok
|
||||
end
|
||||
end
|
||||
|
||||
{:error, _} ->
|
||||
|
||||
@@ -17,7 +17,16 @@ defmodule WandererApp.Permissions do
|
||||
@delete_map 4096
|
||||
|
||||
@viewer_role [@view_system, @view_character, @view_connection]
|
||||
@member_role @viewer_role ++ [@add_system, @add_connection, @update_system, @track_character, @delete_connection, @delete_system, @lock_system]
|
||||
@member_role @viewer_role ++
|
||||
[
|
||||
@add_system,
|
||||
@add_connection,
|
||||
@update_system,
|
||||
@track_character,
|
||||
@delete_connection,
|
||||
@delete_system,
|
||||
@lock_system
|
||||
]
|
||||
@manager_role @member_role
|
||||
@admin_role @manager_role ++ [@add_acl, @delete_acl, @delete_map]
|
||||
|
||||
|
||||
@@ -92,11 +92,11 @@ defmodule WandererAppWeb.CoreComponents do
|
||||
<div class="absolute right-4">
|
||||
<button
|
||||
phx-click={JS.exec("data-cancel", to: "##{@id}")}
|
||||
type="button"
|
||||
class="p-link opacity-70 hover:opacity-100"
|
||||
aria-label={gettext("close")}
|
||||
type="button"
|
||||
class="p-link opacity-70 hover:opacity-100"
|
||||
aria-label={gettext("close")}
|
||||
>
|
||||
<.icon name="hero-x-mark-solid" class="h-5 w-5" />
|
||||
<.icon name="hero-x-mark-solid" class="h-5 w-5" />
|
||||
</button>
|
||||
</div>
|
||||
</h3>
|
||||
|
||||
@@ -45,7 +45,6 @@
|
||||
|
||||
<script defer phx-track-static type="module" src={~p"/assets/app.js"} crossorigin="anonymous">
|
||||
</script>
|
||||
|
||||
<!-- Appzi: Capture Insightful Feedback -->
|
||||
<script defer src="https://w.appzi.io/w.js?token=yddv0">
|
||||
</script>
|
||||
@@ -65,7 +64,6 @@
|
||||
|
||||
gtag('config', 'G-61PHLLS0LD');
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<%= @inner_content %>
|
||||
|
||||
@@ -46,7 +46,10 @@ defmodule WandererAppWeb.UserActivity do
|
||||
<.local_time id={@activity.id} at={@activity.inserted_at} />
|
||||
</span>
|
||||
</p>
|
||||
<p :if={not is_nil(@activity.character)} class="flex shrink-0 items-center space-x-1 min-w-[200px]">
|
||||
<p
|
||||
:if={not is_nil(@activity.character)}
|
||||
class="flex shrink-0 items-center space-x-1 min-w-[200px]"
|
||||
>
|
||||
<.character_item character={@activity.character} />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
<div class="h-10"></div>
|
||||
<div>
|
||||
<div class="inline-flex w-full flex-col items-stretch justify-center gap-2 px-4 md:flex-row xl:justify-start xl:px-0">
|
||||
<.link href={"https://discord.gg/cafERvDD2k"} class="btn md:btn-lg group shrink-0 rounded-full [@media(min-width:768px)]:px-10 bg-[oklch(64.74%_0.124_270.62)] border-[oklch(64.74%_0.124_270.62)] hover:bg-[oklch(60%_0.124_270.62)] hover:border-[oklch(60%_0.124_270.62)]">
|
||||
<.link
|
||||
href="https://discord.gg/cafERvDD2k"
|
||||
class="btn md:btn-lg group shrink-0 rounded-full [@media(min-width:768px)]:px-10 bg-[oklch(64.74%_0.124_270.62)] border-[oklch(64.74%_0.124_270.62)] hover:bg-[oklch(60%_0.124_270.62)] hover:border-[oklch(60%_0.124_270.62)]"
|
||||
>
|
||||
<svg
|
||||
class="h-7 w-auto transition-opacity opacity-100 group-hover:opacity-0"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
|
||||
@@ -18,20 +18,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel carousel-center bg-neutral rounded-box max-w-[80%] space-x-4 p-4">
|
||||
<%= for post <- @posts do %>
|
||||
<.link class="group carousel-item relative" navigate={~p"/news/#{post.id}"}>
|
||||
<div class="artboard-horizontal phone-1 relative hover:text-white mt-10">
|
||||
<img
|
||||
class="rounded-lg shadow-lg block !w-[400px] !h-[200px] opacity-75"
|
||||
src={post.cover_image_uri}
|
||||
/>
|
||||
<div class="absolute top-0 left-0 w-full h-full bg-gradient-to-b from-transparent to-black opacity-75 group-hover:opacity-25 transition-opacity duration-300"></div>
|
||||
<h3 class="absolute bottom-4 left-14 font-bold break-normal pt-6 pb-2 ccp-font text-white">
|
||||
<%= post.title %>
|
||||
</h3>
|
||||
</div>
|
||||
</.link>
|
||||
<% end %>
|
||||
<%= for post <- @posts do %>
|
||||
<.link class="group carousel-item relative" navigate={~p"/news/#{post.id}"}>
|
||||
<div class="artboard-horizontal phone-1 relative hover:text-white mt-10">
|
||||
<img
|
||||
class="rounded-lg shadow-lg block !w-[400px] !h-[200px] opacity-75"
|
||||
src={post.cover_image_uri}
|
||||
/>
|
||||
<div class="absolute top-0 left-0 w-full h-full bg-gradient-to-b from-transparent to-black opacity-75 group-hover:opacity-25 transition-opacity duration-300">
|
||||
</div>
|
||||
<h3 class="absolute bottom-4 left-14 font-bold break-normal pt-6 pb-2 ccp-font text-white">
|
||||
<%= post.title %>
|
||||
</h3>
|
||||
</div>
|
||||
</.link>
|
||||
<% end %>
|
||||
</div>
|
||||
<%!-- <div class="carousel carousel-center !bg-neutral rounded-box max-w-4xl space-x-6 p-4">
|
||||
|
||||
|
||||
@@ -225,7 +225,8 @@ defmodule WandererAppWeb.AccessListsLive do
|
||||
"add_members",
|
||||
%{"member_id" => member_id} = _params,
|
||||
%{assigns: assigns} = socket
|
||||
) when is_binary(member_id) and member_id != "" do
|
||||
)
|
||||
when is_binary(member_id) and member_id != "" do
|
||||
member_option =
|
||||
assigns.member_search_options
|
||||
|> Enum.find(&(&1.value == member_id))
|
||||
@@ -252,7 +253,7 @@ defmodule WandererAppWeb.AccessListsLive do
|
||||
socket
|
||||
|> assign(access_lists: access_lists |> Enum.map(fn acl -> map_ui_acl(acl, nil) end))}
|
||||
|
||||
error ->
|
||||
_error ->
|
||||
{:noreply,
|
||||
socket
|
||||
|> put_flash(
|
||||
|
||||
@@ -169,19 +169,4 @@ defmodule WandererAppWeb.MapAuditLive do
|
||||
_ -> socket
|
||||
end
|
||||
end
|
||||
|
||||
defp map_ui_character(character) do
|
||||
character
|
||||
|> Map.take([
|
||||
:id,
|
||||
:eve_id,
|
||||
:name,
|
||||
:corporation_id,
|
||||
:corporation_name,
|
||||
:corporation_ticker,
|
||||
:alliance_id,
|
||||
:alliance_name,
|
||||
:alliance_ticker
|
||||
])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -107,7 +107,7 @@ defmodule WandererAppWeb.MapsLive do
|
||||
subscription_form = %{
|
||||
"plan" => "omega",
|
||||
"period" => "1",
|
||||
"characters_limit" => "100",
|
||||
"characters_limit" => "300",
|
||||
"hubs_limit" => "10",
|
||||
"auto_renew?" => true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user