@page "/Settings/Beacon" @using LANCommander.SDK.Services @using LANCommander.Server.Settings @using Microsoft.Extensions.Options @inject BeaconClient BeaconClient @inject IOptions Settings @inject SettingsProvider SettingsProvider @inject IMessageService MessageService @inject ILogger Logger @attribute [Authorize(Roles = RoleService.AdministratorRoleName)]
Enabling the beacon will allow clients on the same network to auto-discover the LANCommander address. Use this to customize the name that is broadcasted to clients. Use this to customize the address that is broadcasted to clients. Default: http://<Server IP>:@context.Server.Beacon.Port
@code { async Task Save() { try { SettingsProvider.Update(s => { s.Server.Beacon = Settings.Value.Server.Beacon; }); MessageService.Success("Settings saved!"); if (Settings.Value.Server.Beacon.Enabled) await BeaconClient.StartBeaconAsync(Settings.Value.Server.Beacon.Port, Settings.Value.Server.Beacon.Address, Settings.Value.Server.Beacon.Name); else await BeaconClient.StopBeaconAsync(); } catch (Exception ex) { MessageService.Error("An unknown error occurred."); Logger.LogError(ex, "An unknown error occurred."); } } }