Temporarily disabled Swagger. It's currently not able to build for Linux on Windows in ASP.NET Core 3.

This commit is contained in:
Jared Goodwin 2019-11-30 10:15:05 -08:00
parent 61d904ceef
commit ec173f033c
70 changed files with 12 additions and 37980 deletions

View File

@ -74,7 +74,7 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" PrivateAssets="All" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc4" />
<PackageReference Include="System.Drawing.Common" Version="4.6.1" />
</ItemGroup>

View File

@ -146,10 +146,11 @@ namespace Remotely.Server
})
.AddMessagePackProtocol();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Remotely API", Version = "v1" });
});
// TODO: Re-enable when Swagger works when building for Linux on Windows.
//services.AddSwaggerGen(c =>
//{
// c.SwaggerDoc("v1", new OpenApiInfo { Title = "Remotely API", Version = "v1" });
//});
services.AddLogging();
services.AddScoped<IEmailSender, EmailSender>();
@ -189,12 +190,13 @@ namespace Remotely.Server
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseSwagger();
// TODO: Re-enable when Swagger works when building for Linux on Windows.
//app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "Remotely API V1");
});
//app.UseSwaggerUI(c =>
//{
// c.SwaggerEndpoint("/swagger/v1/swagger.json", "Remotely API V1");
//});
app.UseRouting();

View File

@ -1,152 +0,0 @@
import * as UI from "./UI.js";
import * as DataGrid from "./DataGrid.js";
import { CreateCommandHarness, AddCommandResultsHarness, AddPSCoreResultsHarness, UpdateResultsCount } from "./ResultsParser.js";
import { Store } from "./Store.js";
import { Main } from "./Main.js";
export var Connection;
export var ServiceID;
export var Connected;
export function Connect() {
var signalR = window["signalR"];
Connection = new signalR.HubConnectionBuilder()
.withUrl("/BrowserHub")
.configureLogging(signalR.LogLevel.Information)
.build();
applyMessageHandlers(Connection);
Connection.start().catch(err => {
console.error(err.toString());
Connected = false;
UI.AddConsoleOutput("Your connection was lost. Refresh the page or enter a command to reconnect.");
}).then(() => {
Connected = true;
});
this.Connection.closedCallbacks.push((ev) => {
Connected = false;
if (!Store.IsDisconnectExpected) {
UI.ShowModal("Connection Failure", "Your connection was lost. Click Reconnect to start a new session.", `<button type="button" class="btn btn-secondary" onclick="location.reload()">Reconnect</button>`);
UI.AddConsoleOutput("Connection lost.");
}
});
}
;
function applyMessageHandlers(hubConnection) {
hubConnection.on("UserOptions", (options) => {
Main.UserSettings.CommandModeShortcuts.Web = options.CommandModeShortcutWeb;
Main.UserSettings.CommandModeShortcuts.PSCore = options.CommandModeShortcutPSCore;
Main.UserSettings.CommandModeShortcuts.WinPS = options.CommandModeShortcutWinPS;
Main.UserSettings.CommandModeShortcuts.Bash = options.CommandModeShortcutBash;
Main.UserSettings.CommandModeShortcuts.CMD = options.CommandModeShortcutCMD;
UI.AddConsoleOutput("Console connected.");
DataGrid.RefreshGrid();
});
hubConnection.on("LockedOut", (args) => {
location.assign("/Identity/Account/Lockout");
});
hubConnection.on("DeviceCameOnline", (device) => {
DataGrid.AddOrUpdateDevice(device);
});
hubConnection.on("DeviceWentOffline", (device) => {
DataGrid.AddOrUpdateDevice(device);
});
hubConnection.on("DeviceHeartbeat", (device) => {
DataGrid.AddOrUpdateDevice(device);
});
hubConnection.on("RefreshDeviceList", () => {
DataGrid.RefreshGrid();
});
hubConnection.on("PSCoreResult", (result) => {
AddPSCoreResultsHarness(result);
UpdateResultsCount(result.CommandContextID);
});
hubConnection.on("CommandResult", (result) => {
AddCommandResultsHarness(result);
UpdateResultsCount(result.CommandContextID);
});
hubConnection.on("DisplayConsoleMessage", (message) => {
UI.AddConsoleOutput(message);
});
hubConnection.on("DisplayConsoleHTML", (message) => {
UI.AddConsoleHTML(message);
});
hubConnection.on("GetGroupsResult", (devices) => {
var output = `<div>Permission Groups:</div>
<table class="console-device-table table table-responsive">
<thead><tr>
<th>Device Name</th><th>Permission Groups</th>
</tr></thead>`;
var deviceList = devices.map(x => {
return `<tr>
<td>${x.DeviceName}</td>
<td>
${x.DevicePermissionLinks.map(x => x.PermissionGroup.Name + "<br />").join("")}
</td>
</tr>`;
});
output += deviceList.join("");
output += "</table>";
UI.AddConsoleOutput(output);
});
hubConnection.on("TransferCompleted", (transferID) => {
var completedWrapper = document.getElementById(transferID + "-completed");
var count = parseInt(completedWrapper.innerHTML);
completedWrapper.innerHTML = (count + 1).toString();
});
hubConnection.on("PSCoreResultViaAjax", (commandID, deviceID) => {
var targetURL = `${location.origin}/API/Commands/PSCoreResult/${commandID}/${deviceID}`;
var xhr = new XMLHttpRequest();
xhr.open("get", targetURL);
xhr.onload = function () {
if (xhr.status == 200) {
AddPSCoreResultsHarness(JSON.parse(xhr.responseText));
UpdateResultsCount(commandID);
}
};
xhr.send();
});
hubConnection.on("WinPSResultViaAjax", (commandID, deviceID) => {
var targetURL = `${location.origin}/API/Commands/WinPSResult/${commandID}/${deviceID}`;
var xhr = new XMLHttpRequest();
xhr.open("get", targetURL);
xhr.onload = function () {
if (xhr.status == 200) {
AddCommandResultsHarness(JSON.parse(xhr.responseText));
UpdateResultsCount(commandID);
}
};
xhr.send();
});
hubConnection.on("CMDResultViaAjax", (commandID, deviceID) => {
var targetURL = `${location.origin}/API/Commands/PSCoreResult/${commandID}/${deviceID}`;
var xhr = new XMLHttpRequest();
xhr.open("get", targetURL);
xhr.onload = function () {
if (xhr.status == 200) {
AddCommandResultsHarness(JSON.parse(xhr.responseText));
UpdateResultsCount(commandID);
}
};
xhr.send();
});
hubConnection.on("BashResultViaAjax", (commandID, deviceID) => {
var targetURL = `${location.origin}/API/Commands/PSCoreResult/${commandID}/${deviceID}`;
var xhr = new XMLHttpRequest();
xhr.open("get", targetURL);
xhr.onload = function () {
if (xhr.status == 200) {
AddCommandResultsHarness(JSON.parse(xhr.responseText));
UpdateResultsCount(commandID);
}
};
xhr.send();
});
hubConnection.on("CommandContextCreated", (context) => {
UI.AddConsoleHTML(CreateCommandHarness(context).outerHTML);
});
hubConnection.on("ServiceID", (serviceID) => {
ServiceID = serviceID;
});
hubConnection.on("UnattendedSessionReady", (rcConnectionID) => {
window.open(`/RemoteControl?clientID=${rcConnectionID}&serviceID=${ServiceID}`, "_blank");
});
}
//# sourceMappingURL=BrowserSockets.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,172 +0,0 @@
import { UserSettings } from "./UserSettings.js";
import { Store } from "./Store.js";
import { WebCommands } from "./Commands/WebCommands.js";
import * as UI from "./UI.js";
import { CMDCommands } from "./Commands/CMDCommands.js";
import { PSCoreCommands } from "./Commands/PSCoreCommands.js";
import { WinPSCommands } from "./Commands/WinPSCommands.js";
import { BashCommands } from "./Commands/BashCommands.js";
var commandCompletionDisplayTimeout;
export function DisplayCommandCompletions(commands, relevantText) {
Store.CommandCompletionTimeout = window.setTimeout(() => {
commands.forEach(x => {
var commandCompletionItem = document.createElement("div");
commandCompletionItem.classList.add("command-completion-item");
commandCompletionItem.innerHTML = x.Name;
commandCompletionItem.onclick = function () {
var commandText = UI.ConsoleTextArea.value;
var insertCommandStart = commandText.lastIndexOf(relevantText);
UI.ConsoleTextArea.value = commandText.substring(0, insertCommandStart) + commandCompletionItem.innerHTML;
UI.CommandCompletionDiv.classList.add("hidden");
UI.CommandInfoDiv.classList.add("hidden");
};
commandCompletionItem.onfocus = function () {
ShowCommandInfo(x);
};
UI.CommandCompletionDiv.appendChild(commandCompletionItem);
});
if (commands.length > 0) {
var currentText = UI.ConsoleTextArea.value.toLowerCase();
if (commands.some(x => x.Name.toLowerCase().startsWith(currentText))) {
Store.CommandCompletionPosition = commands.findIndex(x => x.Name.toLowerCase().startsWith(currentText));
}
UI.CommandCompletionDiv.classList.remove("hidden");
HighlightCompletionWindowItem(Store.CommandCompletionPosition);
ShowCommandInfo(commands[Store.CommandCompletionPosition]);
PositionCommandCompletionWindow();
}
}, Math.min(commands.length, 1000));
}
export function DisplayParameterCompletions(command, parameters, commandText) {
if (parameters.length > 0 && !parameters.some(x => x.Value.length == 0) && !commandText.endsWith("-")) {
return;
}
UI.CommandCompletionDiv.classList.remove("hidden");
var remainingParams = command.Parameters.filter(x => !parameters.some(y => y.Name.toLowerCase() == x.Name.toLowerCase() &&
y.Value.length > 0))
.filter(x => x.Name.toLowerCase()
.startsWith(UI.ConsoleTextArea.value.substring(UI.ConsoleTextArea.value.lastIndexOf("-") + 1).toLowerCase()));
remainingParams.forEach(param => {
var commandCompletionItem = document.createElement("div");
commandCompletionItem.classList.add("command-completion-item");
commandCompletionItem.innerHTML = param.Name;
commandCompletionItem.onclick = function () {
var preParam = UI.ConsoleTextArea.value.substring(0, UI.ConsoleTextArea.value.lastIndexOf(" "));
UI.ConsoleTextArea.value = preParam.trim() + ` -${commandCompletionItem.innerText}`;
UI.CommandCompletionDiv.classList.add("hidden");
UI.CommandInfoDiv.classList.add("hidden");
};
commandCompletionItem.onfocus = function () {
ShowParameterInfo(param);
};
UI.CommandCompletionDiv.appendChild(commandCompletionItem);
});
if (!UI.CommandCompletionDiv.classList.contains("hidden") && remainingParams.length > 0) {
SetCommandCompletionPositionToIncompleteParam(parameters);
HighlightCompletionWindowItem(Store.CommandCompletionPosition);
ShowParameterInfo(remainingParams[Store.CommandCompletionPosition]);
PositionCommandCompletionWindow();
}
}
export function DisplayCommandShortcuts(shortcutText) {
UI.CommandCompletionDiv.classList.remove("hidden");
var matchingShortcuts = Object.keys(UserSettings.CommandModeShortcuts).filter(x => UserSettings.CommandModeShortcuts[x].slice(1).toLowerCase().startsWith(shortcutText.toLowerCase()));
matchingShortcuts.forEach(x => {
var commandCompletionItem = document.createElement("div");
commandCompletionItem.classList.add("command-completion-item");
commandCompletionItem.innerHTML = UserSettings.CommandModeShortcuts[x].slice(1);
commandCompletionItem.onclick = function () {
UI.CommandModeSelect.value = x;
UI.ConsoleTextArea.value = "";
UI.CommandCompletionDiv.classList.add("hidden");
UI.CommandInfoDiv.classList.add("hidden");
};
commandCompletionItem.onfocus = function () { };
UI.CommandCompletionDiv.appendChild(commandCompletionItem);
});
if (!UI.CommandCompletionDiv.classList.contains("hidden") && matchingShortcuts.length > 0) {
HighlightCompletionWindowItem(Store.CommandCompletionPosition);
PositionCommandCompletionWindow();
}
}
export function GetCommandCompletions(commandText) {
var commandList;
switch (UI.CommandModeSelect.value) {
case "Web":
commandList = WebCommands;
break;
case "CMD":
commandList = CMDCommands;
break;
case "PSCore":
commandList = PSCoreCommands;
break;
case "WinPS":
commandList = WinPSCommands;
break;
case "Bash":
commandList = BashCommands;
break;
default:
UI.CommandCompletionDiv.classList.add("hidden");
return;
}
var filteredList = commandList.filter(x => x.Name.toLowerCase().indexOf(commandText.toLowerCase()) > -1);
filteredList.sort((a, b) => a.Name.localeCompare(b.Name));
return filteredList;
}
export function SetCommandCompletionPositionToIncompleteParam(parameters) {
var lastParam = parameters[parameters.length - 1];
if (typeof lastParam != 'undefined' && lastParam.Value.length == 0) {
for (var i = 0; i < UI.CommandCompletionDiv.children.length; i++) {
if (UI.CommandCompletionDiv.children[i].innerHTML.startsWith(lastParam.Name)) {
Store.CommandCompletionPosition = i;
break;
}
}
}
}
export function HighlightCompletionWindowItem(index) {
UI.CommandCompletionDiv.querySelectorAll("div.selected").forEach(x => {
x.classList.remove("selected");
});
if (UI.CommandCompletionDiv.children.length >= index + 1) {
UI.CommandCompletionDiv.children[index].classList.add("selected");
UI.CommandCompletionDiv.children[Math.max(0, index - 1)].scrollIntoView();
}
}
export function ShowCommandInfo(command) {
UI.CommandInfoDiv.innerHTML = command.PartialHelp;
UI.CommandInfoDiv.classList.remove("hidden");
}
export function ShowParameterInfo(parameter) {
if (parameter.Summary.length > 0) {
var paramText = "";
if (parameter.ParameterType) {
paramText = ` [${parameter.ParameterType}]`;
}
UI.CommandInfoDiv.innerHTML = `<span class='text-primary'>${parameter.Name}${paramText}: </span>
${parameter.Summary}`;
UI.CommandInfoDiv.classList.remove("hidden");
}
}
export function PositionCommandCompletionWindow() {
var computedStyle = window.getComputedStyle(UI.ConsoleTextArea);
UI.MeasurementContext.font = computedStyle.fontSize + " " + computedStyle.fontFamily;
var width = UI.MeasurementContext.measureText(UI.ConsoleTextArea.value).width;
UI.CommandCompletionDiv.style.marginLeft = String(width + 10) + "px";
var wrapper = document.querySelector("#commandCompletionWrapper");
var inputRect = UI.ConsoleTextArea.getBoundingClientRect();
wrapper.style.left = String(inputRect.left) + "px";
if (inputRect.top / document.documentElement.clientHeight > .5) {
UI.CommandCompletionDiv.style.verticalAlign = "bottom";
UI.CommandInfoDiv.style.verticalAlign = "bottom";
wrapper.style.top = String(inputRect.top - wrapper.clientHeight) + "px";
}
else {
UI.CommandCompletionDiv.style.verticalAlign = "top";
UI.CommandInfoDiv.style.verticalAlign = "top";
wrapper.style.top = String(inputRect.bottom + 5) + "px";
}
}
//# sourceMappingURL=CommandCompletion.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,153 +0,0 @@
import { WebCommands } from "./Commands/WebCommands.js";
import { UserSettings } from "./UserSettings.js";
import { Main } from "./Main.js";
import { CommandLineParameter } from "./Models/CommandLineParameter.js";
import * as UI from "./UI.js";
import { Store } from "./Store.js";
import { DisplayCommandShortcuts, DisplayCommandCompletions, DisplayParameterCompletions, GetCommandCompletions } from "./CommandCompletion.js";
import { Connection } from "./BrowserSockets.js";
export function EvaluateCurrentCommandText() {
UI.AutoSizeTextArea();
window.clearTimeout(Store.CommandCompletionTimeout);
UI.CommandCompletionDiv.classList.add("hidden");
UI.CommandInfoDiv.classList.add("hidden");
UI.CommandCompletionDiv.innerHTML = "";
Store.CommandCompletionPosition = 0;
if (UI.ConsoleTextArea.value.startsWith("/")) {
DisplayCommandShortcuts(UI.ConsoleTextArea.value.slice(1));
return;
}
var relevantText = GetRelevantCommandText(UI.ConsoleTextArea.value);
var commandInputArray = Main.Utilities.Split(relevantText, " ", 2);
var matchingCommands = GetCommandCompletions(commandInputArray[0]);
if (commandInputArray.length == 1) {
if (matchingCommands.length == 0) {
return;
}
DisplayCommandCompletions(matchingCommands, relevantText);
}
else if (commandInputArray.length > 1) {
switch (UI.CommandModeSelect.value) {
case "PSCore":
case "WinPS":
case "Web":
var parameters = ExtractParameters(UI.ConsoleTextArea.value);
DisplayParameterCompletions(matchingCommands[0], parameters, relevantText);
break;
default:
break;
;
}
}
}
export function GetRelevantCommandText(commandText) {
switch (UI.CommandModeSelect.value) {
case "PSCore":
case "WinPS":
case "Bash":
var lastLineBreak = Math.max(commandText.lastIndexOf(";"), commandText.lastIndexOf("|"));
commandText = commandText.substring(lastLineBreak + 1).trim();
break;
case "CMD":
commandText = commandText.substring(commandText.lastIndexOf("&") + 1).trim();
break;
default:
break;
;
}
return commandText;
}
/** Checks the given string for a matching shortcut. */
export function GetCommandModeShortcut() {
switch (UI.ConsoleTextArea.value.toLowerCase()) {
case UserSettings.CommandModeShortcuts.Web:
return "Web";
case UserSettings.CommandModeShortcuts.CMD:
return "CMD";
case UserSettings.CommandModeShortcuts.PSCore:
return "PSCore";
case UserSettings.CommandModeShortcuts.WinPS:
return "WinPS";
case UserSettings.CommandModeShortcuts.Bash:
return "Bash";
default:
return null;
}
}
export function GetCommandMode() {
return UI.CommandModeSelect.value;
}
/** Processes the command input. */
export function ProcessCommand() {
var commandText = UI.ConsoleTextArea.value.trim();
Store.InputHistoryItems.push(commandText);
Store.InputHistoryPosition = Store.InputHistoryItems.length;
UI.ConsoleTextArea.value = "";
var commandMode = UI.CommandModeSelect.value;
switch (commandMode) {
case "Web":
var matchingCommand = WebCommands.find(x => x.Name.toLowerCase() == commandText.split(" ")[0].toLowerCase());
if (matchingCommand) {
var parameters = ExtractParameters(commandText);
// Infer default parameter.
if (parameters.length > 0 && commandText.indexOf("-") == -1 && matchingCommand.Parameters.length == 1) {
parameters = [
new CommandLineParameter(matchingCommand.Parameters[0].Name, commandText.substring(commandText.indexOf(" ")).trim())
];
}
matchingCommand.Execute(parameters);
}
else {
UI.AddConsoleOutput("Unknown command.");
}
break;
case "PSCore":
case "WinPS":
case "CMD":
case "Bash":
var allDevices = Main.DataGrid.GetSelectedDevices();
var windowsDevices = allDevices.filter(x => x.Platform.toLowerCase() == "windows");
var linuxDevices = allDevices.filter(x => x.Platform.toLowerCase() == "linux");
if (commandMode == "CMD" && linuxDevices.length > 0) {
UI.AddConsoleOutput("Linux devices will be excluded from CMD command.");
allDevices = windowsDevices;
}
if (commandMode == "Bash" && windowsDevices.length > 0) {
UI.AddConsoleOutput("Windows devices will be excluded from Bash command.");
allDevices = linuxDevices;
}
if (allDevices.length == 0) {
UI.AddConsoleOutput("At least one device must be selected to send commands.");
return;
}
var deviceIDs = allDevices.map(value => value.ID);
Connection.invoke("ExecuteCommandOnClient", commandMode, commandText, deviceIDs);
break;
default:
break;
}
}
export function ExtractParameters(commandText) {
var parameterArray = new Array();
var startParams = commandText.indexOf(" ");
if (startParams == -1) {
return parameterArray;
}
commandText.substr(startParams).trim().split("-").forEach(x => {
if (x.trim().length == 0) {
return;
}
var key = "";
var value = "";
if (x.indexOf(" ") == -1 || x.substr(x.indexOf(" ")).trim().length == 0) {
key = x.trim();
}
else {
key = x.substr(0, x.indexOf(" "));
value = x.substr(x.indexOf(" ")).trim();
}
parameterArray.push(new CommandLineParameter(key, value));
});
return parameterArray;
}
//# sourceMappingURL=CommandProcessor.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,672 +0,0 @@
import { ConsoleCommand } from "../Models/ConsoleCommand.js";
var commands = [
new ConsoleCommand('accept', [], 'Accept or Reject jobs to a destination, such as a printer.', '', '', () => { }),
new ConsoleCommand('access', [], 'Check a user\'s RWX permission for a file.', '', '', () => { }),
new ConsoleCommand('aclocal', [], 'GNU autoconf too', '', '', () => { }),
new ConsoleCommand('aconnect', [], 'ALSA sequencer connection manager.', '', '', () => { }),
new ConsoleCommand('acpi', [], 'Show information about the Advanced Configuration and Power Interface.', '', '', () => { }),
new ConsoleCommand('acpi_available', [], 'Check if ACPI functionality exists on the system.', '', '', () => { }),
new ConsoleCommand('acpid', [], 'Informs user-space programs about ACPI events.', '', '', () => { }),
new ConsoleCommand('addr2line', [], 'Used to convert addresses into file names and line numbers.', '', '', () => { }),
new ConsoleCommand('addresses', [], 'Formats for internet mail addresses.', '', '', () => { }),
new ConsoleCommand('agetty', [], 'An alternative Linux Getty', '', '', () => { }),
new ConsoleCommand('alias', [], 'Create an alias for Linux commands', '', '', () => { }),
new ConsoleCommand('alsactl', [], 'Access advanced controls for ALSA soundcard driver.', '', '', () => { }),
new ConsoleCommand('amidi', [], 'Perform read/write operation for ALSA RawMIDI ports.', '', '', () => { }),
new ConsoleCommand('amixer', [], 'Access CLI-based mixer for ALSA soundcard driver.', '', '', () => { }),
new ConsoleCommand('anacron', [], 'Used to run commands periodically.', '', '', () => { }),
new ConsoleCommand('aplay', [], 'Sound recorder and player for CLI.', '', '', () => { }),
new ConsoleCommand('aplaymidi', [], 'CLI utility used to play MIDI files.', '', '', () => { }),
new ConsoleCommand('apm', [], 'Show Advanced Power Management (APM) hardware info on older systems.', '', '', () => { }),
new ConsoleCommand('apmd', [], 'Used to handle events reported by APM BIOS drivers.', '', '', () => { }),
new ConsoleCommand('apropos', [], 'Shows the list of all man pages containing a specific keyword', '', '', () => { }),
new ConsoleCommand('apt', [], 'Advanced Package Tool, a package management system for Debian and derivatives.', '', '', () => { }),
new ConsoleCommand('apt-get', [], 'Command-line utility to install/remove/update packages based on APT system.', '', '', () => { }),
new ConsoleCommand('aptitude', [], 'Another utility to add/remove/upgrade packages based on the APT system.', '', '', () => { }),
new ConsoleCommand('ar', [], 'A utility to create/modify/extract from archives.', '', '', () => { }),
new ConsoleCommand('arch', [], 'Display print machine hardware name.', '', '', () => { }),
new ConsoleCommand('arecord', [], 'Just like aplay, it\'s a sound recorder and player for ALSA soundcard driver.', '', '', () => { }),
new ConsoleCommand('arecordmidi', [], 'Record standard MIDI files.', '', '', () => { }),
new ConsoleCommand('arp', [], 'Used to make changes to the system\'s ARP cache', '', '', () => { }),
new ConsoleCommand('as', [], 'A portable GNU assembler.', '', '', () => { }),
new ConsoleCommand('aspell', [], 'An interactive spell checker utility.', '', '', () => { }),
new ConsoleCommand('at', [], 'Used to schedule command execution at specified date &amp; time, reading commands from an input file.', '', '', () => { }),
new ConsoleCommand('atd', [], 'Used to execute jobs queued by the at command.', '', '', () => { }),
new ConsoleCommand('atq', [], 'List a user\'s pending jobs for the at command.', '', '', () => { }),
new ConsoleCommand('atrm', [], 'Delete jobs queued by the at command.', '', '', () => { }),
new ConsoleCommand('audiosend', [], 'Used to send an audio recording as an email.', '', '', () => { }),
new ConsoleCommand('aumix', [], 'An audio mixer utility.', '', '', () => { }),
new ConsoleCommand('autoconf', [], 'Generate configuration scripts from a TEMPLATE-FILE and send the output to standard output.', '', '', () => { }),
new ConsoleCommand('autoheader', [], 'Create a template header for configure.', '', '', () => { }),
new ConsoleCommand('automake', [], 'Creates GNU standards-compliant Makefiles from template files', '', '', () => { }),
new ConsoleCommand('autoreconf', [], 'Update generated configuration files.', '', '', () => { }),
new ConsoleCommand('autoscan', [], 'Generate a preliminary <span class="skimlinks-unlinked">configure.in</span>', '', '', () => { }),
new ConsoleCommand('autoupdate', [], 'Update a <span class="skimlinks-unlinked">configure.in</span> file to newer autoconf.', '', '', () => { }),
new ConsoleCommand('awk', [], 'Used to find and replace text in a file(s).', '', '', () => { }),
new ConsoleCommand('badblocks', [], 'Search a disk partition for bad sectors.', '', '', () => { }),
new ConsoleCommand('banner', [], 'Used to print characters as a poster.', '', '', () => { }),
new ConsoleCommand('basename', [], 'Used to display filenames with directoy or suffix.', '', '', () => { }),
new ConsoleCommand('bash', [], 'GNU Bourne-Again Shell.', '', '', () => { }),
new ConsoleCommand('batch', [], 'Used to run commands entered on a standard input.', '', '', () => { }),
new ConsoleCommand('bc', [], 'Access the GNU bc calculator utility.', '', '', () => { }),
new ConsoleCommand('bg', [], 'Send processes to the background.', '', '', () => { }),
new ConsoleCommand('biff', [], 'Notify about incoming mail and sender\'s name on a system running comsat server.', '', '', () => { }),
new ConsoleCommand('bind', [], 'Used to attach a name to a socket.', '', '', () => { }),
new ConsoleCommand('bison', [], 'A GNU parser generator, compatible with yacc.', '', '', () => { }),
new ConsoleCommand('break', [], 'Used to exit from a loop (eg: for, while, select).', '', '', () => { }),
new ConsoleCommand('builtin', [], 'Used to run shell builtin commands, make custom functions forcommands extending their functionality.', '', '', () => { }),
new ConsoleCommand('bzcmp', [], 'Used to call the cmp program forbzip2 compressed files.', '', '', () => { }),
new ConsoleCommand('bzdiff', [], 'Used to call the diff program for bzip2 compressed files.', '', '', () => { }),
new ConsoleCommand('bzgrep', [], 'Used to call grep for bzip2 compressed files.', '', '', () => { }),
new ConsoleCommand('bzip2', [], 'A block-sorting file compressor used to shrink given files.', '', '', () => { }),
new ConsoleCommand('bzless', [], 'Used to apply \'less\' (show info one page at a time) to bzip2 compressed files.', '', '', () => { }),
new ConsoleCommand('bzmore', [], 'Used to apply \'more\' (an inferior version of less) to bzip2 compressed files.', '', '', () => { }),
new ConsoleCommand('cal', [], 'Show calendar.', '', '', () => { }),
new ConsoleCommand('cardctl', [], 'Used to control PCMCIA sockets and select configuration schemes.', '', '', () => { }),
new ConsoleCommand('cardmgr', [], 'Keeps an eye on the added/removes sockets for PCMCIA devices.', '', '', () => { }),
new ConsoleCommand('case', [], 'Execute a command conditionally by matching a pattern.', '', '', () => { }),
new ConsoleCommand('cat', [], 'Used to concatenate files and print them on the screen.', '', '', () => { }),
new ConsoleCommand('cc', [], 'GNU C and C++ compiler.', '', '', () => { }),
new ConsoleCommand('cd', [], 'Used to change directory.', '', '', () => { }),
new ConsoleCommand('cdda2wav', [], 'Used to rip a CD-ROM and make WAV file.', '', '', () => { }),
new ConsoleCommand('cdparanoia', [], 'Record audio from CD more reliably using data-verification algorithms.', '', '', () => { }),
new ConsoleCommand('cdrdao', [], 'Used to write all the content specified to a file to a CD all at once.', '', '', () => { }),
new ConsoleCommand('cdrecord', [], 'Used to record data or audio compact discs.', '', '', () => { }),
new ConsoleCommand('cfdisk', [], 'Show or change the disk partition table.', '', '', () => { }),
new ConsoleCommand('chage', [], 'Used to change user password information.', '', '', () => { }),
new ConsoleCommand('chattr', [], 'Used to change file attributes.', '', '', () => { }),
new ConsoleCommand('chdir', [], 'Used to change active working directory.', '', '', () => { }),
new ConsoleCommand('chfn', [], 'Used to change real user name and information.', '', '', () => { }),
new ConsoleCommand('chgrp', [], 'Used to change group ownership for file.', '', '', () => { }),
new ConsoleCommand('chkconfig', [], 'Manage execution of runlevel services.', '', '', () => { }),
new ConsoleCommand('chmod', [], 'Change access permission for a file(s).', '', '', () => { }),
new ConsoleCommand('chown', [], 'Change the owner or group for a file.', '', '', () => { }),
new ConsoleCommand('chpasswd', [], 'Update password in a batch.', '', '', () => { }),
new ConsoleCommand('chroot', [], 'Run a command with root privileges.', '', '', () => { }),
new ConsoleCommand('chrt', [], 'Alter process attributed in real-time.', '', '', () => { }),
new ConsoleCommand('chsh', [], 'Switch login shell.', '', '', () => { }),
new ConsoleCommand('chvt', [], 'Change foreground virtual terminal.', '', '', () => { }),
new ConsoleCommand('cksum', [], 'Perform a CRC checksum for files.', '', '', () => { }),
new ConsoleCommand('clear', [], 'Used to clear the terminal window.', '', '', () => { }),
new ConsoleCommand('cmp', [], 'Compare two files (byte by byte).', '', '', () => { }),
new ConsoleCommand('col', [], 'Filter reverse (and half-reverse) line feeds from the input.', '', '', () => { }),
new ConsoleCommand('colcrt', [], 'Filter nroff output for CRT previewing.', '', '', () => { }),
new ConsoleCommand('colrm', [], 'Remove columns from the lines of a file.', '', '', () => { }),
new ConsoleCommand('column', [], 'A utility that formats its input into columns.', '', '', () => { }),
new ConsoleCommand('comm', [], 'Used to compare two sorted files line by line.', '', '', () => { }),
new ConsoleCommand('command', [], 'Used to execute a command with arguments ignoring shell function named command.', '', '', () => { }),
new ConsoleCommand('compress', [], 'Used to compress one or more file(s) and replacing the originals ones.', '', '', () => { }),
new ConsoleCommand('continue', [], 'Resume the next iteration of a loop.', '', '', () => { }),
new ConsoleCommand('cp', [], 'Copy contents of one file to another.', '', '', () => { }),
new ConsoleCommand('cpio', [], 'Copy files from and to archives.', '', '', () => { }),
new ConsoleCommand('cpp', [], 'GNU C language processor.', '', '', () => { }),
new ConsoleCommand('cron', [], 'A daemon to execute scheduled commands.', '', '', () => { }),
new ConsoleCommand('crond', [], 'Same work as cron.', '', '', () => { }),
new ConsoleCommand('crontab', [], 'Manage crontab files (containing schedules commands) for users.', '', '', () => { }),
new ConsoleCommand('csplit', [], 'Split a file into sections on the basis of context lines.', '', '', () => { }),
new ConsoleCommand('ctags', [], 'Make a list of functions and macro names defined in a programming source file.', '', '', () => { }),
new ConsoleCommand('cupsd', [], 'A scheduler for CUPS.', '', '', () => { }),
new ConsoleCommand('curl', [], 'Used to transfer data from or to a server using supported protocols.', '', '', () => { }),
new ConsoleCommand('cut', [], 'Used to remove sections from each line of a file(s).', '', '', () => { }),
new ConsoleCommand('cvs', [], 'Concurrent Versions System. Used to track file versions, allow storage/retrieval of previous versions, and enables multiple users to work on the same file.', '', '', () => { }),
new ConsoleCommand('date', [], 'Show system date and time.', '', '', () => { }),
new ConsoleCommand('dc', [], 'Desk calculator utility.', '', '', () => { }),
new ConsoleCommand('dd', [], 'Used to convert and copy a file, create disk clone, write disk headers, etc.', '', '', () => { }),
new ConsoleCommand('ddrescue', [], 'Used to recover data from a crashed partition.', '', '', () => { }),
new ConsoleCommand('deallocvt', [], 'Deallocates kernel memory for unused virtual consoles.', '', '', () => { }),
new ConsoleCommand('debugfs', [], 'File system debugger for ext2/ext3/ext4', '', '', () => { }),
new ConsoleCommand('declare', [], 'Used to declare variables and assign attributes.', '', '', () => { }),
new ConsoleCommand('depmod', [], 'Generate <span class="skimlinks-unlinked">modules.dep</span> and map files.', '', '', () => { }),
new ConsoleCommand('devdump', [], 'Interactively displays the contents of device or file system ISO.', '', '', () => { }),
new ConsoleCommand('df', [], 'Show disk usage.', '', '', () => { }),
new ConsoleCommand('diff', [], 'Used to compare files line by line.', '', '', () => { }),
new ConsoleCommand('diff3', [], 'Compare three files line by line.', '', '', () => { }),
new ConsoleCommand('dig', [], 'Domain Information Groper, a DNS lookup utility.', '', '', () => { }),
new ConsoleCommand('dir', [], 'List the contents of a directory.', '', '', () => { }),
new ConsoleCommand('dircolors', [], 'Set colors for \'ls\' by altering the LS_COLORS environment variable.', '', '', () => { }),
new ConsoleCommand('dirname', [], 'Display pathname after removing the last slash and characters thereafter.', '', '', () => { }),
new ConsoleCommand('dirs', [], 'Show the list of remembered directories.', '', '', () => { }),
new ConsoleCommand('disable', [], 'Restrict access to a printer.', '', '', () => { }),
new ConsoleCommand('dlpsh', [], 'Interactive Desktop Link Protocol (DLP) shell for PalmOS.', '', '', () => { }),
new ConsoleCommand('dmesg', [], 'Examine and control the kernel ring buffer.', '', '', () => { }),
new ConsoleCommand('dnsdomainname', [], 'Show the DNS domain name of the system.', '', '', () => { }),
new ConsoleCommand('dnssec-keygen', [], 'Generate encrypted Secure DNS keys for a given domain name.', '', '', () => { }),
new ConsoleCommand('dnssec-makekeyset', [], 'Produce domain key set from one or more DNS security keys generated by dnssec-keygen.', '', '', () => { }),
new ConsoleCommand('dnssec-signkey', [], 'Sign a secure DNS keyset with key signatures specified in the list of key-identifiers.', '', '', () => { }),
new ConsoleCommand('dnssec-signzone', [], 'Sign a secure DNS zonefile with the signatures in the specified list of key-identifiers.', '', '', () => { }),
new ConsoleCommand('doexec', [], 'Used to run an executable with an arbitrary argv list provided.', '', '', () => { }),
new ConsoleCommand('domainname', [], 'Show or set the name of current NIS (Network Information Services) domain.', '', '', () => { }),
new ConsoleCommand('dosfsck', [], 'Check and repair MS-DOS file systems.', '', '', () => { }),
new ConsoleCommand('du', [], 'Show disk usage summary for a file(s).', '', '', () => { }),
new ConsoleCommand('dump', [], 'Backup utility for ext2/ext3 file systems.', '', '', () => { }),
new ConsoleCommand('dumpe2fs', [], 'Dump ext2/ext3/ext4 file systems.', '', '', () => { }),
new ConsoleCommand('dumpkeys', [], 'Show information about the keyboard driver\'s current translation tables.', '', '', () => { }),
new ConsoleCommand('e2fsck', [], 'Used to check ext2/ext3/ext4 file systems.', '', '', () => { }),
new ConsoleCommand('e2image', [], 'Store important ext2/ext3/ext4 filesystem metadata to a file.', '', '', () => { }),
new ConsoleCommand('e2label', [], 'Show or change the label on an ext2/ext3/ext4 filesystem.', '', '', () => { }),
new ConsoleCommand('echo', [], 'Send input string(s) to standard output i.e. display text on the screen.', '', '', () => { }),
new ConsoleCommand('ed', [], 'GNU Ed û a line-oriented text editor.', '', '', () => { }),
new ConsoleCommand('edquota', [], 'Used to edit filesystem quotas using a text editor, such as vi.', '', '', () => { }),
new ConsoleCommand('egrep', [], 'Search and display text matching a pattern.', '', '', () => { }),
new ConsoleCommand('eject', [], 'Eject removable media.', '', '', () => { }),
new ConsoleCommand('elvtune', [], 'Used to set latency in the elevator algorithm used to schedule I/O activities for specified block devices.', '', '', () => { }),
new ConsoleCommand('emacs', [], 'Emacs text editor command line utility.', '', '', () => { }),
new ConsoleCommand('enable', [], 'Used to enable/disable shell builtin commands.', '', '', () => { }),
new ConsoleCommand('env', [], 'Run a command in a modified environment. Show/set/delete environment variables.', '', '', () => { }),
new ConsoleCommand('envsubst', [], 'Substitute environment variable values in shell format strings.', '', '', () => { }),
new ConsoleCommand('esd', [], 'Start the Enlightenment Sound Daemon (EsounD or esd). Enables multiple applications to access the same audio device simultaneously.', '', '', () => { }),
new ConsoleCommand('esd-config', [], 'Manage EsounD configuration.', '', '', () => { }),
new ConsoleCommand('esdcat', [], 'Use EsounD to send audio data from a specified file.', '', '', () => { }),
new ConsoleCommand('esdctl', [], 'EsounD control program.', '', '', () => { }),
new ConsoleCommand('esddsp', [], 'Used to reroute non-esd audio data to esd and control all the audio using esd.', '', '', () => { }),
new ConsoleCommand('esdmon', [], 'Used to copy the sound being sent to a device. Also, send it to a secondary device.', '', '', () => { }),
new ConsoleCommand('esdplay', [], 'Use EsounD system to play a file.', '', '', () => { }),
new ConsoleCommand('esdrec', [], 'Use EsounD to record audio to a specified file.', '', '', () => { }),
new ConsoleCommand('esdsample', [], 'Sample audio using esd.', '', '', () => { }),
new ConsoleCommand('etags', [], 'Used to create a list of functions and macros from a programming source file. These etags are used by emacs. For vi, use ctags.', '', '', () => { }),
new ConsoleCommand('ethtool', [], 'Used to query and control network driver and hardware settings.', '', '', () => { }),
new ConsoleCommand('eval', [], 'Used to evaluate multiple commands or arguments are once.', '', '', () => { }),
new ConsoleCommand('ex', [], 'Interactive command', '', '', () => { }),
new ConsoleCommand('exec', [], 'An interactive line-based text editor.', '', '', () => { }),
new ConsoleCommand('exit', [], 'Exit from the terminal.', '', '', () => { }),
new ConsoleCommand('expand', [], 'Convert tabs into spaces in a given file and show the output.', '', '', () => { }),
new ConsoleCommand('expect', [], 'An extension to the Tcl script, it\'s used to automate interaction with other applications based on their expected output.', '', '', () => { }),
new ConsoleCommand('export', [], 'Used to set an environment variable.', '', '', () => { }),
new ConsoleCommand('expr', [], 'Evaluate expressions and display them on standard output.', '', '', () => { }),
new ConsoleCommand('factor', [], 'Display prime factors of specified integer numbers.', '', '', () => { }),
new ConsoleCommand('false', [], 'Do nothing, unsuccessfully. Exit with a status code indicating failure.', '', '', () => { }),
new ConsoleCommand('fc-cache', [], 'Make font information cache after scanning the directories.', '', '', () => { }),
new ConsoleCommand('fc-list', [], 'Show the list of available fonts.', '', '', () => { }),
new ConsoleCommand('fdformat', [], 'Do a low-level format on a floppy disk.', '', '', () => { }),
new ConsoleCommand('fdisk', [], 'Make changes to the disk partition table.', '', '', () => { }),
new ConsoleCommand('fetchmail', [], 'Fetch mail from mail servers and forward it to the local mail delivery system.', '', '', () => { }),
new ConsoleCommand('fg', [], 'Used to send a job to the foreground.', '', '', () => { }),
new ConsoleCommand('fgconsole', [], 'Display the number of the current virtual console.', '', '', () => { }),
new ConsoleCommand('fgrep', [], 'Display lines from a file(s) that match a specified string. A variant of grep.', '', '', () => { }),
new ConsoleCommand('file', [], 'Determine file type for a file.', '', '', () => { }),
new ConsoleCommand('find', [], 'Do a file search in a directory hierarchy.', '', '', () => { }),
new ConsoleCommand('finger', [], 'Display user data including the information listed in <em>.plan</em>and <em>.project</em>in each user\'s home directory.', '', '', () => { }),
new ConsoleCommand('fingerd', [], 'Provides a network interface for the finger program.', '', '', () => { }),
new ConsoleCommand('flex', [], 'Generate programs that perform pattern-matching on text.', '', '', () => { }),
new ConsoleCommand('fmt', [], 'Used to convert text to a specified width by filling lines and removing new lines, displaying the output.', '', '', () => { }),
new ConsoleCommand('fold', [], 'Wrap input line to fit in a specified width.', '', '', () => { }),
new ConsoleCommand('for', [], 'Expand words and run commands for each one in the resultant list.', '', '', () => { }),
new ConsoleCommand('formail', [], 'Used to filter standard input into mailbox format.', '', '', () => { }),
new ConsoleCommand('format', [], 'Used to format disks.', '', '', () => { }),
new ConsoleCommand('free', [], 'Show free and used system memory.', '', '', () => { }),
new ConsoleCommand('fsck', [], 'Check and repair a Linux file system', '', '', () => { }),
new ConsoleCommand('ftp', [], 'File transfer protocol user interface.', '', '', () => { }),
new ConsoleCommand('ftpd', [], 'FTP server process.', '', '', () => { }),
new ConsoleCommand('function', [], 'Used to define function macros.', '', '', () => { }),
new ConsoleCommand('fuser', [], 'Find and kill a process accessing a file.', '', '', () => { }),
new ConsoleCommand('g++', [], 'Run the g++ compiler.', '', '', () => { }),
new ConsoleCommand('gawk', [], 'Used for pattern scanning and language processing. A GNU implementation of AWK language.', '', '', () => { }),
new ConsoleCommand('gcc', [], 'A C and C++ compiler by GNU.', '', '', () => { }),
new ConsoleCommand('gdb', [], 'A utility to debug programs and know about where it crashes.', '', '', () => { }),
new ConsoleCommand('getent', [], 'Shows entries from Name Service Switch Libraries for specified keys.', '', '', () => { }),
new ConsoleCommand('getkeycodes', [], 'Displays the kernel scancode-to-keycode mapping table.', '', '', () => { }),
new ConsoleCommand('getopts', [], 'A utility to parse positional parameters.', '', '', () => { }),
new ConsoleCommand('gpasswd', [], 'Allows an administrator to change group passwords.', '', '', () => { }),
new ConsoleCommand('gpg', [], 'Enables encryption and signing services as per the OpenPGP standard.', '', '', () => { }),
new ConsoleCommand('gpgsplit', [], 'Used to split an OpenPGP message into packets.', '', '', () => { }),
new ConsoleCommand('gpgv', [], 'Used to verify OpenPGP signatures.', '', '', () => { }),
new ConsoleCommand('gpm', [], 'It enables cut and paste functionality and a mouse server for the Linux console.', '', '', () => { }),
new ConsoleCommand('gprof', [], 'Shows call graph profile data.', '', '', () => { }),
new ConsoleCommand('grep', [], 'Searches input files for a given pattern and displays the relevant lines.', '', '', () => { }),
new ConsoleCommand('groff', [], 'Serves as the front-end of the groff document formatting system.', '', '', () => { }),
new ConsoleCommand('groffer', [], 'Displays groff files and man pages.', '', '', () => { }),
new ConsoleCommand('groupadd', [], 'Used to add a new user group.', '', '', () => { }),
new ConsoleCommand('groupdel', [], 'Used to remove a user group.', '', '', () => { }),
new ConsoleCommand('groupmod', [], 'Used to modify a group definition.', '', '', () => { }),
new ConsoleCommand('groups', [], 'Showthe group(s) to which a user belongs.', '', '', () => { }),
new ConsoleCommand('grpck', [], 'Verifies the integrity of group files.', '', '', () => { }),
new ConsoleCommand('grpconv', [], 'Creates agshadow file from a group or an already existing gshadow.', '', '', () => { }),
new ConsoleCommand('gs', [], 'Invokes Ghostscript, and interpreter and previewer for Adobe\'s PostScript and PDF languages.', '', '', () => { }),
new ConsoleCommand('gunzip', [], 'A utility to compress/expand files.', '', '', () => { }),
new ConsoleCommand('gzexe', [], 'Used compress executable files in place and have them automatically uncompress and run at a later stage.', '', '', () => { }),
new ConsoleCommand('gzip', [], 'Same as gzip.', '', '', () => { }),
new ConsoleCommand('halt', [], 'Command used to half the machine.', '', '', () => { }),
new ConsoleCommand('hash', [], 'Shows the path for the commands executed in the shell.', '', '', () => { }),
new ConsoleCommand('hdparm', [], 'Show/configure parameters for SATA/IDE devices.', '', '', () => { }),
new ConsoleCommand('head', [], 'Shows first 10 lines from each specified file.', '', '', () => { }),
new ConsoleCommand('help', [], 'Display\'s help for a built-in command.', '', '', () => { }),
new ConsoleCommand('hexdump', [], 'Shows specified file output in hexadecimal, octal, decimal, or ASCII format.', '', '', () => { }),
new ConsoleCommand('history', [], 'Shows the command history.', '', '', () => { }),
new ConsoleCommand('host', [], 'A utility to perform DNS lookups.', '', '', () => { }),
new ConsoleCommand('hostid', [], 'Shows host\'s numeric ID in hexadecimal format.', '', '', () => { }),
new ConsoleCommand('hostname', [], 'Display/set the hostname of the system.', '', '', () => { }),
new ConsoleCommand('htdigest', [], 'Manage the user authentication file used by the Apache web server.', '', '', () => { }),
new ConsoleCommand('htop', [], 'An interactive process viewer for the command line.', '', '', () => { }),
new ConsoleCommand('hwclock', [], 'Show or configure the system\'s hardware clock.', '', '', () => { }),
new ConsoleCommand('iconv', [], 'Convert text file from one encoding to another.', '', '', () => { }),
new ConsoleCommand('id', [], 'Show user and group information for a specified user.', '', '', () => { }),
new ConsoleCommand('if', [], 'Execute a command conditionally.', '', '', () => { }),
new ConsoleCommand('ifconfig', [], 'Used to configure network interfaces.', '', '', () => { }),
new ConsoleCommand('ifdown', [], 'Stops a network interface.', '', '', () => { }),
new ConsoleCommand('ifup', [], 'Starts a network interface.', '', '', () => { }),
new ConsoleCommand('imapd', [], 'An IMAP (Interactive Mail Access Protocol) server daemon.', '', '', () => { }),
new ConsoleCommand('import', [], 'Capture an X server screen and saves it as an image.', '', '', () => { }),
new ConsoleCommand('inetd', [], 'Extended internet services daemon, it starts the programs that provide internet services.', '', '', () => { }),
new ConsoleCommand('info', [], 'Used to read the documentation in Info format.', '', '', () => { }),
new ConsoleCommand('init', [], 'Systemd system and service manager.', '', '', () => { }),
new ConsoleCommand('insmod', [], 'A program that inserts a module into the Linux kernel.', '', '', () => { }),
new ConsoleCommand('install', [], 'Used to copy files to specified locations and set attributions during the install process.', '', '', () => { }),
new ConsoleCommand('iostat', [], 'Shows statistics for CPU, I/O devices, partitions, network filesystems.', '', '', () => { }),
new ConsoleCommand('ip', [], 'Display/manipulate routing, devices, policy, routing and tunnels.', '', '', () => { }),
new ConsoleCommand('ipcrm', [], 'Used to remove System V interprocess communication (IPC) objects and associated data structures.', '', '', () => { }),
new ConsoleCommand('ipcs', [], 'Show information on IPC facilities for which calling process has read access.', '', '', () => { }),
new ConsoleCommand('iptables', [], 'Administration tool for IPv4 packet filtering and NAT.', '', '', () => { }),
new ConsoleCommand('iptables-restore', [], 'Used to restore IP tables from data specified in the input or a file.', '', '', () => { }),
new ConsoleCommand('iptables-save', [], 'Used to dump IP table contents to standard output.', '', '', () => { }),
new ConsoleCommand('isodump', [], 'A utility that shows the content iso9660 images to verify the integrity of directory contents.', '', '', () => { }),
new ConsoleCommand('isoinfo', [], 'A utility to perform directory like listings of iso9660 images.', '', '', () => { }),
new ConsoleCommand('isosize', [], 'Show the length of an iso9660 filesystem contained in a specified file.', '', '', () => { }),
new ConsoleCommand('isovfy', [], 'Verifies the integrity of an iso9660 image.', '', '', () => { }),
new ConsoleCommand('ispell', [], 'A CLI-based spell-check utility.', '', '', () => { }),
new ConsoleCommand('jobs', [], 'Show the list of active jobs and their status.', '', '', () => { }),
new ConsoleCommand('join', [], 'For each pair of input lines, join them using a command field and display on standard output.', '', '', () => { }),
new ConsoleCommand('kbd_mode', [], 'Set a keyboard mode. Without arguments, shows the current keyboard mode.', '', '', () => { }),
new ConsoleCommand('kbdrate', [], 'Reset keyboard repeat rate and delay time.', '', '', () => { }),
new ConsoleCommand('kill', [], 'Send a kill (termination) signal to one more processes.', '', '', () => { }),
new ConsoleCommand('killall', [], 'Kills a process(es) running a specified command.', '', '', () => { }),
new ConsoleCommand('killall5', [], 'A SystemV killall command. Kills all the processes excluding the ones which it depends on.', '', '', () => { }),
new ConsoleCommand('klogd', [], 'Control and prioritize the kernel messages to be displayed on the console, and log them through syslogd.', '', '', () => { }),
new ConsoleCommand('kudzu', [], 'Used to detect new and enhanced hardware by comparing it with existing database. Only for RHEL and derivates.', '', '', () => { }),
new ConsoleCommand('last', [], 'Shows a list of recent logins on the system by fetching data from <em>/var/log/wtmp</em> file.', '', '', () => { }),
new ConsoleCommand('lastb', [], 'Shows the list of bad login attempts by fetching data from <em>/var/log/btmp</em>file.', '', '', () => { }),
new ConsoleCommand('lastlog', [], 'Displays information about the most recent login of all users or a specified user.', '', '', () => { }),
new ConsoleCommand('ld', [], 'The Unix linker, it combines archives and object files. It then puts them into one output file, resolving external references.', '', '', () => { }),
new ConsoleCommand('ldconfig', [], 'Configure dynamic linker run-time bindings.', '', '', () => { }),
new ConsoleCommand('ldd', [], 'Shows shared object dependencies.', '', '', () => { }),
new ConsoleCommand('less', [], 'Displays contents of a fileone page at a time. It\'s advanced than <em>more</em> command.', '', '', () => { }),
new ConsoleCommand('lesskey', [], 'Used to specify key bindings for less command.', '', '', () => { }),
new ConsoleCommand('let', [], 'Used to perform integer artithmetic on shell variables.', '', '', () => { }),
new ConsoleCommand('lftp', [], 'An FTP utility with extra features.', '', '', () => { }),
new ConsoleCommand('lftpget', [], 'Uses lftop to retrieve HTTP, FTP, and other protocol URLs supported by lftp.', '', '', () => { }),
new ConsoleCommand('link', [], 'Create links between two files. Similar to ln command.', '', '', () => { }),
new ConsoleCommand('ln', [], 'Create links between files. Links can be hard (two names for the same file) or soft (a shortcut of the first file).', '', '', () => { }),
new ConsoleCommand('loadkeys', [], 'Load keyboard translation tables.', '', '', () => { }),
new ConsoleCommand('local', [], 'Used to create function variables.', '', '', () => { }),
new ConsoleCommand('locale', [], 'Shows information about current or all locales.', '', '', () => { }),
new ConsoleCommand('locate', [], 'Used to find files by their name.', '', '', () => { }),
new ConsoleCommand('lockfile', [], 'Create semaphore file(s) which can beused to limit access to a file.', '', '', () => { }),
new ConsoleCommand('logger', [], 'Make entries in the system log.', '', '', () => { }),
new ConsoleCommand('login', [], 'Create a new session on the system.', '', '', () => { }),
new ConsoleCommand('logname', [], 'Shows the login name of the current user.', '', '', () => { }),
new ConsoleCommand('logout', [], 'Performs the logout operation by making changes to the utmp and wtmp files.', '', '', () => { }),
new ConsoleCommand('logrotate', [], 'Used for automatic rotation, compression, removal, and mailing of system log files.', '', '', () => { }),
new ConsoleCommand('look', [], 'Shows any lines in a file containing a given string in the beginning.', '', '', () => { }),
new ConsoleCommand('losetup', [], 'Set up and control loop devices.', '', '', () => { }),
new ConsoleCommand('lpadmin', [], 'Used to configure printer and class queues provided by CUPS (Common UNIX Printing System).', '', '', () => { }),
new ConsoleCommand('lpc', [], 'Line printer control program, it provides limited control over CUPS printer and class queues.', '', '', () => { }),
new ConsoleCommand('lpinfo', [], 'Shows the list of avaiable devices and drivers known to the CUPS server.', '', '', () => { }),
new ConsoleCommand('lpmove', [], 'Move on or more printing jobs to a new destination.', '', '', () => { }),
new ConsoleCommand('lpq', [], 'Shows current print queue status for a specified printer.', '', '', () => { }),
new ConsoleCommand('lpr', [], 'Used to submit files for printing.', '', '', () => { }),
new ConsoleCommand('lprint', [], 'Used to print a file.', '', '', () => { }),
new ConsoleCommand('lprintd', [], 'Used to abort a print job.', '', '', () => { }),
new ConsoleCommand('lprintq', [], 'List the print queue.', '', '', () => { }),
new ConsoleCommand('lprm', [], 'Cancel print jobs.', '', '', () => { }),
new ConsoleCommand('lpstat', [], 'Displays status information about current classes, jobs, and printers.', '', '', () => { }),
new ConsoleCommand('ls', [], 'Shows the list of files in the current directory.', '', '', () => { }),
new ConsoleCommand('lsattr', [], 'Shows file attributes on a Linux ext2 file system.', '', '', () => { }),
new ConsoleCommand('lsblk', [], 'Lists information about all available or the specified block devices.', '', '', () => { }),
new ConsoleCommand('lsmod', [], 'Show the status of modules in the Linux kernel.', '', '', () => { }),
new ConsoleCommand('lsof', [], 'List open files.', '', '', () => { }),
new ConsoleCommand('lspci', [], 'List all PCI devices.', '', '', () => { }),
new ConsoleCommand('lsusb', [], 'List USB devices.', '', '', () => { }),
new ConsoleCommand('m4', [], 'Macro processor.', '', '', () => { }),
new ConsoleCommand('mail', [], 'Utility to compose, receive, send, forward, and reply to emails.', '', '', () => { }),
new ConsoleCommand('mailq', [], 'Shows to list all emails queued for delivery (sendmail queue).', '', '', () => { }),
new ConsoleCommand('mailstats', [], 'Shows current mail statistics.', '', '', () => { }),
new ConsoleCommand('mailto', [], 'Used to send mail with multimedia content in MIME format.', '', '', () => { }),
new ConsoleCommand('make', [], 'Utility to maintain groups of programs, recompile them if needed.', '', '', () => { }),
new ConsoleCommand('makedbm', [], 'Creates an NIS (Network Information Services) database map.', '', '', () => { }),
new ConsoleCommand('makemap', [], 'Creates database maps used by the keyed map lookups in sendmail.', '', '', () => { }),
new ConsoleCommand('man', [], 'Shows manual pages for Linux commands.', '', '', () => { }),
new ConsoleCommand('manpath', [], 'Determine search path for manual pages.', '', '', () => { }),
new ConsoleCommand('mattrib', [], 'Used to change MS-DOS file attribute flags.', '', '', () => { }),
new ConsoleCommand('mbadblocks', [], 'Checks MD-DOS filesystems for bad blocks.', '', '', () => { }),
new ConsoleCommand('mcat', [], 'Dump raw disk image.', '', '', () => { }),
new ConsoleCommand('mcd', [], 'Used to change MS-DOS directory.', '', '', () => { }),
new ConsoleCommand('mcopy', [], 'Used to copy MS-DOS files from or to Unix.', '', '', () => { }),
new ConsoleCommand('md5sum', [], 'Used to check MD5 checksum for a file.', '', '', () => { }),
new ConsoleCommand('mdel, mdeltree', [], 'Used to delete MS-DOS file. mdeltree recursively deletes MS-DOS directory and its contents.', '', '', () => { }),
new ConsoleCommand('mdir', [], 'Used to display an MS-DOS directory.', '', '', () => { }),
new ConsoleCommand('mdu', [], 'Used to display the amount of space occupied by an MS-DOS directory.', '', '', () => { }),
new ConsoleCommand('merge', [], 'Three-way file merge. Includes all changes from file2 and file3 to file1.', '', '', () => { }),
new ConsoleCommand('mesg', [], 'Allow/disallow osends to sedn write messages to your terminal.', '', '', () => { }),
new ConsoleCommand('metamail', [], 'For sending and showing rich text or multimedia email using MIME typing metadata.', '', '', () => { }),
new ConsoleCommand('metasend', [], 'An interface for sending non-text mail.', '', '', () => { }),
new ConsoleCommand('mformat', [], 'Used to add an MS-DOS filesystem to a low-level formatted floppy disk.', '', '', () => { }),
new ConsoleCommand('mimencode', [], 'Translate to/from MIME multimedia mail encoding formats.', '', '', () => { }),
new ConsoleCommand('minfo', [], 'Display parameters of an MS-DOS filesystem.', '', '', () => { }),
new ConsoleCommand('mkdir', [], 'Used to create directories.', '', '', () => { }),
new ConsoleCommand('mkdosfs', [], 'Used to create an MS-DOS filesystem under Linux.', '', '', () => { }),
new ConsoleCommand('mke2fs', [], 'Used create an ext2/ext3/ext4 filesystem.', '', '', () => { }),
new ConsoleCommand('mkfifo', [], 'Used to create named pipes (FIFOs) with the given names.', '', '', () => { }),
new ConsoleCommand('mkfs', [], 'Used to build a Linux filesystem on a hard disk partition.', '', '', () => { }),
new ConsoleCommand('<span class="skimlinks-unlinked">mkfs.ext3</span>', [], 'Same as mke2fs, create an ext3 Linux filesystem.', '', '', () => { }),
new ConsoleCommand('mkisofs', [], 'Used to create an ISO9660/JOLIET/HFS hybrid filesystem.', '', '', () => { }),
new ConsoleCommand('mklost+found', [], 'Create a lost+found directory on a mounted ext2 filesystem.', '', '', () => { }),
new ConsoleCommand('mkmanifest', [], 'Makes alist of file names and their DOS 8.3 equivalent.', '', '', () => { }),
new ConsoleCommand('mknod', [], 'Create a FIFO, block (buffered) special file, character (unbuffered) special file with the specified name.', '', '', () => { }),
new ConsoleCommand('mkraid', [], 'Used to setup RAID device arrays.', '', '', () => { }),
new ConsoleCommand('mkswap', [], 'Set up a Linux swap area.', '', '', () => { }),
new ConsoleCommand('mktemp', [], 'Create a temporary file or directory.', '', '', () => { }),
new ConsoleCommand('mlabel', [], 'Make an MD-DOS volume label.', '', '', () => { }),
new ConsoleCommand('mmd', [], 'Make an MS-DOS subdirectory.', '', '', () => { }),
new ConsoleCommand('mmount', [], 'Mount an MS-DOS disk.', '', '', () => { }),
new ConsoleCommand('mmove', [], 'Move or rename an MS-DOS file or subdirectory.', '', '', () => { }),
new ConsoleCommand('mmv', [], 'Mass move and rename files.', '', '', () => { }),
new ConsoleCommand('modinfo', [], 'Show information about a Linux kernel module.', '', '', () => { }),
new ConsoleCommand('modprobe', [], 'Add or remove modules from the Linux kernel.', '', '', () => { }),
new ConsoleCommand('more', [], 'Display content of a file page-by-page.', '', '', () => { }),
new ConsoleCommand('most', [], 'Browse or page through a text file.', '', '', () => { }),
new ConsoleCommand('mount', [], 'Mount a filesystem.', '', '', () => { }),
new ConsoleCommand('mountd', [], 'NFS mount daemon.', '', '', () => { }),
new ConsoleCommand('mpartition', [], 'Partition an MS-DOS disk.', '', '', () => { }),
new ConsoleCommand('mpg123', [], 'Command-line mp3 player.', '', '', () => { }),
new ConsoleCommand('mpg321', [], 'Similar to mpg123.', '', '', () => { }),
new ConsoleCommand('mrd', [], 'Remove an MS-DOS subdirectory.', '', '', () => { }),
new ConsoleCommand('mren', [], 'Rename an existing MS-DOS file.', '', '', () => { }),
new ConsoleCommand('mshowfat', [], 'Show FTA clusters allocated to a file.', '', '', () => { }),
new ConsoleCommand('mt', [], 'Control magnetic tape drive operation.', '', '', () => { }),
new ConsoleCommand('mtools', [], 'Utilities to access MS-DOS disks.', '', '', () => { }),
new ConsoleCommand('mtoolstest', [], 'Tests and displays the mtools configuration files.', '', '', () => { }),
new ConsoleCommand('mtr', [], 'A network diagnostic tool.', '', '', () => { }),
new ConsoleCommand('mtype', [], 'Display contents of an MS-DOS file.', '', '', () => { }),
new ConsoleCommand('mv', [], 'Move/rename files or directories.', '', '', () => { }),
new ConsoleCommand('mzip', [], 'Change protection mode and eject disk on Zip/Jaz drive.', '', '', () => { }),
new ConsoleCommand('named', [], 'Internet domain name server.', '', '', () => { }),
new ConsoleCommand('namei', [], 'Follow a pathname until a terminal point is found.', '', '', () => { }),
new ConsoleCommand('nameif', [], 'Name network interfaces based on MAC addresses.', '', '', () => { }),
new ConsoleCommand('nc', [], 'Netcat utility. Arbitrary TCP and UDP connections and listens.', '', '', () => { }),
new ConsoleCommand('netstat', [], 'Show network information.', '', '', () => { }),
new ConsoleCommand('newaliases', [], 'Rebuilds mail alias database.', '', '', () => { }),
new ConsoleCommand('newgrp', [], 'Log-in to a new group.', '', '', () => { }),
new ConsoleCommand('newusers', [], 'Update/create new users in batch.', '', '', () => { }),
new ConsoleCommand('nfsd', [], 'Special filesystem for controlling Linux NFS server.', '', '', () => { }),
new ConsoleCommand('nfsstat', [], 'List NFS statistics.', '', '', () => { }),
new ConsoleCommand('nice', [], 'Run a program with modified scheduling priority.', '', '', () => { }),
new ConsoleCommand('nl', [], 'Show numbered line while displaying the contents of a file.', '', '', () => { }),
new ConsoleCommand('nm', [], 'List symbols from object files.', '', '', () => { }),
new ConsoleCommand('nohup', [], 'Run a command immune to hangups.', '', '', () => { }),
new ConsoleCommand('notify-send', [], 'A program to send desktop notifications.', '', '', () => { }),
new ConsoleCommand('nslookup', [], 'Used performs DNS queries. Read this article for more info.', '', '', () => { }),
new ConsoleCommand('nsupdate', [], 'Dynamic DNS update utility.', '', '', () => { }),
new ConsoleCommand('objcopy', [], 'Copy and translate object files.', '', '', () => { }),
new ConsoleCommand('objdump', [], 'Display information from object files.', '', '', () => { }),
new ConsoleCommand('od', [], 'Dump files in octal and other formats.', '', '', () => { }),
new ConsoleCommand('op', [], 'Operator access, allows system administrators to grant users access to certain rootoperations that require superuser privileges.', '', '', () => { }),
new ConsoleCommand('open', [], 'Open a file using its default application.', '', '', () => { }),
new ConsoleCommand('openvt', [], 'Start a program on a new virtual terminal (VT).', '', '', () => { }),
new ConsoleCommand('passwd', [], 'Change user password.', '', '', () => { }),
new ConsoleCommand('paste', [], 'Merge lines of files. Write to standard output, TAB-separated lines consisting of sqentially correspnding lines from each file.', '', '', () => { }),
new ConsoleCommand('patch', [], 'Apply a patchfile (containing differences listing by diff program) to an original file.', '', '', () => { }),
new ConsoleCommand('pathchk', [], 'Check if file names are valid or portable.', '', '', () => { }),
new ConsoleCommand('perl', [], 'Perl 5 language interpreter.', '', '', () => { }),
new ConsoleCommand('pgrep', [], 'List process IDs matching the specified criteria among all the running processes.', '', '', () => { }),
new ConsoleCommand('pidof', [], 'Find process ID of a running program.', '', '', () => { }),
new ConsoleCommand('ping', [], 'Send ICMP ECHO_REQUEST to network hosts.', '', '', () => { }),
new ConsoleCommand('pinky', [], 'Lightweight finger.', '', '', () => { }),
new ConsoleCommand('pkill', [], 'Send kill signal to processes based on name and other attributes.', '', '', () => { }),
new ConsoleCommand('pmap', [], 'Report memory map of a process.', '', '', () => { }),
new ConsoleCommand('popd', [], 'Removes directory on the head of the directory stack and takes you to the new directory on the head.', '', '', () => { }),
new ConsoleCommand('portmap', [], 'Converts RPC program numbers to IP port numbers.', '', '', () => { }),
new ConsoleCommand('poweroff', [], 'Shuts down the machine.', '', '', () => { }),
new ConsoleCommand('pppd', [], 'Point-to-point protocol daemon.', '', '', () => { }),
new ConsoleCommand('pr', [], 'Convert (column or paginate) text files for printing.', '', '', () => { }),
new ConsoleCommand('praliases', [], 'Prints the current system mail aliases.', '', '', () => { }),
new ConsoleCommand('printcap', [], 'Printer capability database.', '', '', () => { }),
new ConsoleCommand('printenv', [], 'Show values of all or specified environment variables.', '', '', () => { }),
new ConsoleCommand('printf', [], 'Show arguments formatted according to a specified format.', '', '', () => { }),
new ConsoleCommand('ps', [], 'Report a snapshot of the current processes.', '', '', () => { }),
new ConsoleCommand('ptx', [], 'Produce a permuted index of file contents.', '', '', () => { }),
new ConsoleCommand('pushd', [], 'Appends a given directory name to the head of the stack and then cd to the given directory.', '', '', () => { }),
new ConsoleCommand('pv', [], 'Monitor progress of data through a pipe.', '', '', () => { }),
new ConsoleCommand('pwck', [], 'Verify integrity of password files.', '', '', () => { }),
new ConsoleCommand('pwconv', [], 'Creates shadow from passwdand an optionally existing shadow.', '', '', () => { }),
new ConsoleCommand('pwd', [], 'Show current directory.', '', '', () => { }),
new ConsoleCommand('python', [], '', '', '', () => { }),
new ConsoleCommand('quota', [], 'Shows disk usage, and space limits for a user or group. Without arguments, only shows user quotas.', '', '', () => { }),
new ConsoleCommand('quotacheck', [], 'Used to scan a file system for disk usage.', '', '', () => { }),
new ConsoleCommand('quotactl', [], 'Make changes to disk quotas.', '', '', () => { }),
new ConsoleCommand('quotaoff', [], 'Enable enforcement of filesystem quotas.', '', '', () => { }),
new ConsoleCommand('quotaon', [], 'Disable enforcement of filesystem quotas.', '', '', () => { }),
new ConsoleCommand('quotastats', [], 'Shows the report of quota system statistics gathered from the kernel.', '', '', () => { }),
new ConsoleCommand('raidstart', [], 'Start/stop RAID devices.', '', '', () => { }),
new ConsoleCommand('ram', [], 'RAM disk device used to access the RAM disk in raw mode.', '', '', () => { }),
new ConsoleCommand('ramsize', [], 'Show usage information for the RAM disk.', '', '', () => { }),
new ConsoleCommand('ranlib', [], 'Generate index to the contents of an archive and store it in the archive.', '', '', () => { }),
new ConsoleCommand('rar', [], 'Create and manage RAR file in Linux.', '', '', () => { }),
new ConsoleCommand('rarpd', [], 'Respond to Reverse Address Resoultion Protocol (RARP) requests.', '', '', () => { }),
new ConsoleCommand('rcp', [], 'Remote copy command to copy files between remote computers.', '', '', () => { }),
new ConsoleCommand('rdate', [], 'Set system date and time by fetching information from a remote machine.', '', '', () => { }),
new ConsoleCommand('rdev', [], 'Set or query RAM disk size, image root device, or video mode.', '', '', () => { }),
new ConsoleCommand('rdist', [], 'Remote file distribution client, maintains identical file copies over multiple hosts.', '', '', () => { }),
new ConsoleCommand('rdistd', [], 'Start the rdist server.', '', '', () => { }),
new ConsoleCommand('read', [], 'Read from a file descriptor.', '', '', () => { }),
new ConsoleCommand('readarray', [], 'Read lines from a file into an array variable.', '', '', () => { }),
new ConsoleCommand('readcd', [], 'Read/write compact disks.', '', '', () => { }),
new ConsoleCommand('readelf', [], 'Shows information about ELF (Executable and Linkable fomrat) files.', '', '', () => { }),
new ConsoleCommand('readlink', [], 'Display value of a symbolic link or canonical file name.', '', '', () => { }),
new ConsoleCommand('readonly', [], 'Mark functions and variables as read-only.', '', '', () => { }),
new ConsoleCommand('reboot', [], 'Restart the machine.', '', '', () => { }),
new ConsoleCommand('reject', [], 'Accept/reject print jobs sent to a specified destination.', '', '', () => { }),
new ConsoleCommand('remsync', [], 'Synchronize remote files over email.', '', '', () => { }),
new ConsoleCommand('rename', [], 'Rename one or more files.', '', '', () => { }),
new ConsoleCommand('renice', [], 'Change priority of active processes.', '', '', () => { }),
new ConsoleCommand('repquota', [], 'Report disk usage and quotas for a specified filesystem.', '', '', () => { }),
new ConsoleCommand('reset', [], 'Reinitialize the terminal.', '', '', () => { }),
new ConsoleCommand('resize2fs', [], 'Used to resize ext2/ext3/ext4 file systems.', '', '', () => { }),
new ConsoleCommand('restore', [], 'Restore files from a backup created using dump.', '', '', () => { }),
new ConsoleCommand('return', [], 'Exit a shell function.', '', '', () => { }),
new ConsoleCommand('rev', [], 'Show contents of a file, reversing the order of characters in every line.', '', '', () => { }),
new ConsoleCommand('rexec', [], 'Remote execution client for exec server.', '', '', () => { }),
new ConsoleCommand('rexecd', [], 'Remote execution server.', '', '', () => { }),
new ConsoleCommand('richtext', [], 'View ôrichtextö on an ACSII terminal.', '', '', () => { }),
new ConsoleCommand('rlogin', [], 'Used to connect a local host system with a remote host.', '', '', () => { }),
new ConsoleCommand('rlogind', [], 'Acts as the server for rlogin.It facilitates remote login, and authentication based on privileged port numbers from trusted hosts.', '', '', () => { }),
new ConsoleCommand('rm', [], 'Removes specified files and directories (not by default).', '', '', () => { }),
new ConsoleCommand('rmail', [], 'Handle remote mail received via uucp.', '', '', () => { }),
new ConsoleCommand('rmdir', [], 'Used to remove empty directories.', '', '', () => { }),
new ConsoleCommand('rmmod', [], 'A program to remove modules from Linux kernel.', '', '', () => { }),
new ConsoleCommand('rndc', [], 'Name server control utility. Send command to a BIND DNS server over a TCP connection.', '', '', () => { }),
new ConsoleCommand('rootflags', [], 'Show/set flags for the kernel image.', '', '', () => { }),
new ConsoleCommand('route', [], 'Show/change IP routing table.', '', '', () => { }),
new ConsoleCommand('routed', [], 'A daemon, invoked at boot time, to manage internet routing tables.', '', '', () => { }),
new ConsoleCommand('rpcgen', [], 'An RPC protocol compiler. Parse a file written in the RPC language.', '', '', () => { }),
new ConsoleCommand('rpcinfo', [], 'Shows RPC information. Makes an RPC call to an RPC server and reports the findings.', '', '', () => { }),
new ConsoleCommand('rpm', [], 'A package manager for linux distributions. Originally developed for RedHat Linux.', '', '', () => { }),
new ConsoleCommand('rsh', [], 'Remote shell. Connects to a specified host and executes commands.', '', '', () => { }),
new ConsoleCommand('rshd', [], 'A daemon that acts as a server for rsh and rcp commands.', '', '', () => { }),
new ConsoleCommand('rsync', [], 'A versitile to for copying files remotely and locally.', '', '', () => { }),
new ConsoleCommand('runlevel', [], 'Shows previous and current SysV runlevel.', '', '', () => { }),
new ConsoleCommand('rup', [], 'Remote status display. Shows current system status for all or specified hosts on the local network.', '', '', () => { }),
new ConsoleCommand('ruptime', [], 'Shows uptime and login details of the machines on the local network.', '', '', () => { }),
new ConsoleCommand('rusers', [], 'Shows the list of the users logged-in to the host or on all machines on the local network.', '', '', () => { }),
new ConsoleCommand('rusersd', [], 'The rsuerd daemon acts as a server that responds to the queries from rsuers command.', '', '', () => { }),
new ConsoleCommand('rwall', [], 'Sends messages to all users on the local network.', '', '', () => { }),
new ConsoleCommand('rwho', [], 'Reports who is logged-in to the hosts on the local network.', '', '', () => { }),
new ConsoleCommand('rwhod', [], 'Acts as a server for rwho and ruptime commands.', '', '', () => { }),
new ConsoleCommand('sane-find-scanner', [], 'Find SCSI and USB scanner and determine their device files.', '', '', () => { }),
new ConsoleCommand('scanadf', [], 'Retrieve multiple images from a scanner equipped with an automatic document feeder (ADF).', '', '', () => { }),
new ConsoleCommand('scanimage', [], 'Read images from image aquistion devices (scanner or camera) and display on standard output in PNM (Portable aNyMap) format.', '', '', () => { }),
new ConsoleCommand('scp', [], 'Copy files between hosts on a network securely using SSH.', '', '', () => { }),
new ConsoleCommand('screen', [], 'A window manager that enables multiple pseudo-terminals with the help of ANSI/VT100 terminal emulation.', '', '', () => { }),
new ConsoleCommand('script', [], 'Used to make a typescript of everything displayed on the screen during a terminal session.', '', '', () => { }),
new ConsoleCommand('sdiff', [], 'Shows two files side-by-side and highlights the differences.', '', '', () => { }),
new ConsoleCommand('sed', [], 'Stream editor for filtering and transforming text (from a file or a pipe input).', '', '', () => { }),
new ConsoleCommand('select', [], 'Synchronous I/O multiplexing.', '', '', () => { }),
new ConsoleCommand('sendmail', [], 'It\'s a mail router or an MTA (Mail Transfer Agent). sendmail support can send a mail to one or more recepients using necessary protocols.', '', '', () => { }),
new ConsoleCommand('sensors', [], 'Shows the current readings of all sensor chips.', '', '', () => { }),
new ConsoleCommand('seq', [], 'Displays an incremental sequence of numbers from first to last.', '', '', () => { }),
new ConsoleCommand('set', [], 'Used to manipulate shell variables and functions.', '', '', () => { }),
new ConsoleCommand('setfdprm', [], 'Sets floppy disk parameters as provided by the user.', '', '', () => { }),
new ConsoleCommand('setkeycodes', [], 'Load kernel scancode-to-keycode mapping table entries.', '', '', () => { }),
new ConsoleCommand('setleds', [], 'Show/change LED light settings of the keyboard.', '', '', () => { }),
new ConsoleCommand('setmetamode', [], 'Define keyboard meta key handling. Without arguments, shows current meta key mode.', '', '', () => { }),
new ConsoleCommand('setquota', [], 'Set disk quotas for users and groups.', '', '', () => { }),
new ConsoleCommand('setsid', [], 'Run a program in a new session.', '', '', () => { }),
new ConsoleCommand('setterm', [], 'Set terminal attributes.', '', '', () => { }),
new ConsoleCommand('sftp', [], 'Secure File Transfer program.', '', '', () => { }),
new ConsoleCommand('sh', [], 'Command interpreter (shell) utility.', '', '', () => { }),
new ConsoleCommand('sha1sum', [], 'Compute and check 160-bit SHA1 checksum to verify file integrity.', '', '', () => { }),
new ConsoleCommand('shift', [], 'Shift positional parameters.', '', '', () => { }),
new ConsoleCommand('shopt', [], 'Shell options.', '', '', () => { }),
new ConsoleCommand('showkey', [], 'Examines codes sent by the keyboard displays them in printable form.', '', '', () => { }),
new ConsoleCommand('showmount', [], 'Shows information about NFS server mount on the host.', '', '', () => { }),
new ConsoleCommand('shred', [], 'Overwrite a file to hide its content (optionally delete it), making it harder to recover it.', '', '', () => { }),
new ConsoleCommand('shutdown', [], 'Power-off the machine.', '', '', () => { }),
new ConsoleCommand('size', [], 'Lists section size and the total size of a specified file.', '', '', () => { }),
new ConsoleCommand('skill', [], 'Send a signal to processes.', '', '', () => { }),
new ConsoleCommand('slabtop', [], 'Show kernel slab cache information in real-time.', '', '', () => { }),
new ConsoleCommand('slattach', [], 'Attack a network interface to a serial line.', '', '', () => { }),
new ConsoleCommand('sleep', [], 'Suspend execution for a specified amount of time (in seconds).', '', '', () => { }),
new ConsoleCommand('slocate', [], 'Display matches by searching filename databases. Takes ownership and file permission into consideration.', '', '', () => { }),
new ConsoleCommand('snice', [], 'Reset priority for processes.', '', '', () => { }),
new ConsoleCommand('sort', [], 'Sort lines of text files.', '', '', () => { }),
new ConsoleCommand('source', [], 'Run commands from a specified file.', '', '', () => { }),
new ConsoleCommand('split', [], 'Split a file into pieces of fixed size.', '', '', () => { }),
new ConsoleCommand('ss', [], 'Display socket statistics, similar to netstat.', '', '', () => { }),
new ConsoleCommand('ssh', [], 'An SSH client for logging in to a remote machine. It provides encrypted communication between the hosts.', '', '', () => { }),
new ConsoleCommand('ssh-add', [], 'Adds private key identities to the authentication agent.', '', '', () => { }),
new ConsoleCommand('ssh-agent', [], 'It holds private keys used for public key authentication.', '', '', () => { }),
new ConsoleCommand('ssh-keygen', [], 'It generates, manages, converts authentication keys for ssh.', '', '', () => { }),
new ConsoleCommand('ssh-keyscan', [], 'Gather ssh public keys.', '', '', () => { }),
new ConsoleCommand('sshd', [], 'Server for the ssh program.', '', '', () => { }),
new ConsoleCommand('stat', [], 'Display file or filesystem status.', '', '', () => { }),
new ConsoleCommand('statd', [], 'A daemon that listens for reboot notifications from other hosts, and manages the list of hosts to be notified when the local system reboots.', '', '', () => { }),
new ConsoleCommand('strace', [], 'Trace system calls and signals.', '', '', () => { }),
new ConsoleCommand('strfile', [], 'Create a random access file for storing strings.', '', '', () => { }),
new ConsoleCommand('strings', [], 'Search a specified file and prints any printable strings with at least four characters and followed by an unprintable character.', '', '', () => { }),
new ConsoleCommand('strip', [], 'Discard symbols from object files.', '', '', () => { }),
new ConsoleCommand('stty', [], 'Change and print terminal line settings.', '', '', () => { }),
new ConsoleCommand('su', [], 'Change user ID or become superuser.', '', '', () => { }),
new ConsoleCommand('sudo', [], 'Execute a command as superuser.', '', '', () => { }),
new ConsoleCommand('sum', [], 'Checksum and count the block in a file.', '', '', () => { }),
new ConsoleCommand('suspend', [], 'Suspend the execution of the current shell.', '', '', () => { }),
new ConsoleCommand('swapoff', [], 'Disable devices for paging and swapping.', '', '', () => { }),
new ConsoleCommand('swapon', [], 'Enable devices for paging and swapping.', '', '', () => { }),
new ConsoleCommand('symlink', [], 'Create a symbolic link to a file.', '', '', () => { }),
new ConsoleCommand('sync', [], 'Synchronize cached writes to persistent storage.', '', '', () => { }),
new ConsoleCommand('sysctl', [], 'Configure kernel parameters at runtime.', '', '', () => { }),
new ConsoleCommand('sysklogd', [], 'Linux system logging utilities. Provides syslogd and klogd functionalities.', '', '', () => { }),
new ConsoleCommand('syslogd', [], 'Read and log system messages to the system console and log files.', '', '', () => { }),
new ConsoleCommand('tac', [], 'Concatenate and print files in reverse order. Opposite of cat command.', '', '', () => { }),
new ConsoleCommand('tail', [], 'Show the last 10 lines of each specified file(s).', '', '', () => { }),
new ConsoleCommand('tailf', [], 'Follow the growth of a log file. (Deprecated command)', '', '', () => { }),
new ConsoleCommand('talk', [], 'A two-way screen-oriented communication utility that allows two user to exchange messages simulateneously.', '', '', () => { }),
new ConsoleCommand('talkd', [], 'A remote user communication server for <em>talk</em>.', '', '', () => { }),
new ConsoleCommand('tar', [], 'GNU version of the tar archiving utility. Used to store and extract multiple files from a single archive.', '', '', () => { }),
new ConsoleCommand('taskset', [], 'Set/retrieve a process\'s CPU affinity.', '', '', () => { }),
new ConsoleCommand('tcpd', [], 'Access control utility for internet services.', '', '', () => { }),
new ConsoleCommand('tcpdump', [], 'Dump traffic on network. Displays a description of the contents of packets on a network interface that match the boolean expression.', '', '', () => { }),
new ConsoleCommand('tcpslice', [], 'Extract pieces of tcpdump files or merge them.', '', '', () => { }),
new ConsoleCommand('tee', [], 'Read from standard input and write to standard output and files.', '', '', () => { }),
new ConsoleCommand('telinit', [], 'Change SysV runlevel.', '', '', () => { }),
new ConsoleCommand('telnet', [], 'Telnet protocol user interface. Used to interact with another host using telnet.', '', '', () => { }),
new ConsoleCommand('telnetd', [], 'A server for the telnet protocol.', '', '', () => { }),
new ConsoleCommand('test', [], 'Check file type and compare values.', '', '', () => { }),
new ConsoleCommand('tftp', [], 'User interface to the internet TFTP (Trivial File Transfer Protocol).', '', '', () => { }),
new ConsoleCommand('tftpd', [], 'TFTP server.', '', '', () => { }),
new ConsoleCommand('time', [], 'Run programs and summarize system resource usage.', '', '', () => { }),
new ConsoleCommand('timeout', [], 'Execute a command with a time limit.', '', '', () => { }),
new ConsoleCommand('times', [], 'Shows accumulated user and system times for the shell and it\'s child processes.', '', '', () => { }),
new ConsoleCommand('tload', [], 'Shows a graph of the current system load average to the specified tty.', '', '', () => { }),
new ConsoleCommand('tmpwatch', [], 'Recursively remove files and directories which haven\'t been accessed for the specified period of time.', '', '', () => { }),
new ConsoleCommand('top', [], 'Displays real-time view of processes running on the system.', '', '', () => { }),
new ConsoleCommand('touch', [], 'Change file access and modification times.', '', '', () => { }),
new ConsoleCommand('tput', [], 'Modify terminal-dependent capabilities, color, etc.', '', '', () => { }),
new ConsoleCommand('tr', [], 'Translate, squeeze, or delete characters from standard input and display on standard output.', '', '', () => { }),
new ConsoleCommand('tracepath', [], 'Traces path to a network host discovering MTU (Maximum Transmission Unit) along this path.', '', '', () => { }),
new ConsoleCommand('traceroute', [], 'Traces the route taken by the packets to reach the network host.', '', '', () => { }),
new ConsoleCommand('trap', [], 'Trap function responds to hardware signals. It defines and creates handlers to run when the shell receives signals.', '', '', () => { }),
new ConsoleCommand('troff', [], 'The troff processor of the groff text formatting system.', '', '', () => { }),
new ConsoleCommand('TRUE', [], 'Exit with a status code indicating success.', '', '', () => { }),
new ConsoleCommand('tset', [], 'Initialize terminal.', '', '', () => { }),
new ConsoleCommand('tsort', [], 'Perform topological sort.', '', '', () => { }),
new ConsoleCommand('tty', [], 'Display the filename of the terminal connected to standard input.', '', '', () => { }),
new ConsoleCommand('tune2fs', [], 'Adjust tunable filesystem parameters on ext2/ext3/ext4 filesystems.', '', '', () => { }),
new ConsoleCommand('tunelp', [], 'Set various parameters for the line printer devices.', '', '', () => { }),
new ConsoleCommand('type', [], 'Write a description for a command type.', '', '', () => { }),
new ConsoleCommand('ul', [], 'Underline text.', '', '', () => { }),
new ConsoleCommand('ulimit', [], 'Get and set user limits for the calling process.', '', '', () => { }),
new ConsoleCommand('umask', [], 'Set file mode creation mask.', '', '', () => { }),
new ConsoleCommand('umount', [], 'Unmount specified file systems.', '', '', () => { }),
new ConsoleCommand('unalias', [], 'Remove alias definitions for specified alias names.', '', '', () => { }),
new ConsoleCommand('uname', [], 'Show system information.', '', '', () => { }),
new ConsoleCommand('uncompress', [], 'Uncompress the files compressed with the compress command.', '', '', () => { }),
new ConsoleCommand('unexpand', [], 'Convert spaces to tabs for a specified file.', '', '', () => { }),
new ConsoleCommand('unicode_start', [], 'Put keyboard and console in Unicode mode.', '', '', () => { }),
new ConsoleCommand('unicode_stop', [], 'Revert keyboard and console from Unicode mode.', '', '', () => { }),
new ConsoleCommand('uniq', [], 'Report or omit repeating lines.', '', '', () => { }),
new ConsoleCommand('units', [], 'Convert units from one scalar to another.', '', '', () => { }),
new ConsoleCommand('unrar', [], 'Extract files from a RAR archive.', '', '', () => { }),
new ConsoleCommand('unset', [], 'Remove variable or function names.', '', '', () => { }),
new ConsoleCommand('unshar', [], 'Unpack shell archive scripts.', '', '', () => { }),
new ConsoleCommand('until', [], 'Execute command until a given condition is true.', '', '', () => { }),
new ConsoleCommand('uptime', [], 'Tell how long the system has been running.', '', '', () => { }),
new ConsoleCommand('useradd', [], 'Create a new user or update default user information.', '', '', () => { }),
new ConsoleCommand('userdel', [], 'Delete a user account and related files.', '', '', () => { }),
new ConsoleCommand('usermod', [], 'Modify a user account.', '', '', () => { }),
new ConsoleCommand('users', [], 'Show the list of active users on the machine.', '', '', () => { }),
new ConsoleCommand('usleep', [], 'Suspend execution for microsecond intervals.', '', '', () => { }),
new ConsoleCommand('uudecode', [], 'Decode a binary file.', '', '', () => { }),
new ConsoleCommand('uuencode', [], 'Encode a binary file.', '', '', () => { }),
new ConsoleCommand('uuidgen', [], 'Created a new UUID (Universally Unique Identifier) table.', '', '', () => { }),
new ConsoleCommand('vdir', [], 'Same as <strong>ls -l -b</strong>. Verbosely list directory contents.', '', '', () => { }),
new ConsoleCommand('vi', [], 'A text editor utility.', '', '', () => { }),
new ConsoleCommand('vidmode', [], 'Set the video mode for a kernel image. Displays current mode value without arguments. Alternative: rdev -v', '', '', () => { }),
new ConsoleCommand('vim', [], 'Vi Improved, a text-based editor which is a successor to vi.', '', '', () => { }),
new ConsoleCommand('vmstat', [], 'Shows information about processes, memory, paging, block IO, traps, disks, and CPU activity.', '', '', () => { }),
new ConsoleCommand('volname', [], 'Returns volume name for a device formatted with an ISO-9660 filesystem. For example, CD-ROM.', '', '', () => { }),
new ConsoleCommand('w', [], 'Show who is logged-on and what they\'re doing.', '', '', () => { }),
new ConsoleCommand('wait', [], 'Waits for a specified process ID(s) to terminate and returns the termination status.', '', '', () => { }),
new ConsoleCommand('wall', [], 'Display a message on the terminals all the users who are currently logged-in.', '', '', () => { }),
new ConsoleCommand('warnquota', [], 'Send mail to the users who\'ve exceeded their disk quota soft limit.', '', '', () => { }),
new ConsoleCommand('watch', [], 'Runs commands repeatedly until interrupted and shows their output and errors.', '', '', () => { }),
new ConsoleCommand('wc', [], 'Print newline, word, and byte count for each of the specified files.', '', '', () => { }),
new ConsoleCommand('wget', [], 'A non-interactive file download utility.', '', '', () => { }),
new ConsoleCommand('whatis', [], 'Display one line manual page descriptions.', '', '', () => { }),
new ConsoleCommand('whereis', [], 'Locate the binary, source, and man page files for a command.', '', '', () => { }),
new ConsoleCommand('which', [], 'For a given command, lists the pathnames for the files which would be executed when the command runs.', '', '', () => { }),
new ConsoleCommand('while', [], 'Conditionally execute commands (while loop).', '', '', () => { }),
new ConsoleCommand('who', [], 'Shows who is logged on.', '', '', () => { }),
new ConsoleCommand('whoami', [], 'Displays the username tied to the current effective user ID.', '', '', () => { }),
new ConsoleCommand('whois', [], 'Looks for an object in a WHOIS database', '', '', () => { }),
new ConsoleCommand('write', [], 'Display a message on other user\'s terminal.', '', '', () => { }),
new ConsoleCommand('xargs', [], 'Runs a command using initial arguments and then reads remaining arguments from standard input.', '', '', () => { }),
new ConsoleCommand('xdg-open', [], 'Used to open a file or URL in an application preferred by the user.', '', '', () => { }),
new ConsoleCommand('xinetd', [], 'Extended internet services daemon. Works similar to inetd.', '', '', () => { }),
new ConsoleCommand('xz', [], 'Compress/ Decompress .xz and .lzma files.', '', '', () => { }),
new ConsoleCommand('yacc', [], 'Yet Another Compiler Compiler, a GNU Project parser generator.', '', '', () => { }),
new ConsoleCommand('yes', [], 'Repeatedly output a line with a specified string(s) until killed.', '', '', () => { }),
new ConsoleCommand('ypbind', [], 'A daemon that helps client processes to connect to an NIS server.', '', '', () => { }),
new ConsoleCommand('ypcat', [], 'Shows the NIS map (or database) for the specified MapName parameter.', '', '', () => { }),
new ConsoleCommand('ypinit', [], 'Sets up NIS maps on an NIS server.', '', '', () => { }),
new ConsoleCommand('ypmatch', [], 'Shows values for specified keys from an NIS map.', '', '', () => { }),
new ConsoleCommand('yppasswd', [], 'Change NIS login password.', '', '', () => { }),
new ConsoleCommand('yppasswdd', [], 'Acts as a server for the yppasswd command. Receives and executes requests.', '', '', () => { }),
new ConsoleCommand('yppoll', [], 'Shows the ID number or version of NIS map currently used on the NIS server.', '', '', () => { }),
new ConsoleCommand('yppush', [], 'Forces slave NIS servers to copy updated NIS maps.', '', '', () => { }),
new ConsoleCommand('ypserv', [], 'A daemon activated at system startup. It looks for information in local NIS maps.', '', '', () => { }),
new ConsoleCommand('ypset', [], 'Point a client (running ypbind) to a specifc server (running ypserv).', '', '', () => { }),
new ConsoleCommand('yptest', [], 'Calls various functions to check the configuration of NIS services.', '', '', () => { }),
new ConsoleCommand('ypwhich', [], 'Shows the hostname for NIS server or master server for a given map.', '', '', () => { }),
new ConsoleCommand('ypxfr', [], 'Transfers NIS server map from server to a local host.', '', '', () => { }),
new ConsoleCommand('zcat', [], 'Used to compress/uncompress files. Similar to gzip', '', '', () => { }),
new ConsoleCommand('zcmp', [], 'Compare compressed files.', '', '', () => { }),
new ConsoleCommand('zdiff', [], 'Compare compressed files line by line.', '', '', () => { }),
new ConsoleCommand('zdump', [], 'Displays time for the timezone mentioned.', '', '', () => { }),
new ConsoleCommand('zforce', [], 'Adds .gz extension to all gzipped files.', '', '', () => { }),
new ConsoleCommand('zgrep', [], 'Performs grep on compressed files.', '', '', () => { }),
new ConsoleCommand('zic', [], 'Creates time conversion information files using the specified input files.', '', '', () => { }),
new ConsoleCommand('zip', [], 'A file compression and packaging utility.', '', '', () => { }),
new ConsoleCommand('zless', [], 'Displays information of a compressed file (using less command) on the terminal one screen at a time.', '', '', () => { }),
new ConsoleCommand('zmore', [], 'Displays output of a compressed file (using more command) on the terminal one page at a time.', '', '', () => { }),
new ConsoleCommand('znew', [], 'Recompress .z files to .gz. files.', '', '', () => { })
];
export const BashCommands = commands;
//# sourceMappingURL=BashCommands.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,400 +0,0 @@
import { ConsoleCommand } from "../Models/ConsoleCommand.js";
import { Parameter } from "../Models/Parameter.js";
import * as UI from "../UI.js";
import * as BrowserSockets from "../BrowserSockets.js";
import { Main } from "../Main.js";
import * as DataGrid from "../DataGrid.js";
import { AddConsoleOutput } from "../UI.js";
import { GetSelectedDevices } from "../DataGrid.js";
var commands = [
new ConsoleCommand("AddGroup", [
new Parameter("group", "The group name to add.", "String")
], "Adds a permission group to the selected computer(s).", "AddGroup -group Lab Devices", "", (parameters, paramDictionary) => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
AddConsoleOutput("No devices are selected.");
return;
}
;
if (!paramDictionary["group"]) {
AddConsoleOutput("A group name is required.");
return;
}
BrowserSockets.Connection.invoke("AddGroup", selectedDevices.map(x => x.ID), paramDictionary["group"]);
}),
new ConsoleCommand("DeployScript", [
new Parameter("pscore", "Indicates that script should be run with PowerShell Core.", "Switch"),
new Parameter("winps", "Indicates that script should be run with Windows PowerShell.", "Switch"),
new Parameter("cmd", "Indicates that script should be run with Windows CMD.", "Switch"),
new Parameter("bash", "Indicates that script should be run with Bash.", "Switch")
], "Deploy and run a script on the selected device(s). Note: Only one switch argument can be used.", "deployscript -pscore", "", (parameters, parameterDict) => {
if (parameters.length != 1) {
AddConsoleOutput("There should be exactly 1 argument to indicate the script type.");
return;
}
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
AddConsoleOutput("No devices are selected.");
return;
}
var fileInput = document.createElement("input");
fileInput.type = "file";
fileInput.hidden = true;
document.body.appendChild(fileInput);
fileInput.onchange = () => {
uploadFiles(fileInput.files).then(value => {
BrowserSockets.Connection.invoke("DeployScript", value[0], parameters[0].Name, selectedDevices.map(x => x.ID));
fileInput.remove();
});
};
fileInput.click();
}),
new ConsoleCommand("GetGroups", [], "Lists the permission group(s) that are applied to the selected computer(s).", "GetGroups", "", (parameters, paramDictionary) => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
AddConsoleOutput("No devices are selected.");
return;
}
;
BrowserSockets.Connection.invoke("GetGroups", selectedDevices.map(x => x.ID));
}),
new ConsoleCommand("GetVersion", [], "Display the remote agent's version.", "GetVersion", "", (parameters, paramDictionary) => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
AddConsoleOutput("No devices are selected.");
return;
}
;
var output = `<div>Version Results:</div>
<table class="console-device-table table table-responsive">
<thead><tr>
<th>Device Name</th><th>Agent Version</th>
</tr></thead>`;
var deviceList = selectedDevices.map(x => {
return `<tr>
<td>${x.DeviceName}</td>
<td>
${x.AgentVersion}
</td>
</tr>`;
});
output += deviceList.join("");
output += "</table>";
UI.AddConsoleOutput(output);
}),
new ConsoleCommand("RemoveGroup", [
new Parameter("group", "The group name to remove.", "String")
], "Removes a permission group to the selected computer(s).", "RemoveGroup -group Lab Devices", "", (parameters, paramDictionary) => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
AddConsoleOutput("No devices are selected.");
return;
}
;
if (!paramDictionary["group"]) {
AddConsoleOutput("A group name is required.");
return;
}
BrowserSockets.Connection.invoke("RemoveGroup", selectedDevices.map(x => x.ID), paramDictionary["group"]);
}),
new ConsoleCommand("Clear", [], "Clears the output window of text.", "clear", "", (parameters, paramDictionary) => { UI.ConsoleOutputDiv.innerHTML = ""; }),
new ConsoleCommand("Connect", [], "Connect or reconnect to the server.", "connect", "", (parameters, paramDictionary) => { BrowserSockets.Connect(); }),
new ConsoleCommand("Echo", [
new Parameter("message", "The text to display in the console.", "String")
], "Writes a message to the console window.", "echo -message This will appear in the console.", "", (parameters, paramDictionary) => {
UI.AddConsoleOutput(paramDictionary["message"]);
}),
new ConsoleCommand("ExpandResults", [], "Expands the results of the last scripting command.", "expandresults", "", (parameters, paramDictionary) => {
$(UI.ConsoleOutputDiv).find(".command-harness").last().find(".collapse")['collapse']('show');
}),
new ConsoleCommand("CollapseResults", [], "Collapses all scripting results.", "collapseresults", "", (parameters, paramDictionary) => {
$(UI.ConsoleOutputDiv).find(".command-harness").find(".collapse")['collapse']('hide');
}),
new ConsoleCommand("Help", [
new Parameter("command", "The name of the command to look up.", "String")
], "Displays the full help text for a command.", "help -command Select", "", (parameters) => {
if (parameters.length == 0) {
var output = `Command List:<br><div class="help-list">`;
WebCommands.forEach(x => {
output += `<div>${x.Name}</div><div>${x.Summary}</div>`;
});
output += "</div>";
AddConsoleOutput(output);
return;
}
var suppliedCommand = parameters.find(x => x.Name.toLowerCase() == "command") || {};
var result = commands.filter(command => {
return command.Name.toLowerCase() == (suppliedCommand.Value || "").toLowerCase();
});
if (result.length == 0) {
UI.AddConsoleOutput("No matching commands found.");
}
else if (result.length == 1) {
UI.AddConsoleHTML("<br>" + result[0].FullHelp);
}
else {
var outputText = "Multiple commands found: <br><br>";
for (var i = 0; i < result.length; i++) {
outputText += result[i].Name + "<br>";
}
UI.AddConsoleHTML(outputText);
}
}),
new ConsoleCommand("List", [], "Displays a list of the currently-selected devices.", "list", "", () => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
UI.AddConsoleOutput("No devices are selected.");
return;
}
var output = `<div>Selected Devices:</div>
<table class="console-device-table table table-responsive">
<thead><tr>
<th>Online</th><th>Device Name</th><th>Current User</th><th>Last Online</th><th>Platform</th><th>OS Description</th><th>Free Storage</th><th>Total Storage (GB)</th><th>Free Memory</th><th>Total Memory (GB)</th><th>Tags</th>
</tr></thead>`;
var deviceList = selectedDevices.map(x => {
return `<tr>
<td>${String(x.IsOnline)
.replace("true", "<span class='fa fa-check-circle'></span>")
.replace("false", "<span class='fa fa-times'></span>")}</td>
<td>${x.DeviceName}</td>
<td>${x.CurrentUser}</td>
<td>${new Date(x.LastOnline).toLocaleString()}</td>
<td>${x.Platform}</td>
<td>${x.OSDescription}</td>
<td>${Math.round(x.FreeStorage * 100)}%</td>
<td>${x.TotalStorage.toLocaleString()}</td>
<td>${Math.round(x.FreeMemory * 100)}%</td>
<td>${x.TotalMemory.toLocaleString()}</td>
<td>${x.Tags}</td>
</tr>`;
});
output += deviceList.join("");
output += "</table>";
UI.AddConsoleOutput(output);
}),
new ConsoleCommand("Remove", [], "Removes the selected devices from the database. (Note: This does not attempt to uninstall the client. Use Uninstall.)", "remove", "", (parameters) => {
var devices = DataGrid.GetSelectedDevices();
if (devices.length == 0) {
UI.AddConsoleOutput("No devices are selected.");
}
else {
BrowserSockets.Connection.invoke("RemoveDevices", devices.map(x => x.ID));
}
}),
new ConsoleCommand("Select", [
new Parameter("all", "If specified, all devices will be selected.", "Switch"),
new Parameter("none", "If specified, no devices will be selected.", "Switch"),
new Parameter("online", "If specified, selects the devices that are currently online.", "Switch"),
new Parameter("filter", "A comma-separated list of search filters (spaces are optional). See the help article for more details.", "String"),
new Parameter("append", "If specified, selected devices will be added list of computers already selected (if any).", "Switch"),
], "Selects devices based on a supplied filter.", "select -filter isonline=true, devicename*Rig, freestorage<50", `The filter contains a comma-separated list of fields to search, and devices that match all filters will be selected.
There are multiple operator types, and they can be used on any of the fields on the grid (plus some extra hidden ones).<br><br>
Operators:<br>
<ul style="list-style:none">
<li>=&nbsp;&nbsp;&nbsp; Exactly equal to. "devicename=myrig" would match "MyRig", but not "MyRig2"</li>
<li>*&nbsp;&nbsp;&nbsp; Like. "currentuser*bus" would match "Business" and "A_Busy_User"</li>
<li>!=&nbsp;&nbsp; Not equal to. "currentuser!=jon" would match every user except "Jon"</li>
<li>!*&nbsp;&nbsp; Not like. "currentuser!*jon" would match "Jon", "Jonathan", and "SuperJon"</li>
<li>>&nbsp;&nbsp;&nbsp; Greater than. "totalmemory>10" would match computers with more than 10GB of RAM</li>
<li><&nbsp;&nbsp;&nbsp; Less than. "freestorage<0.1" would match computers with less than 10% disk space left</li>
</ul>
Fields:<br>
<ul style="list-style:none">
<li>IsOnline (true or false)</li>
<li>DeviceName (text)</li>
<li>CurrentUser (text)</li>
<li>LastOnline (date or date+time</li>
<li>Is64Bit (true or false)</li>
<li>OSDescription (text)</li>
<li>Platform (text)</li>
<li>FreeStorage (between 0 and 1)</li>
<li>TotalStorage (number in GB)</li>
<li>FreeMemory (between 0 and 1)</li>
<li>TotalMemory (number in GB)</li>
<li>ProcessorCount (number)</li>
</ul>`, (parameters, paramDictionary) => {
if (typeof paramDictionary["all"] != "undefined") {
Main.DataGrid.DataSource.forEach(x => {
document.getElementById(x.ID).classList.add("row-selected");
});
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
}
if (typeof paramDictionary["none"] != "undefined") {
Main.UI.DeviceGrid.querySelectorAll(".row-selected").forEach(x => {
x.classList.remove("row-selected");
});
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
}
if (typeof paramDictionary["online"] != "undefined") {
Main.DataGrid.DataSource.filter(x => x.IsOnline).forEach(x => {
document.getElementById(x.ID).classList.add("row-selected");
});
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
}
if (typeof paramDictionary["filter"] != "undefined") {
try {
var lambda = "";
var filterString = paramDictionary["filter"];
var filters = filterString.split(",");
filters.forEach(filter => {
var operatorIndex = filter.search(/([^\w|\d|\s])/i);
var valueIndex = filter.slice(operatorIndex).search(/([\w|\d|\s|.])/i) + operatorIndex;
var key = filter.slice(0, operatorIndex).trim().toLowerCase();
var operator = filter.slice(operatorIndex, valueIndex).trim().toLowerCase();
var value = filter.slice(valueIndex).trim().toLowerCase();
if (key == "lastonline") {
var parsedDate = Date.parse(value);
switch (operator) {
case "=":
case "*":
case "!=":
case "!*":
UI.AddConsoleOutput("Only < and > operators can be used with dates.");
return;
case ">":
lambda += `Date.parse(x[Object.keys(x).find(y=>y.toLowerCase().indexOf("${key}") > -1)]) > ${parsedDate} && `;
break;
case "<":
lambda += `Date.parse(x[Object.keys(x).find(y=>y.toLowerCase().indexOf("${key}") > -1)]) < ${parsedDate} && `;
break;
default:
throw "Unable to parse comparison operator.";
}
}
else {
switch (operator) {
case "=":
lambda += `x[Object.keys(x).find(y=>y.toString().toLowerCase().indexOf("${key}") > -1)].toString().toLowerCase() === "${value}".toString().toLowerCase() && `;
break;
case "*":
lambda += `x[Object.keys(x).find(y=>y.toString().toLowerCase().indexOf("${key}") > -1)].toString().toLowerCase().search("${value}".toString().toLowerCase()) > -1 && `;
break;
case "!=":
lambda += `x[Object.keys(x).find(y=>y.toString().toLowerCase().indexOf("${key}") > -1)].toString().toLowerCase() !== "${value}".toString().toLowerCase() && `;
break;
case "!*":
lambda += `x[Object.keys(x).find(y=>y.toString().toLowerCase().indexOf("${key}") > -1)].toString().toLowerCase().search("${value}".toString().toLowerCase()) === -1 && `;
break;
case ">":
lambda += `parseFloat(x[Object.keys(x).find(y=>y.toString().toLowerCase().indexOf("${key}") > -1)]) > parseFloat("${value}") && `;
break;
case "<":
lambda += `parseFloat(x[Object.keys(x).find(y=>y.toString().toLowerCase().indexOf("${key}") > -1)]) < parseFloat("${value}") && `;
break;
default:
throw "Unable to parse comparison operator.";
}
}
});
}
catch (ex) {
UI.AddConsoleOutput("Unable to parse filter. Please check your syntax.");
return;
}
lambda = lambda.slice(0, lambda.lastIndexOf(" &&"));
if (paramDictionary["append"] != "true") {
Main.UI.DeviceGrid.querySelectorAll(".row-selected").forEach(x => {
x.classList.remove("row-selected");
});
}
var selectedDevices = Main.DataGrid.DataSource.filter(x => eval(lambda));
selectedDevices.forEach(x => {
document.getElementById(x.ID).classList.add("row-selected");
});
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
}
Main.DataGrid.UpdateDeviceCounts();
}),
new ConsoleCommand("RemoteControl", [], "Connect to a computer with Remotely Remote Control.", "list", "", () => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
UI.AddConsoleOutput("You must select a device first.");
return;
}
if (selectedDevices.length > 1) {
UI.AddConsoleOutput("You can only initiate remote control on one device at a time.");
return;
}
UI.AddConsoleOutput("Launching remote control on client device...");
BrowserSockets.Connection.invoke("RemoteControl", selectedDevices[0].ID);
}),
new ConsoleCommand("Uninstall", [], "Uninstalls the Remotely client from the selected devices. Warning: This can't be undone from the web portal. You would need to redeploy the client.", "uninstall", "", (parameters, parameterDict) => {
var selectedDevices = DataGrid.GetSelectedDevices();
BrowserSockets.Connection.invoke("UninstallClients", selectedDevices.map(x => x.ID));
}),
new ConsoleCommand("SetTags", [
new Parameter("Tags", "The tags to set for the device. Max length is 200 characters.", "String"),
new Parameter("Append", "Append the tags to any existing ones.", "Switch")
], "Set the tag/description for the selected devices. Max length is 200 characters.", "SetTags -tags John's computer, Portland office, desktop", "", (parameters, parameterDict) => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
AddConsoleOutput("No devices are selected.");
return;
}
selectedDevices.forEach(x => {
if (typeof parameterDict["append"] != 'undefined') {
var separator = x.Tags.trim().endsWith(",") ? " " : ", ";
parameterDict["tags"] = x.Tags.trim() + separator + parameterDict["tags"];
}
DataGrid.DataSource.find(y => y.ID == x.ID).Tags = parameterDict["tags"];
var deviceTagInput = document.getElementById(x.ID).querySelector(".device-tag");
deviceTagInput.value = parameterDict["tags"];
deviceTagInput.setAttribute("value", parameterDict["tags"]);
BrowserSockets.Connection.invoke("UpdateTags", x.ID, parameterDict["tags"]);
});
}),
new ConsoleCommand("TransferFiles", [], "Transfer file(s) to the selected devices.", "transferfiles", "", (parameters, parameterDict) => {
var selectedDevices = Main.DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
AddConsoleOutput("No devices are selected.");
return;
}
var transferID = Main.Utilities.CreateGUID();
UI.AddTransferHarness(transferID, selectedDevices.length);
var fileInput = document.createElement("input");
fileInput.type = "file";
fileInput.hidden = true;
fileInput.multiple = true;
document.body.appendChild(fileInput);
fileInput.onchange = () => {
uploadFiles(fileInput.files).then(value => {
BrowserSockets.Connection.invoke("TransferFiles", value, transferID, selectedDevices.map(x => x.ID));
fileInput.remove();
});
};
fileInput.click();
})
];
function uploadFiles(fileList) {
return new Promise((resolve, reject) => {
UI.AddConsoleOutput("File upload started...");
var strPath = "/API/FileSharing/";
var fd = new FormData();
for (var i = 0; i < fileList.length; i++) {
fd.append('fileUpload' + i, fileList[i]);
}
var xhr = new XMLHttpRequest();
xhr.open('POST', strPath, true);
xhr.addEventListener("load", function () {
if (xhr.status === 200) {
UI.AddConsoleOutput("File upload completed.");
resolve(JSON.parse(xhr.responseText));
}
else {
UI.AddConsoleOutput("File upload failed.");
reject();
}
});
xhr.addEventListener("error", () => {
UI.AddConsoleOutput("File upload failed.");
reject();
});
xhr.addEventListener("progress", function (e) {
UI.AddConsoleOutput("File upload progress: " + String(isFinite(e.loaded / e.total) ? e.loaded / e.total : 0) + "%");
});
xhr.send(fd);
});
}
export const WebCommands = commands;
//# sourceMappingURL=WebCommands.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,122 +0,0 @@
import * as UI from "./UI.js";
import { Main } from "./Main.js";
import { DeviceGrid } from "./UI.js";
import * as BrowserSockets from "./BrowserSockets.js";
export var DataSource = new Array();
export function AddOrUpdateDevices(devices) {
devices.forEach(x => {
AddOrUpdateDevice(x);
});
}
export function AddOrUpdateDevice(device) {
var existingIndex = DataSource.findIndex(x => x.ID == device.ID);
if (existingIndex > -1) {
DataSource[existingIndex] = device;
}
else {
DataSource.push(device);
}
var tableBody = document.querySelector("#" + Main.UI.DeviceGrid.id + " tbody");
var recordRow = document.getElementById(device.ID);
if (recordRow == null) {
recordRow = document.createElement("tr");
recordRow.classList.add("record-row");
recordRow.id = device.ID;
tableBody.appendChild(recordRow);
recordRow.addEventListener("click", (e) => {
if (!e.ctrlKey && !e.shiftKey) {
var selectedID = e.currentTarget.id;
DeviceGrid.querySelectorAll(`.record-row.row-selected:not([id='${selectedID}'])`).forEach(elem => {
elem.classList.remove("row-selected");
});
}
e.currentTarget.classList.toggle("row-selected");
UpdateDeviceCounts();
});
}
recordRow.innerHTML = `
<td>${String(device.IsOnline)
.replace("true", "<span class='fa fa-check-circle'></span>")
.replace("false", "<span class='fa fa-times'></span>")}</td>
<td>${device.DeviceName}</td>
<td>${device.CurrentUser}</td>
<td>${new Date(device.LastOnline).toLocaleString()}</td>
<td>${device.Platform}</td>
<td>${device.OSDescription}</td>
<td>${Math.round(device.FreeStorage * 100)}%</td>
<td>${device.TotalStorage.toLocaleString()}</td>
<td>${Math.round(device.FreeMemory * 100)}%</td>
<td>${device.TotalMemory.toLocaleString()}</td>
<td><input type="text" class="device-tag" value="${device.Tags}" /></td>`;
recordRow.querySelector(".device-tag").onchange = (ev) => {
var newTag = ev.currentTarget.value;
DataSource.find(x => x.ID == device.ID).Tags = newTag;
var deviceTagInput = document.getElementById(device.ID).querySelector(".device-tag");
deviceTagInput.value = newTag;
deviceTagInput.setAttribute("value", newTag);
BrowserSockets.Connection.invoke("UpdateTags", device.ID, newTag);
};
UpdateDeviceCounts();
}
export function GetSelectedDevices() {
var devices = new Array();
DeviceGrid.querySelectorAll(".row-selected").forEach(row => {
devices.push(DataSource.find(x => x.ID == row.id));
});
return devices;
}
;
export function ClearAllData() {
DataSource.splice(0, DataSource.length);
UI.DeviceGrid.querySelectorAll(".record-row").forEach(row => {
row.remove();
});
UpdateDeviceCounts();
}
export function RefreshGrid() {
ClearAllData();
var xhr = new XMLHttpRequest();
xhr.open("get", "/API/Devices");
xhr.onerror = () => {
UI.ShowModal("Request Failure", "Failed to retrieve device data. Please refresh your connection or contact support.");
};
xhr.onload = (e) => {
if (xhr.status == 200) {
var devices = JSON.parse(xhr.responseText);
if (devices.length == 0) {
UI.AddConsoleOutput("It looks like you don't have the Remotely service installed on any devices. You can get the install script from the Client Downloads page.");
}
else {
}
AddOrUpdateDevices(devices);
}
else {
UI.ShowModal("Request Failure", "Failed to retrieve device data. Please refresh your connection or contact support.");
}
};
xhr.send();
}
export function ToggleSelectAll() {
var currentlySelected = DeviceGrid.querySelectorAll(".row-selected:not(.hidden)");
if (currentlySelected.length > 0) {
currentlySelected.forEach(elem => {
elem.classList.remove("row-selected");
});
}
else {
DeviceGrid.querySelectorAll(".record-row:not(.hidden)").forEach(elem => {
elem.classList.add("row-selected");
});
}
UpdateDeviceCounts();
}
export function UpdateDeviceCounts() {
UI.DevicesSelectedCount.innerText = UI.DeviceGrid.querySelectorAll(".row-selected").length.toString();
UI.OnlineDevicesCount.innerText = DataSource.filter(x => x.IsOnline).length.toString();
UI.TotalDevicesCount.innerText = DataSource.length.toString();
if (DataSource.some(x => x.IsOnline == false &&
document.getElementById(x.ID).classList.contains("row-selected"))) {
UI.AddConsoleOutput(`Your selection contains offline computers. Your commands will only be sent to those that are online.`);
}
}
//# sourceMappingURL=DataGrid.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"DataGrid.js","sourceRoot":"","sources":["DataGrid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AAEtD,MAAM,CAAC,IAAI,UAAU,GAAkB,IAAI,KAAK,EAAU,CAAC;AAE3D,MAAM,UAAU,kBAAkB,CAAC,OAAsB;IACrD,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;QAChB,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACP,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC5C,IAAI,aAAa,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC;IACjE,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE;QACpB,UAAU,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC;KACtC;SACI;QACD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC3B;IAED,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC;IAC/E,IAAI,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,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c,CAAC,CAAC;QAC1C,CAAC,CAAC,CAAC;KACN;SACI;QACD,UAAU,CAAC,gBAAgB,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACnE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACvC,CAAC,CAAC,CAAA;KACL;IACD,kBAAkB,EAAE,CAAC;AACzB,CAAC;AACD,MAAM,UAAU,kBAAkB;IAC9B,EAAE,CAAC,oBAAoB,CAAC,SAAS,GAAG,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IACtG,EAAE,CAAC,kBAAkB,CAAC,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IACvF,EAAE,CAAC,iBAAiB,CAAC,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC9D,IACI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CACpB,CAAC,CAAC,QAAQ,IAAI,KAAK;QACnB,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,EACnE;QACE,EAAE,CAAC,gBAAgB,CAAC,uGAAuG,CAAC,CAAC;KAChI;AACL,CAAC"}

View File

@ -1,7 +0,0 @@
export var RemoteControlMode;
(function (RemoteControlMode) {
RemoteControlMode[RemoteControlMode["None"] = 0] = "None";
RemoteControlMode[RemoteControlMode["Unattended"] = 1] = "Unattended";
RemoteControlMode[RemoteControlMode["Normal"] = 2] = "Normal";
})(RemoteControlMode || (RemoteControlMode = {}));
//# sourceMappingURL=RemoteControlMode.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"RemoteControlMode.js","sourceRoot":"","sources":["RemoteControlMode.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IACzB,yDAAI,CAAA;IACJ,qEAAU,CAAA;IACV,6DAAM,CAAA;AACV,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B"}

View File

@ -1,183 +0,0 @@
import { PositionCommandCompletionWindow, HighlightCompletionWindowItem } from "./CommandCompletion.js";
import * as UI from "./UI.js";
import * as CommandProcessor from "./CommandProcessor.js";
import { Store } from "./Store.js";
import * as DataGrid from "./DataGrid.js";
import * as BrowserSockets from "./BrowserSockets.js";
import { WebCommands } from "./Commands/WebCommands.js";
export function ApplyInputEventHandlers() {
keyDownOnWindow();
keyDownOnInputTextArea();
inputOnCommandTextArea();
inputOnFilterTextBox();
clickToggleAllDevices();
clickStartRemoteControlButton();
consoleTabSelected();
window.addEventListener("resize", ev => {
PositionCommandCompletionWindow();
});
}
function arrowUpOrDownOnTextArea(e) {
if (e.ctrlKey) {
if (e.key.toLowerCase() == "arrowdown") {
UI.TabContentWrapper.scrollTop += 30;
}
else if (e.key.toLowerCase() == "arrowup") {
UI.TabContentWrapper.scrollTop -= 30;
}
}
else {
if (!UI.CommandCompletionDiv.classList.contains("hidden")) {
if (e.key.toLowerCase() == "arrowdown") {
if (Store.CommandCompletionPosition < UI.CommandCompletionDiv.children.length - 1) {
Store.CommandCompletionPosition += 1;
HighlightCompletionWindowItem(Store.CommandCompletionPosition);
UI.CommandCompletionDiv.querySelector(".selected").onfocus(new FocusEvent(""));
}
}
else if (e.key.toLowerCase() == "arrowup") {
if (Store.CommandCompletionPosition > 0) {
Store.CommandCompletionPosition -= 1;
HighlightCompletionWindowItem(Store.CommandCompletionPosition);
UI.CommandCompletionDiv.querySelector(".selected").onfocus(new FocusEvent(""));
}
}
}
else {
if (e.key.toLowerCase() == "arrowdown") {
if (Store.InputHistoryPosition < Store.InputHistoryItems.length - 1) {
Store.InputHistoryPosition += 1;
UI.ConsoleTextArea.value = Store.InputHistoryItems[Store.InputHistoryPosition];
}
}
else if (e.key.toLowerCase() == "arrowup") {
if (Store.InputHistoryPosition > 0) {
Store.InputHistoryPosition -= 1;
UI.ConsoleTextArea.value = Store.InputHistoryItems[Store.InputHistoryPosition];
}
}
}
}
}
function keyDownOnInputTextArea() {
UI.ConsoleTextArea.addEventListener("keydown", function (e) {
if (!e.shiftKey) {
switch (e.key.toLowerCase()) {
case "enter":
e.preventDefault();
if (UI.ConsoleTextArea.value.trim().length == 0) {
return;
}
UI.CommandCompletionDiv.classList.add("hidden");
UI.CommandInfoDiv.classList.add("hidden");
UI.AddConsoleOutput(`<span class="echo-input">${UI.ConsoleTextArea.value}</span>`);
if (!BrowserSockets.Connected) {
UI.AddConsoleOutput("Not connected. Reconnecting...");
BrowserSockets.Connect();
return;
}
CommandProcessor.ProcessCommand();
break;
case "arrowup":
case "arrowdown":
e.preventDefault();
arrowUpOrDownOnTextArea(e);
break;
case "escape":
if (!UI.CommandCompletionDiv.classList.contains("hidden")) {
e.preventDefault();
UI.CommandCompletionDiv.classList.add("hidden");
UI.CommandInfoDiv.classList.add("hidden");
}
else {
e.preventDefault();
UI.ConsoleTextArea.value = "";
}
break;
case "tab":
if (!UI.CommandCompletionDiv.classList.contains("hidden")) {
e.preventDefault();
UI.CommandCompletionDiv.querySelector(".selected").click();
}
break;
case "backspace":
if (UI.ConsoleTextArea.value.length == 0 && !UI.CommandCompletionDiv.classList.contains("hidden")) {
UI.CommandCompletionDiv.classList.add("hidden");
UI.CommandInfoDiv.classList.add("hidden");
}
break;
case "q":
if (e.ctrlKey) {
UI.ConsoleOutputDiv.innerHTML = "";
}
break;
default:
break;
}
}
});
}
function keyDownOnWindow() {
window.addEventListener("keydown", (e) => {
if (!document.activeElement.isEqualNode(UI.ConsoleTextArea) &&
document.activeElement.tagName.toLowerCase() != "select" &&
document.activeElement.tagName.toLowerCase() != "input" &&
!e.altKey &&
!e.ctrlKey) {
UI.ConsoleTextArea.focus();
}
});
}
function inputOnCommandTextArea() {
UI.ConsoleTextArea.addEventListener("input", (e) => {
var commandMode = CommandProcessor.GetCommandModeShortcut();
if (commandMode) {
UI.CommandModeSelect.value = commandMode;
UI.ConsoleTextArea.value = "";
UI.CommandCompletionDiv.classList.add("hidden");
}
else {
CommandProcessor.EvaluateCurrentCommandText();
}
UI.ConsoleFrame.scrollTop = UI.ConsoleFrame.scrollHeight;
});
}
function inputOnFilterTextBox() {
document.querySelector("#gridFilter").addEventListener("input", (e) => {
var currentText = e.currentTarget.value.toLowerCase();
UI.DeviceGrid.querySelectorAll("tbody tr").forEach((row) => {
if (row.innerHTML.toLowerCase().indexOf(currentText) == -1) {
row.classList.add("hidden");
}
else {
row.classList.remove("hidden");
}
});
});
}
function consoleTabSelected() {
$(UI.ConsoleTab).on("shown.bs.tab", () => {
UI.ConsoleAlert.hidden = true;
});
}
function clickToggleAllDevices() {
document.getElementById("toggleAllDevices").addEventListener("click", function (e) {
DataGrid.ToggleSelectAll();
});
}
function clickStartRemoteControlButton() {
document.getElementById("startRemoteControlButton").addEventListener("click", function (e) {
var selectedDevices = DataGrid.GetSelectedDevices();
if (selectedDevices.length == 0) {
UI.FloatMessage("You must select a device first.");
}
else if (selectedDevices.length > 1) {
UI.FloatMessage("You must select only one device to control.");
}
else {
UI.FloatMessage("Starting remote control...");
WebCommands.find(x => x.Name == "RemoteControl").Execute([]);
}
});
}
//# sourceMappingURL=InputEventHandlers.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,41 +0,0 @@
import * as BrowserSockets from "./BrowserSockets.js";
import * as UI from "./UI.js";
import * as CommandProcessor from "./CommandProcessor.js";
import { WebCommands } from "./Commands/WebCommands.js";
import { CMDCommands } from "./Commands/CMDCommands.js";
import { PSCoreCommands } from "./Commands/PSCoreCommands.js";
import * as Utilities from "./Utilities.js";
import * as DataGrid from "./DataGrid.js";
import { UserSettings } from "./UserSettings.js";
import { WinPSCommands } from "./Commands/WinPSCommands.js";
import { ApplyInputEventHandlers } from "./InputEventHandlers.js";
import { Sound } from "./Sound.js";
var remotely = {
Commands: {
"Web": WebCommands,
"WinPS": WinPSCommands,
"PSCore": PSCoreCommands,
"CMD": CMDCommands
},
CommandProcessor: CommandProcessor,
DataGrid: DataGrid,
UI: UI,
Utilities: Utilities,
Sockets: BrowserSockets,
Storage: Storage,
UserSettings: UserSettings,
Sound: Sound,
Init() {
UI.ConsoleTextArea.focus();
ApplyInputEventHandlers();
BrowserSockets.Connect();
}
};
export const Main = remotely;
window["Remotely"] = remotely;
window.onload = (ev) => {
remotely.Init();
document.querySelector(".loading-frame").remove();
document.querySelector(".work-area").classList.remove("hidden");
};
//# sourceMappingURL=Main.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Main.js","sourceRoot":"","sources":["Main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,IAAI,QAAQ,GAAG;IACX,QAAQ,EAAE;QACN,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,aAAa;QACtB,QAAQ,EAAE,cAAc;QACxB,KAAK,EAAE,WAAW;KACrB;IACD,gBAAgB,EAAE,gBAAgB;IAClC,QAAQ,EAAE,QAAQ;IAClB,EAAE,EAAE,EAAE;IACN,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,OAAO;IAChB,YAAY,EAAE,YAAY;IAC1B,KAAK,EAAE,KAAK;IACZ,IAAI;QACA,EAAE,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;QAC3B,uBAAuB,EAAE,CAAC;QAC1B,cAAc,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACJ,CAAA;AAED,MAAM,CAAC,MAAM,IAAI,GAAG,QAAQ,CAAC;AAC7B,MAAM,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;AAE9B,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE;IACnB,QAAQ,CAAC,IAAI,EAAE,CAAC;IAChB,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,MAAM,EAAE,CAAC;IAClD,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACpE,CAAC,CAAA"}

View File

@ -1 +0,0 @@
//# sourceMappingURL=CommandContext.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"CommandContext.js","sourceRoot":"","sources":["CommandContext.ts"],"names":[],"mappings":""}

View File

@ -1,7 +0,0 @@
export class CommandLineParameter {
constructor(name, value) {
this.Name = name;
this.Value = value;
}
}
//# sourceMappingURL=CommandLineParameter.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"CommandLineParameter.js","sourceRoot":"","sources":["CommandLineParameter.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,oBAAoB;IAC7B,YAAY,IAAY,EAAE,KAAa;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CAGJ"}

View File

@ -1,54 +0,0 @@
import { EncodeForHTML } from "../Utilities.js";
export class ConsoleCommand {
constructor(name, parameters, summary, syntax, extendedHelp, callback) {
this.Name = name;
this.Parameters = parameters;
this.Summary = summary;
this.Syntax = syntax;
this.ExtendedHelp = extendedHelp;
this.Callback = callback;
}
get FullHelp() {
if (this.ExtendedHelp) {
var fullHelp = this.PartialHelp.substring(0, this.PartialHelp.lastIndexOf("</div>"));
fullHelp += "<br><br><span class='extended-help'>Extended Help:</span><br>" + this.ExtendedHelp + "</div>";
return fullHelp;
}
else {
return this.PartialHelp;
}
}
get PartialHelp() {
var partialHelp = `<div class='help-wrapper'>
<div>
<span class="text-primary">Summary: </span>
${EncodeForHTML(this.Summary)}
</div>
<div>
<span class="text-success">Syntax: </span>
<span class="label label-default code">${EncodeForHTML(this.Syntax).trim()}</span>
</div>`;
if (this.Parameters.length > 0) {
partialHelp += "<br>";
partialHelp += `<div class='text-info'>Parameters:</div> <div>`;
for (var i = 0; i < this.Parameters.length; i++) {
var paramText = "";
if (this.Parameters[i].ParameterType) {
paramText = ` [${EncodeForHTML(this.Parameters[i].ParameterType)}]`;
}
partialHelp += `<div>-${EncodeForHTML(this.Parameters[i].Name)}${EncodeForHTML(paramText)}: ${EncodeForHTML(this.Parameters[i].Summary).trim()}</div>`;
}
partialHelp += "</div>";
}
partialHelp += "</div>";
return partialHelp;
}
Execute(parameters) {
var paramDictionary = {};
parameters.forEach(x => {
paramDictionary[x.Name.toLowerCase()] = x.Value;
});
this.Callback(parameters, paramDictionary);
}
}
//# sourceMappingURL=ConsoleCommand.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"ConsoleCommand.js","sourceRoot":"","sources":["ConsoleCommand.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,OAAO,cAAc;IACvB,YACI,IAAY,EACZ,UAA4B,EAC5B,OAAe,EACf,MAAc,EACd,YAAoB,EACpB,QAA4E;QAE5E,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,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,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,KAAK,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC;aAC1J;YACD,WAAW,IAAI,QAAQ,CAAC;SAC3B;QAED,WAAW,IAAI,QAAQ,CAAC;QACxB,OAAO,WAAW,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,UAAkC;QACtC,IAAI,eAAe,GAAG,EAAE,CAAC;QACzB,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACnB,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;QACpD,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;IAC/C,CAAC;CACJ"}

View File

@ -1 +0,0 @@
//# sourceMappingURL=CursorInfo.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"CursorInfo.js","sourceRoot":"","sources":["CursorInfo.ts"],"names":[],"mappings":""}

View File

@ -1 +0,0 @@
//# sourceMappingURL=Device.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Device.js","sourceRoot":"","sources":["Device.ts"],"names":[],"mappings":""}

View File

@ -1 +0,0 @@
//# sourceMappingURL=DevicePermissionLink.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"DevicePermissionLink.js","sourceRoot":"","sources":["DevicePermissionLink.ts"],"names":[],"mappings":""}

View File

@ -1 +0,0 @@
//# sourceMappingURL=GenericCommandResult.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"GenericCommandResult.js","sourceRoot":"","sources":["GenericCommandResult.ts"],"names":[],"mappings":""}

View File

@ -1 +0,0 @@
//# sourceMappingURL=PSCoreCommandResult.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"PSCoreCommandResult.js","sourceRoot":"","sources":["PSCoreCommandResult.ts"],"names":[],"mappings":""}

View File

@ -1,9 +0,0 @@
/**A parameter definition for Command Completion. */
export class Parameter {
constructor(name, summary, parameterType) {
this.Name = name;
this.Summary = summary;
this.ParameterType = parameterType;
}
}
//# sourceMappingURL=Parameter.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Parameter.js","sourceRoot":"","sources":["Parameter.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,MAAM,OAAO,SAAS;IAClB,YAAY,IAAW,EAAE,OAAc,EAAE,aAAoB;QACzD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;CAKJ"}

