Add remember me button and more
This commit is contained in:
@@ -6,20 +6,33 @@ using System.Text;
|
||||
namespace Server_Dashboard {
|
||||
class DashboardModuleViewModel : BaseViewModel {
|
||||
public ObservableCollection<DashboardModule> Modules { get; set; }
|
||||
private int gpuUsage;
|
||||
|
||||
public int GPUUsage {
|
||||
get { return gpuUsage; }
|
||||
set {
|
||||
if(value != gpuUsage)
|
||||
gpuUsage = value;
|
||||
OnPropertyChanged(nameof(gpuUsage));
|
||||
}
|
||||
}
|
||||
|
||||
public DashboardModuleViewModel() {
|
||||
Modules = new ObservableCollection<DashboardModule>();
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Modules.Add(new DashboardModule(true) {
|
||||
ModulName = "TestModule",
|
||||
ModuleName = "TestModule",
|
||||
Creator = "Username",
|
||||
ModuleIcon = "../../Assets/Images/PlaceHolderModuleLight.png",
|
||||
CreationDate = DateTime.Now.ToString(),
|
||||
ServerInfo = new ServerInformation() {
|
||||
GpuUsage = "20",
|
||||
CpuUsage = "20",
|
||||
CpuTemp = "88.88",
|
||||
DeployDate = DateTime.Now.ToString(),
|
||||
GpuTemp = "69.69",
|
||||
ServerName = "Ubuntu",
|
||||
OSUserName = "crylia",
|
||||
OSUserName = "crylia " + i,
|
||||
PrivateIpAdress = "192.168.1.1",
|
||||
PublicIpAdress = "85.69.102.58",
|
||||
Uptime = DateTime.Now.ToString()
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.ObjectModel;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Server_Dashboard_Socket;
|
||||
|
||||
namespace Server_Dashboard {
|
||||
class DashboardViewModel : BaseViewModel {
|
||||
@@ -30,26 +31,30 @@ namespace Server_Dashboard {
|
||||
}
|
||||
|
||||
public DashboardViewModel() {
|
||||
EchoServer echoServer = new EchoServer();
|
||||
echoServer.Start();
|
||||
OpenLinkCommand = new RelayCommand(OpenLink);
|
||||
CreateNewModuleCommand = new RelayCommand(CreateNewModule);
|
||||
OpenNewModuleWindowCommand = new RelayCommand(OpenNewModuleWindow);
|
||||
CreateModuleCommand = new RelayCommand(CreateModule);
|
||||
Modules = dmvm.Modules;
|
||||
|
||||
}
|
||||
|
||||
public ICommand OpenLinkCommand { get; set; }
|
||||
public ICommand CreateNewModuleCommand { get; set; }
|
||||
|
||||
public ICommand OpenNewModuleWindowCommand { get; set; }
|
||||
public ICommand CreateModuleCommand { get; set; }
|
||||
private void OpenLink(object param) {
|
||||
Process.Start(new ProcessStartInfo((string)param) { UseShellExecute = true });
|
||||
}
|
||||
|
||||
private void CreateNewModule(object param) {
|
||||
private void OpenNewModuleWindow(object param) {
|
||||
CreateModulePopup cmp = new CreateModulePopup {
|
||||
DataContext = this
|
||||
};
|
||||
cmp.Owner = Application.Current.MainWindow;
|
||||
cmp.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||
cmp.WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
cmp.ShowDialog();
|
||||
}
|
||||
private void CreateModule(object param) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user