Remotely/Shared/Models/Device.cs
Jared Goodwin 3ef4cdf81a
Extract remote control functionality into separate library. (#539)
* Convert server to new single-file startup model.

* Add remote control implementations.

* Implement IViewerAuthorizer.

* Update hub endpoints.

* Implement HubEventHandler.

* Implement ViewerHubDataProvider.

* Implement page data provider.

* Implement RCL and refactor.

* Update submodule.

* Replace submodule with NuGet.

* Update copy URL.

* Update NuGet.

* Remove deprecated WebRTC.

* Remove deprecated WebRTC.

* Update Immense.RemoteControl

* Building out desktop projects.

* Bring more services into submodule.

* Update submodule.

* Update submodule.

* Refactoring for module.

* Update submodule.

* Update submodule

* Got Windows desktop app running.

* Refactor for submodule changes.

* FIx unattended session start.

* Switch desktop app out of console mode.

* Fix tests.

* Update publishing.

* Remove ClickOnce middleware.

* Remove ClickOnce remnants.

* Update submodule

* Add some logging.

* Update Linux path.

* Update submodule.

* Add cleanup service for unattended sessions that failed to start.

* Update submodule.

* Fix chat.

* Add ValidateExecutableReferencesMatchSelfContained property.

* Add other submodule projects.  Align checkbox.

* Update submodule.  Reduce deserialization in the browser, resulting in faster renders.

* Update submodule.

* Update submodule.

* Update submodule.

* Update submodule.

* Add orgId back for branding.

* Get branding loading in desktop apps.

* Update submodule.

* Create log dir.

* Refactor version check on config page.

* Update submodule.

* Update submodule.

* Change submodule URL.

* Correct namespace.

* Update submodule.

* Checkout submodules recursively.
2022-12-23 06:39:12 -08:00

116 lines
3.2 KiB
C#

using Remotely.Shared.Attributes;
using Remotely.Shared.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Runtime.InteropServices;
using System.Text.Json.Serialization;
namespace Remotely.Shared.Models
{
public class Device
{
public static Device Empty { get; } = new();
[Sortable]
[Display(Name = "Agent Version")]
public string AgentVersion { get; set; }
public ICollection<Alert> Alerts { get; set; }
[StringLength(100)]
[Sortable]
[Display(Name = "Alias")]
public string Alias { get; set; }
[Sortable]
[Display(Name = "CPU Utilization")]
public double CpuUtilization { get; set; }
[Sortable]
[Display(Name = "Current User")]
public string CurrentUser { get; set; }
public DeviceGroup DeviceGroup { get; set; }
public string DeviceGroupID { get; set; }
[Sortable]
[Display(Name = "Device Name")]
public string DeviceName { get; set; }
public List<Drive> Drives { get; set; }
[Key]
public string ID { get; set; }
public bool Is64Bit { get; set; }
public bool IsOnline { get; set; }
[Sortable]
[Display(Name = "Last Online")]
public DateTimeOffset LastOnline { get; set; }
[StringLength(5000)]
public string Notes { get; set; }
[JsonIgnore]
public Organization Organization { get; set; }
public string OrganizationID { get; set; }
public Architecture OSArchitecture { get; set; }
[Sortable]
[Display(Name = "OS Description")]
public string OSDescription { get; set; }
[Sortable]
[Display(Name = "Platform")]
public string Platform { get; set; }
[Sortable]
[Display(Name = "Processor Count")]
public int ProcessorCount { get; set; }
public string PublicIP { get; set; }
public string ServerVerificationToken { get; set; }
[JsonIgnore]
public List<ScriptResult> ScriptResults { get; set; }
[JsonIgnore]
public List<ScriptRun> ScriptRuns { get; set; }
[JsonIgnore]
public List<ScriptRun> ScriptRunsCompleted { get; set; }
[JsonIgnore]
public List<ScriptSchedule> ScriptSchedules { get; set; }
[StringLength(200)]
[Sortable]
[Display(Name = "Tags")]
public string Tags { get; set; } = "";
[Sortable]
[Display(Name = "Memory Total")]
public double TotalMemory { get; set; }
[Sortable]
[Display(Name = "Storage Total")]
public double TotalStorage { get; set; }
[Sortable]
[Display(Name = "Memory Used")]
public double UsedMemory { get; set; }
[Sortable]
[Display(Name = "Memory Used %")]
public double UsedMemoryPercent => UsedMemory / TotalMemory;
[Sortable]
[Display(Name = "Storage Used")]
public double UsedStorage { get; set; }
[Sortable]
[Display(Name = "Storage Used %")]
public double UsedStoragePercent => UsedStorage / TotalStorage;
}
}