mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
Connect With Non-Terminal Widgets (#304)
- Adds connection buttons for previews - Makes it possible for graphs and previews to connect on backend (without a terminal open to connection) - Changes the wsh install message
This commit is contained in:
@@ -353,12 +353,21 @@ const ChangeConnectionBlockModal = React.memo(
|
||||
}) => {
|
||||
const [connSelected, setConnSelected] = React.useState("");
|
||||
const changeConnModalOpen = jotai.useAtomValue(changeConnModalAtom);
|
||||
const [blockData] = WOS.useWaveObjectValue<Block>(WOS.makeORef("block", blockId));
|
||||
const changeConnection = React.useCallback(
|
||||
async (connName: string) => {
|
||||
const oldCwd = blockData?.meta?.file ?? "";
|
||||
let newCwd: string;
|
||||
if (oldCwd == "") {
|
||||
newCwd = "";
|
||||
} else {
|
||||
newCwd = "~";
|
||||
}
|
||||
await WshServer.SetMetaCommand({
|
||||
oref: WOS.makeORef("block", blockId),
|
||||
meta: { connection: connName },
|
||||
meta: { connection: connName, file: newCwd },
|
||||
});
|
||||
await services.BlockService.EnsureConnection(blockId).catch((e) => console.log(e));
|
||||
await WshServer.ControllerRestartCommand({ blockid: blockId });
|
||||
},
|
||||
[blockId]
|
||||
|
||||
Reference in New Issue
Block a user