mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Moved console functions to their own module.
This commit is contained in:
parent
a4d9fd3c94
commit
85f89591d4
@ -29,6 +29,7 @@
|
||||
<Content Remove="wwwroot\scripts\Commands\PSCoreCommands.ts" />
|
||||
<Content Remove="wwwroot\scripts\Commands\WebCommands.ts" />
|
||||
<Content Remove="wwwroot\scripts\Commands\WinPSCommands.ts" />
|
||||
<Content Remove="wwwroot\scripts\Console.ts" />
|
||||
<Content Remove="wwwroot\scripts\DataGrid.ts" />
|
||||
<Content Remove="wwwroot\scripts\Enums\RemoteControlMode.ts" />
|
||||
<Content Remove="wwwroot\scripts\InputEventHandlers.ts" />
|
||||
@ -134,6 +135,7 @@
|
||||
<TypeScriptCompile Include="wwwroot\scripts\Commands\CMDCommands.ts" />
|
||||
<TypeScriptCompile Include="wwwroot\scripts\Commands\WebCommands.ts" />
|
||||
<TypeScriptCompile Include="wwwroot\scripts\Commands\PSCoreCommands.ts" />
|
||||
<TypeScriptCompile Include="wwwroot\scripts\Console.ts" />
|
||||
<TypeScriptCompile Include="wwwroot\scripts\DataGrid.ts" />
|
||||
<TypeScriptCompile Include="wwwroot\scripts\Enums\RemoteControlMode.ts" />
|
||||
<TypeScriptCompile Include="wwwroot\scripts\InputEventHandlers.ts" />
|
||||
|
||||
@ -3,6 +3,7 @@ import * as DataGrid from "./DataGrid.js";
|
||||
import { CreateCommandHarness, AddCommandResultsHarness, AddPSCoreResultsHarness, UpdateResultsCount } from "./ResultsParser.js";
|
||||
import { Store } from "./Store.js";
|
||||
import { Main } from "./Main.js";
|
||||
import { AddConsoleOutput, AddConsoleHTML } from "./Console.js";
|
||||
export var Connection;
|
||||
export var ServiceID;
|
||||
export var Connected;
|
||||
@ -17,7 +18,7 @@ export function Connect() {
|
||||
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.");
|
||||
AddConsoleOutput("Your connection was lost. Refresh the page or enter a command to reconnect.");
|
||||
}).then(() => {
|
||||
Connected = true;
|
||||
});
|
||||
@ -25,7 +26,7 @@ export function Connect() {
|
||||
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.");
|
||||
AddConsoleOutput("Connection lost.");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -37,7 +38,7 @@ function applyMessageHandlers(hubConnection) {
|
||||
Main.UserSettings.CommandModeShortcuts.WinPS = options.CommandModeShortcutWinPS;
|
||||
Main.UserSettings.CommandModeShortcuts.Bash = options.CommandModeShortcutBash;
|
||||
Main.UserSettings.CommandModeShortcuts.CMD = options.CommandModeShortcutCMD;
|
||||
UI.AddConsoleOutput("Console connected.");
|
||||
AddConsoleOutput("Console connected.");
|
||||
DataGrid.RefreshGrid();
|
||||
});
|
||||
hubConnection.on("LockedOut", (args) => {
|
||||
@ -65,14 +66,14 @@ function applyMessageHandlers(hubConnection) {
|
||||
});
|
||||
hubConnection.on("DisplayMessage", (consoleMessage, popupMessage) => {
|
||||
if (consoleMessage) {
|
||||
UI.AddConsoleOutput(consoleMessage);
|
||||
AddConsoleOutput(consoleMessage);
|
||||
}
|
||||
if (popupMessage) {
|
||||
UI.PopupMessage(popupMessage);
|
||||
}
|
||||
});
|
||||
hubConnection.on("DisplayConsoleHTML", (message) => {
|
||||
UI.AddConsoleHTML(message);
|
||||
AddConsoleHTML(message);
|
||||
});
|
||||
hubConnection.on("TransferCompleted", (transferID) => {
|
||||
var completedWrapper = document.getElementById(transferID + "-completed");
|
||||
@ -128,7 +129,7 @@ function applyMessageHandlers(hubConnection) {
|
||||
xhr.send();
|
||||
});
|
||||
hubConnection.on("CommandContextCreated", (context) => {
|
||||
UI.AddConsoleHTML(CreateCommandHarness(context).outerHTML);
|
||||
AddConsoleHTML(CreateCommandHarness(context).outerHTML);
|
||||
});
|
||||
hubConnection.on("ServiceID", (serviceID) => {
|
||||
ServiceID = serviceID;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -7,8 +7,8 @@ import { CommandContext } from "./Models/CommandContext.js";
|
||||
import { CreateCommandHarness, AddCommandResultsHarness, AddPSCoreResultsHarness, UpdateResultsCount } from "./ResultsParser.js";
|
||||
import { Store } from "./Store.js";
|
||||
import { UserOptions } from "./Models/UserOptions.js";
|
||||
import { UserSettings } from "./UserSettings.js";
|
||||
import { Main } from "./Main.js";
|
||||
import { AddConsoleOutput, AddConsoleHTML } from "./Console.js";
|
||||
|
||||
|
||||
export var Connection: any;
|
||||
@ -28,7 +28,7 @@ export function Connect() {
|
||||
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.");
|
||||
AddConsoleOutput("Your connection was lost. Refresh the page or enter a command to reconnect.");
|
||||
}).then(() => {
|
||||
Connected = true;
|
||||
})
|
||||
@ -38,7 +38,7 @@ export function Connect() {
|
||||
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.");
|
||||
AddConsoleOutput("Connection lost.");
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -50,7 +50,7 @@ function applyMessageHandlers(hubConnection) {
|
||||
Main.UserSettings.CommandModeShortcuts.WinPS = options.CommandModeShortcutWinPS;
|
||||
Main.UserSettings.CommandModeShortcuts.Bash = options.CommandModeShortcutBash;
|
||||
Main.UserSettings.CommandModeShortcuts.CMD = options.CommandModeShortcutCMD;
|
||||
UI.AddConsoleOutput("Console connected.");
|
||||
AddConsoleOutput("Console connected.");
|
||||
DataGrid.RefreshGrid();
|
||||
});
|
||||
hubConnection.on("LockedOut", (args) => {
|
||||
@ -81,14 +81,14 @@ function applyMessageHandlers(hubConnection) {
|
||||
});
|
||||
hubConnection.on("DisplayMessage", (consoleMessage: string, popupMessage: string) => {
|
||||
if (consoleMessage) {
|
||||
UI.AddConsoleOutput(consoleMessage);
|
||||
AddConsoleOutput(consoleMessage);
|
||||
}
|
||||
if (popupMessage) {
|
||||
UI.PopupMessage(popupMessage);
|
||||
}
|
||||
});
|
||||
hubConnection.on("DisplayConsoleHTML", (message: string) => {
|
||||
UI.AddConsoleHTML(message);
|
||||
AddConsoleHTML(message);
|
||||
});
|
||||
|
||||
hubConnection.on("TransferCompleted", (transferID: string) => {
|
||||
@ -145,7 +145,7 @@ function applyMessageHandlers(hubConnection) {
|
||||
xhr.send();
|
||||
});
|
||||
hubConnection.on("CommandContextCreated", (context: CommandContext) => {
|
||||
UI.AddConsoleHTML(CreateCommandHarness(context).outerHTML);
|
||||
AddConsoleHTML(CreateCommandHarness(context).outerHTML);
|
||||
});
|
||||
hubConnection.on("ServiceID", (serviceID: string) => {
|
||||
ServiceID = serviceID;
|
||||
|
||||
@ -6,7 +6,6 @@ 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 => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -10,8 +10,6 @@ import { PSCoreCommands } from "./Commands/PSCoreCommands.js";
|
||||
import { WinPSCommands } from "./Commands/WinPSCommands.js";
|
||||
import { BashCommands } from "./Commands/BashCommands.js";
|
||||
|
||||
var commandCompletionDisplayTimeout;
|
||||
|
||||
export function DisplayCommandCompletions(commands: Array<ConsoleCommand>, relevantText: string) {
|
||||
Store.CommandCompletionTimeout = window.setTimeout(() => {
|
||||
commands.forEach(x => {
|
||||
|
||||
@ -6,8 +6,9 @@ import * as UI from "./UI.js";
|
||||
import { Store } from "./Store.js";
|
||||
import { DisplayCommandShortcuts, DisplayCommandCompletions, DisplayParameterCompletions, GetCommandCompletions } from "./CommandCompletion.js";
|
||||
import { Connection } from "./BrowserSockets.js";
|
||||
import { AutoSizeTextArea, AddConsoleOutput } from "./Console.js";
|
||||
export function EvaluateCurrentCommandText() {
|
||||
UI.AutoSizeTextArea();
|
||||
AutoSizeTextArea();
|
||||
window.clearTimeout(Store.CommandCompletionTimeout);
|
||||
UI.CommandCompletionDiv.classList.add("hidden");
|
||||
UI.CommandInfoDiv.classList.add("hidden");
|
||||
@ -98,7 +99,7 @@ export function ProcessCommand() {
|
||||
matchingCommand.Execute(parameters);
|
||||
}
|
||||
else {
|
||||
UI.AddConsoleOutput("Unknown command.");
|
||||
AddConsoleOutput("Unknown command.");
|
||||
}
|
||||
break;
|
||||
case "PSCore":
|
||||
@ -109,15 +110,15 @@ export function ProcessCommand() {
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
AddConsoleOutput("At least one device must be selected to send commands.");
|
||||
return;
|
||||
}
|
||||
var deviceIDs = allDevices.map(value => value.ID);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -6,9 +6,10 @@ import * as UI from "./UI.js";
|
||||
import { Store } from "./Store.js";
|
||||
import { DisplayCommandShortcuts, DisplayCommandCompletions, DisplayParameterCompletions, GetCommandCompletions } from "./CommandCompletion.js";
|
||||
import { Connection } from "./BrowserSockets.js";
|
||||
import { AutoSizeTextArea, AddConsoleOutput } from "./Console.js";
|
||||
|
||||
export function EvaluateCurrentCommandText() {
|
||||
UI.AutoSizeTextArea();
|
||||
AutoSizeTextArea();
|
||||
window.clearTimeout(Store.CommandCompletionTimeout);
|
||||
|
||||
UI.CommandCompletionDiv.classList.add("hidden");
|
||||
@ -106,7 +107,7 @@ export function ProcessCommand() {
|
||||
matchingCommand.Execute(parameters);
|
||||
}
|
||||
else {
|
||||
UI.AddConsoleOutput("Unknown command.");
|
||||
AddConsoleOutput("Unknown command.");
|
||||
}
|
||||
break;
|
||||
case "PSCore":
|
||||
@ -118,16 +119,16 @@ export function ProcessCommand() {
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
AddConsoleOutput("At least one device must be selected to send commands.");
|
||||
return;
|
||||
}
|
||||
var deviceIDs = allDevices.map(value => value.ID);
|
||||
|
||||
@ -4,7 +4,7 @@ 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 { AddConsoleHTML, AddConsoleOutput, AddTransferHarness } from "../Console.js";
|
||||
import { GetSelectedDevices } from "../DataGrid.js";
|
||||
var commands = [
|
||||
new ConsoleCommand("DeployScript", [
|
||||
@ -56,14 +56,14 @@ var commands = [
|
||||
});
|
||||
output += deviceList.join("");
|
||||
output += "</table>";
|
||||
UI.AddConsoleOutput(output);
|
||||
AddConsoleOutput(output);
|
||||
}),
|
||||
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"]);
|
||||
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');
|
||||
@ -88,23 +88,23 @@ var commands = [
|
||||
return command.Name.toLowerCase() == (suppliedCommand.Value || "").toLowerCase();
|
||||
});
|
||||
if (result.length == 0) {
|
||||
UI.AddConsoleOutput("No matching commands found.");
|
||||
AddConsoleOutput("No matching commands found.");
|
||||
}
|
||||
else if (result.length == 1) {
|
||||
UI.AddConsoleHTML("<br>" + result[0].FullHelp);
|
||||
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);
|
||||
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.");
|
||||
AddConsoleOutput("No devices are selected.");
|
||||
return;
|
||||
}
|
||||
var output = `<div>Selected Devices:</div>
|
||||
@ -131,12 +131,12 @@ var commands = [
|
||||
});
|
||||
output += deviceList.join("");
|
||||
output += "</table>";
|
||||
UI.AddConsoleOutput(output);
|
||||
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.");
|
||||
AddConsoleOutput("No devices are selected.");
|
||||
}
|
||||
else {
|
||||
BrowserSockets.Connection.invoke("RemoveDevices", devices.map(x => x.ID));
|
||||
@ -180,19 +180,19 @@ var commands = [
|
||||
Main.DataGrid.DataSource.forEach(x => {
|
||||
document.getElementById(x.ID).classList.add("row-selected");
|
||||
});
|
||||
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
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.`);
|
||||
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.`);
|
||||
AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
}
|
||||
if (typeof paramDictionary["filter"] != "undefined") {
|
||||
try {
|
||||
@ -212,7 +212,7 @@ var commands = [
|
||||
case "*":
|
||||
case "!=":
|
||||
case "!*":
|
||||
UI.AddConsoleOutput("Only < and > operators can be used with dates.");
|
||||
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} && `;
|
||||
@ -251,7 +251,7 @@ var commands = [
|
||||
});
|
||||
}
|
||||
catch (ex) {
|
||||
UI.AddConsoleOutput("Unable to parse filter. Please check your syntax.");
|
||||
AddConsoleOutput("Unable to parse filter. Please check your syntax.");
|
||||
return;
|
||||
}
|
||||
lambda = lambda.slice(0, lambda.lastIndexOf(" &&"));
|
||||
@ -271,21 +271,21 @@ var commands = [
|
||||
selectedDevices.forEach(x => {
|
||||
document.getElementById(x.ID).classList.add("row-selected");
|
||||
});
|
||||
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
}
|
||||
Main.DataGrid.UpdateDeviceCounts();
|
||||
}),
|
||||
new ConsoleCommand("RemoteControl", [], "Connect to a computer with Remotely Remote Control.", "remotecontrol", "", () => {
|
||||
var selectedDevices = Main.DataGrid.GetSelectedDevices();
|
||||
if (selectedDevices.length == 0) {
|
||||
UI.AddConsoleOutput("You must select a device first.");
|
||||
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.");
|
||||
AddConsoleOutput("You can only initiate remote control on one device at a time.");
|
||||
return;
|
||||
}
|
||||
UI.AddConsoleOutput("Launching remote control on client device...");
|
||||
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) => {
|
||||
@ -317,7 +317,7 @@ var commands = [
|
||||
return;
|
||||
}
|
||||
var transferID = Main.Utilities.CreateGUID();
|
||||
UI.AddTransferHarness(transferID, selectedDevices.length);
|
||||
AddTransferHarness(transferID, selectedDevices.length);
|
||||
var fileInput = document.createElement("input");
|
||||
fileInput.type = "file";
|
||||
fileInput.hidden = true;
|
||||
@ -334,7 +334,7 @@ var commands = [
|
||||
];
|
||||
function uploadFiles(fileList) {
|
||||
return new Promise((resolve, reject) => {
|
||||
UI.AddConsoleOutput("File upload started...");
|
||||
AddConsoleOutput("File upload started...");
|
||||
var strPath = "/API/FileSharing/";
|
||||
var fd = new FormData();
|
||||
for (var i = 0; i < fileList.length; i++) {
|
||||
@ -344,20 +344,20 @@ function uploadFiles(fileList) {
|
||||
xhr.open('POST', strPath, true);
|
||||
xhr.addEventListener("load", function () {
|
||||
if (xhr.status === 200) {
|
||||
UI.AddConsoleOutput("File upload completed.");
|
||||
AddConsoleOutput("File upload completed.");
|
||||
resolve(JSON.parse(xhr.responseText));
|
||||
}
|
||||
else {
|
||||
UI.AddConsoleOutput("File upload failed.");
|
||||
AddConsoleOutput("File upload failed.");
|
||||
reject();
|
||||
}
|
||||
});
|
||||
xhr.addEventListener("error", () => {
|
||||
UI.AddConsoleOutput("File upload failed.");
|
||||
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) + "%");
|
||||
AddConsoleOutput("File upload progress: " + String(isFinite(e.loaded / e.total) ? e.loaded / e.total : 0) + "%");
|
||||
});
|
||||
xhr.send(fd);
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,12 +1,11 @@
|
||||
import { ConsoleCommand } from "../Models/ConsoleCommand.js"
|
||||
import { Parameter } from "../Models/Parameter.js";
|
||||
import { Device } from "../Models/Device.js";
|
||||
import * as UI from "../UI.js";
|
||||
import * as BrowserSockets from "../BrowserSockets.js";
|
||||
import { CommandLineParameter } from "../Models/CommandLineParameter.js";
|
||||
import { Main } from "../Main.js";
|
||||
import * as DataGrid from "../DataGrid.js";
|
||||
import { AddConsoleHTML, AddConsoleOutput } from "../UI.js";
|
||||
import { AddConsoleHTML, AddConsoleOutput, AddTransferHarness } from "../Console.js";
|
||||
import { GetSelectedDevices } from "../DataGrid.js";
|
||||
|
||||
|
||||
@ -75,7 +74,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
});
|
||||
output += deviceList.join("");
|
||||
output += "</table>";
|
||||
UI.AddConsoleOutput(output);
|
||||
AddConsoleOutput(output);
|
||||
}
|
||||
),
|
||||
new ConsoleCommand(
|
||||
@ -105,7 +104,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
"echo -message This will appear in the console.",
|
||||
"",
|
||||
(parameters, paramDictionary) => {
|
||||
UI.AddConsoleOutput(paramDictionary["message"]);
|
||||
AddConsoleOutput(paramDictionary["message"]);
|
||||
}
|
||||
),
|
||||
new ConsoleCommand(
|
||||
@ -155,17 +154,17 @@ var commands: Array<ConsoleCommand> = [
|
||||
return command.Name.toLowerCase() == (suppliedCommand.Value || "").toLowerCase();
|
||||
});
|
||||
if (result.length == 0) {
|
||||
UI.AddConsoleOutput("No matching commands found.");
|
||||
AddConsoleOutput("No matching commands found.");
|
||||
}
|
||||
else if (result.length == 1) {
|
||||
UI.AddConsoleHTML("<br>" + result[0].FullHelp);
|
||||
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);
|
||||
AddConsoleHTML(outputText);
|
||||
}
|
||||
}
|
||||
),
|
||||
@ -179,7 +178,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
var selectedDevices = Main.DataGrid.GetSelectedDevices();
|
||||
|
||||
if (selectedDevices.length == 0) {
|
||||
UI.AddConsoleOutput("No devices are selected.");
|
||||
AddConsoleOutput("No devices are selected.");
|
||||
return;
|
||||
}
|
||||
var output = `<div>Selected Devices:</div>
|
||||
@ -207,7 +206,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
});
|
||||
output += deviceList.join("");
|
||||
output += "</table>";
|
||||
UI.AddConsoleOutput(output);
|
||||
AddConsoleOutput(output);
|
||||
}
|
||||
),
|
||||
new ConsoleCommand(
|
||||
@ -221,7 +220,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
(parameters) => {
|
||||
var devices = DataGrid.GetSelectedDevices();
|
||||
if (devices.length == 0) {
|
||||
UI.AddConsoleOutput("No devices are selected.");
|
||||
AddConsoleOutput("No devices are selected.");
|
||||
}
|
||||
else {
|
||||
BrowserSockets.Connection.invoke("RemoveDevices", devices.map(x=>x.ID));
|
||||
@ -273,19 +272,19 @@ var commands: Array<ConsoleCommand> = [
|
||||
Main.DataGrid.DataSource.forEach(x => {
|
||||
document.getElementById(x.ID).classList.add("row-selected");
|
||||
})
|
||||
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
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.`);
|
||||
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.`);
|
||||
AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
}
|
||||
if (typeof paramDictionary["filter"] != "undefined") {
|
||||
try {
|
||||
@ -306,7 +305,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
case "*":
|
||||
case "!=":
|
||||
case "!*":
|
||||
UI.AddConsoleOutput("Only < and > operators can be used with dates.");
|
||||
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} && `;
|
||||
@ -346,7 +345,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
})
|
||||
}
|
||||
catch (ex) {
|
||||
UI.AddConsoleOutput("Unable to parse filter. Please check your syntax.");
|
||||
AddConsoleOutput("Unable to parse filter. Please check your syntax.");
|
||||
return;
|
||||
}
|
||||
lambda = lambda.slice(0, lambda.lastIndexOf(" &&"));
|
||||
@ -366,7 +365,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
selectedDevices.forEach(x => {
|
||||
document.getElementById(x.ID).classList.add("row-selected");
|
||||
});
|
||||
UI.AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
AddConsoleOutput(`${GetSelectedDevices().length} devices selected.`);
|
||||
}
|
||||
|
||||
Main.DataGrid.UpdateDeviceCounts();
|
||||
@ -381,14 +380,14 @@ var commands: Array<ConsoleCommand> = [
|
||||
() => {
|
||||
var selectedDevices = Main.DataGrid.GetSelectedDevices();
|
||||
if (selectedDevices.length == 0) {
|
||||
UI.AddConsoleOutput("You must select a device first.");
|
||||
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.");
|
||||
AddConsoleOutput("You can only initiate remote control on one device at a time.");
|
||||
return;
|
||||
}
|
||||
UI.AddConsoleOutput("Launching remote control on client device...");
|
||||
AddConsoleOutput("Launching remote control on client device...");
|
||||
BrowserSockets.Connection.invoke("RemoteControl", selectedDevices[0].ID);
|
||||
}
|
||||
),
|
||||
@ -441,7 +440,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
return;
|
||||
}
|
||||
var transferID = Main.Utilities.CreateGUID();
|
||||
UI.AddTransferHarness(transferID, selectedDevices.length);
|
||||
AddTransferHarness(transferID, selectedDevices.length);
|
||||
var fileInput = document.createElement("input");
|
||||
fileInput.type = "file";
|
||||
fileInput.hidden = true;
|
||||
@ -460,7 +459,7 @@ var commands: Array<ConsoleCommand> = [
|
||||
|
||||
function uploadFiles(fileList: FileList): Promise<string[]> {
|
||||
return new Promise<string[]>((resolve, reject) => {
|
||||
UI.AddConsoleOutput("File upload started...");
|
||||
AddConsoleOutput("File upload started...");
|
||||
|
||||
var strPath = "/API/FileSharing/";
|
||||
var fd = new FormData();
|
||||
@ -471,20 +470,20 @@ function uploadFiles(fileList: FileList): Promise<string[]> {
|
||||
xhr.open('POST', strPath, true);
|
||||
xhr.addEventListener("load", function () {
|
||||
if (xhr.status === 200) {
|
||||
UI.AddConsoleOutput("File upload completed.");
|
||||
AddConsoleOutput("File upload completed.");
|
||||
resolve(JSON.parse(xhr.responseText));
|
||||
}
|
||||
else {
|
||||
UI.AddConsoleOutput("File upload failed.");
|
||||
AddConsoleOutput("File upload failed.");
|
||||
reject();
|
||||
}
|
||||
});
|
||||
xhr.addEventListener("error", () => {
|
||||
UI.AddConsoleOutput("File upload failed.");
|
||||
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) + "%");
|
||||
AddConsoleOutput("File upload progress: " + String(isFinite(e.loaded / e.total) ? e.loaded / e.total : 0) + "%");
|
||||
});
|
||||
xhr.send(fd);
|
||||
})
|
||||
|
||||
42
Server/wwwroot/scripts/Console.js
Normal file
42
Server/wwwroot/scripts/Console.js
Normal file
@ -0,0 +1,42 @@
|
||||
import { UserSettings } from "./UserSettings.js";
|
||||
import { ConsoleOutputDiv, ConsoleFrame, ConsoleTab, ConsoleAlert, ConsoleTextArea } from "./UI.js";
|
||||
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) {
|
||||
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";
|
||||
}
|
||||
//# sourceMappingURL=Console.js.map
|
||||
1
Server/wwwroot/scripts/Console.js.map
Normal file
1
Server/wwwroot/scripts/Console.js.map
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"Console.js","sourceRoot":"","sources":["Console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEpG,MAAM,UAAU,gBAAgB,CAAC,gBAAwB;IACrD,IAAI,WAAW,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAE3C,IAAI,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACvC,MAAM,CAAC,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC;IAE7C,IAAI,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IACvC,MAAM,CAAC,SAAS,GAAG,gBAAgB,CAAC;IAEpC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAChC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAEhC,gBAAgB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAE1C,YAAY,CAAC,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC;IAEnD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAC1C,YAAY,CAAC,MAAM,GAAG,KAAK,CAAC;KAC/B;AACL,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,IAAY;IACvC,IAAI,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnD,cAAc,CAAC,SAAS,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAE7C,YAAY,CAAC,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC;AACvD,CAAC;AACD,MAAM,UAAU,kBAAkB,CAAC,UAAkB,EAAE,YAAoB;IACvE,IAAI,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACpD,eAAe,CAAC,EAAE,GAAG,UAAU,CAAC;IAChC,eAAe,CAAC,SAAS,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACjD,eAAe,CAAC,SAAS,GAAG;;;6BAGH,YAAY;mCACN,UAAU;eAC9B,CAAC;IACZ,cAAc,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC;AACD,MAAM,UAAU,gBAAgB;IAC5B,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC;IACrC,eAAe,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,eAAe,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC;AACrF,CAAC"}
|
||||
49
Server/wwwroot/scripts/Console.ts
Normal file
49
Server/wwwroot/scripts/Console.ts
Normal file
@ -0,0 +1,49 @@
|
||||
import { UserSettings } from "./UserSettings.js";
|
||||
import { ConsoleOutputDiv, ConsoleFrame, ConsoleTab, ConsoleAlert, ConsoleTextArea } from "./UI.js";
|
||||
|
||||
export function AddConsoleOutput(strOutputMessage: string) {
|
||||
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: string) {
|
||||
var contentWrapper = document.createElement("div");
|
||||
contentWrapper.innerHTML = html;
|
||||
ConsoleOutputDiv.appendChild(contentWrapper);
|
||||
|
||||
ConsoleFrame.scrollTop = ConsoleFrame.scrollHeight;
|
||||
}
|
||||
export function AddTransferHarness(transferID: string, totalDevices: number) {
|
||||
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";
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
import * as UI from "./UI.js";
|
||||
import { Main } from "./Main.js";
|
||||
import { DeviceGrid } from "./UI.js";
|
||||
import { AddConsoleOutput } from "./Console.js";
|
||||
export const DataSource = new Array();
|
||||
export const FilterOptions = new class {
|
||||
constructor() {
|
||||
@ -99,7 +100,7 @@ export function RefreshGrid() {
|
||||
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.");
|
||||
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 {
|
||||
}
|
||||
@ -135,7 +136,7 @@ export function UpdateDeviceCounts() {
|
||||
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.`);
|
||||
AddConsoleOutput(`Your selection contains offline computers. Your commands will only be sent to those that are online.`);
|
||||
}
|
||||
}
|
||||
function deviceMatchesFilter(device) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -2,6 +2,7 @@
|
||||
import { Device } from "./Models/Device.js";
|
||||
import { Main } from "./Main.js";
|
||||
import { DeviceGrid } from "./UI.js";
|
||||
import { AddConsoleOutput } from "./Console.js";
|
||||
|
||||
|
||||
export const DataSource: Array<Device> = new Array<Device>();
|
||||
@ -108,7 +109,7 @@ export function RefreshGrid() {
|
||||
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.");
|
||||
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 {
|
||||
|
||||
@ -149,7 +150,7 @@ export function UpdateDeviceCounts() {
|
||||
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.`);
|
||||
AddConsoleOutput(`Your selection contains offline computers. Your commands will only be sent to those that are online.`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import { Store } from "./Store.js";
|
||||
import * as DataGrid from "./DataGrid.js";
|
||||
import * as BrowserSockets from "./BrowserSockets.js";
|
||||
import { WebCommands } from "./Commands/WebCommands.js";
|
||||
import { AddConsoleOutput } from "./Console.js";
|
||||
export function ApplyInputEventHandlers() {
|
||||
keyDownOnWindow();
|
||||
keyDownOnInputTextArea();
|
||||
@ -71,9 +72,9 @@ function keyDownOnInputTextArea() {
|
||||
}
|
||||
UI.CommandCompletionDiv.classList.add("hidden");
|
||||
UI.CommandInfoDiv.classList.add("hidden");
|
||||
UI.AddConsoleOutput(`<span class="echo-input">${UI.ConsoleTextArea.value}</span>`);
|
||||
AddConsoleOutput(`<span class="echo-input">${UI.ConsoleTextArea.value}</span>`);
|
||||
if (!BrowserSockets.Connected) {
|
||||
UI.AddConsoleOutput("Not connected. Reconnecting...");
|
||||
AddConsoleOutput("Not connected. Reconnecting...");
|
||||
BrowserSockets.Connect();
|
||||
return;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -5,6 +5,7 @@ import { Store } from "./Store.js";
|
||||
import * as DataGrid from "./DataGrid.js";
|
||||
import * as BrowserSockets from "./BrowserSockets.js";
|
||||
import { WebCommands } from "./Commands/WebCommands.js";
|
||||
import { AddConsoleOutput } from "./Console.js";
|
||||
|
||||
|
||||
export function ApplyInputEventHandlers() {
|
||||
@ -76,9 +77,9 @@ function keyDownOnInputTextArea() {
|
||||
}
|
||||
UI.CommandCompletionDiv.classList.add("hidden");
|
||||
UI.CommandInfoDiv.classList.add("hidden");
|
||||
UI.AddConsoleOutput(`<span class="echo-input">${UI.ConsoleTextArea.value}</span>`);
|
||||
AddConsoleOutput(`<span class="echo-input">${UI.ConsoleTextArea.value}</span>`);
|
||||
if (!BrowserSockets.Connected) {
|
||||
UI.AddConsoleOutput("Not connected. Reconnecting...");
|
||||
AddConsoleOutput("Not connected. Reconnecting...");
|
||||
BrowserSockets.Connect();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -6,10 +6,12 @@ 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 { Store } from "./Store.js";
|
||||
import { UserSettings } from "./UserSettings.js";
|
||||
import { WinPSCommands } from "./Commands/WinPSCommands.js";
|
||||
import { ApplyInputEventHandlers } from "./InputEventHandlers.js";
|
||||
import { Sound } from "./Sound.js";
|
||||
import * as Console from "./Console.js";
|
||||
var remotely = {
|
||||
Commands: {
|
||||
"Web": WebCommands,
|
||||
@ -18,13 +20,14 @@ var remotely = {
|
||||
"CMD": CMDCommands
|
||||
},
|
||||
CommandProcessor: CommandProcessor,
|
||||
Console: Console,
|
||||
DataGrid: DataGrid,
|
||||
UI: UI,
|
||||
Utilities: Utilities,
|
||||
Sockets: BrowserSockets,
|
||||
Storage: Storage,
|
||||
UserSettings: UserSettings,
|
||||
Sound: Sound,
|
||||
Store: Store,
|
||||
Init() {
|
||||
UI.ConsoleTextArea.focus();
|
||||
ApplyInputEventHandlers();
|
||||
|
||||
@ -1 +1 @@
|
||||
{"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,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AAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,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,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ;IAClB,EAAE,EAAE,EAAE;IACN,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,cAAc;IACvB,YAAY,EAAE,YAAY;IAC1B,KAAK,EAAE,KAAK;IACZ,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"}
|
||||
@ -4,7 +4,6 @@ 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 { ConsoleCommand } from "./Models/ConsoleCommand.js";
|
||||
import * as Utilities from "./Utilities.js";
|
||||
import * as DataGrid from "./DataGrid.js";
|
||||
import { Store } from "./Store.js";
|
||||
@ -12,6 +11,7 @@ import { UserSettings } from "./UserSettings.js";
|
||||
import { WinPSCommands } from "./Commands/WinPSCommands.js";
|
||||
import { ApplyInputEventHandlers } from "./InputEventHandlers.js";
|
||||
import { Sound } from "./Sound.js";
|
||||
import * as Console from "./Console.js";
|
||||
|
||||
var remotely = {
|
||||
Commands: {
|
||||
@ -21,13 +21,14 @@ var remotely = {
|
||||
"CMD": CMDCommands
|
||||
},
|
||||
CommandProcessor: CommandProcessor,
|
||||
Console: Console,
|
||||
DataGrid: DataGrid,
|
||||
UI: UI,
|
||||
Utilities: Utilities,
|
||||
Sockets: BrowserSockets,
|
||||
Storage: Storage,
|
||||
UserSettings: UserSettings,
|
||||
Sound: Sound,
|
||||
Store: Store,
|
||||
Init() {
|
||||
UI.ConsoleTextArea.focus();
|
||||
ApplyInputEventHandlers();
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import { UserSettings } from "./UserSettings.js";
|
||||
import * as Utilities from "./Utilities.js";
|
||||
export var CommandCompletionDiv = document.querySelector("#commandCompletionDiv");
|
||||
export var CommandInfoDiv = document.querySelector("#commandInfoDiv");
|
||||
@ -17,45 +16,6 @@ export var ConsoleTab = document.getElementById("consoleTab");
|
||||
export var ConsoleAlert = document.getElementById("consoleAlert");
|
||||
export var DeviceGroupSelect = document.getElementById("deviceGroupSelect");
|
||||
export var GridFilter = document.getElementById("gridFilter");
|
||||
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) {
|
||||
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 PopupMessage(message) {
|
||||
var messageDiv = document.createElement("div");
|
||||
messageDiv.classList.add("float-message");
|
||||
|
||||
@ -1 +1 @@
|
||||
{"version":3,"file":"UI.js","sourceRoot":"","sources":["UI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAG5C,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,CAAC,oBAAoB,CAAsB,CAAC;AACjG,MAAM,CAAC,IAAI,gBAAgB,GAAG,QAAQ,CAAC,aAAa,CAAC,mBAAmB,CAAmB,CAAC;AAC5F,MAAM,CAAC,IAAI,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,kBAAkB,CAAwB,CAAC;AAC/F,MAAM,CAAC,IAAI,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAqB,CAAC;AAClF,MAAM,CAAC,IAAI,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,sBAAsB,CAAoB,CAAC;AACp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,CAAC,UAAU,EAAE,CAAC;IACrC,IAAI,SAAS,GAAG,YAAY,OAAO;;;;0CAIG,KAAK;;;;;;kBAM7B,aAAa;;;kBAGb,WAAW;;;;;eAKd,CAAC;IACZ,IAAI,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC/C,UAAU,CAAC,SAAS,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,EAAE;QACxC,IAAI;YACA,IAAI,iBAAiB,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,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,UAAU,CAAC;AACtB,CAAC;AAAA,CAAC;AACF,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"}
|
||||
@ -1,5 +1,4 @@
|
||||
import { UserSettings} from "./UserSettings.js";
|
||||
import * as Utilities from "./Utilities.js";
|
||||
import * as Utilities from "./Utilities.js";
|
||||
|
||||
|
||||
export var CommandCompletionDiv = document.querySelector("#commandCompletionDiv") as HTMLDivElement;
|
||||
@ -21,52 +20,6 @@ export var DeviceGroupSelect = document.getElementById("deviceGroupSelect") as H
|
||||
export var GridFilter = document.getElementById("gridFilter") as HTMLInputElement;
|
||||
|
||||
|
||||
export function AddConsoleOutput(strOutputMessage:string) {
|
||||
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: string) {
|
||||
var contentWrapper = document.createElement("div");
|
||||
contentWrapper.innerHTML = html;
|
||||
ConsoleOutputDiv.appendChild(contentWrapper);
|
||||
|
||||
ConsoleFrame.scrollTop = ConsoleFrame.scrollHeight;
|
||||
}
|
||||
export function AddTransferHarness(transferID: string, totalDevices:number) {
|
||||
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 PopupMessage(message: string) {
|
||||
var messageDiv = document.createElement("div");
|
||||
messageDiv.classList.add("float-message");
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
export const UserSettings = new class {
|
||||
constructor() {
|
||||
this.PromptString = "~>";
|
||||
this.CommandModeShortcuts = {
|
||||
"Web": "/web",
|
||||
"PSCore": "/pscore",
|
||||
"WinPS": "/winps",
|
||||
"CMD": "/cmd",
|
||||
"Bash": "/bash"
|
||||
};
|
||||
export const UserSettings = {
|
||||
PromptString: "~>",
|
||||
CommandModeShortcuts: {
|
||||
"Web": "/web",
|
||||
"PSCore": "/pscore",
|
||||
"WinPS": "/winps",
|
||||
"CMD": "/cmd",
|
||||
"Bash": "/bash"
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=UserSettings.js.map
|
||||
@ -1 +1 @@
|
||||
{"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"}
|
||||
{"version":3,"file":"UserSettings.js","sourceRoot":"","sources":["UserSettings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,YAAY,EAAE,IAAI;IAElB,oBAAoB,EAAE;QAClB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,SAAS;QACnB,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,OAAO;KAClB;CACJ,CAAA"}
|
||||
@ -1,7 +1,7 @@
|
||||
export const UserSettings = new class {
|
||||
PromptString = "~>";
|
||||
export const UserSettings = {
|
||||
PromptString: "~>",
|
||||
|
||||
CommandModeShortcuts = {
|
||||
CommandModeShortcuts: {
|
||||
"Web": "/web",
|
||||
"PSCore": "/pscore",
|
||||
"WinPS": "/winps",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user