|
13 | 13 |
|
14 | 14 | <Page.Resources>
|
15 | 15 | <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
16 |
| - <converters:InverseBoolToVisibilityConverter x:Key="InverseBoolToVisibilityConverter" /> |
17 | 16 |
|
18 | 17 | <converters:VpnLifecycleToBoolConverter x:Key="ConnectingBoolConverter" Unknown="true" Starting="true"
|
19 | 18 | Stopping="true" />
|
20 | 19 | <converters:VpnLifecycleToBoolConverter x:Key="NotConnectingBoolConverter" Started="true" Stopped="true" />
|
21 | 20 | <converters:VpnLifecycleToBoolConverter x:Key="StoppedBoolConverter" Stopped="true" />
|
22 |
| - <converters:VpnLifecycleToVisibilityConverter x:Key="StartedVisibilityConverter" Started="true" /> |
23 |
| - <converters:VpnLifecycleToVisibilityConverter x:Key="NotStartedVisibilityConverter" Starting="true" |
24 |
| - Stopping="true" Stopped="true" /> |
25 | 21 |
|
26 | 22 | <converters:AgentStatusToColorConverter x:Key="AgentStatusToColorConverter" />
|
27 | 23 | <converters:BoolToObjectConverter x:Key="ShowMoreLessTextConverter" TrueValue="Show less"
|
|
67 | 63 |
|
68 | 64 | <controls:HorizontalRule />
|
69 | 65 |
|
| 66 | + <TextBlock |
| 67 | + Text="{x:Bind ViewModel.VpnFailedMessage, Mode=OneWay}" |
| 68 | + Foreground="Red" |
| 69 | + Margin="0,6,0,6" |
| 70 | + TextWrapping="Wrap" |
| 71 | + Visibility="{x:Bind ViewModel.ShowFailedSection, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" /> |
| 72 | + |
| 73 | + <TextBlock |
| 74 | + Text="Enable CoderVPN to view your workspaces." |
| 75 | + TextWrapping="Wrap" |
| 76 | + Margin="0,6,0,6" |
| 77 | + Visibility="{x:Bind ViewModel.ShowEnableSection, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" |
| 78 | + Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
| 79 | + |
70 | 80 | <TextBlock
|
71 | 81 | Text="Workspaces"
|
72 | 82 | FontWeight="semibold"
|
| 83 | + Visibility="{x:Bind ViewModel.ShowWorkspacesHeader, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" |
73 | 84 | Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
74 | 85 |
|
75 | 86 | <TextBlock
|
76 |
| - Text="Enable CoderVPN to view your workspaces." |
| 87 | + Text="There are no workspace agents to display." |
77 | 88 | TextWrapping="Wrap"
|
78 | 89 | Margin="0,0,0,6"
|
79 |
| - Visibility="{x:Bind ViewModel.VpnLifecycle, Converter={StaticResource NotStartedVisibilityConverter}, Mode=OneWay}" |
| 90 | + Visibility="{x:Bind ViewModel.ShowNoAgentsSection, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" |
80 | 91 | Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" />
|
81 | 92 |
|
82 |
| - <StackPanel |
83 |
| - Orientation="Vertical" |
84 |
| - Visibility="{x:Bind ViewModel.VpnLifecycle, Converter={StaticResource StartedVisibilityConverter}, Mode=OneWay}"> |
85 |
| - |
86 |
| - <TextBlock |
87 |
| - Text="There are no workspace agents to display." |
88 |
| - TextWrapping="Wrap" |
89 |
| - Margin="0,0,0,6" |
90 |
| - Visibility="{x:Bind ViewModel.NoAgents, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" |
91 |
| - Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
92 |
| - |
93 |
| - <ItemsRepeater |
94 |
| - ItemsSource="{x:Bind ViewModel.VisibleAgents, Mode=OneWay}" |
95 |
| - Visibility="{x:Bind ViewModel.NoAgents, Converter={StaticResource InverseBoolToVisibilityConverter}, Mode=OneWay}"> |
96 |
| - |
97 |
| - <ItemsRepeater.Layout> |
98 |
| - <StackLayout Orientation="Vertical" /> |
99 |
| - </ItemsRepeater.Layout> |
100 |
| - |
101 |
| - <ItemsRepeater.ItemTemplate> |
102 |
| - <DataTemplate x:DataType="viewModels:AgentViewModel"> |
103 |
| - <Grid> |
104 |
| - <Grid.ColumnDefinitions> |
105 |
| - <ColumnDefinition Width="*" /> |
106 |
| - <ColumnDefinition Width="Auto" /> |
107 |
| - </Grid.ColumnDefinitions> |
108 |
| - |
109 |
| - <HyperlinkButton |
110 |
| - Grid.Column="0" |
111 |
| - NavigateUri="{x:Bind DashboardUrl, Mode=OneWay}" |
112 |
| - Margin="-12,0,0,0" |
| 93 | + <ItemsRepeater |
| 94 | + ItemsSource="{x:Bind ViewModel.VisibleAgents, Mode=OneWay}" |
| 95 | + Visibility="{x:Bind ViewModel.ShowAgentsSection, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}"> |
| 96 | + |
| 97 | + <ItemsRepeater.Layout> |
| 98 | + <StackLayout Orientation="Vertical" /> |
| 99 | + </ItemsRepeater.Layout> |
| 100 | + |
| 101 | + <ItemsRepeater.ItemTemplate> |
| 102 | + <DataTemplate x:DataType="viewModels:AgentViewModel"> |
| 103 | + <Grid> |
| 104 | + <Grid.ColumnDefinitions> |
| 105 | + <ColumnDefinition Width="*" /> |
| 106 | + <ColumnDefinition Width="Auto" /> |
| 107 | + </Grid.ColumnDefinitions> |
| 108 | + |
| 109 | + <HyperlinkButton |
| 110 | + Grid.Column="0" |
| 111 | + NavigateUri="{x:Bind DashboardUrl, Mode=OneWay}" |
| 112 | + Margin="-12,0,0,0" |
| 113 | + HorizontalAlignment="Stretch" |
| 114 | + HorizontalContentAlignment="Left"> |
| 115 | + |
| 116 | + <StackPanel |
| 117 | + Orientation="Horizontal" |
113 | 118 | HorizontalAlignment="Stretch"
|
114 |
| - HorizontalContentAlignment="Left"> |
115 |
| - |
116 |
| - <StackPanel |
117 |
| - Orientation="Horizontal" |
| 119 | + Spacing="10"> |
| 120 | + |
| 121 | + <Canvas |
| 122 | + HorizontalAlignment="Center" |
| 123 | + VerticalAlignment="Center" |
| 124 | + Height="14" Width="14" |
| 125 | + Margin="0,1,0,0"> |
| 126 | + |
| 127 | + <Ellipse |
| 128 | + Fill="{x:Bind ConnectionStatus, Converter={StaticResource AgentStatusToColorConverter}, Mode=OneWay}" |
| 129 | + Opacity="0.2" |
| 130 | + Width="14" |
| 131 | + Height="14" |
| 132 | + Canvas.Left="0" |
| 133 | + Canvas.Top="0" /> |
| 134 | + |
| 135 | + <Ellipse |
| 136 | + Fill="{x:Bind ConnectionStatus, Converter={StaticResource AgentStatusToColorConverter}, Mode=OneWay}" |
| 137 | + Width="8" |
| 138 | + Height="8" |
| 139 | + VerticalAlignment="Center" |
| 140 | + Canvas.Left="3" |
| 141 | + Canvas.Top="3" /> |
| 142 | + </Canvas> |
| 143 | + |
| 144 | + <!-- See .cs for why the Loaded event handler is needed --> |
| 145 | + <!-- TODO: I couldn't get ellipsis to work without hardcoding a width here --> |
| 146 | + <TextBlock |
| 147 | + Loaded="AgentHostnameText_OnLoaded" |
| 148 | + VerticalAlignment="Center" |
118 | 149 | HorizontalAlignment="Stretch"
|
119 |
| - Spacing="10"> |
| 150 | + HorizontalTextAlignment="Left" |
| 151 | + TextTrimming="CharacterEllipsis" |
| 152 | + TextWrapping="NoWrap" |
| 153 | + Width="180"> |
| 154 | + |
| 155 | + <Run Text="{x:Bind Hostname, Mode=OneWay}" |
| 156 | + Foreground="{ThemeResource DefaultTextForegroundThemeBrush}" /> |
| 157 | + <Run Text="{x:Bind HostnameSuffix, Mode=OneWay}" |
| 158 | + Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
| 159 | + </TextBlock> |
| 160 | + </StackPanel> |
| 161 | + </HyperlinkButton> |
| 162 | + |
| 163 | + <HyperlinkButton |
| 164 | + Grid.Column="1" |
| 165 | + x:Name="AgentHostnameCopyButton" |
| 166 | + Command="{x:Bind CopyHostnameCommand}" |
| 167 | + CommandParameter="{Binding ElementName=AgentHostnameCopyButton}" |
| 168 | + Margin="0,0,-12,0" |
| 169 | + VerticalAlignment="Stretch"> |
| 170 | + |
| 171 | + <FontIcon |
| 172 | + Glyph="" |
| 173 | + FontSize="16" |
| 174 | + Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
| 175 | + </HyperlinkButton> |
| 176 | + </Grid> |
| 177 | + </DataTemplate> |
| 178 | + </ItemsRepeater.ItemTemplate> |
| 179 | + </ItemsRepeater> |
120 | 180 |
|
121 |
| - <Canvas |
122 |
| - HorizontalAlignment="Center" |
123 |
| - VerticalAlignment="Center" |
124 |
| - Height="14" Width="14" |
125 |
| - Margin="0,1,0,0"> |
126 |
| - |
127 |
| - <Ellipse |
128 |
| - Fill="{x:Bind ConnectionStatus, Converter={StaticResource AgentStatusToColorConverter}, Mode=OneWay}" |
129 |
| - Opacity="0.2" |
130 |
| - Width="14" |
131 |
| - Height="14" |
132 |
| - Canvas.Left="0" |
133 |
| - Canvas.Top="0" /> |
134 |
| - |
135 |
| - <Ellipse |
136 |
| - Fill="{x:Bind ConnectionStatus, Converter={StaticResource AgentStatusToColorConverter}, Mode=OneWay}" |
137 |
| - Width="8" |
138 |
| - Height="8" |
139 |
| - VerticalAlignment="Center" |
140 |
| - Canvas.Left="3" |
141 |
| - Canvas.Top="3" /> |
142 |
| - </Canvas> |
143 |
| - |
144 |
| - <!-- See .cs for why the Loaded event handler is needed --> |
145 |
| - <!-- TODO: I couldn't get ellipsis to work without hardcoding a width here --> |
146 |
| - <TextBlock |
147 |
| - Loaded="AgentHostnameText_OnLoaded" |
148 |
| - VerticalAlignment="Center" |
149 |
| - HorizontalAlignment="Stretch" |
150 |
| - HorizontalTextAlignment="Left" |
151 |
| - TextTrimming="CharacterEllipsis" |
152 |
| - TextWrapping="NoWrap" |
153 |
| - Width="180"> |
154 |
| - |
155 |
| - <Run Text="{x:Bind Hostname, Mode=OneWay}" |
156 |
| - Foreground="{ThemeResource DefaultTextForegroundThemeBrush}" /> |
157 |
| - <Run Text="{x:Bind HostnameSuffix, Mode=OneWay}" |
158 |
| - Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
159 |
| - </TextBlock> |
160 |
| - </StackPanel> |
161 |
| - </HyperlinkButton> |
162 |
| - |
163 |
| - <HyperlinkButton |
164 |
| - Grid.Column="1" |
165 |
| - x:Name="AgentHostnameCopyButton" |
166 |
| - Command="{x:Bind CopyHostnameCommand}" |
167 |
| - CommandParameter="{Binding ElementName=AgentHostnameCopyButton}" |
168 |
| - Margin="0,0,-12,0" |
169 |
| - VerticalAlignment="Stretch"> |
170 |
| - |
171 |
| - <FontIcon |
172 |
| - Glyph="" |
173 |
| - FontSize="16" |
174 |
| - Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
175 |
| - </HyperlinkButton> |
176 |
| - </Grid> |
177 |
| - </DataTemplate> |
178 |
| - </ItemsRepeater.ItemTemplate> |
179 |
| - </ItemsRepeater> |
180 |
| - |
181 |
| - <HyperlinkButton |
182 |
| - Margin="-12,10,-12,0" |
183 |
| - HorizontalAlignment="Stretch" |
184 |
| - HorizontalContentAlignment="Left" |
185 |
| - Visibility="{x:Bind ViewModel.AgentOverflow, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" |
186 |
| - Command="{x:Bind ViewModel.ToggleShowAllAgentsCommand}"> |
187 |
| - |
188 |
| - <TextBlock |
189 |
| - Text="{x:Bind ViewModel.ShowAllAgents, Converter={StaticResource ShowMoreLessTextConverter}, Mode=OneWay}" |
190 |
| - Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
191 |
| - </HyperlinkButton> |
192 |
| - </StackPanel> |
| 181 | + <HyperlinkButton |
| 182 | + Margin="-12,0,-12,0" |
| 183 | + HorizontalAlignment="Stretch" |
| 184 | + HorizontalContentAlignment="Left" |
| 185 | + Visibility="{x:Bind ViewModel.ShowAgentOverflowButton, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay}" |
| 186 | + Command="{x:Bind ViewModel.ToggleShowAllAgentsCommand}"> |
| 187 | + |
| 188 | + <TextBlock |
| 189 | + Text="{x:Bind ViewModel.ShowAllAgents, Converter={StaticResource ShowMoreLessTextConverter}, Mode=OneWay}" |
| 190 | + Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}" /> |
| 191 | + </HyperlinkButton> |
193 | 192 |
|
194 | 193 | <controls:HorizontalRule />
|
195 | 194 |
|
|
0 commit comments