Compare commits
No commits in common. "a70123f778d267e67f5150ddf1ce07d8a48a5f49" and "a72c35b16826bb63d3f3acd78a5f33483c9f302a" have entirely different histories.
a70123f778
...
a72c35b168
|
@ -1,7 +1,7 @@
|
||||||
<Project>
|
<Project>
|
||||||
<Import Project="dependencies.props" />
|
<Import Project="dependencies.props" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>1.2.3</Version>
|
<Version>1.1.3</Version>
|
||||||
<Authors>Tudor Stanciu</Authors>
|
<Authors>Tudor Stanciu</Authors>
|
||||||
<Company>STA</Company>
|
<Company>STA</Company>
|
||||||
<PackageTags>NetworkResurrector</PackageTags>
|
<PackageTags>NetworkResurrector</PackageTags>
|
||||||
|
|
|
@ -2,33 +2,26 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
<Date>2020-11-28 18:15</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
System initialization
|
|
||||||
Simple .net core 3.1 console application that serve as an REST API through witch a user can execute wake or shutdown commands on machines from his network.
|
Simple .net core 3.1 console application that serve as an REST API through witch a user can execute wake or shutdown commands on machines from his network.
|
||||||
Has been added Wake on LAN support and "wake" route in the API controller.
|
Has been added Wake on LAN support and "wake" route in the API controller.
|
||||||
</Content>
|
</Content>
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
<Date>2020-11-29 22:14</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
New functionalities added
|
Has been added "ping" and "shutdown" support. Routes with same names have also been added to the controller.
|
||||||
Added support for "ping" and "shutdown". Routes with the same names have also been added to the controller.
|
|
||||||
</Content>
|
</Content>
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.0.2</Version>
|
<Version>1.0.2</Version>
|
||||||
<Date>2020-12-20 23:00</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
Changes in the system structure
|
|
||||||
Replaced Swagger and MediatR implementations with inhouse nuget packages.
|
Replaced Swagger and MediatR implementations with inhouse nuget packages.
|
||||||
Integration with Tuitio.
|
Integration with Tuitio.
|
||||||
</Content>
|
</Content>
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.0.3</Version>
|
<Version>1.0.3</Version>
|
||||||
<Date>2022-01-03 08:52</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
Added NetworkResurrector.Agent service
|
Added NetworkResurrector.Agent service
|
||||||
Upgrade all services to net5.0
|
Upgrade all services to net5.0
|
||||||
|
@ -36,36 +29,8 @@
|
||||||
The system will be able to execute these operations in multiple ways. This is just the first one and all of them are handled by the NetworkResurrector.Api. For example, if the user wants to shutdown a clean Windows machine, he can use the agent and configure the API to call it, but in case of a proxmox machine, the API can be configured to execute a http request directly to the OS with the shutdown action (without the need for the agent).
|
The system will be able to execute these operations in multiple ways. This is just the first one and all of them are handled by the NetworkResurrector.Api. For example, if the user wants to shutdown a clean Windows machine, he can use the agent and configure the API to call it, but in case of a proxmox machine, the API can be configured to execute a http request directly to the OS with the shutdown action (without the need for the agent).
|
||||||
</Content>
|
</Content>
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
|
||||||
<Version>1.0.4</Version>
|
|
||||||
<Date>2022-01-14 01:22</Date>
|
|
||||||
<Content>
|
|
||||||
NetworkResurrector.Agent improvements
|
|
||||||
• Multiple operations were implemented in the agent: Shutdown, Restart, Sleep, LockLogout and Cancel. The "Cancel" action can cancel one of the previously operations programmed with a delay.
|
|
||||||
• Added NetworkResurrector.Agent.Wrapper nuget package. It provides an easy and efficient method for a developer to connect another system written in .NET to this agent.
|
|
||||||
</Content>
|
|
||||||
</Note>
|
|
||||||
<Note>
|
|
||||||
<Version>1.0.5</Version>
|
|
||||||
<Date>2022-01-18 21:43</Date>
|
|
||||||
<Content>
|
|
||||||
NetworkResurrector.Server.Wrapper nuget package
|
|
||||||
• Added NetworkResurrector.Server.Wrapper nuget package. It provides an easy and efficient method for a developer to connect another system written in .NET to NetworkResurrector.Server.
|
|
||||||
• Added logic where the http headers from the caller's request are automatically passed to the request sent to this server.
|
|
||||||
</Content>
|
|
||||||
</Note>
|
|
||||||
<Note>
|
|
||||||
<Version>1.0.6</Version>
|
|
||||||
<Date>2022-06-19 08:18</Date>
|
|
||||||
<Content>
|
|
||||||
Implemented Netmash.Infrastructure.DatabaseMigration
|
|
||||||
• Through this nuget package, support was added for the automatic running of new sql scripts at system startup.
|
|
||||||
• The current sql scripts have been corrected or updated to meet the migrator rules.
|
|
||||||
</Content>
|
|
||||||
</Note>
|
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.0.7</Version>
|
<Version>1.0.7</Version>
|
||||||
<Date>2022-11-30 23:21</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
Code cleanup and refactoring
|
Code cleanup and refactoring
|
||||||
• Preparing to make the project open source on my Gitea instance.
|
• Preparing to make the project open source on my Gitea instance.
|
||||||
|
@ -75,7 +40,6 @@
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.1.0</Version>
|
<Version>1.1.0</Version>
|
||||||
<Date>2023-01-29 00:31</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
Massive improvements
|
Massive improvements
|
||||||
• .NET 6 upgrade
|
• .NET 6 upgrade
|
||||||
|
@ -88,7 +52,6 @@
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.1.1</Version>
|
<Version>1.1.1</Version>
|
||||||
<Date>2023-02-02 19:03</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
Retouches after the last upgrade
|
Retouches after the last upgrade
|
||||||
• Nuget packages upgrade
|
• Nuget packages upgrade
|
||||||
|
@ -97,68 +60,18 @@
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.1.2</Version>
|
<Version>1.1.2</Version>
|
||||||
<Date>2023-02-04 11:14</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
Tuitio latest updates
|
Tuitio latest updates
|
||||||
• Tuitio nuget packages upgrade
|
• Tuitio nuget packages upgrade
|
||||||
• Tuitio configuration changes
|
• Tuitio configuration changes
|
||||||
• Many frontend developments
|
|
||||||
• Tuitio client NPM package integration: @flare/tuitio-react-client
|
|
||||||
• Added license file
|
|
||||||
• Login with enter key
|
|
||||||
</Content>
|
</Content>
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
<Note>
|
||||||
<Version>1.1.3</Version>
|
<Version>1.1.3</Version>
|
||||||
<Date>2023-03-18 02:49</Date>
|
|
||||||
<Content>
|
<Content>
|
||||||
Tuitio latest changes
|
Tuitio latest changes
|
||||||
• Account logout method and the latest changes published by Tuitio were implemented
|
• Account logout method and the latest changes published by Tuitio were implemented
|
||||||
• Netmash.Security.Authentication.Tuitio nuget package upgrade
|
• Netmash.Security.Authentication.Tuitio nuget package upgrade
|
||||||
</Content>
|
</Content>
|
||||||
</Note>
|
</Note>
|
||||||
<Note>
|
|
||||||
<Version>1.2.0</Version>
|
|
||||||
<Date>2023-03-19 14:56</Date>
|
|
||||||
<Content>
|
|
||||||
Massive frontend developments
|
|
||||||
• Complete UI refactoring
|
|
||||||
• A complete menu has been added to the application.
|
|
||||||
• The theme and the switch between dark and light mode have been implemented.
|
|
||||||
• Axios upgrade.
|
|
||||||
• The ugly and useless stepper has been removed from the machines page.
|
|
||||||
</Content>
|
|
||||||
</Note>
|
|
||||||
<Note>
|
|
||||||
<Version>1.2.1</Version>
|
|
||||||
<Date>2023-03-19 20:11</Date>
|
|
||||||
<Content>
|
|
||||||
Frontend developments
|
|
||||||
• Added sensitive info toggle.
|
|
||||||
• Apply mask on sensitive information.
|
|
||||||
• Mask machine logs.
|
|
||||||
</Content>
|
|
||||||
</Note>
|
|
||||||
<Note>
|
|
||||||
<Version>1.2.2</Version>
|
|
||||||
<Date>2023-03-19 23:14</Date>
|
|
||||||
<Content>
|
|
||||||
Added user profile page
|
|
||||||
• The data on the page is extracted from the Tuitio token.
|
|
||||||
</Content>
|
|
||||||
</Note>
|
|
||||||
<Note>
|
|
||||||
<Version>1.2.3</Version>
|
|
||||||
<Date>2023-03-25 02:26</Date>
|
|
||||||
<Content>
|
|
||||||
Important developments in frontend
|
|
||||||
• Machines view modes
|
|
||||||
• New menu entries: About, Administration and System
|
|
||||||
• About page. It contains information about the system and the release notes.
|
|
||||||
• New methods have been added to the API for reading the system version and release notes.
|
|
||||||
• Release notes area
|
|
||||||
• Timeline area
|
|
||||||
• Settings page redesign
|
|
||||||
</Content>
|
|
||||||
</Note>
|
|
||||||
</ReleaseNotes>
|
</ReleaseNotes>
|
|
@ -13,7 +13,7 @@
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MicrosoftExtensionsPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||||
<PackageReference Include="NBB.Messaging.Abstractions" Version="$(NBBPackageVersion)" />
|
<PackageReference Include="NBB.Messaging.Abstractions" Version="$(NBBPackageVersion)" />
|
||||||
<PackageReference Include="NetworkResurrector.Agent.Wrapper" Version="1.1.0" />
|
<PackageReference Include="NetworkResurrector.Agent.Wrapper" Version="1.1.0" />
|
||||||
<PackageReference Include="NetworkResurrector.Server.Wrapper" Version="1.1.1" />
|
<PackageReference Include="NetworkResurrector.Server.Wrapper" Version="1.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
using MediatR;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Xml;
|
|
||||||
|
|
||||||
namespace NetworkResurrector.Api.Application.Queries
|
|
||||||
{
|
|
||||||
public class GetReleaseNotes
|
|
||||||
{
|
|
||||||
public class Query : IRequest<Model[]>
|
|
||||||
{
|
|
||||||
public Query() { }
|
|
||||||
}
|
|
||||||
|
|
||||||
public record Model(string Version, DateTime Date, string[] Notes);
|
|
||||||
|
|
||||||
public class QueryHandler : IRequestHandler<Query, Model[]>
|
|
||||||
{
|
|
||||||
public QueryHandler() { }
|
|
||||||
|
|
||||||
public async Task<Model[]> Handle(Query request, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
var x = Directory.GetCurrentDirectory();
|
|
||||||
Console.WriteLine(x);
|
|
||||||
|
|
||||||
var releaseNotes = new XmlDocument();
|
|
||||||
releaseNotes.Load("ReleaseNotes.xml");
|
|
||||||
|
|
||||||
var rows = releaseNotes.DocumentElement.SelectNodes("Note");
|
|
||||||
var result = new List<Model>();
|
|
||||||
|
|
||||||
foreach (XmlNode node in rows)
|
|
||||||
{
|
|
||||||
var version = node.SelectSingleNode("Version").InnerText;
|
|
||||||
var date = GetReleaseDateUtc(node.SelectSingleNode("Date").InnerText);
|
|
||||||
var notes = ParseContent(node.SelectSingleNode("Content").InnerText);
|
|
||||||
|
|
||||||
result.Add(new Model(version, date, notes));
|
|
||||||
}
|
|
||||||
|
|
||||||
return await Task.FromResult(result.ToArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
private string[] ParseContent(string text)
|
|
||||||
{
|
|
||||||
var lines = text
|
|
||||||
.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None)
|
|
||||||
.Where(z => !string.IsNullOrWhiteSpace(z))
|
|
||||||
.ToArray();
|
|
||||||
|
|
||||||
for (int i = 0; i < lines.Count(); i++)
|
|
||||||
{
|
|
||||||
lines[i] = lines[i].TrimStart().TrimEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
return lines;
|
|
||||||
}
|
|
||||||
|
|
||||||
private DateTime GetReleaseDateUtc(string date)
|
|
||||||
{
|
|
||||||
var datetime = Convert.ToDateTime(date);
|
|
||||||
var utcDatetime = TimeZoneInfo.ConvertTimeToUtc(datetime, TimeZoneInfo.Local);
|
|
||||||
return utcDatetime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +1,4 @@
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using NetworkResurrector.Server.Wrapper.Services;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -12,38 +11,15 @@ namespace NetworkResurrector.Api.Application.Queries
|
||||||
{
|
{
|
||||||
public class Query : IRequest<Model> { }
|
public class Query : IRequest<Model> { }
|
||||||
|
|
||||||
public class Model
|
public record Model(string Version, DateTime LastUpdateDate);
|
||||||
{
|
|
||||||
public ServiceVersion Api { get; set; }
|
|
||||||
public ServiceVersion Server { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public record ServiceVersion(string Version, DateTime LastReleaseDate);
|
|
||||||
|
|
||||||
public class QueryHandler : IRequestHandler<Query, Model>
|
public class QueryHandler : IRequestHandler<Query, Model>
|
||||||
{
|
{
|
||||||
private readonly IResurrectorService _resurrectorService;
|
public QueryHandler()
|
||||||
|
|
||||||
public QueryHandler(IResurrectorService resurrectorService)
|
|
||||||
{
|
{
|
||||||
_resurrectorService=resurrectorService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<Model> Handle(Query request, CancellationToken cancellationToken)
|
public async Task<Model> Handle(Query request, CancellationToken cancellationToken)
|
||||||
{
|
|
||||||
var serverVersion = await _resurrectorService.GetServiceVersion();
|
|
||||||
var apiVersion = GetApiVersion();
|
|
||||||
|
|
||||||
var result = new Model
|
|
||||||
{
|
|
||||||
Api = apiVersion,
|
|
||||||
Server = new ServiceVersion(serverVersion.Version, serverVersion.LastReleaseDate)
|
|
||||||
};
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ServiceVersion GetApiVersion()
|
|
||||||
{
|
{
|
||||||
var version = Environment.GetEnvironmentVariable("APP_VERSION");
|
var version = Environment.GetEnvironmentVariable("APP_VERSION");
|
||||||
var appDate = Environment.GetEnvironmentVariable("APP_DATE");
|
var appDate = Environment.GetEnvironmentVariable("APP_DATE");
|
||||||
|
@ -51,14 +27,14 @@ namespace NetworkResurrector.Api.Application.Queries
|
||||||
if (string.IsNullOrEmpty(version))
|
if (string.IsNullOrEmpty(version))
|
||||||
version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||||
|
|
||||||
if (!DateTime.TryParse(appDate, out var lastReleaseDate))
|
if (!DateTime.TryParse(appDate, out var lastUpdateDate))
|
||||||
{
|
{
|
||||||
var location = Assembly.GetExecutingAssembly().Location;
|
var location = Assembly.GetExecutingAssembly().Location;
|
||||||
lastReleaseDate = File.GetLastWriteTime(location);
|
lastUpdateDate = File.GetLastWriteTime(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = new ServiceVersion(version, lastReleaseDate);
|
var result = new Model(version, lastUpdateDate);
|
||||||
return result;
|
return await Task.FromResult(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,12 +32,5 @@ namespace NetworkResurrector.Api.Controllers
|
||||||
var result = await _mediator.Send(query);
|
var result = await _mediator.Send(query);
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("release-notes")]
|
|
||||||
public async Task<IActionResult> GetReleaseNotes([FromRoute] GetReleaseNotes.Query query)
|
|
||||||
{
|
|
||||||
var result = await _mediator.Send(query);
|
|
||||||
return Ok(result);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,8 +33,6 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
ARG APP_VERSION=0.0.0.0
|
ARG APP_VERSION=0.0.0.0
|
||||||
ENV APP_VERSION=${APP_VERSION}
|
ENV APP_VERSION=${APP_VERSION}
|
||||||
ARG APP_DATE="-"
|
|
||||||
ENV APP_DATE=${APP_DATE}
|
|
||||||
|
|
||||||
#Workaround to lower the TLS level in container for old sql server version
|
#Workaround to lower the TLS level in container for old sql server version
|
||||||
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf
|
RUN sed -i 's/TLSv1.2/TLSv1.0/g' /etc/ssl/openssl.cnf
|
||||||
|
|
|
@ -5,10 +5,6 @@
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="..\..\..\ReleaseNotes.xml" Link="ReleaseNotes.xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.4" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.4" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration" Version="$(MicrosoftExtensionsPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Configuration" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using NetworkResurrector.Server.PublishedLanguage.Dto;
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@ -10,15 +9,17 @@ namespace NetworkResurrector.Server.Application.Queries
|
||||||
{
|
{
|
||||||
public class GetSystemVersion
|
public class GetSystemVersion
|
||||||
{
|
{
|
||||||
public class Query : IRequest<ServiceVersion> { }
|
public class Query : IRequest<Model> { }
|
||||||
|
|
||||||
public class QueryHandler : IRequestHandler<Query, ServiceVersion>
|
public record Model(string Version, DateTime LastUpdateDate);
|
||||||
|
|
||||||
|
public class QueryHandler : IRequestHandler<Query, Model>
|
||||||
{
|
{
|
||||||
public QueryHandler()
|
public QueryHandler()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ServiceVersion> Handle(Query request, CancellationToken cancellationToken)
|
public async Task<Model> Handle(Query request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var version = Environment.GetEnvironmentVariable("APP_VERSION");
|
var version = Environment.GetEnvironmentVariable("APP_VERSION");
|
||||||
var appDate = Environment.GetEnvironmentVariable("APP_DATE");
|
var appDate = Environment.GetEnvironmentVariable("APP_DATE");
|
||||||
|
@ -26,13 +27,13 @@ namespace NetworkResurrector.Server.Application.Queries
|
||||||
if (string.IsNullOrEmpty(version))
|
if (string.IsNullOrEmpty(version))
|
||||||
version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
version = Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
|
||||||
|
|
||||||
if (!DateTime.TryParse(appDate, out var lastReleaseDate))
|
if (!DateTime.TryParse(appDate, out var lastUpdateDate))
|
||||||
{
|
{
|
||||||
var location = Assembly.GetExecutingAssembly().Location;
|
var location = Assembly.GetExecutingAssembly().Location;
|
||||||
lastReleaseDate = File.GetLastWriteTime(location);
|
lastUpdateDate = File.GetLastWriteTime(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = new ServiceVersion(version, lastReleaseDate);
|
var result = new Model(version, lastUpdateDate);
|
||||||
return await Task.FromResult(result);
|
return await Task.FromResult(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace NetworkResurrector.Server.PublishedLanguage.Dto
|
|
||||||
{
|
|
||||||
public record ServiceVersion(string Version, DateTime LastReleaseDate);
|
|
||||||
}
|
|
|
@ -6,7 +6,7 @@
|
||||||
<RepositoryUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</RepositoryUrl>
|
<RepositoryUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageProjectUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</PackageProjectUrl>
|
<PackageProjectUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</PackageProjectUrl>
|
||||||
<Version>1.1.1</Version>
|
<Version>1.1.0</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
internal struct ApiRoutes
|
internal struct ApiRoutes
|
||||||
{
|
{
|
||||||
public const string
|
public const string
|
||||||
SystemVersion = "system/version",
|
|
||||||
Wake = "resurrector/wake",
|
Wake = "resurrector/wake",
|
||||||
Ping = "resurrector/ping",
|
Ping = "resurrector/ping",
|
||||||
Shutdown = "resurrector/shutdown";
|
Shutdown = "resurrector/shutdown";
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<PackageProjectUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</PackageProjectUrl>
|
<PackageProjectUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</PackageProjectUrl>
|
||||||
<RepositoryUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</RepositoryUrl>
|
<RepositoryUrl>https://lab.code-rove.com/gitea/tudor.stanciu/network-resurrector</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<Version>1.1.1</Version>
|
<Version>1.1.0</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -15,10 +15,7 @@
|
||||||
<PackageReference Include="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsPackageVersion)" />
|
<PackageReference Include="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" />
|
<PackageReference Include="Microsoft.Net.Http.Headers" Version="2.2.8" />
|
||||||
<PackageReference Include="Netmash.Extensions.Http" Version="1.0.0" />
|
<PackageReference Include="Netmash.Extensions.Http" Version="1.0.0" />
|
||||||
</ItemGroup>
|
<PackageReference Include="NetworkResurrector.Server.PublishedLanguage" Version="1.1.0" />
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\NetworkResurrector.Server.PublishedLanguage\NetworkResurrector.Server.PublishedLanguage.csproj" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
using NetworkResurrector.Server.PublishedLanguage.Dto;
|
using NetworkResurrector.Server.PublishedLanguage.Events;
|
||||||
using NetworkResurrector.Server.PublishedLanguage.Events;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace NetworkResurrector.Server.Wrapper.Services
|
namespace NetworkResurrector.Server.Wrapper.Services
|
||||||
{
|
{
|
||||||
public interface IResurrectorService
|
public interface IResurrectorService
|
||||||
{
|
{
|
||||||
Task<ServiceVersion> GetServiceVersion();
|
|
||||||
Task<MachineWaked> Wake(string macAddress);
|
Task<MachineWaked> Wake(string macAddress);
|
||||||
Task<MachinePinged> Ping(string ipAddressOrMachineName);
|
Task<MachinePinged> Ping(string ipAddressOrMachineName);
|
||||||
Task<MachineShutdown> Shutdown(string ipAddressOrMachineName);
|
Task<MachineShutdown> Shutdown(string ipAddressOrMachineName);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using Netmash.Extensions.Http;
|
using Netmash.Extensions.Http;
|
||||||
using NetworkResurrector.Server.PublishedLanguage.Commands;
|
using NetworkResurrector.Server.PublishedLanguage.Commands;
|
||||||
using NetworkResurrector.Server.PublishedLanguage.Dto;
|
|
||||||
using NetworkResurrector.Server.PublishedLanguage.Events;
|
using NetworkResurrector.Server.PublishedLanguage.Events;
|
||||||
using NetworkResurrector.Server.Wrapper.Constants;
|
using NetworkResurrector.Server.Wrapper.Constants;
|
||||||
using NetworkResurrector.Server.Wrapper.Models;
|
using NetworkResurrector.Server.Wrapper.Models;
|
||||||
|
@ -30,12 +29,6 @@ namespace NetworkResurrector.Server.Wrapper.Services
|
||||||
_httpClient = httpClient;
|
_httpClient = httpClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ServiceVersion> GetServiceVersion()
|
|
||||||
{
|
|
||||||
var result = await _httpClient.ExecuteGetRequest<ServiceVersion>(ApiRoutes.SystemVersion);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<MachineWaked> Wake(string macAddress)
|
public async Task<MachineWaked> Wake(string macAddress)
|
||||||
{
|
{
|
||||||
var body = new WakeMachine() { MacAddress = macAddress };
|
var body = new WakeMachine() { MacAddress = macAddress };
|
||||||
|
|
Loading…
Reference in New Issue