Example #1
0
        private async Task Remove(Infrastructure.Schema.Whitelist row)
        {
            var confirmed = await JSRuntime.InvokeAsync <bool>("confirm", new object[] { $"Remove rule '{row.Pattern}'?" });

            if (confirmed)
            {
                WhitelistModel.Remove(row);
                _whitelistTable !.InvalidateData();
                await ReloadWhitelist();
            }
        }
Example #2
0
        private async Task Edit(Infrastructure.Schema.Whitelist row)
        {
            _editRule = row;
            _editing  = true;

            _editIPsList !.Set(row.IPs?.Select(v => v.ToString()) ?? new string[] { });
            _editSubnetsList !.Set(row.Subnets?.Select(v => v.ToString()) ?? new string[] { });
            _editHostnameList !.Set(row.Hostnames?.Select(v => v.ToString()) ?? new string[] { });
            _editMACsList !.Set(row.MACs?.Select(Utility.FormatMAC) ?? new string[] { });

            _vendorSelector !.Select(row.Vendors ?? new List <string>(), true);
            _vendorSelector !.UpdateFilterValue("");

            BuildHeaders();
            StateHasChanged();
            _onInputReset.Trigger();
            _onRowChange.Trigger();
        }