Add very basic but functional support for authentication and custom servers

This commit is contained in:
Alexander Horner
2022-12-06 19:37:39 +00:00
parent b66620c9da
commit 0a11d5a583
9 changed files with 662 additions and 105 deletions

View File

@@ -30,10 +30,16 @@ namespace ntfysh_client
private void InitializeComponent()
{
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.topicId = new System.Windows.Forms.TextBox();
this.serverUrl = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.username = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.password = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
@@ -43,23 +49,11 @@ namespace ntfysh_client
this.panel1.Controls.Add(this.button2);
this.panel1.Controls.Add(this.button1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 81);
this.panel1.Location = new System.Drawing.Point(0, 175);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(297, 44);
this.panel1.TabIndex = 0;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(212, 11);
this.button1.Margin = new System.Windows.Forms.Padding(3, 10, 10, 10);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Subscribe";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -72,10 +66,22 @@ namespace ntfysh_client
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button1.Location = new System.Drawing.Point(212, 11);
this.button1.Margin = new System.Windows.Forms.Padding(3, 10, 10, 10);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 2;
this.button1.Text = "Subscribe";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 23);
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(51, 13);
this.label1.TabIndex = 1;
@@ -83,20 +89,85 @@ namespace ntfysh_client
//
// topicId
//
this.topicId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.topicId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.topicId.Location = new System.Drawing.Point(15, 39);
this.topicId.Location = new System.Drawing.Point(12, 25);
this.topicId.Name = "topicId";
this.topicId.Size = new System.Drawing.Size(273, 20);
this.topicId.TabIndex = 0;
this.topicId.KeyDown += new System.Windows.Forms.KeyEventHandler(this.topicId_KeyDown);
//
// serverUrl
//
this.serverUrl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.serverUrl.Location = new System.Drawing.Point(12, 64);
this.serverUrl.Name = "serverUrl";
this.serverUrl.Size = new System.Drawing.Size(273, 20);
this.serverUrl.TabIndex = 2;
this.serverUrl.Text = "https://ntfy.sh";
this.serverUrl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.serverUrl_KeyDown);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(10, 48);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(66, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Server URL:";
//
// username
//
this.username.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.username.Location = new System.Drawing.Point(12, 103);
this.username.Name = "username";
this.username.Size = new System.Drawing.Size(273, 20);
this.username.TabIndex = 4;
this.username.KeyDown += new System.Windows.Forms.KeyEventHandler(this.username_KeyDown);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(10, 87);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(58, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Username:";
//
// password
//
this.password.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.password.Location = new System.Drawing.Point(12, 142);
this.password.Name = "password";
this.password.Size = new System.Drawing.Size(273, 20);
this.password.TabIndex = 6;
this.password.UseSystemPasswordChar = true;
this.password.KeyDown += new System.Windows.Forms.KeyEventHandler(this.password_KeyDown);
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(10, 126);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(56, 13);
this.label4.TabIndex = 7;
this.label4.Text = "Password:";
//
// SubscribeDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(297, 125);
this.ClientSize = new System.Drawing.Size(297, 219);
this.Controls.Add(this.password);
this.Controls.Add(this.label4);
this.Controls.Add(this.username);
this.Controls.Add(this.label3);
this.Controls.Add(this.serverUrl);
this.Controls.Add(this.label2);
this.Controls.Add(this.topicId);
this.Controls.Add(this.label1);
this.Controls.Add(this.panel1);
@@ -114,6 +185,9 @@ namespace ntfysh_client
}
private System.Windows.Forms.TextBox serverUrl;
private System.Windows.Forms.Label label2;
#endregion
private System.Windows.Forms.Panel panel1;
@@ -121,5 +195,9 @@ namespace ntfysh_client
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox topicId;
private System.Windows.Forms.TextBox username;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox password;
private System.Windows.Forms.Label label4;
}
}