#2781 - Correcting some typos in Terminal notebook and elaborating the data in _remote_login request

This commit is contained in:
Charlie Crane
2024-08-08 11:57:30 +01:00
parent 93ef3076f5
commit ff054830bc
2 changed files with 12 additions and 10 deletions

View File

@@ -87,7 +87,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"You can view all active connections to a terminal through use of the `show()` method, " "You can view all active connections to a terminal through use of the `show()` method."
] ]
}, },
{ {
@@ -96,11 +96,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"terminal_b.show()\n", "terminal_b.show()"
"print(term_a_term_b_remote_connection.ssh_session_id)\n",
"computer_b.user_session_manager.show(include_session_id=True)\n",
"computer_b.user_session_manager.show()\n",
"\n"
] ]
}, },
{ {
@@ -184,7 +180,6 @@
"term_a_term_b_remote_connection.disconnect()\n", "term_a_term_b_remote_connection.disconnect()\n",
"\n", "\n",
"terminal_a.show()\n", "terminal_a.show()\n",
"\n",
"terminal_b.show()" "terminal_b.show()"
] ]
}, },
@@ -192,7 +187,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Disconnected Terminal sessions will no longer show in the node's `user_session_manager` as active, but will be under the historic sessions" "Disconnected Terminal sessions will no longer show in the node's Terminal connection list, but will be under the historic sessions in the `user_session_manager`."
] ]
}, },
{ {

View File

@@ -181,12 +181,19 @@ class Terminal(Service):
}, },
) )
else: else:
return RequestResponse(status="failure", data={}) return RequestResponse(status="failure", data={"reason": "Invalid login credentials"})
def _remote_login(request: RequestFormat, context: Dict) -> RequestResponse: def _remote_login(request: RequestFormat, context: Dict) -> RequestResponse:
login = self._send_remote_login(username=request[0], password=request[1], ip_address=request[2]) login = self._send_remote_login(username=request[0], password=request[1], ip_address=request[2])
if login: if login:
return RequestResponse(status="success", data={}) return RequestResponse(
status="success",
data={
"connection ID": login.connection_uuid,
"ssh_session_id": login.ssh_session_id,
"ip_address": login.ip_address,
},
)
else: else:
return RequestResponse(status="failure", data={}) return RequestResponse(status="failure", data={})