core: cli remote control help section (#3445)
This commit is contained in:
parent
74e80eb348
commit
b1cf1656a0
@ -6073,8 +6073,9 @@ chatCommandP =
|
||||
("/help groups" <|> "/help group" <|> "/hg") $> ChatHelp HSGroups,
|
||||
("/help contacts" <|> "/help contact" <|> "/hc") $> ChatHelp HSContacts,
|
||||
("/help address" <|> "/ha") $> ChatHelp HSMyAddress,
|
||||
"/help incognito" $> ChatHelp HSIncognito,
|
||||
("/help incognito" <|> "/hi") $> ChatHelp HSIncognito,
|
||||
("/help messages" <|> "/hm") $> ChatHelp HSMessages,
|
||||
("/help remote" <|> "/hr") $> ChatHelp HSRemote,
|
||||
("/help settings" <|> "/hs") $> ChatHelp HSSettings,
|
||||
("/help db" <|> "/hd") $> ChatHelp HSDatabase,
|
||||
("/help" <|> "/h") $> ChatHelp HSMain,
|
||||
@ -6181,7 +6182,6 @@ chatCommandP =
|
||||
"/set disappear " *> (SetUserTimedMessages <$> (("yes" $> True) <|> ("no" $> False))),
|
||||
("/incognito" <* optional (A.space *> onOffP)) $> ChatHelp HSIncognito,
|
||||
"/set device name " *> (SetLocalDeviceName <$> textP),
|
||||
-- "/create remote host" $> CreateRemoteHost,
|
||||
"/list remote hosts" $> ListRemoteHosts,
|
||||
"/switch remote host " *> (SwitchRemoteHost <$> ("local" $> Nothing <|> (Just <$> A.decimal))),
|
||||
"/start remote host " *> (StartRemoteHost <$> ("new" $> Nothing <|> (Just <$> ((,) <$> A.decimal <*> (" multicast=" *> onOffP <|> pure False))))),
|
||||
|
@ -203,7 +203,7 @@ data ChatController = ChatController
|
||||
contactMergeEnabled :: TVar Bool
|
||||
}
|
||||
|
||||
data HelpSection = HSMain | HSFiles | HSGroups | HSContacts | HSMyAddress | HSIncognito | HSMarkdown | HSMessages | HSSettings | HSDatabase
|
||||
data HelpSection = HSMain | HSFiles | HSGroups | HSContacts | HSMyAddress | HSIncognito | HSMarkdown | HSMessages | HSRemote | HSSettings | HSDatabase
|
||||
deriving (Show)
|
||||
|
||||
data ChatCommand
|
||||
|
@ -10,6 +10,7 @@ module Simplex.Chat.Help
|
||||
myAddressHelpInfo,
|
||||
incognitoHelpInfo,
|
||||
messagesHelpInfo,
|
||||
remoteHelpInfo,
|
||||
markdownInfo,
|
||||
settingsInfo,
|
||||
databaseHelpInfo,
|
||||
@ -87,7 +88,7 @@ chatHelpInfo =
|
||||
green "Create your address: " <> highlight "/address",
|
||||
"",
|
||||
green "Other commands:",
|
||||
indent <> highlight "/help <topic> " <> " - help on: " <> listHighlight ["groups", "contacts", "messages", "files", "address", "settings", "db"],
|
||||
indent <> highlight "/help <topic> " <> " - help on: " <> listHighlight ["groups", "contacts", "messages", "files", "address", "incognito", "remote", "settings", "db"],
|
||||
indent <> highlight "/profile " <> " - show / update user profile",
|
||||
indent <> highlight "/delete <contact>" <> " - delete contact and all messages with them",
|
||||
indent <> highlight "/chats " <> " - most recent chats",
|
||||
@ -272,6 +273,34 @@ messagesHelpInfo =
|
||||
indent <> highlight "! #team (hi) <new msg> " <> " - to edit your message in the group #team"
|
||||
]
|
||||
|
||||
remoteHelpInfo :: [StyledString]
|
||||
remoteHelpInfo =
|
||||
map
|
||||
styleMarkdown
|
||||
[ green "Remote control",
|
||||
"You can use CLI as a remote controller for a mobile app or as a remote host for a desktop app (or another CLI).",
|
||||
"For example, you can run CLI on a server and use it from a desktop computer, connecting via SSH port forwarding.",
|
||||
"",
|
||||
indent <> highlight "/set device name <name> " <> " - set CLI name for remote connections",
|
||||
"",
|
||||
green "Using as remote controller",
|
||||
indent <> highlight "/start remote host new " <> " - pair and connect a new remote host",
|
||||
indent <> highlight "/start remote host <id> [multicast=on] " <> " - start connection with a known (paired) remote host",
|
||||
indent <> highlight "/stop remote host new " <> " - cancel pairing with a new remote host",
|
||||
indent <> highlight "/stop remote host <id> " <> " - stop connection with connected remote host",
|
||||
indent <> highlight "/switch remote host local " <> " - switch to using local database",
|
||||
indent <> highlight "/switch remote host <id> " <> " - switch to connected remote host",
|
||||
indent <> highlight "/list remote hosts " <> " - list known remote hosts",
|
||||
indent <> highlight "/delete remote host <id> " <> " - delete (unpair) known remote hosts - also deletes all host files from controller",
|
||||
"",
|
||||
green "Using as remote host",
|
||||
indent <> highlight "/connect remote ctrl <session_address> " <> " - connect to remote controller via the adress from /start remote host",
|
||||
indent <> highlight "/stop remote ctrl " <> " - stop connection with remote controller",
|
||||
indent <> highlight "/find remote ctrl " <> " - find known remote controller on the local network (it should be started with multicast=on)",
|
||||
indent <> highlight "/list remote ctrls " <> " - list known remote controllers",
|
||||
indent <> highlight "/delete remote ctrl <id> " <> " - delete known remote controller"
|
||||
]
|
||||
|
||||
markdownInfo :: [StyledString]
|
||||
markdownInfo =
|
||||
map
|
||||
|
@ -136,6 +136,7 @@ responseToView hu@(currentRH, user_) ChatConfig {logLevel, showReactions, showRe
|
||||
HSIncognito -> incognitoHelpInfo
|
||||
HSMessages -> messagesHelpInfo
|
||||
HSMarkdown -> markdownInfo
|
||||
HSRemote -> remoteHelpInfo
|
||||
HSSettings -> settingsInfo
|
||||
HSDatabase -> databaseHelpInfo
|
||||
CRWelcome user -> chatWelcome user
|
||||
@ -310,6 +311,7 @@ responseToView hu@(currentRH, user_) ChatConfig {logLevel, showReactions, showRe
|
||||
[ "remote controller " <> sShow remoteCtrlId <> " found: "
|
||||
<> maybe (deviceName <> "not compatible") (\info -> viewRemoteCtrl info appVersion compatible) ctrlAppInfo_
|
||||
]
|
||||
<> [ "use " <> highlight ("/confirm remote ctrl " <> show remoteCtrlId) <> " to connect" | isJust ctrlAppInfo_ && compatible]
|
||||
where
|
||||
deviceName = if T.null ctrlDeviceName then "" else plain ctrlDeviceName <> ", "
|
||||
CRRemoteCtrlConnecting {remoteCtrl_, ctrlAppInfo, appVersion} ->
|
||||
|
@ -460,6 +460,7 @@ startRemoteDiscover mobile desktop = do
|
||||
mobile ##> "/find remote ctrl"
|
||||
mobile <## "ok"
|
||||
mobile <## ("remote controller 1 found: My desktop, v" <> versionNumber)
|
||||
mobile <## "use /confirm remote ctrl 1 to connect"
|
||||
mobile ##> "/confirm remote ctrl 1"
|
||||
|
||||
mobile <## ("connecting remote controller 1: My desktop, v" <> versionNumber)
|
||||
|
Loading…
Reference in New Issue
Block a user