diff --git a/lib/tietopaketti_web/live/dash_live/index.ex b/lib/tietopaketti_web/live/dash_live/index.ex index f1d6e45..dab5990 100644 --- a/lib/tietopaketti_web/live/dash_live/index.ex +++ b/lib/tietopaketti_web/live/dash_live/index.ex @@ -4,7 +4,7 @@ defmodule TietopakettiWeb.DashLive.Index do def mount(_params, _session, socket) do socket = - assign(socket, instance: Application.fetch_env!(:tietopaketti, :instance), sysdata: nil) + assign(socket, instance: Application.fetch_env!(:tietopaketti, :instance), sysdata: nil, counter: 0) if connected?(socket) do Phoenix.PubSub.subscribe(Tietopaketti.PubSub, Tietopaketti.Sysmon.pubsub_topic()) @@ -16,7 +16,7 @@ defmodule TietopakettiWeb.DashLive.Index do def handle_info(msg, socket) def handle_info({Tietopaketti.Sysdata, sysdata}, socket) do - {:noreply, assign(socket, sysdata: sysdata)} + {:noreply, assign(socket, sysdata: sysdata, counter: socket.assigns.counter + 1)} end def handle_info(_msg, socket) do diff --git a/lib/tietopaketti_web/live/dash_live/index.html.heex b/lib/tietopaketti_web/live/dash_live/index.html.heex index 097bd30..5615085 100644 --- a/lib/tietopaketti_web/live/dash_live/index.html.heex +++ b/lib/tietopaketti_web/live/dash_live/index.html.heex @@ -12,6 +12,7 @@ value={cpu} max={100} value-display={"#{Float.round(cpu)} %"} + counter={@counter} /> <% end %> @@ -30,6 +31,7 @@ @sysdata.mem.total_ram, true )}"} + counter={@counter} />
@@ -43,6 +45,7 @@ @sysdata.mem.total_swap, true )}"} + counter={@counter} />
@@ -61,6 +64,7 @@ disk.total * 1024, true )}"} + counter={@counter} />
@@ -70,6 +74,7 @@ label={"W: #{disk.path}"} value={sector_diff_bytes(disk.prev_stats, disk.stats, &writes_getter/1)} value-display={"R #{humanize_size_si(sector_diff_bytes(disk.prev_stats, disk.stats, &reads_getter/1), true)} | W #{humanize_size_si(sector_diff_bytes(disk.prev_stats, disk.stats, &writes_getter/1), true)}"} + counter={@counter} />
<% end %> diff --git a/mix.exs b/mix.exs index 45d7125..58be03a 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Tietopaketti.MixProject do def project do [ app: :tietopaketti, - version: "1.2.6", + version: "1.2.7", elixir: "~> 1.15", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod,