Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Added design on Server list
-> Removed old session code
-> Removed old config manager
-> Made some ui buttons work
  • Loading branch information
NaysKutzu committed Sep 28, 2023
1 parent 502a054 commit de79487
Show file tree
Hide file tree
Showing 10 changed files with 472 additions and 132 deletions.
50 changes: 6 additions & 44 deletions FrmLogin.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Salaros.Configuration;

namespace PteroController
{
public partial class FrmLogin : Form
Expand All @@ -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 == "")
{
Expand All @@ -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();
Expand All @@ -78,7 +40,7 @@ private void btnlogin_Click(object sender, EventArgs e)

private void FrmLogin_Load(object sender, EventArgs e)
{
CheckSession();

}
}
}
95 changes: 54 additions & 41 deletions FrmServerController.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions FrmServerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

}
4 changes: 2 additions & 2 deletions FrmServerController.resx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<data name="btnservers.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEIAAABCCAYAAADjVADoAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAAAzdJREFUeF7tm02IjVEcxu/MhBoLWRhlwoKUlAWasJgy2RiRj0lShs3MRpGS2FBE
DQAACw0B7QfALAAAAzdJREFUeF7tm02IjVEcxu/MhBoLWRhlwoKUlAWasJgy2RiRj0lShs3MRpGS2FBE
1EQWForNYImVDQ0pdmPnY8dGSigWvvJxPf/zf+ad933dxft5nXM6v3o259z/c57/ae69877nvY1AIBAI
BNpHs9nsgrZDV6FH0GQb9QC6BPUzzv8BAdZAzyEbkE1ZzGjtA4sOQF8kgUW8hZYxYv1gsR7og6xsIc+g
mYxaL1hI3pc2c4BR6wOLzIA+muXsZZJx6wOL9OtaVvMHmsfI9YAFzpil7GcbI9cDFniq61jPBUauHpjP
Expand All @@ -141,7 +141,7 @@
<data name="btnlogout.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DwAACw8BkvkDpQAAArpJREFUeF7tmktPFFEQhUfjBl1BcOdCwKDga0E0blzjz9BfQDRujMYY16Ib/RPu
DQAACw0B7QfALAAAArpJREFUeF7tmktPFFEQhUfjBl1BcOdCwKDga0E0blzjz9BfQDRujMYY16Ib/RPu
fPwRE18s3EHia6NC1IWOp24dMeCtMXTf7mrp+pKTMN01p85UmDu3e2YQBEEQBEEQFGQ4HB6A5qGFQhKv
/bTvLgh5DnoKfYNKI55PoLNs1y0Q7Cb0E2oa6XGDbbsBAl1N0drlMtv7giBT0PcUqV2k5wxj+IEQ91Ic
H5YZww+EeKVZXHjBGH4gxIZmyfIRelNT4mGxwRh+MIjFFMsqA49ptcrDMj+Yw+IQyyojHmqVh2V+MIdF
Expand Down
Loading

0 comments on commit de79487

Please sign in to comment.