mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
WIP
This commit is contained in:
parent
cc42cf339e
commit
b2f7183f12
@ -38,20 +38,6 @@
|
||||
<ProjectReference Include="..\Shared\Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System">
|
||||
<HintPath>System</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<HintPath>System.Data</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceProcess">
|
||||
<HintPath>System.ServiceProcess</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<HintPath>System.Xml</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Services\WindowsService.cs">
|
||||
|
||||
@ -16,7 +16,7 @@ namespace Remotely.Agent.Services
|
||||
{
|
||||
if (!File.Exists("ConnectionInfo.json"))
|
||||
{
|
||||
throw new Exception("No connection info available. Please create ConnectionInfo.json file with appropriate values.");
|
||||
Logger.Write(new Exception("No connection info available. Please create ConnectionInfo.json file with appropriate values."));
|
||||
}
|
||||
return JsonConvert.DeserializeObject<ConnectionInfo>(File.ReadAllText("ConnectionInfo.json"));
|
||||
}
|
||||
|
||||
@ -40,7 +40,6 @@ namespace Remotely.Server.Data
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
builder.Entity<IdentityUser>().ToTable("RemotelyUsers");
|
||||
//builder.Entity<RemotelyUser>().ToTable("RemotelyUsers");
|
||||
|
||||
builder.Entity<Organization>()
|
||||
.HasMany(x => x.Devices)
|
||||
|
||||
@ -59,7 +59,6 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.0.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="3.0.0" />
|
||||
@ -155,14 +154,6 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Drawing">
|
||||
<HintPath>..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Drawing.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="CurrentVersion.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
||||
23
Server/Services/PascalCase.cs
Normal file
23
Server/Services/PascalCase.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Remotely.Server.Services
|
||||
{
|
||||
public class PascalCase : JsonNamingPolicy
|
||||
{
|
||||
public override string ConvertName(string name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
var first = name.First().ToString().ToUpper();
|
||||
|
||||
return first + new string(name.Skip(1).ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -127,10 +127,10 @@ namespace Remotely.Server
|
||||
});
|
||||
}
|
||||
|
||||
services.AddMvcCore()
|
||||
services.AddMvc()
|
||||
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0).AddJsonOptions(options =>
|
||||
{
|
||||
|
||||
options.JsonSerializerOptions.PropertyNamingPolicy = new PascalCase();
|
||||
});
|
||||
|
||||
services.AddSignalR(options =>
|
||||
@ -139,7 +139,7 @@ namespace Remotely.Server
|
||||
})
|
||||
.AddJsonProtocol(options =>
|
||||
{
|
||||
|
||||
options.PayloadSerializerOptions.PropertyNamingPolicy = new PascalCase();
|
||||
})
|
||||
.AddMessagePackProtocol();
|
||||
|
||||
@ -233,12 +233,6 @@ namespace Remotely.Server
|
||||
|
||||
private void ConfigureStaticFiles(IApplicationBuilder app)
|
||||
{
|
||||
JsonConvert.DefaultSettings = () =>
|
||||
{
|
||||
var settings = new JsonSerializerSettings();
|
||||
settings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
|
||||
return settings;
|
||||
};
|
||||
var provider = new FileExtensionContentTypeProvider();
|
||||
// Add new mappings
|
||||
provider.Mappings[".ps1"] = "application/octet-stream";
|
||||
|
||||
@ -7,6 +7,7 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Remotely.Shared.Models
|
||||
{
|
||||
@ -15,6 +16,8 @@ namespace Remotely.Shared.Models
|
||||
public string AgentVersion { get; set; }
|
||||
public string CurrentUser { get; set; }
|
||||
public string DeviceName { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<DevicePermissionLink> DevicePermissionLinks { get; set; } = new List<DevicePermissionLink>();
|
||||
public List<Drive> Drives { get; set; }
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user