1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-17 21:44:05 +00:00

Shell feature (#44)

Resolves #37: adds a shell tab where the user can write mongo shell
scripts and execute them.
This commit is contained in:
2023-07-01 21:34:32 +02:00
committed by GitHub
parent 62f4b88ea6
commit 61142844fa
12 changed files with 375 additions and 59 deletions

View File

@ -16,6 +16,7 @@ import {
DropCollection,
DropDatabase,
DropIndex,
ExecuteShellScript,
GetIndexes,
HostLogs,
Hosts,
@ -224,6 +225,11 @@ async function refresh() {
});
});
};
collection.executeShellScript = async function(script) {
const result = await ExecuteShellScript(hostKey, dbKey, collKey, script);
return result;
};
}
await refresh();
@ -262,11 +268,21 @@ async function refresh() {
await database.open();
}
};
database.executeShellScript = async function(script) {
const result = await ExecuteShellScript(hostKey, dbKey, '', script);
return result;
};
}
await refresh();
};
host.executeShellScript = async function(script) {
const result = await ExecuteShellScript(hostKey, '', '', script);
return result;
};
host.newDatabase = async function() {
const name = await dialogs.enterText('Create a database', 'Enter the database name. Note: databases in MongoDB do not exist until they have a collection and an item. Your new database will not persist on the server; fill it to have it created.', '');
if (name) {