示例#1
0
        private async void DoLogin(object btn, RoutedEventArgs args)
        {
            if (this.Token.Text.Length == 0)
            {
                return;
            }
            var client = new SelectelApi(this.Token.Text);

            try
            {
                if (!client.Servers.Dashboard.Maintenance().Status)
                {
                    var vault = new PasswordVault();
                    vault.Add(new PasswordCredential("selectel", "default", this.Token.Text));
                    this.OnSuccess?.Invoke();
                }
                else
                {
                    await new MessageDialog("Error").ShowAsync();
                }
            }
            catch (Exception)
            {
                await new MessageDialog(Utils.LocString("Login/Error")).ShowAsync();
            }
        }
示例#2
0
 public Login()
 {
     this.InitializeComponent();
     this.Logo.Source      = new SvgImageSource(Utils.AssetPath("logo.svg"));
     this.LoginBtn.Content = new TextBlock {
         Text = Utils.LocString("Login/Login")
     };
     this.Token.PlaceholderText = Utils.LocString("Login/TokenPlacehodler");
 }