wire up allowDefault, allowManaged, allowGlobal, allowDefault options

This commit is contained in:
Grant Limberg 2016-11-04 14:50:07 -07:00
parent efcc24a76b
commit 1ab9c43135
3 changed files with 12 additions and 4 deletions

View File

@ -107,7 +107,7 @@ namespace WinUI
} }
} }
public void JoinNetwork(string nwid, bool allowManaged = false, bool allowGlobal = false, bool allowDefault = false) public void JoinNetwork(string nwid, bool allowManaged = true, bool allowGlobal = false, bool allowDefault = false)
{ {
var request = WebRequest.Create(url + "/network/" + nwid + "?auth=" + authtoken) as HttpWebRequest; var request = WebRequest.Create(url + "/network/" + nwid + "?auth=" + authtoken) as HttpWebRequest;
if (request == null) if (request == null)

View File

@ -65,9 +65,9 @@
<TextBlock x:Name="bridgingEnabled" FontFamily="Lucida Console" TextWrapping="Wrap" Text="DISABLED" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="7" Background="#FFEEEEEE" Foreground="#FF000000"/> <TextBlock x:Name="bridgingEnabled" FontFamily="Lucida Console" TextWrapping="Wrap" Text="DISABLED" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="7" Background="#FFEEEEEE" Foreground="#FF000000"/>
<TextBlock x:Name="deviceName" FontFamily="Lucida Console" TextWrapping="Wrap" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="8" Foreground="#FF000000"><Span><Run Text="ethernet_32771"/></Span></TextBlock> <TextBlock x:Name="deviceName" FontFamily="Lucida Console" TextWrapping="Wrap" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="8" Foreground="#FF000000"><Span><Run Text="ethernet_32771"/></Span></TextBlock>
<TextBlock x:Name="managedIps" TextWrapping="Wrap" FontFamily="Lucida Console" HorizontalAlignment="Right" TextAlignment="Right" Grid.Column="2" Grid.Row="9" Foreground="#FF000000"><Span><Run Text="28.2.169.248/7 "/></Span><LineBreak/><Span><Run Text="fd80:56c2:e21c:0000:0199:9383:4a02:a9f8/88"/></Span></TextBlock> <TextBlock x:Name="managedIps" TextWrapping="Wrap" FontFamily="Lucida Console" HorizontalAlignment="Right" TextAlignment="Right" Grid.Column="2" Grid.Row="9" Foreground="#FF000000"><Span><Run Text="28.2.169.248/7 "/></Span><LineBreak/><Span><Run Text="fd80:56c2:e21c:0000:0199:9383:4a02:a9f8/88"/></Span></TextBlock>
<CheckBox x:Name="allowGlobal" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="10" Checked="AllowGlobal_CheckStateChanged" Unchecked="AllowGlobal_CheckStateChanged"/> <CheckBox x:Name="allowGlobal" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="10" />
<CheckBox x:Name="allowManaged" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="11" Checked="AllowManaged_CheckStateChanged" Unchecked="AllowManaged_CheckStateChanged"/> <CheckBox x:Name="allowManaged" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="11" />
<CheckBox x:Name="allowDefault" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="12" Checked="AllowDefault_CheckStateChanged" Unchecked="AllowDefault_CheckStateChanged"/> <CheckBox x:Name="allowDefault" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="12" />
<Separator Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/> <Separator Grid.Column="0" Grid.Row="13" Grid.ColumnSpan="3"/>

View File

@ -58,6 +58,14 @@ namespace WinUI
this.allowDefault.IsChecked = network.AllowDefault; this.allowDefault.IsChecked = network.AllowDefault;
this.allowGlobal.IsChecked = network.AllowGlobal; this.allowGlobal.IsChecked = network.AllowGlobal;
this.allowManaged.IsChecked = network.AllowManaged; this.allowManaged.IsChecked = network.AllowManaged;
allowDefault.Checked += AllowDefault_CheckStateChanged;
allowDefault.Unchecked += AllowDefault_CheckStateChanged;
allowGlobal.Checked += AllowGlobal_CheckStateChanged;
allowGlobal.Unchecked += AllowGlobal_CheckStateChanged;
allowManaged.Checked += AllowManaged_CheckStateChanged;
allowManaged.Unchecked += AllowManaged_CheckStateChanged;
} }
public bool HasNetwork(ZeroTierNetwork network) public bool HasNetwork(ZeroTierNetwork network)