Files
DodoSSH/src/DodoSSH.Client.Android/Views/ServerScreen.axaml
T

71 lines
3.7 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:DodoSSH.Client.Shell.ViewModels"
x:Class="DodoSSH.Client.Android.Views.ServerScreen"
x:DataType="vm:MainWindowViewModel"
Background="{StaticResource Canvas}">
<!--
Not in the design, which starts at an enrolled phone — but it is ShellState.NeedsServer and the only
state that requires a network, so a head without it cannot be used on a phone that has never signed in.
One field and one button. Everything about the identity provider comes from the server's own
/.well-known/dodossh-configuration, so there is no authority, client id or scope to type — which is the
whole reason this screen is one box on a phone rather than a form.
-->
<ScrollViewer>
<StackPanel Margin="24,0" VerticalAlignment="Center" Spacing="0">
<StackPanel Spacing="10" HorizontalAlignment="Center" Margin="0,48,0,36">
<!--
Filled rather than outlined since v2, the same mark the header, the desktop titlebar and the
launcher icon carry. The radius is not picked: the mark runs 6 at 20 and 8 at 26, a third of a
unit per unit of tile, and lands on 14 at 44.
◆ That used to be a rung of Phone.axaml's own ladder too — 14, the one for a block of monospaced
output, which this glyph reads as — and the coincidence was worth a sentence: one fewer number
the ladder had to introduce. It is a coincidence no longer. v5's ladder moves output to 12 and
never reaches 14 at all, so the mark's own 6/8/14 progression stands on its own now rather than
borrowing a card- or output-shaped justification — a self-contained proportion for a badge that
answers to nothing but its own three sizes. Left at 14 rather than moved to 12 with everything
else: the ladder governs content surfaces, and this is a mark, sized off its own tile rather than
off what it holds.
-->
<Border Width="44" Height="44" CornerRadius="14" Background="{StaticResource Accent}"
HorizontalAlignment="Center">
<TextBlock Text="&gt;_" Foreground="{StaticResource AccentInk}" FontFamily="{StaticResource MonoFont}"
FontSize="16" FontWeight="Bold"
HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<TextBlock Classes="title" Text="DodoSSH" HorizontalAlignment="Center" />
</StackPanel>
<TextBlock Classes="label" Text="SERVER" />
<TextBox Classes="field" Margin="0,6,0,0" Text="{Binding ServerUrl}"
PlaceholderText="https://dodossh.example.com"
IsEnabled="{Binding !IsBusy}">
<TextBox.KeyBindings>
<KeyBinding Gesture="Enter" Command="{Binding SignInCommand}" />
</TextBox.KeyBindings>
</TextBox>
<Button Classes="primary" Content="SIGN IN" Margin="0,10,0,0"
Command="{Binding SignInCommand}" IsEnabled="{Binding !IsBusy}" />
<!--
Said before the browser opens rather than after. RFC 8252 §8.12 requires the system browser and not
an embedded one, which means the user is about to be handed to another application — and an SSH
client that bounces you out to Chrome with no warning looks like it has crashed.
-->
<TextBlock Classes="detail" Margin="0,14,0,0" TextWrapping="Wrap" TextAlignment="Center"
Text="opens your browser to sign in · DodoSSH never sees your password" />
<TextBlock Classes="body" Margin="0,16,0,0" TextAlignment="Center" Text="{Binding StatusMessage}" />
</StackPanel>
</ScrollViewer>
</UserControl>