mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: shell can open a saved host's editor for plugins (Plugin-SSH-Terminal#36)
This commit is contained in:
1 parent
cc2223d69e
commit
8da88b906b
4 files changed
+10
No files matched your search
@@ -12,6 +12,7 @@ Plugin API 1.13.0.
|
||||
- SSH transport providers get the host's owner, sync id, connection origin and local only flag in `claims` and `open`, and core's SSH relay takes a `syncId` instead of a host id
|
||||
- `ctx.sync.host.entities.idsOf` maps sync ids to the local ids of the user's own rows of one type
|
||||
- Rail items take `useStatus` for a small ok, warning or error dot on the icon
|
||||
- `shell.editHost(hostId)` opens the editor of a saved host
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
@@ -206,6 +206,8 @@ export interface ShellApi {
|
||||
* user reviews and saves it. Absent in some shells.
|
||||
*/
|
||||
openHostEditor?: (draft?: HostDraft) => void;
|
||||
/** Opens the editor of a saved host. Termix 26.10.6+, absent in some shells. */
|
||||
editHost?: (hostId: number) => void;
|
||||
/** Opens a rail view in the left sidebar. */
|
||||
openRailView: (id: string) => void;
|
||||
/** Closes a rail view wherever it is shown. */
|
||||
|
||||
@@ -173,6 +173,10 @@ export function ShellControllerProvider({
|
||||
},
|
||||
openHostEditor: (draft) =>
|
||||
requestManage({ kind: "host", hostId: null, draft }),
|
||||
editHost: (hostId) => {
|
||||
requestManage({ kind: "host", hostId });
|
||||
if (isMobile) regions.left.setOpen(false);
|
||||
},
|
||||
saveQuickConnect: tabsState.saveQuickConnectHost,
|
||||
confirm: (options) =>
|
||||
confirmRef.current ? confirmRef.current(options) : Promise.resolve(false),
|
||||
@@ -196,6 +200,7 @@ export function ShellControllerProvider({
|
||||
closeRailView: (...args) => shellImplRef.current.closeRailView(...args),
|
||||
openHostEditor: (...args) =>
|
||||
shellImplRef.current.openHostEditor?.(...args),
|
||||
editHost: (...args) => shellImplRef.current.editHost?.(...args),
|
||||
saveQuickConnect: (...args) =>
|
||||
shellImplRef.current.saveQuickConnect!(...args),
|
||||
confirm: (...args) => shellImplRef.current.confirm!(...args),
|
||||
|
||||
@@ -33,6 +33,8 @@ export interface TabShellCallbacks {
|
||||
closeRailView: (id: string) => void;
|
||||
/** Opens the host editor for a new host with these fields filled in. */
|
||||
openHostEditor?: (draft?: HostDraft) => void;
|
||||
/** Opens the editor of a saved host. */
|
||||
editHost?: (hostId: number) => void;
|
||||
/** Saves a quick-connect tab's host. Core terminal only. */
|
||||
saveQuickConnect?: (tab: Tab, host: Host) => Promise<void>;
|
||||
/** Asks a yes or no question over the main area. */
|
||||
|
||||
Reference in new issue
Block a user