Skip to content

Commit

Permalink
Convert the remaining Razor Pages to Blazor components.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Feb 20, 2024
1 parent e3da9f0 commit 9b7f0f0
Show file tree
Hide file tree
Showing 43 changed files with 325 additions and 413 deletions.
4 changes: 2 additions & 2 deletions .azure-pipelines/Release Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- task: UseDotNet@2
displayName: Use .NET SDK
inputs:
version: 7.x
version: 8.x

- task: DotNetCoreCLI@2
displayName: dotnet publish x64
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
- task: UseDotNet@2
displayName: Use .NET SDK
inputs:
version: 7.x
version: 8.x

- task: DotNetCoreCLI@2
displayName: dotnet restore
Expand Down
1 change: 1 addition & 0 deletions Agent.Installer.Win/Agent.Installer.Win.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
Expand Down
2 changes: 1 addition & 1 deletion Agent.Installer.Win/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Agent.Installer.Win/Services/InstallerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private void CreateSupportShortcut(string serverUrl, string deviceUuid, bool cre
var shortcut = (IWshShortcut)shell.CreateShortcut(shortcutLocation);
shortcut.Description = "Get IT support";
shortcut.IconLocation = Path.Combine(_installPath, "Remotely_Agent.exe");
shortcut.TargetPath = serverUrl.TrimEnd('/') + $"/GetSupport?deviceID={deviceUuid}";
shortcut.TargetPath = serverUrl.TrimEnd('/') + $"/get-support?deviceID={deviceUuid}";
shortcut.Save();

if (createSupportShortcut)
Expand Down
2 changes: 1 addition & 1 deletion Agent/Services/FileLogsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public async IAsyncEnumerable<byte[]> ReadAllBytes([EnumeratorCancellation] Canc
{
yield break;
}
yield return File.ReadAllBytes(file);
yield return chunk;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Ideally, you'd be doing remote control from an actual computer or laptop. Howev
- Click-and-drag: Long-press, then drag
## End User Support Page
There's a page at `/GetSupport` where end users can request support. When the form is submitted, an alert appears on the main page, above the grid.
There's a page at `/get-support` where end users can request support. When the form is submitted, an alert appears on the main page, above the grid.
A shortcut to this page is placed in the `\Program Files\Remotely\` folder. You can copy it anywhere you like. You can also have it copied to the desktop automatically by using the `-supportshortcut` switch on the installer.
Expand Down
2 changes: 1 addition & 1 deletion Server/API/OrganizationManagementController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public async Task<IActionResult> SendInvite([FromBody] InviteViewModel invite)
return BadRequest(newInvite.Reason);
}

var inviteURL = $"{Request.Scheme}://{Request.Host}/Invite?id={newInvite.Value.ID}";
var inviteURL = $"{Request.Scheme}://{Request.Host}/Invite/{newInvite.Value.ID}";
var emailResult = await _emailSender.SendEmailAsync(invite.InvitedUser, "Invitation to Organization in Remotely",
$@"<img src='{Request.Scheme}://{Request.Host}/images/Remotely_Logo.png'/>
<br><br>
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/Account/Pages/Login.razor
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<label class="form-label">
<InputCheckbox
@bind-Value="Input.RememberMe"
class="darker-border-checkbox form-check-input ml-0 d-inline-block position-relative align-middle mt-0" />
class="darker-border-checkbox form-check-input ms-0 d-inline-block position-relative align-middle mt-0" />
<span class="align-middle">
Remember me
</span>
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/AlertBanner.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@if (!string.IsNullOrEmpty(Message))
{
<div class="alert alert-@GetStatusClass() alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close" @onclick="Close"><span aria-hidden="true">&times;</span></button>
<button type="button" class="btn-close" data-bs-dismiss="alert" @onclick="Close"></button>
@Message
</div>
}
Expand Down
6 changes: 3 additions & 3 deletions Server/Components/AlertsFrame.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

<div id="alertsFrame" class="bg-secondary @FrameClass">
<div class="text-right">
<button id="clearAllAlertsButton" class="btn btn-secondary mt-2 mr-2 align-top" @onclick="ClearAllAlerts">
<button id="clearAllAlertsButton" class="btn btn-secondary mt-2 me-2 align-top" @onclick="ClearAllAlerts">
Clear All
</button>
<button id="closeAlertsFrameButton" class="btn btn-secondary btn-sm mt-2 mr-2 align-top" @onclick="ToggleOpen">
<button id="closeAlertsFrameButton" class="btn btn-secondary btn-sm mt-2 me-2 align-top" @onclick="ToggleOpen">
<span class="oi oi-x pointer"></span>
</button>
</div>

<div id="alertsBody" class="mt-3">
@foreach (var alert in _alerts)
{
<div @key="alert.ID" id="@alert.ID" class="card border-primary mb-3 mr-2 ml-2">
<div @key="alert.ID" id="@alert.ID" class="card border-primary mb-3 me-2 ms-2">
<div class="card-header">@alert.CreatedOn.ToString()</div>
<div class="card-body">
<h6 class="card-title">@alert.Device?.DeviceName</h6>
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/AuthorizedIndex.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

@if (!string.IsNullOrWhiteSpace(AppConfig.MessageOfTheDay))
{
<div class="mr-5">
<div class="me-5">
<AlertBanner Message="@AppConfig.MessageOfTheDay" StatusClass="info" />
</div>
}
Expand Down
4 changes: 2 additions & 2 deletions Server/Components/Devices/ChatCard.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<div class="chat-card border border-secondary bg-secondary @Session.ExpandedClass">
<div class="chat-header bg-primary text-white p-2" @onclick="HeaderClicked">
<h6 class="mt-3">
<i class="oi oi-chat mr-1"></i>
<span class="badge badge-info badge-pill mr-1">
<i class="oi oi-chat me-1"></i>
<span class="badge badge-info badge-pill me-1">
@Session.MissedChats
</span>
@Session.DeviceName
Expand Down
22 changes: 11 additions & 11 deletions Server/Components/Devices/DeviceCard.razor
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@attribute [Authorize]
@inherits AuthComponentBase

<div @ref="_card" class="card border-secondary my-3 mr-3 device-card @_theme @GetCardStateClass()"
<div @ref="_card" class="card border-secondary my-3 me-3 device-card @_theme @GetCardStateClass()"
@onclick="ExpandCard"
@onclick:stopPropagation
@oncontextmenu="ContextMenuOpening"
Expand All @@ -28,7 +28,7 @@
<i class="oi oi-power-standby text-danger" title="Offline"></i>
}
</div>
<div class="overflow-hidden ml-2">
<div class="overflow-hidden ms-2">
<div class="d-inline-block">
<div>@Device.DeviceName</div>

Expand All @@ -39,7 +39,7 @@
<div class="text-right">
@if (IsExpanded)
{
<button class="btn btn-sm mr-2" title="Open in New Tab"
<button class="btn btn-sm me-2" title="Open in New Tab"
@onclick:stopPropagation
@onclick="OpenDeviceDetails">
<i class="oi oi-external-link" style="font-size: 1.3em"></i>
Expand Down Expand Up @@ -72,49 +72,49 @@

<div style="grid-row: span 2" class="expanded-visible"></div>
<div style="grid-row: span 2" class="expanded-visible">
<DropdownButton DropDownMenuClass="dropdown-menu-right mb-2" ButtonClass="btn-primary">
<DropdownButton DropDownMenuClass="dropdown-menu-end mb-2" ButtonClass="btn-primary">
<ButtonContent>
<i class="oi oi-bolt"></i>
<span class="ml-2">Actions</span>
<span class="ms-2">Actions</span>
</ButtonContent>
<ChildListItems>
<li>
<button class="dropdown-item" @onclick="StartChat">
<i class="oi oi-chat" title="Chat"></i>
<span class="ml-2">Chat</span>
<span class="ms-2">Chat</span>
</button>
</li>
<li>
<button class="dropdown-item" @onclick="() => StartRemoteControl(false)">
<i class="oi oi-laptop" title="Remote Control"></i>
<span class="ml-2">Remote Control</span>
<span class="ms-2">Remote Control</span>
</button>
</li>
<li>
<button class="dropdown-item" @onclick="() => StartRemoteControl(true)">
<i class="oi oi-eye" title="View Only"></i>
<span class="ml-2">View Only</span>
<span class="ms-2">View Only</span>
</button>
</li>
<li>
<button class="dropdown-item" @onclick="() => WakeDevice()">
<i class="oi oi-power-standby" title="Wake Device"></i>
<span class="ml-2">Wake</span>
<span class="ms-2">Wake</span>
</button>
</li>
<li>
<FileInputButton ClassNames="dropdown-item btn btn-primary"
OnChanged="OnFileInputChanged">
<ButtonContent>
<i class="oi oi-data-transfer-upload" title="Upload File"></i>
<span class="ml-2">Upload File</span>
<span class="ms-2">Upload File</span>
</ButtonContent>
</FileInputButton>
</li>
<li>
<button class="dropdown-item bg-danger" @onclick="UninstallAgent">
<i class="oi oi-delete" title="Uninstall"></i>
<span class="ml-2">Uninstall</span>
<span class="ms-2">Uninstall</span>
</button>
</li>
</ChildListItems>
Expand Down
4 changes: 2 additions & 2 deletions Server/Components/Devices/DevicesFrame.razor
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<label class="custom-control-label" for="hideOfflineDevicesCheckbox">Hide offline devices</label>
</div>
<div class="mt-2">
<button class="btn btn-sm btn-secondary mr-2" @onclick="SelectAllCards">Select All</button>
<button class="btn btn-sm btn-secondary me-2" @onclick="SelectAllCards">Select All</button>
<button class="btn btn-sm btn-primary" @onclick="HandleRefreshClicked">Refresh</button>
</div>
</div>
Expand Down Expand Up @@ -78,7 +78,7 @@
<option value="100">100</option>
<option value="200">200</option>
</select>
<span class="ml-1 small">per page</span>
<span class="ms-1 small">per page</span>
</div>
</div>

Expand Down
12 changes: 6 additions & 6 deletions Server/Components/Devices/Terminal.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<div class="terminal-frame @_terminalOpenClass">
<div class="terminal-header">
<div>
<button class="btn btn-secondary terminal-button ml-4" @onclick="ToggleTerminalOpen">
<button class="btn btn-secondary terminal-button ms-4" @onclick="ToggleTerminalOpen">
<i class="oi oi-terminal"></i>
<span class="ml-2">Terminal</span>
<span class="ms-2">Terminal</span>
</button>
</div>
<div class="text-right">
<button class="btn btn-secondary terminal-button mr-4" @onclick="ShowQuickScripts">
<button class="btn btn-secondary terminal-button me-4" @onclick="ShowQuickScripts">
<i class="oi oi-script"></i>
<span class="ml-2">Quick Scripts</span>
<span class="ms-2">Quick Scripts</span>
</button>
</div>

Expand All @@ -22,15 +22,15 @@

@foreach (var line in TerminalStore.TerminalLines)
{
<div @key="line.Id" class="ml-1 terminal-line @line.ClassName" title="@line.Title">
<div @key="line.Id" class="ms-1 terminal-line @line.ClassName" title="@line.Title">
@line.Text
</div>
}
</div>
<div>
<div class="terminal-input-area px-2 mb-2">
<div>
<button class="btn btn-sm btn-secondary mr-1"
<button class="btn btn-sm btn-secondary me-1"
style="align-self: center"
@onclick="ShowTerminalHelp">
<i class="oi oi-question-mark"></i>
Expand Down
4 changes: 2 additions & 2 deletions Server/Components/DropdownButton.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inject IJsInterop JsInterop

<div class="dropdown @DropDownClass" @onmouseout="MouseLeft" @onmouseover="MouseEnter">
<div class="@WrapperClass" @onmouseout="MouseLeft" @onmouseover="MouseEnter">
<button class="btn dropdown-toggle @ButtonClass @_showClass"
type="button"
data-bs-toggle="dropdown"
Expand All @@ -25,7 +25,7 @@
public RenderFragment? ButtonContent { get; set; }

[Parameter]
public string? DropDownClass { get; set; }
public string? WrapperClass { get; set; }

[Parameter]
public string? DropDownMenuClass { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/Layout/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@inject IApplicationConfig AppConfig
@inject IDataService DataService

<div class="pl-4 pb-1 pr-0 pt-0 navbar navbar-dark" style="background-color: rgba(0,0,0,0.3)">
<div class="ps-4 pb-1 pe-0 pt-0 navbar navbar-dark" style="background-color: rgba(0,0,0,0.3)">
<a class="navbar-brand text-left" href="">
<div class="logo-title">
@if (!string.IsNullOrWhiteSpace(_organization?.OrganizationName))
Expand Down
1 change: 0 additions & 1 deletion Server/Components/Layout/NavMenu.razor.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
width: 2rem;
font-size: 1.1rem;
vertical-align: text-top;
top: -2px;
}

.nav-item {
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/ModalContents/EditDeviceGroup.razor
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<input
id="@group.ID"
type="checkbox"
class="align-middle mr-2"
class="align-middle me-2"
checked="@(DoesGroupContainUser(group))"
@onchange="ev => GroupCheckChanged(ev, group)" />
<label class="align-middle mb-0" for="@group.ID">@group.Name</label>
Expand Down
4 changes: 1 addition & 3 deletions Server/Components/ModalHarness.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">@ModalService.Title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" @onclick="CloseModal">
<span aria-hidden="true">&times;</span>
</button>
<button type="button" class="btn-close" data-bs-dismiss="alert" @onclick="CloseModal"></button>
</div>
<div class="modal-body" >
@if (ModalService.RenderBody is not null)
Expand Down
10 changes: 5 additions & 5 deletions Server/Components/Pages/ApiKeys.razor
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,26 @@ else if (User is not null)
{
<h5 class="text-warning font-weight-bold mb-2 mt-4">Warning: The key's secret will only be shown once. Save it now.</h5>
<h5 class="mb-4">
<label class="mr-1">Key Secret:</label>
<label class="me-1">Key Secret:</label>
<input class="form-control custom-control-inline" readonly value="@_newKeySecret" style="width:400px" />
</h5>
}


<div class="mb-2 mt-4">
<label class="mr-1">New Token Name:</label>
<label class="me-1">New Token Name:</label>
<input @bind="_createKeyName" @bind:event="oninput"
class="form-control form-control-sm custom-control-inline mr-1"
class="form-control form-control-sm custom-control-inline me-1"
style="width:200px" />

<button class="btn btn-primary" type="button" @onclick="CreateNewKey">Create</button>

<button class="btn btn-sm btn-secondary ml-2" @onclick="ShowApiKeyHelp">
<button class="btn btn-sm btn-secondary ms-2" @onclick="ShowApiKeyHelp">
<span class="oi oi-question-mark"></span>
</button>
</div>

<table class="table table-hover table-striped">
<table class="table table-dark table-hover table-striped">
<thead>
<tr>
<th>Name</th>
Expand Down
2 changes: 1 addition & 1 deletion Server/Components/Pages/Branding.razor
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<InputFile type="file" accept="image/png" class="form-control" OnChange="IconUploadInputChanged" />
</div>
<div class="form-group text-right">
<button class="btn btn-secondary mr-3" type="button" @onclick="ResetBranding">Reset</button>
<button class="btn btn-secondary me-3" type="button" @onclick="ResetBranding">Reset</button>
<button class="btn btn-primary" type="submit">Submit</button>
</div>
</EditForm>
Expand Down
4 changes: 2 additions & 2 deletions Server/Components/Pages/DeviceDetails.razor
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ else
else
{
<div class="mb-2">
<button class="btn btn-primary mr-2" @onclick="GetRemoteLogs">Refresh</button>
<button class="btn btn-primary me-2" @onclick="GetRemoteLogs">Refresh</button>
<button class="btn btn-danger" @onclick="DeleteLogs">Delete Logs</button>
</div>

Expand Down Expand Up @@ -238,7 +238,7 @@ else
<h3 class="mb-3 mt-3">
Script History
</h3>
<table class="table table-hover table-striped">
<table class="table table-dark table-hover table-striped">
<thead>
<tr>
<th>Shell</th>
Expand Down
Loading

0 comments on commit 9b7f0f0

Please sign in to comment.