View File

@ -1 +0,0 @@
//# sourceMappingURL=Point.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Point.js","sourceRoot":"","sources":["Point.ts"],"names":[],"mappings":""}

View File

@ -1 +0,0 @@
//# sourceMappingURL=UserOptions.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"UserOptions.js","sourceRoot":"","sources":["UserOptions.ts"],"names":[],"mappings":""}

View File

@ -1,299 +0,0 @@
import { ShowModal, ValidateInput, FloatMessage } from "../UI.js";
document.getElementById("permissionHelpButton").addEventListener("click", (ev) => {
ShowModal("Permissions", `Permission groups can be used to restrict access to computers.<br><br>
A computer with no permission groups will be accessible by anyone. If permissions groups
are applied, only users with one or more matching groups can access it.
<br><br>
All permission groups for the organization are managed in this list.`);
});
document.getElementById("usersHelpButton").addEventListener("click", (ev) => {
ShowModal("Users", `All users for the organization are managed here.<br><br>
Administrators will have access to this management screen as well as all computers.
<br><br>
Users with no permission groups will only have access to computers that also have
no permission groups.
<br><br>
Users with permission groups will also have access to computers with the same
permission group.`);
});
document.getElementById("invitesHelpButton").addEventListener("click", (ev) => {
ShowModal("Invitations", `All pending invitations will be shown here and can be revoked by deleting them.<br><br>
If a user does not exist, sending an invite will create their account and send them a password reset email too.
The password reset must be completed before accepting the invitation.
<br><br>
The Admin checkbox determines if the new user will have administrator privileges in this organization
after they accept the invitation.`);
});
document.getElementById("organizationNameInput").addEventListener("input", (ev) => {
var addon = ev.currentTarget.parentElement.querySelector(".fa");
addon.classList.remove("fa-check-circle");
addon.classList.add("fa-edit");
});
document.getElementById("organizationNameInput").addEventListener("blur", (ev) => {
var xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
var addon = ev.target.parentElement.querySelector(".fa");
addon.classList.remove("fa-edit");
addon.classList.add("fa-check-circle");
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("put", location.origin + "/api/OrganizationManagement/Name");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(ev.currentTarget.value));
});
document.getElementById("removePermissionButton").addEventListener("click", (ev) => {
var selectList = document.getElementById("permissionList");
for (var i = 0; i < selectList.selectedOptions.length; i++) {
let selectedValue = selectList.selectedOptions[i].value;
let xhr = new XMLHttpRequest();
xhr.onload = (ev) => {
console.log(ev.srcElement);
if (xhr.status == 200) {
document.querySelectorAll(`.all-permissions-list option[value='${selectedValue}']`).forEach(option => {
option.remove();
});
document.querySelectorAll(`.user-permissions-list option[value='${selectedValue}']`).forEach(option => {
option.remove();
});
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("delete", location.origin + "/api/OrganizationManagement/Permission");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(selectedValue));
}
});
document.getElementById("permissionInput").addEventListener("keypress", (e) => {
if (e.key.toLowerCase() == "enter") {
document.getElementById("addPermissionButton").click();
}
});
document.getElementById("addPermissionButton").addEventListener("click", () => {
var input = document.getElementById("permissionInput");
if (input.checkValidity() && input.value.length > 0) {
var xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
document.querySelectorAll(`.all-permissions-list`).forEach((list) => {
var newOption = new Option(input.value, xhr.responseText);
list.options.add(newOption);
});
input.value = "";
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("post", location.origin + "/api/OrganizationManagement/Permission");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify({ Name: input.value }));
}
});
document.querySelectorAll(".remove-permission-from-user-button").forEach((removeButton) => {
removeButton.addEventListener("click", (ev) => {
var userID = removeButton.getAttribute("user");
var userPermissionList = document.querySelector(`div.modal[user='${userID}'] .user-permissions-list`);
for (var i = 0; i < userPermissionList.selectedOptions.length; i++) {
let selectedValue = userPermissionList.selectedOptions[i].value;
let xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
userPermissionList.querySelector(`option[value='${selectedValue}']`).remove();
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("delete", `${location.origin}/api/OrganizationManagement/RemovePermissionFromUser/${userID}/${selectedValue}`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
}
});
});
document.querySelectorAll(".add-permission-to-user-button").forEach((addButton) => {
addButton.addEventListener("click", (ev) => {
var userID = addButton.getAttribute("user");
var userPermissionList = document.querySelector(`div.modal[user='${userID}'] .user-permissions-list`);
var allPermissionsList = document.querySelector(`div.modal[user='${userID}'] .all-permissions-list`);
var xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
var newOption = new Option(allPermissionsList.selectedOptions[0].text, allPermissionsList.selectedOptions[0].value);
userPermissionList.options.add(newOption);
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("post", location.origin + `/api/OrganizationManagement/AddUserPermission/${userID}`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(allPermissionsList.selectedOptions[0].value));
});
});
document.querySelectorAll(".user-is-admin-checkbox").forEach((checkbox) => {
checkbox.addEventListener("change", (ev) => {
var userID = checkbox.getAttribute("user");
var xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("post", location.origin + `/api/OrganizationManagement/ChangeIsAdmin/${userID}`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(ev.currentTarget.checked));
});
});
document.querySelectorAll(".remove-user-button").forEach((removeButton) => {
removeButton.addEventListener("click", (ev) => {
var result = confirm("Are you sure you want to remove this user from the organization?");
if (result) {
var userID = removeButton.getAttribute("user");
var xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
document.querySelector(`tr[user='${userID}']`).remove();
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("delete", `${location.origin}/api/OrganizationManagement/RemoveUserFromOrganization/${userID}`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
}
});
});
document.getElementById("sendInviteButton").addEventListener("click", (ev) => {
var inviteUserInput = document.querySelector("#inviteUserInput");
if (!ValidateInput(inviteUserInput)) {
return;
}
var invitedUser = inviteUserInput.value;
inviteUserInput.value = "";
var isAdmin = document.getElementById("inviteIsAdmin").checked;
var xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
var newInvite = JSON.parse(xhr.responseText);
var tbody = document.querySelector("#invitesTable tbody");
var newRow = document.createElement("tr");
newRow.setAttribute("invite", newInvite.ID);
var innerHtml = `<td class="middle-aligned"><label class="control-label">${newInvite.InvitedUser}</label></td>
<td class="middle-aligned text-center"><input type="checkbox" disabled ${newInvite.IsAdmin ? "checked" : ""}/></td>
<td class="middle-aligned">
<label class="control-label">
<a href="${location.origin}/Invite/?id=${newInvite.ID}">Join Link</a>`;
if (newInvite.ResetUrl) {
innerHtml += `<br /> <a href="${newInvite.ResetUrl}">Reset Password</a>`;
}
innerHtml += ` </label> </td>
<td><button type="button" class="btn btn-danger delete-invite-button" invite="${newInvite.ID}">Delete</button></td>`;
newRow.innerHTML = innerHtml;
tbody.appendChild(newRow);
newRow.querySelector(".delete-invite-button").addEventListener("click", (ev) => {
deleteInvite(ev);
});
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("post", location.origin + `/api/OrganizationManagement/SendInvite/`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify({ InvitedUser: invitedUser, IsAdmin: isAdmin }));
FloatMessage("Sending invite...");
});
document.getElementById("inviteUserInput").addEventListener("keypress", (e) => {
if (e.key.toLowerCase() == "enter") {
document.getElementById("sendInviteButton").click();
}
});
document.querySelectorAll(".delete-invite-button").forEach((deleteButton) => {
deleteButton.addEventListener("click", (ev) => {
deleteInvite(ev);
});
});
function deleteInvite(ev) {
var inviteID = ev.currentTarget.getAttribute("invite");
var xhr = new XMLHttpRequest();
xhr.onload = () => {
if (xhr.status == 200) {
var row = document.querySelector(`tr[invite='${inviteID}']`);
row.remove();
}
else if (xhr.status == 400) {
ShowModal("Invalid Request", xhr.responseText);
}
else {
showError(xhr);
}
};
xhr.onerror = () => {
showError(xhr);
};
xhr.open("delete", location.origin + `/api/OrganizationManagement/DeleteInvite/${inviteID}`);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send();
}
function showError(xhr) {
console.error(xhr);
ShowModal("Error", "There was an error saving the data.", "", () => { location.reload(); });
}
//# sourceMappingURL=OrganizationManagement.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,12 +0,0 @@
export class Conductor {
constructor(rcBrowserSockets, clientID, serviceID, requesterName) {
this.ClientID = "";
this.ServiceID = "";
this.RequesterName = "";
this.RCBrowserSockets = rcBrowserSockets;
this.ClientID = clientID;
this.ServiceID = serviceID;
this.RequesterName = requesterName;
}
}
//# sourceMappingURL=Conductor.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Conductor.js","sourceRoot":"","sources":["Conductor.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,SAAS;IAClB,YAAY,gBAAkC,EAAE,QAAgB,EAAE,SAAiB,EAAE,aAAoB;QAOzG,aAAQ,GAAW,EAAE,CAAC;QACtB,cAAS,GAAY,EAAE,CAAC;QAExB,kBAAa,GAAW,EAAE,CAAC;QATvB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;CAMJ"}

View File

@ -1,32 +0,0 @@
import * as Utilities from "../Utilities.js";
import { RCBrowserSockets } from "./RCBrowserSockets.js";
import * as UI from "./UI.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
import { Conductor } from "./Conductor.js";
var queryString = Utilities.ParseSearchString();
var rcBrowserSockets = new RCBrowserSockets();
export const RemoteControl = new Conductor(rcBrowserSockets, queryString["clientID"] ? decodeURIComponent(queryString["clientID"]) : "", queryString["serviceID"] ? decodeURIComponent(queryString["serviceID"]) : "", queryString["requesterName"] ? decodeURIComponent(queryString["requesterName"]) : "");
export function ConnectToClient() {
UI.ConnectButton.disabled = true;
RemoteControl.ClientID = UI.SessionIDInput.value.split(" ").join("");
RemoteControl.RequesterName = UI.RequesterNameInput.value;
RemoteControl.Mode = RemoteControlMode.Normal;
RemoteControl.RCBrowserSockets.Connect();
UI.StatusMessage.innerHTML = "Sending connection request...";
}
window.onload = () => {
UI.ApplyInputHandlers(rcBrowserSockets);
if (queryString["clientID"]) {
RemoteControl.Mode = RemoteControlMode.Unattended;
UI.ConnectBox.style.display = "none";
RemoteControl.RCBrowserSockets.Connect();
}
else if (queryString["sessionID"]) {
UI.SessionIDInput.value = decodeURIComponent(queryString["sessionID"]);
if (queryString["requesterName"]) {
UI.RequesterNameInput.value = decodeURIComponent(queryString["requesterName"]);
ConnectToClient();
}
}
};
//# sourceMappingURL=Main.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Main.js","sourceRoot":"","sources":["Main.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,IAAI,WAAW,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAC;AAChD,IAAI,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAE9C,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,SAAS,CAAC,gBAAgB,EACvD,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAC1E,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAC5E,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAE1F,MAAM,UAAU,eAAe;IAC3B,EAAE,CAAC,aAAa,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjC,aAAa,CAAC,QAAQ,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrE,aAAa,CAAC,aAAa,GAAG,EAAE,CAAC,kBAAkB,CAAC,KAAK,CAAC;IAC1D,aAAa,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC;IAC9C,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IACzC,EAAE,CAAC,aAAa,CAAC,SAAS,GAAG,+BAA+B,CAAC;AACjE,CAAC;AAED,MAAM,CAAC,MAAM,GAAG,GAAG,EAAE;IACjB,EAAE,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;IAExC,IAAI,WAAW,CAAC,UAAU,CAAC,EAAE;QACzB,aAAa,CAAC,IAAI,GAAG,iBAAiB,CAAC,UAAU,CAAC;QAClD,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC;QACrC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;KAC5C;SACI,IAAI,WAAW,CAAC,WAAW,CAAC,EAAE;QAC/B,EAAE,CAAC,cAAc,CAAC,KAAK,GAAG,kBAAkB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;QACvE,IAAI,WAAW,CAAC,eAAe,CAAC,EAAE;YAC9B,EAAE,CAAC,kBAAkB,CAAC,KAAK,GAAG,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAC;YAC/E,eAAe,EAAE,CAAC;SACrB;KACJ;AACL,CAAC,CAAA"}

View File

@ -1,184 +0,0 @@
import * as Utilities from "../Utilities.js";
import * as UI from "./UI.js";
import { RemoteControl } from "./Main.js";
import { Sound } from "../Sound.js";
var signalR = window["signalR"];
export class RCBrowserSockets {
Connect() {
this.Connection = new signalR.HubConnectionBuilder()
.withUrl("/RCBrowserHub")
.withHubProtocol(new signalR.protocols.msgpack.MessagePackHubProtocol())
.configureLogging(signalR.LogLevel.Information)
.build();
this.ApplyMessageHandlers(this.Connection);
this.Connection.start().then(() => {
this.SendScreenCastRequestToDevice();
UI.ConnectButton.removeAttribute("disabled");
UI.ConnectBox.style.display = "none";
UI.ScreenViewer.removeAttribute("hidden");
UI.StatusMessage.innerHTML = "";
}).catch(err => {
console.error(err.toString());
console.log("Connection closed.");
UI.StatusMessage.innerHTML = `Connection error: ${err.message}`;
UI.Screen2DContext.clearRect(0, 0, UI.ScreenViewer.width, UI.ScreenViewer.height);
UI.ScreenViewer.setAttribute("hidden", "hidden");
UI.ConnectBox.style.removeProperty("display");
});
this.Connection.closedCallbacks.push((ev) => {
UI.Screen2DContext.clearRect(0, 0, UI.ScreenViewer.width, UI.ScreenViewer.height);
UI.ScreenViewer.setAttribute("hidden", "hidden");
UI.ConnectBox.style.removeProperty("display");
});
}
;
SendScreenCastRequestToDevice() {
this.Connection.invoke("SendScreenCastRequestToDevice", RemoteControl.ClientID, RemoteControl.RequesterName, RemoteControl.Mode);
}
SendLatencyUpdate(latency) {
this.Connection.invoke("SendLatencyUpdate", latency);
}
SendSelectScreen(index) {
this.Connection.invoke("SelectScreen", index);
}
SendMouseMove(percentX, percentY) {
this.Connection.invoke("MouseMove", percentX, percentY);
}
SendMouseDown(button, percentX, percentY) {
this.Connection.invoke("MouseDown", button, percentX, percentY);
}
SendMouseUp(button, percentX, percentY) {
this.Connection.invoke("MouseUp", button, percentX, percentY);
}
SendTouchDown() {
this.Connection.invoke("TouchDown");
}
SendLongPress() {
this.Connection.invoke("LongPress");
}
SendTouchMove(moveX, moveY) {
this.Connection.invoke("TouchMove", moveX, moveY);
}
SendTouchUp() {
this.Connection.invoke("TouchUp");
}
SendTap(percentX, percentY) {
this.Connection.invoke("Tap", percentX, percentY);
}
SendMouseWheel(deltaX, deltaY) {
this.Connection.invoke("MouseWheel", deltaX, deltaY);
}
SendKeyDown(key) {
this.Connection.invoke("KeyDown", key);
}
SendKeyUp(key) {
this.Connection.invoke("KeyUp", key);
}
SendKeyPress(key) {
this.Connection.invoke("KeyPress", key);
}
SendCtrlAltDel() {
this.Connection.invoke("CtrlAltDel");
}
SendSharedFileIDs(fileIDs) {
this.Connection.invoke("SendSharedFileIDs", JSON.parse(fileIDs));
}
SendQualityChange(qualityLevel) {
this.Connection.invoke("SendQualityChange", qualityLevel);
}
SendToggleAudio(toggleOn) {
this.Connection.invoke("SendToggleAudio", toggleOn);
}
;
SendClipboardTransfer(text) {
this.Connection.invoke("SendClipboardTransfer", text);
}
ApplyMessageHandlers(hubConnection) {
hubConnection.on("ScreenCount", (primaryScreenIndex, screenCount) => {
document.querySelector("#screenSelectBar").innerHTML = "";
for (let i = 0; i < screenCount; i++) {
var button = document.createElement("button");
button.innerHTML = `Monitor ${i}`;
button.classList.add("horizontal-bar-button");
if (i == primaryScreenIndex) {
button.classList.add("toggled");
}
document.querySelector("#screenSelectBar").appendChild(button);
button.onclick = (ev) => {
this.SendSelectScreen(i);
document.querySelectorAll("#screenSelectBar .horizontal-bar-button").forEach(button => {
button.classList.remove("toggled");
});
ev.currentTarget.classList.add("toggled");
};
}
});
hubConnection.on("ScreenSize", (width, height) => {
UI.ScreenViewer.width = width;
UI.ScreenViewer.height = height;
UI.Screen2DContext.clearRect(0, 0, width, height);
});
hubConnection.on("ScreenCapture", (buffer, left, top, width, height, captureTime) => {
var latency = Date.now() - new Date(captureTime).getTime();
this.SendLatencyUpdate(latency);
var url = window.URL.createObjectURL(new Blob([buffer]));
var img = document.createElement("img");
img.onload = () => {
UI.Screen2DContext.drawImage(img, left, top, width, height);
window.URL.revokeObjectURL(url);
};
img.src = url;
});
hubConnection.on("AudioSample", (buffer) => {
Sound.Play(buffer);
});
hubConnection.on("ConnectionFailed", () => {
UI.ConnectButton.removeAttribute("disabled");
UI.StatusMessage.innerHTML = "Connection failed or was denied.";
UI.ShowMessage("Connection failed. Please reconnect.");
this.Connection.stop();
});
hubConnection.on("ViewerRemoved", () => {
UI.ConnectButton.removeAttribute("disabled");
UI.StatusMessage.innerHTML = "The session was stopped by your partner.";
UI.ShowMessage("Session ended.");
this.Connection.stop();
});
hubConnection.on("SessionIDNotFound", () => {
UI.ConnectButton.removeAttribute("disabled");
UI.StatusMessage.innerHTML = "Session ID not found.";
this.Connection.stop();
});
hubConnection.on("ScreenCasterDisconnected", () => {
UI.StatusMessage.innerHTML = "The host has disconnected.";
this.Connection.stop();
});
hubConnection.on("ReceiveMachineName", (machineName) => {
document.title = `${machineName} - Remotely Session`;
});
hubConnection.on("RelaunchedScreenCasterReady", (newClientID) => {
RemoteControl.ClientID = newClientID;
this.Connection.stop();
this.Connect();
});
hubConnection.on("Reconnecting", () => {
UI.ShowMessage("Reconnecting...");
});
hubConnection.on("CursorChange", (cursor) => {
if (cursor.CssOverride) {
UI.ScreenViewer.style.cursor = cursor.CssOverride;
}
else if (cursor.ImageBytes.byteLength == 0) {
UI.ScreenViewer.style.cursor = "default";
}
else {
var base64 = Utilities.ConvertUInt8ArrayToBase64(cursor.ImageBytes);
UI.ScreenViewer.style.cursor = `url('data:image/png;base64,${base64}') ${cursor.HotSpot.X} ${cursor.HotSpot.Y}, default`;
}
});
hubConnection.on("RequestingScreenCast", () => {
UI.ShowMessage("Requesting remote control...");
});
}
}
//# sourceMappingURL=RCBrowserSockets.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,436 +0,0 @@
import { ConnectToClient, RemoteControl } from "./Main.js";
import { FloatMessage } from "../UI.js";
import { RemoteControlMode } from "../Enums/RemoteControlMode.js";
export var AudioButton = document.getElementById("audioButton");
export var MenuButton = document.getElementById("menuButton");
export var MenuFrame = document.getElementById("menuFrame");
export var SessionIDInput = document.getElementById("sessionIDInput");
export var ConnectButton = document.getElementById("connectButton");
export var RequesterNameInput = document.getElementById("nameInput");
export var StatusMessage = document.getElementById("statusMessage");
export var ScreenViewer = document.getElementById("screenViewer");
export var Screen2DContext = ScreenViewer.getContext("2d");
export var HorizontalBars = document.querySelectorAll(".horizontal-button-bar");
export var ConnectBox = document.getElementById("connectBox");
export var ScreenSelectBar = document.getElementById("screenSelectBar");
export var QualityBar = document.getElementById("qualityBar");
export var QualitySlider = document.getElementById("qualityRangeInput");
export var ActionsBar = document.getElementById("actionsBar");
export var ViewBar = document.getElementById("viewBar");
export var ChangeScreenButton = document.getElementById("changeScreenButton");
export var QualityButton = document.getElementById("qualityButton");
export var FitToScreenButton = document.getElementById("fitToScreenButton");
export var DisconnectButton = document.getElementById("disconnectButton");
export var FileTransferInput = document.getElementById("fileTransferInput");
export var FileTransferProgress = document.getElementById("fileTransferProgress");
export var KeyboardButton = document.getElementById("keyboardButton");
export var InviteButton = document.getElementById("inviteButton");
export var FileTransferButton = document.getElementById("fileTransferButton");
export var CtrlAltDelButton = document.getElementById("ctrlAltDelButton");
export var TouchKeyboardTextArea = document.getElementById("touchKeyboardTextArea");
export var ClipboardTransferBar = document.getElementById("clipboardTransferBar");
export var ClipboardTransferTextArea = document.getElementById("clipboardTransferTextArea");
export var ClipboardTransferButton = document.getElementById("clipboardTransferButton");
var lastPointerMove = Date.now();
var isDragging;
var currentPointerDevice;
var currentTouchCount;
var cancelNextViewerClick;
var isPinchZooming;
var startPinchPoint1;
var startPinchPoint2;
var isMenuButtonDragging;
var startMenuDraggingY;
export function ApplyInputHandlers(sockets) {
AudioButton.addEventListener("click", (ev) => {
AudioButton.classList.toggle("toggled");
var toggleOn = AudioButton.classList.contains("toggled");
sockets.SendToggleAudio(toggleOn);
});
ChangeScreenButton.addEventListener("click", (ev) => {
closeAllHorizontalBars("screenSelectBar");
ScreenSelectBar.classList.toggle("open");
});
ClipboardTransferButton.addEventListener("click", (ev) => {
closeAllHorizontalBars("clipboardTransferBar");
ClipboardTransferBar.classList.toggle("open");
});
ClipboardTransferTextArea.addEventListener("input", (ev) => {
if (ClipboardTransferTextArea.value.length == 0) {
return;
}
sockets.SendClipboardTransfer(ClipboardTransferTextArea.value);
ClipboardTransferTextArea.value = "";
ClipboardTransferTextArea.blur();
ClipboardTransferBar.classList.remove("open");
FloatMessage("Clipboard sent!");
});
ConnectButton.addEventListener("click", (ev) => {
ConnectToClient();
});
CtrlAltDelButton.addEventListener("click", (ev) => {
if (!RemoteControl.ServiceID) {
ShowMessage("Not available for this session.");
return;
}
closeAllHorizontalBars(null);
RemoteControl.RCBrowserSockets.SendCtrlAltDel();
});
DisconnectButton.addEventListener("click", (ev) => {
ConnectButton.removeAttribute("disabled");
RemoteControl.RCBrowserSockets.Connection.stop();
});
document.querySelectorAll("#sessionIDInput, #nameInput").forEach(x => {
x.addEventListener("keypress", (ev) => {
if (ev.key.toLowerCase() == "enter") {
ConnectToClient();
}
});
});
FileTransferButton.addEventListener("click", (ev) => {
FileTransferInput.click();
});
FileTransferInput.addEventListener("change", (ev) => {
uploadFiles(FileTransferInput.files);
});
FitToScreenButton.addEventListener("click", (ev) => {
var button = ev.currentTarget;
button.classList.toggle("toggled");
if (button.classList.contains("toggled")) {
ScreenViewer.style.removeProperty("max-width");
ScreenViewer.style.removeProperty("max-height");
}
else {
ScreenViewer.style.maxWidth = "unset";
ScreenViewer.style.maxHeight = "unset";
}
});
InviteButton.addEventListener("click", (ev) => {
var url = "";
if (RemoteControl.Mode == RemoteControlMode.Normal) {
url = `${location.origin}${location.pathname}?sessionID=${RemoteControl.ClientID}`;
}
else {
url = `${location.origin}${location.pathname}?clientID=${RemoteControl.ClientID}&serviceID=${RemoteControl.ServiceID}`;
}
var input = document.createElement("input");
input.style.position = "fixed";
input.style.top = "-1000px";
input.type = "text";
document.body.appendChild(input);
input.value = url;
input.select();
document.execCommand("copy", false, location.href);
input.remove();
FloatMessage("Link copied to clipboard.");
});
KeyboardButton.addEventListener("click", (ev) => {
closeAllHorizontalBars(null);
TouchKeyboardTextArea.focus();
TouchKeyboardTextArea.setSelectionRange(TouchKeyboardTextArea.value.length, TouchKeyboardTextArea.value.length);
MenuFrame.classList.remove("open");
MenuButton.classList.remove("open");
});
MenuButton.addEventListener("click", (ev) => {
if (isMenuButtonDragging) {
isMenuButtonDragging = false;
return;
}
MenuFrame.classList.toggle("open");
MenuButton.classList.toggle("open");
closeAllHorizontalBars(null);
});
MenuButton.addEventListener("mousedown", (ev) => {
isMenuButtonDragging = false;
startMenuDraggingY = ev.clientY;
window.addEventListener("mousemove", moveMenuButton);
window.addEventListener("mouseup", removeMouseButtonWindowListeners);
window.addEventListener("mouseleave", removeMouseButtonWindowListeners);
});
MenuButton.addEventListener("touchmove", (ev) => {
MenuButton.style.top = `${ev.touches[0].clientY}px`;
});
QualityButton.addEventListener("click", (ev) => {
closeAllHorizontalBars("qualityBar");
QualityBar.classList.toggle("open");
});
QualitySlider.addEventListener("change", (ev) => {
sockets.SendQualityChange(Number(QualitySlider.value));
});
ScreenViewer.addEventListener("pointermove", function (e) {
currentPointerDevice = e.pointerType;
});
ScreenViewer.addEventListener("pointerdown", function (e) {
currentPointerDevice = e.pointerType;
});
ScreenViewer.addEventListener("pointerenter", function (e) {
currentPointerDevice = e.pointerType;
});
ScreenViewer.addEventListener("mousemove", function (e) {
e.preventDefault();
if (Date.now() - lastPointerMove < 25) {
return;
}
lastPointerMove = Date.now();
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
sockets.SendMouseMove(percentX, percentY);
});
ScreenViewer.addEventListener("mousedown", function (e) {
if (currentPointerDevice == "touch") {
return;
}
if (e.button != 0 && e.button != 2) {
return;
}
e.preventDefault();
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
sockets.SendMouseDown(e.button, percentX, percentY);
});
ScreenViewer.addEventListener("mouseup", function (e) {
if (currentPointerDevice == "touch") {
return;
}
if (e.button != 0 && e.button != 2) {
return;
}
e.preventDefault();
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
sockets.SendMouseUp(e.button, percentX, percentY);
});
ScreenViewer.addEventListener("click", function (e) {
if (cancelNextViewerClick) {
cancelNextViewerClick = false;
return;
}
if (currentPointerDevice == "mouse") {
e.preventDefault();
e.stopPropagation();
}
else if (currentPointerDevice == "touch" && currentTouchCount == 0) {
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
sockets.SendTap(percentX, percentY);
}
});
ScreenViewer.addEventListener("dblclick", function (e) {
if (currentPointerDevice == "mouse") {
return;
}
var percentX = e.offsetX / ScreenViewer.clientWidth;
var percentY = e.offsetY / ScreenViewer.clientHeight;
sockets.SendMouseDown(2, percentX, percentY);
sockets.SendMouseUp(2, percentX, percentY);
});
ScreenViewer.addEventListener("touchstart", function (e) {
if (e.touches.length > 1) {
cancelNextViewerClick = true;
}
if (e.touches.length == 2) {
startPinchPoint1 = { X: e.touches[0].pageX, Y: e.touches[0].pageY, IsEmpty: false };
startPinchPoint2 = { X: e.touches[1].pageX, Y: e.touches[1].pageY, IsEmpty: false };
}
isDragging = false;
currentTouchCount = e.touches.length;
KeyboardButton.removeAttribute("hidden");
var focusedInput = document.querySelector("input:focus");
if (focusedInput) {
focusedInput.blur();
}
});
ScreenViewer.addEventListener("touchmove", function (e) {
currentTouchCount = e.touches.length;
var percentX = (e.touches[0].pageX - ScreenViewer.getBoundingClientRect().left) / ScreenViewer.clientWidth;
var percentY = (e.touches[0].pageY - ScreenViewer.getBoundingClientRect().top) / ScreenViewer.clientHeight;
if (e.touches.length == 2) {
var distance1 = Math.hypot(startPinchPoint1.X - e.touches[0].pageX, startPinchPoint1.Y - e.touches[0].pageY);
var distance2 = Math.hypot(startPinchPoint2.X - e.touches[1].pageX, startPinchPoint2.Y - e.touches[1].pageY);
if (distance1 > 5 || distance2 > 5) {
isPinchZooming = true;
}
return;
}
else if (isDragging) {
e.preventDefault();
e.stopPropagation();
sockets.SendMouseMove(percentX, percentY);
}
});
ScreenViewer.addEventListener("touchend", function (e) {
currentTouchCount = e.touches.length;
if (e.touches.length == 1 && !isPinchZooming) {
isDragging = true;
var percentX = (e.touches[0].pageX - ScreenViewer.getBoundingClientRect().left) / ScreenViewer.clientWidth;
var percentY = (e.touches[0].pageY - ScreenViewer.getBoundingClientRect().top) / ScreenViewer.clientHeight;
sockets.SendMouseMove(percentX, percentY);
sockets.SendMouseDown(0, percentX, percentY);
return;
}
if (currentTouchCount == 0) {
cancelNextViewerClick = false;
isPinchZooming = false;
startPinchPoint1 = null;
startPinchPoint2 = null;
}
if (isDragging) {
var percentX = (e.changedTouches[0].pageX - ScreenViewer.getBoundingClientRect().left) / ScreenViewer.clientWidth;
var percentY = (e.changedTouches[0].pageY - ScreenViewer.getBoundingClientRect().top) / ScreenViewer.clientHeight;
sockets.SendMouseUp(0, percentX, percentY);
}
isDragging = false;
});
ScreenViewer.addEventListener("contextmenu", (ev) => {
ev.preventDefault();
});
ScreenViewer.addEventListener("wheel", function (e) {
e.preventDefault();
sockets.SendMouseWheel(e.deltaX, e.deltaY);
});
TouchKeyboardTextArea.addEventListener("input", (ev) => {
if (TouchKeyboardTextArea.value.length == 1) {
sockets.SendKeyPress("Backspace");
}
else if (TouchKeyboardTextArea.value.endsWith("\n")) {
sockets.SendKeyPress("Enter");
}
else if (TouchKeyboardTextArea.value.endsWith(" ")) {
sockets.SendKeyPress(" ");
}
else {
var input = TouchKeyboardTextArea.value.trim().substr(1);
for (var i = 0; i < input.length; i++) {
var character = input.charAt(i);
var sendShift = character.match(/[A-Z~!@#$%^&*()_+{}|<>?]/);
if (sendShift) {
sockets.SendKeyDown("Shift");
}
sockets.SendKeyPress(character);
if (sendShift) {
sockets.SendKeyUp("Shift");
}
}
}
window.setTimeout(() => {
TouchKeyboardTextArea.value = " #";
TouchKeyboardTextArea.setSelectionRange(TouchKeyboardTextArea.value.length, TouchKeyboardTextArea.value.length);
});
});
window.addEventListener("keydown", function (e) {
if (document.querySelector("input:focus") || document.querySelector("textarea:focus")) {
return;
}
e.preventDefault();
sockets.SendKeyDown(e.key);
});
window.addEventListener("keyup", function (e) {
if (document.querySelector("input:focus") || document.querySelector("textarea:focus")) {
return;
}
e.preventDefault();
sockets.SendKeyUp(e.key);
});
window.ondragover = function (e) {
e.preventDefault();
e.dataTransfer.dropEffect = "copy";
};
window.ondrop = function (e) {
e.preventDefault();
if (e.dataTransfer.files.length < 1) {
return;
}
uploadFiles(e.dataTransfer.files);
};
}
export function Prompt(promptMessage) {
return new Promise((resolve, reject) => {
var modalDiv = document.createElement("div");
modalDiv.classList.add("modal-prompt");
var messageDiv = document.createElement("div");
messageDiv.innerHTML = promptMessage;
var responseInput = document.createElement("input");
var buttonsDiv = document.createElement("div");
buttonsDiv.classList.add("buttons-footer");
var cancelButton = document.createElement("button");
cancelButton.innerHTML = "Cancel";
var okButton = document.createElement("button");
okButton.innerHTML = "OK";
buttonsDiv.appendChild(okButton);
buttonsDiv.appendChild(cancelButton);
modalDiv.appendChild(messageDiv);
modalDiv.appendChild(responseInput);
modalDiv.appendChild(buttonsDiv);
document.body.appendChild(modalDiv);
okButton.onclick = () => {
modalDiv.remove();
resolve(responseInput.value);
};
cancelButton.onclick = () => {
modalDiv.remove();
resolve(null);
};
});
}
export function ShowMessage(message) {
var messageDiv = document.createElement("div");
messageDiv.classList.add("float-message");
messageDiv.innerHTML = message;
document.body.appendChild(messageDiv);
window.setTimeout(() => {
messageDiv.remove();
}, 5000);
}
function uploadFiles(fileList) {
ShowMessage("File upload started...");
FileTransferProgress.value = 0;
FileTransferProgress.parentElement.removeAttribute("hidden");
var strPath = "/API/FileSharing/";
var fd = new FormData();
for (var i = 0; i < fileList.length; i++) {
fd.append('fileUpload' + i, fileList[i]);
}
var xhr = new XMLHttpRequest();
xhr.open('POST', strPath, true);
xhr.addEventListener("load", function () {
FileTransferProgress.parentElement.setAttribute("hidden", "hidden");
if (xhr.status === 200) {
ShowMessage("File upload completed.");
RemoteControl.RCBrowserSockets.SendSharedFileIDs(xhr.responseText);
}
else {
ShowMessage("File upload failed.");
}
});
xhr.addEventListener("error", () => {
FileTransferProgress.parentElement.setAttribute("hidden", "hidden");
ShowMessage("File upload failed.");
});
xhr.addEventListener("progress", function (e) {
FileTransferProgress.value = isFinite(e.loaded / e.total) ? e.loaded / e.total : 0;
});
xhr.send(fd);
}
function closeAllHorizontalBars(exceptBarId) {
HorizontalBars.forEach(x => {
if (x.id != exceptBarId) {
x.classList.remove('open');
}
});
}
function moveMenuButton(ev) {
if (Math.abs(ev.clientY - startMenuDraggingY) > 5) {
if (ev.clientY < 0 || ev.clientY > window.innerHeight) {
return;
}
isMenuButtonDragging = true;
MenuButton.style.top = `${ev.clientY}px`;
}
}
function removeMouseButtonWindowListeners(ev) {
window.removeEventListener("mousemove", moveMenuButton);
window.removeEventListener("mouseup", removeMouseButtonWindowListeners);
window.removeEventListener("mouseleave", removeMouseButtonWindowListeners);
isMenuButtonDragging = false;
}
//# sourceMappingURL=UI.js.map

File diff suppressed because one or more lines are too long

View File

@ -1,84 +0,0 @@
import * as DataGrid from "./DataGrid.js";
import { ConsoleFrame } from "./UI.js";
export function CreateCommandHarness(context) {
var collapseClass = context.TargetDeviceIDs.length > 1 ? "collapse" : "collapse show";
var commandHarness = document.createElement("div");
var contextID = "c" + context.ID;
commandHarness.id = contextID;
commandHarness.classList.add("command-harness");
commandHarness.innerHTML = `
<div class="command-harness-title">
Command Type: ${context.CommandMode} |
Total Devices: <span id="${contextID}-totaldevices">${context.TargetDeviceIDs.length}</span> |
Completed: <span id="${contextID}-completed">0%</span> |
Errors: <span id="${contextID}-errors">0</span> |
<button class="btn btn-sm btn-secondary" data-toggle="collapse" data-target='#${contextID}-results'>View</button>
<a class="btn btn-sm btn-secondary" target="_blank" href="${location.origin}/API/Commands/JSON/${context.ID}">JSON</a>
<a class="btn btn-sm btn-secondary" target="_blank" href="${location.origin}/API/Commands/XML/${context.ID}">XML</a>
</div>
<div id="${contextID}-results" class="${collapseClass}">
</div>`;
return commandHarness;
}
export function AddPSCoreResultsHarness(result) {
var contextID = "c" + result.CommandContextID;
var deviceName = DataGrid.DataSource.find(x => x.ID == result.DeviceID).DeviceName;
var resultsWrapper = document.getElementById(contextID + "-results");
var totalDevices = parseInt(document.getElementById(contextID + "-totaldevices").innerText);
var collapseClass = totalDevices > 1 ? "collapse" : "collapse show";
var resultDiv = document.createElement("div");
resultDiv.innerHTML = `
<div class="result-header">
Device: ${deviceName} |
Had Errors: ${result.ErrorOutput.length > 1 ? "Yes" : "No"} |
<button class="btn btn-sm btn-secondary" data-toggle="collapse" data-target='#${contextID + result.DeviceID}-result'>View</button>
</div>
<div id='${contextID + result.DeviceID}-result' class="command-result-output ${collapseClass}">
<div>Host Output:<br>${result.HostOutput.replace(/\n/g, "<br>").replace(/ /g, "&nbsp;")}</div>
<div>Debug Output:<br>${result.DebugOutput.join("<br>").replace(/ /g, "&nbsp;")}</div>
<div>Verbose Output:<br>${result.VerboseOutput.join("<br>").replace(/ /g, "&nbsp;")}</div>
<div>Information Output:<br>${result.InformationOutput.join("<br>").replace(/ /g, "&nbsp;")}</div>
<div>Error Output:<br>${result.ErrorOutput.join("<br>").replace(/ /g, "&nbsp;")}</div>
</div>`;
if (result.ErrorOutput.length > 0) {
var errorSpan = document.getElementById(contextID + "-errors");
var currentErrors = parseInt(errorSpan.innerText);
currentErrors += 1;
errorSpan.innerText = String(currentErrors);
}
resultsWrapper.appendChild(resultDiv);
ConsoleFrame.scrollTop = ConsoleFrame.scrollHeight;
}
export function AddCommandResultsHarness(result) {
var contextID = "c" + result.CommandContextID;
var deviceName = DataGrid.DataSource.find(x => x.ID == result.DeviceID).DeviceName;
var resultsWrapper = document.getElementById(contextID + "-results");
var totalDevices = parseInt(document.getElementById(contextID + "-totaldevices").innerText);
var collapseClass = totalDevices > 1 ? "collapse" : "collapse show";
var resultDiv = document.createElement("div");
resultDiv.innerHTML = `
<div class="result-header">
Device: ${deviceName} |
Had Errors: ${result.ErrorOutput.length > 1 ? "Yes" : "No"} |
<button class="btn btn-sm btn-secondary" data-toggle="collapse" data-target="#${contextID + result.DeviceID}-result">View</button>
</div>
<div id="${contextID + result.DeviceID}-result" class="command-result-output ${collapseClass}">
<div>Standard Output:<br>${result.StandardOutput.replace(/\n/g, "<br>").replace(/ /g, "&nbsp;")}</div>
<div>Error Output:<br>${result.ErrorOutput.replace(/\n/g, "<br>").replace(/ /g, "&nbsp;")}</div>
</div>`;
if (result.ErrorOutput.length > 0) {
var errorSpan = document.getElementById(`${contextID}-errors`);
var currentErrors = parseInt(errorSpan.innerText);
currentErrors += 1;
errorSpan.innerText = String(currentErrors);
}
resultsWrapper.appendChild(resultDiv);
ConsoleFrame.scrollTop = ConsoleFrame.scrollHeight;
}
export function UpdateResultsCount(commandContextID) {
var contextID = "c" + commandContextID;
var totalDevices = parseInt(document.getElementById(`${contextID}-totaldevices`).innerText);
var percentComplete = Math.round(document.getElementById(`${contextID}-results`).children.length / totalDevices * 100);
document.getElementById(`${contextID}-completed`).innerText = String(percentComplete) + "%";
}
//# sourceMappingURL=ResultsParser.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"ResultsParser.js","sourceRoot":"","sources":["ResultsParser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAuC,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5E,MAAM,UAAU,oBAAoB,CAAC,OAAuB;IACxD,IAAI,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC;IACtF,IAAI,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnD,IAAI,SAAS,GAAG,GAAG,GAAG,OAAO,CAAC,EAAE,CAAC;IACjC,cAAc,CAAC,EAAE,GAAG,SAAS,CAAC;IAC9B,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAChD,cAAc,CAAC,SAAS,GAAG;;4BAEH,OAAO,CAAC,WAAW;uCACR,SAAS,kBAAkB,OAAO,CAAC,eAAe,CAAC,MAAM;mCAC7D,SAAS;gCACZ,SAAS;4FACmD,SAAS;wEAC7B,Q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AAI,CAAC,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,SAAS,UAAU,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,YAAY,GAAG,GAAG,CAAC,CAAC;IACvH,QAAQ,CAAC,cAAc,CAAC,GAAG,SAAS,YAAY,CAAC,CAAC,SAAS,GAAG,MAAM,CAAC,eAAe,CAAC,GAAG,GAAG,CAAC;AAChG,CAAC"}

View File

@ -1,23 +0,0 @@
export const Sound = new class {
constructor() {
this.AudioElements = new Array();
this.SourceNodes = new Array();
this.Context = new AudioContext();
this.BackgroundAudio = new Audio();
this.BackgroundNode = this.Context.createMediaElementSource(this.BackgroundAudio);
this.BackgroundNode.connect(this.Context.destination);
}
Play(buffer) {
var fr = new FileReader();
fr.onload = async (ev) => {
var audioBuffer = await this.Context.decodeAudioData(fr.result);
var bufferSource = this.Context.createBufferSource();
bufferSource.buffer = audioBuffer;
bufferSource.connect(this.Context.destination);
bufferSource.start();
};
fr.readAsArrayBuffer(new Blob([buffer], { 'type': 'audio/wav' }));
}
;
};
//# sourceMappingURL=Sound.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Sound.js","sourceRoot":"","sources":["Sound.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI;IACrB;QAOA,kBAAa,GAA4B,IAAI,KAAK,EAAoB,CAAC;QACvE,gBAAW,GAAuC,IAAI,KAAK,EAA+B,CAAC;QAPvF,IAAI,CAAC,OAAO,GAAG,IAAI,YAAY,EAAE,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,IAAI,KAAK,EAAE,CAAC;QACnC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAClF,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1D,CAAC;IAQD,IAAI,CAAC,MAAkB;QAEnB,IAAI,EAAE,GAAG,IAAI,UAAU,EAAE,CAAC;QAC1B,EAAE,CAAC,MAAM,GAAG,KAAK,EAAE,EAAE,EAAE,EAAE;YACrB,IAAI,WAAW,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC,MAAqB,CAAC,CAAC;YAC/E,IAAI,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC;YACrD,YAAY,CAAC,MAAM,GAAG,WAAW,CAAC;YAClC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAC/C,YAAY,CAAC,KAAK,EAAE,CAAC;QACzB,CAAC,CAAA;QAED,EAAE,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IACtE,CAAC;IAAA,CAAC;CACL,CAAA"}

View File

@ -1,8 +0,0 @@
export const Store = new class {
constructor() {
this.CommandCompletionPosition = -1;
this.InputHistoryPosition = -1;
this.InputHistoryItems = [];
}
};
//# sourceMappingURL=Store.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Store.js","sourceRoot":"","sources":["Store.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI;IAAA;QACrB,8BAAyB,GAAG,CAAC,CAAC,CAAC;QAE/B,yBAAoB,GAAG,CAAC,CAAC,CAAC;QAC1B,sBAAiB,GAAkB,EAAE,CAAC;IAE1C,CAAC;CAAA,CAAA"}

View File

@ -1,118 +0,0 @@
import { UserSettings } from "./UserSettings.js";
import * as Utilities from "./Utilities.js";
import { GetSelectedDevices } from "./DataGrid.js";
export var CommandCompletionDiv = document.querySelector("#commandCompletionDiv");
export var CommandInfoDiv = document.querySelector("#commandInfoDiv");
export var CommandModeSelect = document.querySelector("#commandModeSelect");
export var ConsoleOutputDiv = document.querySelector("#consoleOutputDiv");
export var ConsoleTextArea = document.querySelector("#consoleTextArea");
export var DeviceGrid = document.querySelector("#deviceGrid");
export var DevicesSelectedCount = document.querySelector("#devicesSelectedSpan");
export var OnlineDevicesCount = document.querySelector("#onlineDevicesSpan");
export var TotalDevicesCount = document.querySelector("#totalDevicesSpan");
export var MeasurementCanvas = document.createElement("canvas");
export var MeasurementContext = MeasurementCanvas.getContext("2d");
export var TabContentWrapper = document.getElementById("tabContentWrapper");
export var ConsoleFrame = document.getElementById("consoleFrame");
export var ConsoleTab = document.getElementById("consoleTab");
export var ConsoleAlert = document.getElementById("consoleAlert");
export function AddConsoleOutput(strOutputMessage) {
var outputBlock = document.createElement("div");
outputBlock.classList.add("console-block");
var prompt = document.createElement("div");
prompt.classList.add("console-prompt");
prompt.innerHTML = UserSettings.PromptString;
var output = document.createElement("div");
output.classList.add("console-output");
output.innerHTML = strOutputMessage;
outputBlock.appendChild(prompt);
outputBlock.appendChild(output);
ConsoleOutputDiv.appendChild(outputBlock);
ConsoleFrame.scrollTop = ConsoleFrame.scrollHeight;
if (!ConsoleTab.classList.contains("active")) {
ConsoleAlert.hidden = false;
}
}
export function AddConsoleHTML(html) {
var contentWrapper = document.createElement("div");
contentWrapper.innerHTML = html;
ConsoleOutputDiv.appendChild(contentWrapper);
ConsoleFrame.scrollTop = ConsoleFrame.scrollHeight;
}
export function AddTransferHarness(transferID, totalDevices) {
GetSelectedDevices();
var transferHarness = document.createElement("div");
transferHarness.id = transferID;
transferHarness.classList.add("command-harness");
transferHarness.innerHTML = `
<div class="command-harness-title">
File Transfer Status |
Total Devices: ${totalDevices} |
Completed: <span id="${transferID}-completed">0</span>
</div>`;
AddConsoleHTML(transferHarness.outerHTML);
}
export function AutoSizeTextArea() {
ConsoleTextArea.style.height = "1px";
ConsoleTextArea.style.height = Math.max(12, ConsoleTextArea.scrollHeight) + "px";
}
export function FloatMessage(message) {
var messageDiv = document.createElement("div");
messageDiv.classList.add("float-message");
messageDiv.innerHTML = message;
document.body.appendChild(messageDiv);
window.setTimeout(() => {
messageDiv.remove();
}, 5000);
}
export function ShowModal(title, message, buttonsHTML = "", onDismissCallback = null) {
var modalID = Utilities.CreateGUID();
var modalHTML = `<div id="${modalID}" class="modal fade in" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">${title}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
${message}
</div>
<div class="modal-footer">
${buttonsHTML}
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>`;
var wrapperDiv = document.createElement("div");
wrapperDiv.innerHTML = modalHTML;
document.body.appendChild(wrapperDiv);
$("#" + modalID).on("hidden.bs.modal", ev => {
try {
if (onDismissCallback) {
onDismissCallback();
}
}
finally {
ev.currentTarget.parentElement.remove();
}
});
$("#" + modalID)["modal"]();
}
;
export function ValidateInput(inputElement) {
if (!inputElement.checkValidity()) {
$(inputElement)["tooltip"]({
template: '<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner text-danger"></div></div>',
title: inputElement.validationMessage
});
$(inputElement)["tooltip"]("show");
return false;
}
else {
return true;
}
}
//# sourceMappingURL=UI.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"UI.js","sourceRoot":"","sources":["UI.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAY5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,CAAC,IAAI,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAmB,CAAC;AACpG,MAAM,CAAC,IAAI,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,iBAAiB,CAAmB,CAAC;AACxF,MAAM,CAAC,IAAI,iBAAiB,GAAG,QAAQ,CAAC,aAAa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AAiB,EAAE;gBACnB,iBAAiB,EAAE,CAAC;aACvB;SACJ;gBACO;YACH,EAAE,CAAC,aAA6B,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;SAC5D;IACL,CAAC,CAAC,CAAC;IACH,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;AAChC,CAAC;AAAA,CAAC;AAEF,MAAM,UAAU,aAAa,CAAC,YAA8B;IACxD,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,EAAE;QAC/B,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;YACvB,QAAQ,EAAE,kHAAkH;YAC5H,KAAK,EAAE,YAAY,CAAC,iBAAiB;SACxC,CAAC,CAAC;QACH,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;QACnC,OAAO,KAAK,CAAC;KAChB;SACI;QACD,OAAO,IAAI,CAAC;KACf;AACL,CAAC"}

View File

@ -1,13 +0,0 @@
export const UserSettings = new class {
constructor() {
this.PromptString = "~>";
this.CommandModeShortcuts = {
"Web": "/web",
"PSCore": "/pscore",
"WinPS": "/winps",
"CMD": "/cmd",
"Bash": "/bash"
};
}
};
//# sourceMappingURL=UserSettings.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"UserSettings.js","sourceRoot":"","sources":["UserSettings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI;IAAA;QAC5B,iBAAY,GAAG,IAAI,CAAC;QAEpB,yBAAoB,GAAG;YACnB,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,SAAS;YACnB,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,OAAO;SAClB,CAAA;IACL,CAAC;CAAA,CAAA"}

View File

@ -1,81 +0,0 @@
/**
* Splits a string into "parts" number of pieces. Once "parts" number is
* reached, additional occurrences of the splitter are ignored.
* @param splitter
* @param parts
*/
export function Split(originalString, splitter, parts) {
var returnArray = [];
var remainingString = originalString;
for (var i = 1; i < parts; i++) {
if (remainingString.indexOf(splitter) == -1) {
break;
}
returnArray.push(remainingString.slice(0, remainingString.indexOf(splitter)));
remainingString = remainingString.slice(remainingString.indexOf(splitter) + splitter.length);
}
returnArray.push(remainingString);
return returnArray;
}
export function CreateGUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
export function EncodeForHTML(text) {
var tempDiv = document.createElement("div");
tempDiv.innerText = text;
return tempDiv.innerHTML;
}
export function ParseSearchString() {
var queryStrings = {};
var queryArray = location.search.substring(1).split("&");
queryArray.forEach(value => {
var keyValue = value.split("=");
queryStrings[keyValue[0]] = keyValue[1];
});
return queryStrings;
}
export function GetDistanceBetween(fromX, fromY, toX, toY) {
return Math.sqrt(Math.pow(fromX - toX, 2) +
Math.pow(fromY - toY, 2));
}
export async function When(predicate) {
return new Promise((resolve, reject) => {
function checkCondition() {
if (predicate()) {
resolve();
}
else {
window.setTimeout(() => {
checkCondition();
}, 500);
}
}
checkCondition();
});
}
export function ConvertBase64ToUInt8Array(base64) {
var binaryString = window.atob(base64);
var bytes = new Uint8ClampedArray(binaryString.length);
for (var i = 0; i < binaryString.length; i++) {
bytes[i] = binaryString.charCodeAt(i);
}
return bytes;
}
export function ConvertUInt8ArrayToBase64(array) {
var base64String = '';
for (var i = 0; i < array.byteLength; i++) {
base64String += String.fromCharCode(array[i]);
}
return btoa(base64String);
}
export function RemoveFromArray(array, item) {
var index = array.indexOf(item);
if (index > -1) {
array.splice(index, 1);
}
}
;
//# sourceMappingURL=Utilities.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"Utilities.js","sourceRoot":"","sources":["Utilities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,cAAqB,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