1
0

Add key to li elements for servers.

This improves performance. If a new server was to be added interactively, then ALL li elements would update. With this key, only the new li element will be added.
This commit is contained in:
Kevin Matsubara 2025-03-25 23:57:26 +01:00
parent b02d6d2bb9
commit ea04b947e8

View File

@ -38,7 +38,7 @@
<ul> <ul>
@foreach(var server in servers) @foreach(var server in servers)
{ {
<li> <li @key="server.Id">
@server.Name in @server.City is @server.Name in @server.City is
<span style="color:@(server.IsOnline ? "green" : "red")"> <span style="color:@(server.IsOnline ? "green" : "red")">
@(server.IsOnline ? "online" : "offline") @(server.IsOnline ? "online" : "offline")