diff --git a/FrmLogin.cs b/FrmLogin.cs index c6bfa46..a778d28 100644 --- a/FrmLogin.cs +++ b/FrmLogin.cs @@ -1,5 +1,3 @@ -using Salaros.Configuration; - namespace PteroController { public partial class FrmLogin : Form @@ -8,46 +6,8 @@ public FrmLogin() { InitializeComponent(); } - - - private void Form1_Load(object sender, EventArgs e) - { - RPC discordRPC = new RPC(); - discordRPC.InitializeRPC(); - } - - private void CheckSession() - { - try - { - var account = new ConfigParser(Program.AppAccountInfo); - var EpanelUrl = account.GetValue("LOGIN", "panel_url"); - var EpanelApi = account.GetValue("LOGIN", "api_key"); - var EpanelPass = account.GetValue("LOGIN", "panel_pwd"); - if (EpanelApi == null || EpanelPass == null || EpanelApi == null) - { - - } - else - { - string panelUrl = Base64Encryption.Decrypt(EpanelUrl); - string panelAPI = Base64Encryption.Decrypt(EpanelApi); - string panelPass = Base64Encryption.Decrypt(EpanelPass); - txtpanelurl.Text = panelUrl; - txtpanelapikey.Text = panelAPI; - txtpanelpwd.Text = panelPass; - btnlogin.PerformClick(); - } - } - catch (Exception ex) - { - Console.WriteLine("Session Error: " + ex.Message); - Program.Alert("Failed to get session", FrmAlert.enmType.Error); - } - } - - private void btnlogin_Click(object sender, EventArgs e) + private async void btnlogin_Click(object sender, EventArgs e) { if (txtpanelurl.Text == "" && txtpanelapikey.Text == "") { @@ -61,8 +21,10 @@ private void btnlogin_Click(object sender, EventArgs e) Program.Alert("SFTP module disabled", FrmAlert.enmType.Warning); } #pragma warning disable - Pterodactyl.User.Info.Get(txtpanelurl.Text, txtpanelapikey.Text, txtpanelpwd.Text); - if (Pterodactyl.User.Info.panel_username != null && Pterodactyl.User.Info.panel_email!= null && Pterodactyl.User.Info.panel_id!= null) + await Pterodactyl.User.Info.Get(txtpanelurl.Text, txtpanelapikey.Text, txtpanelpwd.Text); + if (Pterodactyl.User.Info.panel_username != null && + Pterodactyl.User.Info.panel_email != null && + Pterodactyl.User.Info.panel_id != null) { FrmServerSelector x = new FrmServerSelector(); x.Show(); @@ -78,7 +40,7 @@ private void btnlogin_Click(object sender, EventArgs e) private void FrmLogin_Load(object sender, EventArgs e) { - CheckSession(); + } } } \ No newline at end of file diff --git a/FrmServerController.Designer.cs b/FrmServerController.Designer.cs index acda157..a0c7ccf 100644 --- a/FrmServerController.Designer.cs +++ b/FrmServerController.Designer.cs @@ -37,15 +37,16 @@ private void InitializeComponent() PageBackups = new TabPage(); navbar = new Panel(); lblappname = new Label(); + pbappicon = new PictureBox(); + separator = new Guna.UI2.WinForms.Guna2Separator(); lblminimize = new Label(); lblexit = new Label(); - pbappicon = new PictureBox(); subnavbar = new Panel(); - pblblpanellogo = new PictureBox(); - txtpanelname = new Label(); btnservers = new PictureBox(); btnlogout = new PictureBox(); pbavatar = new PictureBox(); + txtpanelname = new Label(); + pblblpanellogo = new PictureBox(); DragController = new Guna.UI2.WinForms.Guna2DragControl(components); AnimateWindow = new Guna.UI2.WinForms.Guna2AnimateWindow(components); Elipse = new Guna.UI2.WinForms.Guna2Elipse(components); @@ -53,10 +54,10 @@ private void InitializeComponent() navbar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pbappicon).BeginInit(); subnavbar.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)pblblpanellogo).BeginInit(); ((System.ComponentModel.ISupportInitialize)btnservers).BeginInit(); ((System.ComponentModel.ISupportInitialize)btnlogout).BeginInit(); ((System.ComponentModel.ISupportInitialize)pbavatar).BeginInit(); + ((System.ComponentModel.ISupportInitialize)pblblpanellogo).BeginInit(); SuspendLayout(); // // Pages @@ -115,7 +116,7 @@ private void InitializeComponent() // PageDatabases.Location = new Point(184, 4); PageDatabases.Name = "PageDatabases"; - PageDatabases.Size = new Size(830, 581); + PageDatabases.Size = new Size(830, 582); PageDatabases.TabIndex = 2; PageDatabases.Text = "Databases"; PageDatabases.UseVisualStyleBackColor = true; @@ -124,7 +125,7 @@ private void InitializeComponent() // PageBackups.Location = new Point(184, 4); PageBackups.Name = "PageBackups"; - PageBackups.Size = new Size(830, 581); + PageBackups.Size = new Size(830, 582); PageBackups.TabIndex = 3; PageBackups.Text = "Backups"; PageBackups.UseVisualStyleBackColor = true; @@ -133,9 +134,10 @@ private void InitializeComponent() // navbar.BackColor = Color.FromArgb(29, 37, 49); navbar.Controls.Add(lblappname); + navbar.Controls.Add(pbappicon); + navbar.Controls.Add(separator); navbar.Controls.Add(lblminimize); navbar.Controls.Add(lblexit); - navbar.Controls.Add(pbappicon); navbar.Controls.Add(subnavbar); navbar.Dock = DockStyle.Top; navbar.Location = new Point(0, 0); @@ -154,6 +156,24 @@ private void InitializeComponent() lblappname.TabIndex = 4; lblappname.Text = "PteroController (1.0.0)"; // + // pbappicon + // + pbappicon.Image = Properties.Resources.pterry1; + pbappicon.Location = new Point(3, 3); + pbappicon.Name = "pbappicon"; + pbappicon.Size = new Size(20, 20); + pbappicon.SizeMode = PictureBoxSizeMode.StretchImage; + pbappicon.TabIndex = 1; + pbappicon.TabStop = false; + // + // separator + // + separator.BackColor = Color.Transparent; + separator.Location = new Point(-79, 20); + separator.Name = "separator"; + separator.Size = new Size(1180, 10); + separator.TabIndex = 9; + // // lblminimize // lblminimize.AutoSize = true; @@ -178,51 +198,20 @@ private void InitializeComponent() lblexit.Text = "X"; lblexit.Click += lblexit_Click; // - // pbappicon - // - pbappicon.Image = Properties.Resources.pterry1; - pbappicon.Location = new Point(3, 3); - pbappicon.Name = "pbappicon"; - pbappicon.Size = new Size(20, 20); - pbappicon.SizeMode = PictureBoxSizeMode.StretchImage; - pbappicon.TabIndex = 1; - pbappicon.TabStop = false; - // // subnavbar // subnavbar.BackColor = Color.FromArgb(33, 42, 57); - subnavbar.Controls.Add(pblblpanellogo); - subnavbar.Controls.Add(txtpanelname); subnavbar.Controls.Add(btnservers); subnavbar.Controls.Add(btnlogout); subnavbar.Controls.Add(pbavatar); + subnavbar.Controls.Add(txtpanelname); + subnavbar.Controls.Add(pblblpanellogo); subnavbar.Dock = DockStyle.Bottom; subnavbar.Location = new Point(0, 24); subnavbar.Name = "subnavbar"; subnavbar.Size = new Size(1018, 38); subnavbar.TabIndex = 0; // - // pblblpanellogo - // - pblblpanellogo.Image = Properties.Resources.pterry1; - pblblpanellogo.Location = new Point(8, 3); - pblblpanellogo.Name = "pblblpanellogo"; - pblblpanellogo.Size = new Size(32, 32); - pblblpanellogo.SizeMode = PictureBoxSizeMode.StretchImage; - pblblpanellogo.TabIndex = 6; - pblblpanellogo.TabStop = false; - // - // txtpanelname - // - txtpanelname.AutoSize = true; - txtpanelname.Font = new Font("Segoe UI", 15F, FontStyle.Bold, GraphicsUnit.Point); - txtpanelname.ForeColor = Color.WhiteSmoke; - txtpanelname.Location = new Point(46, 3); - txtpanelname.Name = "txtpanelname"; - txtpanelname.Size = new Size(179, 28); - txtpanelname.TabIndex = 5; - txtpanelname.Text = "Pterodactyl Panel"; - // // btnservers // btnservers.Image = (Image)resources.GetObject("btnservers.Image"); @@ -232,6 +221,7 @@ private void InitializeComponent() btnservers.SizeMode = PictureBoxSizeMode.StretchImage; btnservers.TabIndex = 2; btnservers.TabStop = false; + btnservers.Click += btnservers_Click; // // btnlogout // @@ -242,6 +232,7 @@ private void InitializeComponent() btnlogout.SizeMode = PictureBoxSizeMode.StretchImage; btnlogout.TabIndex = 1; btnlogout.TabStop = false; + btnlogout.Click += btnlogout_Click; // // pbavatar // @@ -253,6 +244,27 @@ private void InitializeComponent() pbavatar.TabIndex = 0; pbavatar.TabStop = false; // + // txtpanelname + // + txtpanelname.AutoSize = true; + txtpanelname.Font = new Font("Segoe UI", 15F, FontStyle.Bold, GraphicsUnit.Point); + txtpanelname.ForeColor = Color.WhiteSmoke; + txtpanelname.Location = new Point(46, 3); + txtpanelname.Name = "txtpanelname"; + txtpanelname.Size = new Size(179, 28); + txtpanelname.TabIndex = 5; + txtpanelname.Text = "Pterodactyl Panel"; + // + // pblblpanellogo + // + pblblpanellogo.Image = Properties.Resources.pterry1; + pblblpanellogo.Location = new Point(8, 3); + pblblpanellogo.Name = "pblblpanellogo"; + pblblpanellogo.Size = new Size(32, 32); + pblblpanellogo.SizeMode = PictureBoxSizeMode.StretchImage; + pblblpanellogo.TabIndex = 6; + pblblpanellogo.TabStop = false; + // // DragController // DragController.DockIndicatorTransparencyValue = 0.6D; @@ -288,10 +300,10 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)pbappicon).EndInit(); subnavbar.ResumeLayout(false); subnavbar.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)pblblpanellogo).EndInit(); ((System.ComponentModel.ISupportInitialize)btnservers).EndInit(); ((System.ComponentModel.ISupportInitialize)btnlogout).EndInit(); ((System.ComponentModel.ISupportInitialize)pbavatar).EndInit(); + ((System.ComponentModel.ISupportInitialize)pblblpanellogo).EndInit(); ResumeLayout(false); } @@ -316,5 +328,6 @@ private void InitializeComponent() private PictureBox btnservers; private Label txtpanelname; private PictureBox pblblpanellogo; + private Guna.UI2.WinForms.Guna2Separator separator; } } \ No newline at end of file diff --git a/FrmServerController.cs b/FrmServerController.cs index 8ab51d1..3ef1145 100644 --- a/FrmServerController.cs +++ b/FrmServerController.cs @@ -32,6 +32,20 @@ private void lblexit_Click(object sender, EventArgs e) { Application.Exit(); } + + private void btnlogout_Click(object sender, EventArgs e) + { + FrmSessions x = new FrmSessions(); + x.Show(); + this.Hide(); + } + + private void btnservers_Click(object sender, EventArgs e) + { + FrmServerSelector x = new FrmServerSelector(); + x.Show(); + this.Hide(); + } } } \ No newline at end of file diff --git a/FrmServerController.resx b/FrmServerController.resx index fd44f57..148d39f 100644 --- a/FrmServerController.resx +++ b/FrmServerController.resx @@ -121,7 +121,7 @@ iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL - DwAACw8BkvkDpQAAAzdJREFUeF7tm02IjVEcxu/MhBoLWRhlwoKUlAWasJgy2RiRj0lShs3MRpGS2FBE + DQAACw0B7QfALAAAAzdJREFUeF7tm02IjVEcxu/MhBoLWRhlwoKUlAWasJgy2RiRj0lShs3MRpGS2FBE 1EQWForNYImVDQ0pdmPnY8dGSigWvvJxPf/zf+ad933dxft5nXM6v3o259z/c57/ae69877nvY1AIBAI BNpHs9nsgrZDV6FH0GQb9QC6BPUzzv8BAdZAzyEbkE1ZzGjtA4sOQF8kgUW8hZYxYv1gsR7og6xsIc+g mYxaL1hI3pc2c4BR6wOLzIA+muXsZZJx6wOL9OtaVvMHmsfI9YAFzpil7GcbI9cDFniq61jPBUauHpjP @@ -141,7 +141,7 @@ iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL - DwAACw8BkvkDpQAAArpJREFUeF7tmktPFFEQhUfjBl1BcOdCwKDga0E0blzjz9BfQDRujMYY16Ib/RPu + DQAACw0B7QfALAAAArpJREFUeF7tmktPFFEQhUfjBl1BcOdCwKDga0E0blzjz9BfQDRujMYY16Ib/RPu fPwRE18s3EHia6NC1IWOp24dMeCtMXTf7mrp+pKTMN01p85UmDu3e2YQBEEQBEEQFGQ4HB6A5qGFQhKv /bTvLgh5DnoKfYNKI55PoLNs1y0Q7Cb0E2oa6XGDbbsBAl1N0drlMtv7giBT0PcUqV2k5wxj+IEQ91Ic H5YZww+EeKVZXHjBGH4gxIZmyfIRelNT4mGxwRh+MIjFFMsqA49ptcrDMj+Yw+IQyyojHmqVh2V+MIdF diff --git a/FrmServerSelector.Designer.cs b/FrmServerSelector.Designer.cs index 4b9193a..d2c2bcc 100644 --- a/FrmServerSelector.Designer.cs +++ b/FrmServerSelector.Designer.cs @@ -28,43 +28,248 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmServerSelector)); lblwlc = new Label(); serverListBox = new ListBox(); + navbar = new Panel(); + guna2Separator1 = new Guna.UI2.WinForms.Guna2Separator(); + subnavbar = new Panel(); + pblblpanellogo = new PictureBox(); + txtpanelname = new Label(); + btnservers = new PictureBox(); + btnlogout = new PictureBox(); + pbavatar = new PictureBox(); + lblappname = new Label(); + lblminimize = new Label(); + lblexit = new Label(); + pbappicon = new PictureBox(); + DragController = new Guna.UI2.WinForms.Guna2DragControl(components); + Elipse = new Guna.UI2.WinForms.Guna2Elipse(components); + AnimateWindow = new Guna.UI2.WinForms.Guna2AnimateWindow(components); + lblwlcdsc = new Label(); + navbar.SuspendLayout(); + subnavbar.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pblblpanellogo).BeginInit(); + ((System.ComponentModel.ISupportInitialize)btnservers).BeginInit(); + ((System.ComponentModel.ISupportInitialize)btnlogout).BeginInit(); + ((System.ComponentModel.ISupportInitialize)pbavatar).BeginInit(); + ((System.ComponentModel.ISupportInitialize)pbappicon).BeginInit(); SuspendLayout(); // // lblwlc // lblwlc.AutoSize = true; - lblwlc.Location = new Point(12, 9); + lblwlc.Font = new Font("Segoe UI", 12F, FontStyle.Bold, GraphicsUnit.Point); + lblwlc.ForeColor = Color.White; + lblwlc.Location = new Point(12, 76); lblwlc.Name = "lblwlc"; - lblwlc.Size = new Size(129, 15); + lblwlc.Size = new Size(183, 21); lblwlc.TabIndex = 0; lblwlc.Text = "Hello ."; + lblwlc.Click += lblwlc_Click; // // serverListBox // + serverListBox.BackColor = Color.FromArgb(30, 49, 65); + serverListBox.BorderStyle = BorderStyle.FixedSingle; + serverListBox.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); + serverListBox.ForeColor = Color.White; serverListBox.FormattingEnabled = true; - serverListBox.ItemHeight = 15; - serverListBox.Location = new Point(12, 27); + serverListBox.ItemHeight = 17; + serverListBox.Location = new Point(12, 119); serverListBox.Name = "serverListBox"; - serverListBox.Size = new Size(776, 409); + serverListBox.Size = new Size(994, 495); serverListBox.TabIndex = 1; serverListBox.SelectedIndexChanged += serverListBox_SelectedIndexChanged; serverListBox.KeyDown += serverListBox_KeyDown; // + // navbar + // + navbar.BackColor = Color.FromArgb(29, 37, 49); + navbar.Controls.Add(guna2Separator1); + navbar.Controls.Add(subnavbar); + navbar.Controls.Add(lblappname); + navbar.Controls.Add(lblminimize); + navbar.Controls.Add(lblexit); + navbar.Controls.Add(pbappicon); + navbar.Dock = DockStyle.Top; + navbar.Location = new Point(0, 0); + navbar.Name = "navbar"; + navbar.Size = new Size(1018, 63); + navbar.TabIndex = 4; + // + // guna2Separator1 + // + guna2Separator1.Location = new Point(-149, 20); + guna2Separator1.Name = "guna2Separator1"; + guna2Separator1.Size = new Size(1180, 10); + guna2Separator1.TabIndex = 8; + // + // subnavbar + // + subnavbar.BackColor = Color.FromArgb(33, 42, 57); + subnavbar.Controls.Add(pblblpanellogo); + subnavbar.Controls.Add(txtpanelname); + subnavbar.Controls.Add(btnservers); + subnavbar.Controls.Add(btnlogout); + subnavbar.Controls.Add(pbavatar); + subnavbar.Dock = DockStyle.Bottom; + subnavbar.Location = new Point(0, 25); + subnavbar.Name = "subnavbar"; + subnavbar.Size = new Size(1018, 38); + subnavbar.TabIndex = 7; + // + // pblblpanellogo + // + pblblpanellogo.Image = Properties.Resources.pterry1; + pblblpanellogo.Location = new Point(8, 3); + pblblpanellogo.Name = "pblblpanellogo"; + pblblpanellogo.Size = new Size(32, 32); + pblblpanellogo.SizeMode = PictureBoxSizeMode.StretchImage; + pblblpanellogo.TabIndex = 6; + pblblpanellogo.TabStop = false; + // + // txtpanelname + // + txtpanelname.AutoSize = true; + txtpanelname.Font = new Font("Segoe UI", 15F, FontStyle.Bold, GraphicsUnit.Point); + txtpanelname.ForeColor = Color.WhiteSmoke; + txtpanelname.Location = new Point(46, 3); + txtpanelname.Name = "txtpanelname"; + txtpanelname.Size = new Size(179, 28); + txtpanelname.TabIndex = 5; + txtpanelname.Text = "Pterodactyl Panel"; + // + // btnservers + // + btnservers.Image = (Image)resources.GetObject("btnservers.Image"); + btnservers.Location = new Point(898, 4); + btnservers.Name = "btnservers"; + btnservers.Size = new Size(32, 32); + btnservers.SizeMode = PictureBoxSizeMode.StretchImage; + btnservers.TabIndex = 2; + btnservers.TabStop = false; + // + // btnlogout + // + btnlogout.Image = (Image)resources.GetObject("btnlogout.Image"); + btnlogout.Location = new Point(974, 4); + btnlogout.Name = "btnlogout"; + btnlogout.Size = new Size(32, 32); + btnlogout.SizeMode = PictureBoxSizeMode.StretchImage; + btnlogout.TabIndex = 1; + btnlogout.TabStop = false; + btnlogout.Click += btnlogout_Click; + // + // pbavatar + // + pbavatar.Image = Properties.Resources.test; + pbavatar.Location = new Point(936, 4); + pbavatar.Name = "pbavatar"; + pbavatar.Size = new Size(32, 32); + pbavatar.SizeMode = PictureBoxSizeMode.StretchImage; + pbavatar.TabIndex = 0; + pbavatar.TabStop = false; + pbavatar.Click += pbavatar_Click; + // + // lblappname + // + lblappname.AutoSize = true; + lblappname.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); + lblappname.ForeColor = Color.WhiteSmoke; + lblappname.Location = new Point(29, 3); + lblappname.Name = "lblappname"; + lblappname.Size = new Size(160, 19); + lblappname.TabIndex = 4; + lblappname.Text = "PteroController (1.0.0)"; + // + // lblminimize + // + lblminimize.AutoSize = true; + lblminimize.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); + lblminimize.ForeColor = Color.WhiteSmoke; + lblminimize.Location = new Point(981, 1); + lblminimize.Name = "lblminimize"; + lblminimize.Size = new Size(15, 19); + lblminimize.TabIndex = 3; + lblminimize.Text = "-"; + lblminimize.Click += lblminimize_Click; + // + // lblexit + // + lblexit.AutoSize = true; + lblexit.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); + lblexit.ForeColor = Color.WhiteSmoke; + lblexit.Location = new Point(997, 3); + lblexit.Name = "lblexit"; + lblexit.Size = new Size(18, 19); + lblexit.TabIndex = 2; + lblexit.Text = "X"; + lblexit.Click += lblexit_Click; + // + // pbappicon + // + pbappicon.Image = Properties.Resources.pterry1; + pbappicon.Location = new Point(3, 3); + pbappicon.Name = "pbappicon"; + pbappicon.Size = new Size(20, 20); + pbappicon.SizeMode = PictureBoxSizeMode.StretchImage; + pbappicon.TabIndex = 1; + pbappicon.TabStop = false; + // + // DragController + // + DragController.DockIndicatorTransparencyValue = 0.6D; + DragController.DragStartTransparencyValue = 0.6D; + DragController.TargetControl = navbar; + DragController.UseTransparentDrag = true; + // + // Elipse + // + Elipse.BorderRadius = 20; + Elipse.TargetControl = this; + // + // AnimateWindow + // + AnimateWindow.TargetForm = this; + // + // lblwlcdsc + // + lblwlcdsc.AutoSize = true; + lblwlcdsc.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); + lblwlcdsc.ForeColor = Color.White; + lblwlcdsc.Location = new Point(12, 97); + lblwlcdsc.Name = "lblwlcdsc"; + lblwlcdsc.Size = new Size(596, 19); + lblwlcdsc.TabIndex = 5; + lblwlcdsc.Text = "Welcome to PteroController! Let's start by selecting the server that you want to control."; + // // FrmServerSelector // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; - ClientSize = new Size(800, 450); + BackColor = Color.FromArgb(30, 45, 59); + ClientSize = new Size(1018, 635); + Controls.Add(lblwlcdsc); + Controls.Add(navbar); Controls.Add(serverListBox); Controls.Add(lblwlc); + FormBorderStyle = FormBorderStyle.None; Icon = (Icon)resources.GetObject("$this.Icon"); Name = "FrmServerSelector"; StartPosition = FormStartPosition.CenterScreen; Text = "PteroController"; Load += FrmServerSelector_Load; + navbar.ResumeLayout(false); + navbar.PerformLayout(); + subnavbar.ResumeLayout(false); + subnavbar.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pblblpanellogo).EndInit(); + ((System.ComponentModel.ISupportInitialize)btnservers).EndInit(); + ((System.ComponentModel.ISupportInitialize)btnlogout).EndInit(); + ((System.ComponentModel.ISupportInitialize)pbavatar).EndInit(); + ((System.ComponentModel.ISupportInitialize)pbappicon).EndInit(); ResumeLayout(false); PerformLayout(); } @@ -73,5 +278,21 @@ private void InitializeComponent() private Label lblwlc; private ListBox serverListBox; + private Panel navbar; + private Label lblappname; + private Label lblminimize; + private Label lblexit; + private PictureBox pbappicon; + private Guna.UI2.WinForms.Guna2DragControl DragController; + private Guna.UI2.WinForms.Guna2Elipse Elipse; + private Guna.UI2.WinForms.Guna2AnimateWindow AnimateWindow; + private Label lblwlcdsc; + private Panel subnavbar; + private PictureBox pblblpanellogo; + private Label txtpanelname; + private PictureBox btnservers; + private PictureBox btnlogout; + private PictureBox pbavatar; + private Guna.UI2.WinForms.Guna2Separator guna2Separator1; } } \ No newline at end of file diff --git a/FrmServerSelector.cs b/FrmServerSelector.cs index 7ebe061..781b5e9 100644 --- a/FrmServerSelector.cs +++ b/FrmServerSelector.cs @@ -20,7 +20,7 @@ private async void FrmServerSelector_Load(object sender, EventArgs e) lblwlc.Text = "Welcome, " + Pterodactyl.User.Info.panel_username; try { - #pragma warning disable +#pragma warning disable HttpResponseMessage response = await httpClient.GetAsync(Pterodactyl.User.Info.panel_url + "/api/client"); response.EnsureSuccessStatusCode(); string jsonResponse = await response.Content.ReadAsStringAsync(); @@ -35,7 +35,7 @@ private async void FrmServerSelector_Load(object sender, EventArgs e) serverListBox.DataSource = serverNames; serverListBox.ClearSelected(); isFirstLoad = true; - #pragma warning restore +#pragma warning restore } catch (Exception ex) { @@ -89,4 +89,31 @@ private void serverListBox_SelectedIndexChanged(object sender, EventArgs e) MessageBox.Show("We are sorry but we can't load the servers:\n" + ex.Message); } } + + private void lblwlc_Click(object sender, EventArgs e) + { + + } + + private void lblexit_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void lblminimize_Click(object sender, EventArgs e) + { + this.WindowState = FormWindowState.Minimized; + } + + private void btnlogout_Click(object sender, EventArgs e) + { + FrmSessions x = new FrmSessions(); + x.Show(); + this.Hide(); + } + + private void pbavatar_Click(object sender, EventArgs e) + { + + } } diff --git a/FrmServerSelector.resx b/FrmServerSelector.resx index be83ca5..078cec4 100644 --- a/FrmServerSelector.resx +++ b/FrmServerSelector.resx @@ -118,6 +118,50 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + DAAACwwBP0AiyAAAAzdJREFUeF7tm02IjVEcxu/MhBoLWRhlwoKUlAWasJgy2RiRj0lShs3MRpGS2FBE + 1EQWForNYImVDQ0pdmPnY8dGSigWvvJxPf/zf+ad933dxft5nXM6v3o259z/c57/ae69877nvY1AIBAI + BNpHs9nsgrZDV6FH0GQb9QC6BPUzzv8BAdZAzyEbkE1ZzGjtA4sOQF8kgUW8hZYxYv1gsR7og6xsIc+g + mYxaL1hI3pc2c4BR6wOLzIA+muXsZZJx6wOL9OtaVvMHmsfI9YAFzpil7GcbI9cDFniq61jPBUauHpjP + h+TPzgXq+5yA+bCu4QS/oDmMXi0wvmmWcIdNjF4dMO2E3hl7dzjL+NUB0z71dorHjF8dMD2h3k7xA+pm + C9UAwyfG2j02sIXywGwu9NPYusdJtlEemO1STyeZYBvlgdk19XSSr1D5y3KYdEBvxNFh1rOd4sBkpXo5 + zTG2UxyYHFUvp7nLdooDkwn1cprPUBdbyg+KZ0PfxckDVrGt/KB4q3p4wWG2lR8UX1YPL7jNtvKD4lfq + 4QXvoU62lh0UrTblftHH9rKDor1am2AI2uiIJGuaYbaXHRSNau00nHIGxo4zyqnsSJHWTsMpK0Ccbug8 + dB86xOEEGE/j5UaMaaqI3ZyK4HgcLzfioaaKGONUBMfjeLkRRzSVQc5a/rkTpVMJvNwIuT0g32wXoQEO + J8B4Gv82IguMHafQRrT6Hj4OyQa5IMmaZojtZQdFSyFXzjmzIL0sYXv5QOEdY+EHt9hWflB8XT28YJxt + 5QOFvZCcKPuC9LKA7WUHRYOmPMlOqIMvsRbJCLX6sB/kS7KDohGtTWD9JkwhWTVyghFOZwdF8hWUgFNW + gDjy1pWnbT9BN6BZnIrAWBov/7Mc11QRBzkVwfE4Xm6EXH7HOcepCI7H8XIjdkBTJ/RybrGcUxE6lcDP + aw1EWgHtgXo5lEAypyi0Ea2eoOvhtPUgqzwKmabQPct1WpvgBXTFEb2E0qxle9lBkfwy57Up9wM5o8l/ + riGgcAvkwxXob2gz2yoGDPZD38TNUeSJmX1spxwwWgSdhu5BrX5kZqMk6yloIdsIBAKBQKASGo2/tFuN + z5leC5YAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL + DAAACwwBP0AiyAAAArpJREFUeF7tmktPFFEQhUfjBl1BcOdCwKDga0E0blzjz9BfQDRujMYY16Ib/RPu + fPwRE18s3EHia6NC1IWOp24dMeCtMXTf7mrp+pKTMN01p85UmDu3e2YQBEEQBEEQFGQ4HB6A5qGFQhKv + /bTvLgh5DnoKfYNKI55PoLNs1y0Q7Cb0E2oa6XGDbbsBAl1N0drlMtv7giBT0PcUqV2k5wxj+IEQ91Ic + H5YZww+EeKVZXHjBGH4gxIZmyfIRelNT4mGxwRh+MIjFFMsqA49ptcrDMj+Yw+IQyyojHmqVh2V+MIdF + DIBllYHHPmgc2gsdhW5Dm+sOy/xgDovaA8gB32NQ+vThIT8kxAgaGYAA70noGR/6kV6mTZEBwOcCdAma + 4KEEHk/yTz8QYhQl1oBltUqsQXM81Q00l0mtAeD5e6DtG6230DxL/NFMJiX+A1bUagvvoOMs8UXzmJQY + wHkot92WIZxgmR+axaTUIihD+JIct/IeOsUyHzSHSXYAOD4L3YUe7kCvoRwfoNO0bh/NYPLXAHBMLm4+ + p7PlkCHUvvCqhPY3yQ3glp4qzgO2aBc2t2hzAPfZol3Y3CI3ALmH+CmdLcf/8xYQcPwIJDu83GJnadQi + 6PdJoBlMsgPYKfAZ9TF4kmU+aA6T2gOAR783QvDIbYXlemD3b4XxfLkYWk9Of+jdxdAdtUqsQv25HP4N + fBahi9A4DyXwePffELGA90GoH7fEtgPf/twUhYfcFp+AZEGUq0jZSm8ujCzzgzksSgwgvhlSqzws84M5 + LKZZVhnxUKs8LPMDGTy/Hl9nDD8Q4qVmceE5Y/iBEL3/icxhqInfBf4L+ZFU7TWmCAhyJUVqlyW27wYI + dB36kaI1i/S4xrbdAsHOQI+hJt4SX6FH0ALbdReEHIPmJGwhidcY7YMgCIIgCIL6DAa/AAOc7ejs57x3 + AAAAAElFTkSuQmCC + + + + 17, 17 + + + 292, 17 + AAABAAgAEBAAAAEAIABoBAAAhgAAABgYAAABACAAiAkAAO4EAAAgIAAAAQAgAKgQAAB2DgAAMDAAAAEA @@ -6966,4 +7010,7 @@ AAAAAAAAAAAAAAAAAAAAAAAA + + 149, 17 + \ No newline at end of file diff --git a/FrmSessions.Designer.cs b/FrmSessions.Designer.cs index 576647a..5b295b9 100644 --- a/FrmSessions.Designer.cs +++ b/FrmSessions.Designer.cs @@ -29,6 +29,10 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { components = new System.ComponentModel.Container(); + Guna.UI2.WinForms.Suite.CustomizableEdges customizableEdges3 = new Guna.UI2.WinForms.Suite.CustomizableEdges(); + Guna.UI2.WinForms.Suite.CustomizableEdges customizableEdges4 = new Guna.UI2.WinForms.Suite.CustomizableEdges(); + Guna.UI2.WinForms.Suite.CustomizableEdges customizableEdges1 = new Guna.UI2.WinForms.Suite.CustomizableEdges(); + Guna.UI2.WinForms.Suite.CustomizableEdges customizableEdges2 = new Guna.UI2.WinForms.Suite.CustomizableEdges(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmSessions)); navbar = new Panel(); lblappname = new Label(); @@ -39,7 +43,9 @@ private void InitializeComponent() DragController = new Guna.UI2.WinForms.Guna2DragControl(components); AnimateWindow = new Guna.UI2.WinForms.Guna2AnimateWindow(components); SessionListBox = new ListBox(); - button1 = new Button(); + lblwlc = new Label(); + btnaddsession = new Guna.UI2.WinForms.Guna2Button(); + btnsession = new Guna.UI2.WinForms.Guna2Button(); navbar.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pbappicon).BeginInit(); SuspendLayout(); @@ -54,7 +60,7 @@ private void InitializeComponent() navbar.Dock = DockStyle.Top; navbar.Location = new Point(0, 0); navbar.Name = "navbar"; - navbar.Size = new Size(1016, 28); + navbar.Size = new Size(671, 28); navbar.TabIndex = 3; // // lblappname @@ -73,7 +79,7 @@ private void InitializeComponent() lblminimize.AutoSize = true; lblminimize.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); lblminimize.ForeColor = Color.WhiteSmoke; - lblminimize.Location = new Point(980, 0); + lblminimize.Location = new Point(624, 1); lblminimize.Name = "lblminimize"; lblminimize.Size = new Size(15, 19); lblminimize.TabIndex = 3; @@ -85,7 +91,7 @@ private void InitializeComponent() lblexit.AutoSize = true; lblexit.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); lblexit.ForeColor = Color.WhiteSmoke; - lblexit.Location = new Point(996, 2); + lblexit.Location = new Point(640, 3); lblexit.Name = "lblexit"; lblexit.Size = new Size(18, 19); lblexit.TabIndex = 2; @@ -121,35 +127,82 @@ private void InitializeComponent() // SessionListBox // SessionListBox.BackColor = Color.FromArgb(30, 49, 65); - SessionListBox.BorderStyle = BorderStyle.None; + SessionListBox.BorderStyle = BorderStyle.FixedSingle; SessionListBox.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); SessionListBox.ForeColor = Color.White; SessionListBox.FormattingEnabled = true; SessionListBox.ItemHeight = 17; - SessionListBox.Location = new Point(12, 46); + SessionListBox.Location = new Point(29, 84); SessionListBox.Name = "SessionListBox"; - SessionListBox.Size = new Size(992, 357); + SessionListBox.Size = new Size(620, 257); SessionListBox.TabIndex = 4; SessionListBox.SelectedIndexChanged += SessionListBox_SelectedIndexChanged; SessionListBox.KeyDown += SessionListBox_KeyDown; // - // button1 - // - button1.Location = new Point(453, 415); - button1.Name = "button1"; - button1.Size = new Size(123, 23); - button1.TabIndex = 5; - button1.Text = "Add session"; - button1.UseVisualStyleBackColor = true; - button1.Click += button1_Click; + // lblwlc + // + lblwlc.AutoSize = true; + lblwlc.Font = new Font("Segoe UI", 12F, FontStyle.Bold, GraphicsUnit.Point); + lblwlc.ForeColor = Color.WhiteSmoke; + lblwlc.Location = new Point(41, 49); + lblwlc.Name = "lblwlc"; + lblwlc.Size = new Size(588, 21); + lblwlc.TabIndex = 5; + lblwlc.Text = "Welcome to PteroController! Please select your panel to start using our app!"; + // + // btnaddsession + // + btnaddsession.BorderColor = Color.Transparent; + btnaddsession.BorderRadius = 12; + btnaddsession.BorderStyle = System.Drawing.Drawing2D.DashStyle.Custom; + btnaddsession.BorderThickness = 2; + btnaddsession.CustomizableEdges = customizableEdges3; + btnaddsession.DisabledState.BorderColor = Color.DarkGray; + btnaddsession.DisabledState.CustomBorderColor = Color.DarkGray; + btnaddsession.DisabledState.FillColor = Color.FromArgb(169, 169, 169); + btnaddsession.DisabledState.ForeColor = Color.FromArgb(141, 141, 141); + btnaddsession.FillColor = Color.FromArgb(59, 130, 246); + btnaddsession.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); + btnaddsession.ForeColor = Color.White; + btnaddsession.Location = new Point(41, 359); + btnaddsession.Name = "btnaddsession"; + btnaddsession.ShadowDecoration.CustomizableEdges = customizableEdges4; + btnaddsession.Size = new Size(160, 30); + btnaddsession.TabIndex = 8; + btnaddsession.Text = "Add a new session"; + btnaddsession.Click += btnaddsession_Click; + // + // btnsession + // + btnsession.BorderColor = Color.Transparent; + btnsession.BorderRadius = 12; + btnsession.BorderStyle = System.Drawing.Drawing2D.DashStyle.Custom; + btnsession.BorderThickness = 2; + btnsession.CustomizableEdges = customizableEdges1; + btnsession.DisabledState.BorderColor = Color.DarkGray; + btnsession.DisabledState.CustomBorderColor = Color.DarkGray; + btnsession.DisabledState.FillColor = Color.FromArgb(169, 169, 169); + btnsession.DisabledState.ForeColor = Color.FromArgb(141, 141, 141); + btnsession.FillColor = Color.FromArgb(59, 130, 246); + btnsession.Font = new Font("Segoe UI", 10F, FontStyle.Bold, GraphicsUnit.Point); + btnsession.ForeColor = Color.White; + btnsession.Location = new Point(479, 359); + btnsession.Name = "btnsession"; + btnsession.ShadowDecoration.CustomizableEdges = customizableEdges2; + btnsession.Size = new Size(160, 30); + btnsession.TabIndex = 9; + btnsession.Text = "Direct Session"; + btnsession.Click += btnsession_Click; // // FrmSessions // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; BackColor = Color.FromArgb(30, 45, 59); - ClientSize = new Size(1016, 450); - Controls.Add(button1); + ClientSize = new Size(671, 410); + Controls.Add(btnsession); + Controls.Add(btnaddsession); + Controls.Add(lblwlc); Controls.Add(SessionListBox); Controls.Add(navbar); FormBorderStyle = FormBorderStyle.None; @@ -162,6 +215,7 @@ private void InitializeComponent() navbar.PerformLayout(); ((System.ComponentModel.ISupportInitialize)pbappicon).EndInit(); ResumeLayout(false); + PerformLayout(); } #endregion @@ -175,6 +229,8 @@ private void InitializeComponent() private Guna.UI2.WinForms.Guna2DragControl DragController; private Guna.UI2.WinForms.Guna2AnimateWindow AnimateWindow; private ListBox SessionListBox; - private Button button1; + private Label lblwlc; + private Guna.UI2.WinForms.Guna2Button btnsession; + private Guna.UI2.WinForms.Guna2Button btnaddsession; } } \ No newline at end of file diff --git a/FrmSessions.cs b/FrmSessions.cs index c19085e..68088a0 100644 --- a/FrmSessions.cs +++ b/FrmSessions.cs @@ -1,6 +1,5 @@ using PteroController.Pterodactyl; -using System.Windows.Forms; - +#pragma warning disable namespace PteroController { public partial class FrmSessions : Form @@ -28,7 +27,8 @@ private void PopulateListBoxWithSessions() } private void FrmSessions_Load(object sender, EventArgs e) { - + RPC discordRPC = new RPC(); + discordRPC.InitializeRPC(); } private void lblexit_Click(object sender, EventArgs e) @@ -43,9 +43,7 @@ private void lblminimize_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e) { - FrmAddSession x = new FrmAddSession(); - x.Show(); - this.Hide(); + } private void SessionListBox_KeyDown(object sender, KeyEventArgs e) @@ -100,5 +98,19 @@ private async void SessionListBox_SelectedIndexChanged(object sender, EventArgs MessageBox.Show("We are sorry but we can't load the sessions:\n" + ex.Message); } } + + private void btnaddsession_Click(object sender, EventArgs e) + { + FrmAddSession x = new FrmAddSession(); + x.Show(); + this.Hide(); + } + + private void btnsession_Click(object sender, EventArgs e) + { + FrmLogin x = new FrmLogin(); + x.Show(); + this.Hide(); + } } } diff --git a/Pterodactyl/User/Info.cs b/Pterodactyl/User/Info.cs index f21b9f5..b41f7e8 100644 --- a/Pterodactyl/User/Info.cs +++ b/Pterodactyl/User/Info.cs @@ -83,18 +83,6 @@ public static async Task } panel_url = panelUrl; panel_api_key = apiKey; - try - { - var account = new ConfigParser(Program.AppAccountInfo); - account.SetValue("LOGIN", "panel_url", Base64Encryption.Encrypt(panelUrl)); - account.SetValue("LOGIN", "api_key", Base64Encryption.Encrypt(apiKey)); - account.SetValue("LOGIN", "panel_pwd", Base64Encryption.Encrypt(password)); - account.Save(); - } - catch (Exception ex) - { - MessageBox.Show(ex.Message); - } } } }