+
+
+ - License key:
-- Cancelling a lease on server side does not prevent the client from using the licensed - software until the lease has expired. You, and not the licensing server, are - ultimately responsible to ensure that the license agreement is being respected. -
-- Are you sure you want to cancel the lease? -
-
-
- Back -
- -
-
-
-
-
- Page generated on <%=VirtualDateTime.UtcNow.ToLocalTime()%>. -
-
- From
-
-
- Back -
-No license has been installed in this license server.
-
- Install a new license
-
- Export logs
-
- Page generated on <%=VirtualDateTime.UtcNow.ToLocalTime()%>. -
- -- Back -
- -- 30 days | - 90 days | - 180 days | - 365 days -
- -
-+ Back +
+Paste the license key sent to you by PostSharp Technologies.
+ + diff --git a/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/AddLicense.cshtml.cs b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/AddLicense.cshtml.cs new file mode 100644 index 0000000..4b2b6ed --- /dev/null +++ b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/AddLicense.cshtml.cs @@ -0,0 +1,87 @@ +// Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details. + +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.EntityFrameworkCore; +using SharpCrafters.Backstage.LicenseServer.Data; +using SharpCrafters.Backstage.LicenseServer.Licensing; + +namespace SharpCrafters.Backstage.LicenseServer.Pages.Admin; + +///+ Back +
++ Cancel the lease of @Model.Lease!.UserName on + @Model.Lease.Machine, which currently runs until + @Model.Lease.EndTime.ToString( "g" )? +
+ ++ The seat is released on this server immediately, and the lease is kept in the audit log. +
+ ++ The machine of the user keeps the lease it already holds until that lease expires, because a + client is never told that a lease was cancelled. Cancelling frees the seat for somebody else; it + does not stop the product on that machine. +
+ + diff --git a/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/Cancel.cshtml.cs b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/Cancel.cshtml.cs new file mode 100644 index 0000000..a998c57 --- /dev/null +++ b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/Cancel.cshtml.cs @@ -0,0 +1,59 @@ +// Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details. + +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.EntityFrameworkCore; +using SharpCrafters.Backstage.LicenseServer.Data; + +namespace SharpCrafters.Backstage.LicenseServer.Pages.Admin; + +///+ This license is disabled: it serves no new lease. The leases it has already granted run + until they expire. +
++ @Model.Leases.Count current lease(s), consuming + @Model.Seats seat(s). + See the usage history. +
+ ++ A seat is one user working on up to @Model.MachinesPerSeatText. A user working on more machines + takes more than one seat: the number of machines divided by @Model.MachinesPerSeat, rounded up. + The capacity of a license is a number of seats. +
+ +@if (Model.Leases.Count == 0) +{ +No lease is currently held against this license.
+} +else +{ +| Lease | +User | +Machine | +Start | +End | +Grace | ++ |
|---|---|---|---|---|---|---|
| @lease.LeaseId | +@lease.UserName | +@lease.Machine | +@lease.StartTime.ToString( "g" ) | +@lease.EndTime.ToString( "g" ) | +@( lease.Grace ? "Yes" : "" ) | ++ Cancel + | +
+ Back +
++ The export is a text file with one line per lease, with the user name and the machine name as + they were recorded. The file contains personal data. It is meant for the administrator of this + server, who uses it to understand how the licenses are used. +
+ + diff --git a/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/Export.cshtml.cs b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/Export.cshtml.cs new file mode 100644 index 0000000..fe2ef18 --- /dev/null +++ b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/Export.cshtml.cs @@ -0,0 +1,77 @@ +// Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details. + +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Globalization; + +namespace SharpCrafters.Backstage.LicenseServer.Pages.Admin; + +///+ Back +
++ Simulates a team building software over a period, so that the dashboard and the usage graph have + something to show. This page exists only in a development environment. +
+ +@if (Model.Message != null) +{ ++ @Model.Message +
+} + + diff --git a/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/GenerateDemoData.cshtml.cs b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/GenerateDemoData.cshtml.cs new file mode 100644 index 0000000..37e443b --- /dev/null +++ b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Admin/GenerateDemoData.cshtml.cs @@ -0,0 +1,158 @@ +// Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details. + +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ModelBinding; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.EntityFrameworkCore; +using SharpCrafters.Backstage.LicenseServer.Data; +using SharpCrafters.Backstage.LicenseServer.Services; + +namespace SharpCrafters.Backstage.LicenseServer.Pages.Admin; + +///An unexpected error occurred while handling your request.
+ +@if (Model.RequestId != null) +{ +Request identifier: @Model.RequestId
The details are in the server log.
+ + diff --git a/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Error.cshtml.cs b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Error.cshtml.cs new file mode 100644 index 0000000..fdca4f7 --- /dev/null +++ b/src/SharpCrafters.Backstage.LicenseServer.Web/Pages/Error.cshtml.cs @@ -0,0 +1,18 @@ +// Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details. + +using System.Diagnostics; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace SharpCrafters.Backstage.LicenseServer.Pages; + +[ResponseCache( Duration = 0, Location = ResponseCacheLocation.None, NoStore = true )] +public sealed class ErrorModel : PageModel +{ + ///+ @foreach (var window in GraphModel.AllowedWindows) + { + if (window == Model.Days) + { + @window days + } + else + { + @window days + } + } + · Back +
++ No license has been registered yet. Add a license key to + let this server serve leases. +
+| License | +Type | +Product | +Seats | +In use | +Grace started | +Maintenance ends | +Status | ++ |
|---|---|---|---|---|---|---|---|---|
| @license.LicenseId | +@license.LicenseType | +@license.ProductCode | +@( license.MaxUsers?.ToString() ?? "Unlimited" ) | +@license.CurrentUsers | +@license.GraceStartTime?.ToString( "d" ) | +@license.MaintenanceEndDate?.ToString( "d" ) | ++ @license.Status + | ++ Details + · + Usage + | +