using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
-using System.Threading;
-using System.Windows;
using System.Windows.Media;
using System.Xml;
return false;
}
- /**
- * process login stuff
- */
- /*
- public static void login () {
- try {
- Application.Current.Dispatcher.BeginInvoke(new Action(() => {
- MainWindow MainWindow = Application.Current.MainWindow as MainWindow;
-
- // LoginPage
- LoginPage LoginPage = MainWindow.loginPage as LoginPage;
- LoginPage.button1.Content = "Logout";
- LoginPage.PasswordCheckBox.Visibility = Visibility.Hidden;
- LoginPage.tbip.Visibility = Visibility.Hidden;
- LoginPage.diTextBlock.Visibility = Visibility.Hidden;
- LoginPage.tbpw.Visibility = Visibility.Hidden;
- LoginPage.PasswordBox.Visibility = Visibility.Hidden;
- LoginPage.cbSave.Visibility = Visibility.Hidden;
-
- // MainWindow
- MainWindow.btnLogin.Content = "Logout";
-
- MainWindow.btnOverview.IsEnabled = true;
- MainWindow.btnDsl.IsEnabled = true;
- MainWindow.btnLteInfo.IsEnabled = true;
- MainWindow.btnSyslog.IsEnabled = true;
- MainWindow.btnTR181.IsEnabled = true;
- MainWindow.btnPhone.IsEnabled = true;
- MainWindow.btnLan.IsEnabled = true;
- MainWindow.btnControls.IsEnabled = true;
- }));
- }
- catch (Exception ex) {
- Console.WriteLine(ex.Message);
- }
- }
- */
- /**
- * process logout stuff
- */
- /*
- public static void logout () {
- try {
- Application.Current.Dispatcher.BeginInvoke(new Action(() => {
- MainWindow MainWindow = Application.Current.MainWindow as MainWindow;
-
- // LteInfoPage
- LteInfoPage lteInfo = MainWindow.lteInfoPage as LteInfoPage;
- if (Object.Equals(lteInfo._ltepopup, null).Equals(false)) {
- lteInfo._ltepopup.StopTimer();
- lteInfo._ltepopup.Hide();
- lteInfo._ltepopup = null;
- }
- lteInfo.StopTimer();
-
- // DslPage
- DslPage dslInfo = MainWindow.dslPage as DslPage;
- dslInfo.StopTimer();
-
- // LoginPage
- LoginPage LoginPage = MainWindow.loginPage as LoginPage;
- LoginPage.PasswordBox.Visibility = Visibility.Visible;
- LoginPage.tbip.Visibility = Visibility.Visible;
- LoginPage.diTextBlock.Visibility = Visibility.Visible;
- LoginPage.tbpw.Visibility = Visibility.Visible;
- LoginPage.PasswordCheckBox.Visibility = Visibility.Visible;
- LoginPage.button1.Content = "Login";
- LoginPage.cbSave.Visibility = Visibility.Visible;
- LoginPage.PasswordBox.Focus();
-
- // MainWindow
- MainWindow.btnLogin.Content = "Login";
- MainWindow.frame.Content = MainWindow.loginPage;
- MainWindow.changeColor(MainWindow.btnLogin);
-
- MainWindow.btnOverview.IsEnabled = false;
- MainWindow.btnDsl.IsEnabled = false;
- MainWindow.btnLteInfo.IsEnabled = false;
- MainWindow.btnSyslog.IsEnabled = false;
- MainWindow.btnTR181.IsEnabled = false;
- MainWindow.btnPhone.IsEnabled = false;
- MainWindow.btnLan.IsEnabled = false;
- MainWindow.btnControls.IsEnabled = false;
- }));
- }
- catch (Exception ex) {
- Console.WriteLine(ex.Message);
- }
- }
- */
-
public static bool checkInstalled (string c_name) {
string displayName = string.Empty;
<pagemodel:LoginPageModel x:Key="LoginPageModel"></pagemodel:LoginPageModel>
<pagemodel:StatusPageModel x:Key="StatusPageModel"></pagemodel:StatusPageModel>
- <model:Status x:Key="Status"></model:Status>
<model:LTE x:Key="LTE"></model:LTE>
<model:LTE x:Key="LTE2"></model:LTE>
<model:DSLViewModel x:Key="DSL"></model:DSLViewModel>
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
+using System.Windows;
namespace SpeedportHybridControl {
/// <summary>
using System.Linq;
using System.Windows;
using SpeedportHybridControl.Model;
+using SpeedportHybridControl.PageModel;
using SpeedportHybridControl.Implementations;
namespace SpeedportHybridControl.Data {
public static void initStatus() {
try {
- Status status = Application.Current.FindResource("Status") as Status;
+ StatusPageModel status = Application.Current.FindResource("StatusPageModel") as StatusPageModel;
string response = SpeedportHybridAPI.getInstance().sendRequest("data/status.json");
if (response.IsNullOrEmpty())
return;
status.dsl_downstream = string.Concat(jArray.getVar("dsl_downstream"), " kBit/s");
status.dsl_upstream = string.Concat(jArray.getVar("dsl_upstream"), " kBit/s");
- List<StatusPhoneList> statusPhoneList = new List<StatusPhoneList>();
+ List<StatusPhoneListModel> statusPhoneList = new List<StatusPhoneListModel>();
status.addphonenumber = null;
foreach (JToken jToken in jArray) {
pstatus = "Nicht aktiv";
}
- statusPhoneList.Add(new StatusPhoneList() { number = pnumber, status = pstatus });
+ statusPhoneList.Add(new StatusPhoneListModel() { number = pnumber, status = pstatus });
}
}
using SpeedportHybridControl.Implementations;
using SpeedportHybridControl.Model;
using Newtonsoft.Json;
-using System.Security;
using SpeedportHybridControl.PageModel;
namespace SpeedportHybridControl.Data {
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using System.ComponentModel;
-using SpeedportHybridControl.Implementations;
-using Microsoft.Win32;
+using System.Windows;
namespace SpeedportHybridControl {
/// <summary>
--- /dev/null
+namespace SpeedportHybridControl.Model {
+ class StatusPhoneListModel : SuperViewModel {
+ private string _number;
+ private string _status;
+
+ public string number {
+ get { return _number; }
+ set { SetProperty(ref _number, value); }
+ }
+
+ public string status {
+ get { return _status; }
+ set { SetProperty(ref _status, value); }
+ }
+
+ public StatusPhoneListModel () {
+
+ }
+ }
+}
+++ /dev/null
-using System.Collections.Generic;
-
-namespace SpeedportHybridControl.Model {
- public class Status : SuperViewModel {
- private string _device_name;
- private string _lte_status;
- private string _lte_signal;
- private string _lte_image = "../assets/lte0.png";
- private string _datetime;
- private string _imei;
- private string _dsl_link_status;
- private string _status;
- private string _dsl_downstream;
- private string _dsl_upstream;
- private List<StatusPhoneList> _addphonenumber;
- private string _use_dect;
- private string _dect_devices;
- private string _wlan_ssid;
- private string _wlan_5ghz_ssid;
- private string _use_wlan;
- private string _use_wlan_5ghz;
- private string _wlan_devices;
- private string _wlan_5ghz_devices;
- private string _lan1_device = "../assets/x.png";
- private string _lan2_device = "../assets/x.png";
- private string _lan3_device = "../assets/x.png";
- private string _lan4_device = "../assets/x.png";
- private string _hsfon_status;
- private string _firmware_version;
- private string _serial_number;
- private string _uptime;
-
- public string device_name {
- get { return _device_name; }
- set { SetProperty(ref _device_name, value); }
- }
-
- public string lte_status {
- get { return _lte_status; }
- set { SetProperty(ref _lte_status, value); }
- }
-
- public string lte_signal {
- get { return _lte_signal; }
- set { SetProperty(ref _lte_signal, value); }
- }
-
- public string lte_image {
- get { return _lte_image; }
- set { SetProperty(ref _lte_image, value); }
- }
-
- public string datetime {
- get { return _datetime; }
- set { SetProperty(ref _datetime, value); }
- }
-
- public string imei {
- get { return _imei; }
- set { SetProperty(ref _imei, value); }
- }
-
- public string dsl_link_status {
- get { return _dsl_link_status; }
- set { SetProperty(ref _dsl_link_status, value); }
- }
-
- public string status {
- get { return _status; }
- set { SetProperty(ref _status, value); }
- }
-
- public string dsl_downstream {
- get { return _dsl_downstream; }
- set { SetProperty(ref _dsl_downstream, value); }
- }
-
- public string dsl_upstream {
- get { return _dsl_upstream; }
- set { SetProperty(ref _dsl_upstream, value); }
- }
-
- public List<StatusPhoneList> addphonenumber {
- get { return _addphonenumber; }
- set { SetProperty(ref _addphonenumber, value); }
- }
-
- public string use_dect {
- get { return _use_dect; }
- set { SetProperty(ref _use_dect, value); }
- }
-
- public string dect_devices {
- get { return _dect_devices; }
- set { SetProperty(ref _dect_devices, value); }
- }
-
- public string wlan_ssid {
- get { return _wlan_ssid; }
- set { SetProperty(ref _wlan_ssid, value); }
- }
-
- public string wlan_5ghz_ssid {
- get { return _wlan_5ghz_ssid; }
- set { SetProperty(ref _wlan_5ghz_ssid, value); }
- }
-
- public string use_wlan {
- get { return _use_wlan; }
- set { SetProperty(ref _use_wlan, value); }
- }
-
- public string use_wlan_5ghz {
- get { return _use_wlan_5ghz; }
- set { SetProperty(ref _use_wlan_5ghz, value); }
- }
-
- public string wlan_devices {
- get { return _wlan_devices; }
- set { SetProperty(ref _wlan_devices, value); }
- }
-
- public string wlan_5ghz_devices {
- get { return _wlan_5ghz_devices; }
- set { SetProperty(ref _wlan_5ghz_devices, value); }
- }
-
- public string lan1_device {
- get { return _lan1_device; }
- set { SetProperty(ref _lan1_device, value); }
- }
-
- public string lan2_device {
- get { return _lan2_device; }
- set { SetProperty(ref _lan2_device, value); }
- }
-
- public string lan3_device {
- get { return _lan3_device; }
- set { SetProperty(ref _lan3_device, value); }
- }
-
- public string lan4_device {
- get { return _lan4_device; }
- set { SetProperty(ref _lan4_device, value); }
- }
-
- public string hsfon_status {
- get { return _hsfon_status; }
- set { SetProperty(ref _hsfon_status, value); }
- }
-
- public string firmware_version {
- get { return _firmware_version; }
- set { SetProperty(ref _firmware_version, value); }
- }
-
- public string serial_number {
- get { return _serial_number; }
- set { SetProperty(ref _serial_number, value); }
- }
-
- public string uptime {
- get { return _uptime; }
- set { SetProperty(ref _uptime, value); }
- }
-
- public Status() {
- }
- }
-
- public class StatusPhoneList : SuperViewModel {
- private string _number;
- private string _status;
-
- public string number {
- get { return _number; }
- set { SetProperty(ref _number, value); }
- }
-
- public string status {
- get { return _status; }
- set { SetProperty(ref _status, value); }
- }
-
- public StatusPhoneList () {
-
- }
- }
-}
using SpeedportHybridControl.Data;
using System.Windows;
using System.Threading;
-using System.Security;
using SpeedportHybridControl.Model;
namespace SpeedportHybridControl.PageModel {
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using SpeedportHybridControl.Model;
using SpeedportHybridControl.Implementations;
using System.Threading;
class StatusPageModel : SuperViewModel {
private DelegateCommand _reloadCommand;
+ private string _device_name;
+ private string _lte_status;
+ private string _lte_signal;
+ private string _lte_image = "../assets/lte0.png";
+ private string _datetime;
+ private string _imei;
+ private string _dsl_link_status;
+ private string _status;
+ private string _dsl_downstream;
+ private string _dsl_upstream;
+ private List<StatusPhoneListModel> _addphonenumber;
+ private string _use_dect;
+ private string _dect_devices;
+ private string _wlan_ssid;
+ private string _wlan_5ghz_ssid;
+ private string _use_wlan;
+ private string _use_wlan_5ghz;
+ private string _wlan_devices;
+ private string _wlan_5ghz_devices;
+ private string _lan1_device = "../assets/x.png";
+ private string _lan2_device = "../assets/x.png";
+ private string _lan3_device = "../assets/x.png";
+ private string _lan4_device = "../assets/x.png";
+ private string _hsfon_status;
+ private string _firmware_version;
+ private string _serial_number;
+ private string _uptime;
+
public DelegateCommand ReloadCommand {
get { return _reloadCommand; }
set { SetProperty(ref _reloadCommand, value); }
new Thread(() => { SpeedportHybrid.initStatus(); }).Start();
}
+ public string device_name {
+ get { return _device_name; }
+ set { SetProperty(ref _device_name, value); }
+ }
+
+ public string lte_status {
+ get { return _lte_status; }
+ set { SetProperty(ref _lte_status, value); }
+ }
+
+ public string lte_signal {
+ get { return _lte_signal; }
+ set { SetProperty(ref _lte_signal, value); }
+ }
+
+ public string lte_image {
+ get { return _lte_image; }
+ set { SetProperty(ref _lte_image, value); }
+ }
+
+ public string datetime {
+ get { return _datetime; }
+ set { SetProperty(ref _datetime, value); }
+ }
+
+ public string imei {
+ get { return _imei; }
+ set { SetProperty(ref _imei, value); }
+ }
+
+ public string dsl_link_status {
+ get { return _dsl_link_status; }
+ set { SetProperty(ref _dsl_link_status, value); }
+ }
+
+ public string status {
+ get { return _status; }
+ set { SetProperty(ref _status, value); }
+ }
+
+ public string dsl_downstream {
+ get { return _dsl_downstream; }
+ set { SetProperty(ref _dsl_downstream, value); }
+ }
+
+ public string dsl_upstream {
+ get { return _dsl_upstream; }
+ set { SetProperty(ref _dsl_upstream, value); }
+ }
+
+ public List<StatusPhoneListModel> addphonenumber {
+ get { return _addphonenumber; }
+ set { SetProperty(ref _addphonenumber, value); }
+ }
+
+ public string use_dect {
+ get { return _use_dect; }
+ set { SetProperty(ref _use_dect, value); }
+ }
+
+ public string dect_devices {
+ get { return _dect_devices; }
+ set { SetProperty(ref _dect_devices, value); }
+ }
+
+ public string wlan_ssid {
+ get { return _wlan_ssid; }
+ set { SetProperty(ref _wlan_ssid, value); }
+ }
+
+ public string wlan_5ghz_ssid {
+ get { return _wlan_5ghz_ssid; }
+ set { SetProperty(ref _wlan_5ghz_ssid, value); }
+ }
+
+ public string use_wlan {
+ get { return _use_wlan; }
+ set { SetProperty(ref _use_wlan, value); }
+ }
+
+ public string use_wlan_5ghz {
+ get { return _use_wlan_5ghz; }
+ set { SetProperty(ref _use_wlan_5ghz, value); }
+ }
+
+ public string wlan_devices {
+ get { return _wlan_devices; }
+ set { SetProperty(ref _wlan_devices, value); }
+ }
+
+ public string wlan_5ghz_devices {
+ get { return _wlan_5ghz_devices; }
+ set { SetProperty(ref _wlan_5ghz_devices, value); }
+ }
+
+ public string lan1_device {
+ get { return _lan1_device; }
+ set { SetProperty(ref _lan1_device, value); }
+ }
+
+ public string lan2_device {
+ get { return _lan2_device; }
+ set { SetProperty(ref _lan2_device, value); }
+ }
+
+ public string lan3_device {
+ get { return _lan3_device; }
+ set { SetProperty(ref _lan3_device, value); }
+ }
+
+ public string lan4_device {
+ get { return _lan4_device; }
+ set { SetProperty(ref _lan4_device, value); }
+ }
+
+ public string hsfon_status {
+ get { return _hsfon_status; }
+ set { SetProperty(ref _hsfon_status, value); }
+ }
+
+ public string firmware_version {
+ get { return _firmware_version; }
+ set { SetProperty(ref _firmware_version, value); }
+ }
+
+ public string serial_number {
+ get { return _serial_number; }
+ set { SetProperty(ref _serial_number, value); }
+ }
+
+ public string uptime {
+ get { return _uptime; }
+ set { SetProperty(ref _uptime, value); }
+ }
+
public StatusPageModel () {
ReloadCommand = new DelegateCommand(new Action(OnReloadCommandExecute));
}
<Compile Include="Model\bonding_client.cs" />
<Compile Include="Model\DeviceViewModel.cs" />
<Compile Include="Model\DSLViewModel.cs" />
+ <Compile Include="Model\StatusPhoneListModel.cs" />
<Compile Include="PageModel\LoginPageModel.cs" />
<Compile Include="Model\LTEViewModel.cs" />
<Compile Include="PageModel\MainWindowModel.cs" />
<Compile Include="Model\OverviewModel.cs" />
<Compile Include="Model\PhoneCallViewModel.cs" />
- <Compile Include="Model\StatusViewModel.cs" />
<Compile Include="Model\SuperViewModel.cs" />
<Compile Include="Data\SpeedportHybridAPI.cs" />
<Page Include="MainWindow.xaml">
-using System.Windows;
-using System.Windows.Controls;
-using System.Threading;
-using System;
-using SpeedportHybridControl.Model;
-using SpeedportHybridControl.Implementations;
+using System.Windows.Controls;
namespace SpeedportHybridControl.page {
/// <summary>
Width="Auto" Height="Auto"
Title="StatusPage">
- <Grid DataContext="{StaticResource Status}">
+ <Grid DataContext="{StaticResource StatusPageModel}">
<GroupBox Header="Status-Informationen" HorizontalAlignment="Left" VerticalAlignment="Top" Width="235">
<Grid>
<StackPanel HorizontalAlignment="Left" Width="120">
</GroupBox>
<TextBlock Text="{Binding datetime}" Margin="0,0,10,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
- <Button DataContext="{StaticResource StatusPageModel}" Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom"/>
+ <Button Command="{Binding Path=ReloadCommand}" x:Name="reload" Content="Aktualisieren" Margin="218,0,218,0" VerticalAlignment="Bottom"/>
</Grid>
</Page>
-using SpeedportHybridControl.Model;
-using System.Windows;
-using System.Windows.Controls;
+using System.Windows.Controls;
namespace SpeedportHybridControl.page {
/// <summary>