diff --git a/docs/src/api/statemachine.md b/docs/src/api/statemachine.md index 7d03b134..29c05492 100644 --- a/docs/src/api/statemachine.md +++ b/docs/src/api/statemachine.md @@ -17,24 +17,39 @@ The following is an example of the FSM when the client has obtained a Wireguard/ ```mermaid graph TD -style Deregistered fill:white +style Deregistered fill:cyan Deregistered(Deregistered) -->|Client registers| No_Server +style No_Server fill:white +No_Server(No_Server) -->|Reload list| No_Server + +style No_Server fill:white +No_Server(No_Server) -->|The client wants to ask for a location on the main screen| Ask_Location + style No_Server fill:white No_Server(No_Server) -->|User clicks a server in the UI| Loading_Server +style No_Server fill:white +No_Server(No_Server) -->|The VPN is still active| Connected + style Ask_Location fill:white Ask_Location(Ask_Location) -->|Location chosen| Chosen_Location style Ask_Location fill:white Ask_Location(Ask_Location) -->|Go back or Error| No_Server +style Ask_Location fill:white +Ask_Location(Ask_Location) -->|Go back or Error| Got_Config + style Chosen_Location fill:white Chosen_Location(Chosen_Location) -->|Server has been chosen| Chosen_Server style Chosen_Location fill:white Chosen_Location(Chosen_Location) -->|Go back or Error| No_Server +style Chosen_Location fill:white +Chosen_Location(Chosen_Location) -->|Go back or Error| Got_Config + style Loading_Server fill:white Loading_Server(Loading_Server) -->|Server info loaded| Chosen_Server @@ -44,18 +59,30 @@ Loading_Server(Loading_Server) -->|User chooses a Secure Internet server but no style Loading_Server fill:white Loading_Server(Loading_Server) -->|Go back or Error| No_Server +style Loading_Server fill:white +Loading_Server(Loading_Server) -->|Go back or Error| Got_Config + style Chosen_Server fill:white Chosen_Server(Chosen_Server) -->|Found tokens in config| Authorized style Chosen_Server fill:white Chosen_Server(Chosen_Server) -->|No tokens found in config| OAuth_Started +style Chosen_Server fill:white +Chosen_Server(Chosen_Server) -->|Go back or Error| No_Server + +style Chosen_Server fill:white +Chosen_Server(Chosen_Server) -->|Go back or Error| Got_Config + style OAuth_Started fill:white OAuth_Started(OAuth_Started) -->|User authorizes with browser| Authorized style OAuth_Started fill:white OAuth_Started(OAuth_Started) -->|Go back or Error| No_Server +style OAuth_Started fill:white +OAuth_Started(OAuth_Started) -->|Go back or Error| Got_Config + style Authorized fill:white Authorized(Authorized) -->|Re-authorize with OAuth| OAuth_Started @@ -63,7 +90,13 @@ style Authorized fill:white Authorized(Authorized) -->|Client requests a config| Request_Config style Authorized fill:white -Authorized(Authorized) -->|Client wants to go back to the main screen| No_Server +Authorized(Authorized) -->|Load the server again| Loading_Server + +style Authorized fill:white +Authorized(Authorized) -->|Go back or Error| No_Server + +style Authorized fill:white +Authorized(Authorized) -->|Go back or Error| Got_Config style Request_Config fill:white Request_Config(Request_Config) -->|Multiple profiles found and no profile chosen| Ask_Profile @@ -72,10 +105,13 @@ style Request_Config fill:white Request_Config(Request_Config) -->|Only one profile or profile already chosen| Chosen_Profile style Request_Config fill:white -Request_Config(Request_Config) -->|Cancel or Error| No_Server +Request_Config(Request_Config) -->|Re-authorize| OAuth_Started style Request_Config fill:white -Request_Config(Request_Config) -->|Re-authorize| OAuth_Started +Request_Config(Request_Config) -->|Go back or Error| No_Server + +style Request_Config fill:white +Request_Config(Request_Config) -->|Go back or Error| Got_Config style Ask_Profile fill:white Ask_Profile(Ask_Profile) -->|Cancel or Error| No_Server @@ -83,17 +119,44 @@ Ask_Profile(Ask_Profile) -->|Cancel or Error| No_Server style Ask_Profile fill:white Ask_Profile(Ask_Profile) -->|Profile has been chosen| Chosen_Profile -style Chosen_Profile fill:white -Chosen_Profile(Chosen_Profile) -->|Cancel or Error| No_Server +style Ask_Profile fill:white +Ask_Profile(Ask_Profile) -->|Go back or Error| No_Server + +style Ask_Profile fill:white +Ask_Profile(Ask_Profile) -->|Go back or Error| Got_Config style Chosen_Profile fill:white Chosen_Profile(Chosen_Profile) -->|Config has been obtained| Got_Config -style Got_Config fill:cyan +style Chosen_Profile fill:white +Chosen_Profile(Chosen_Profile) -->|Go back or Error| No_Server + +style Chosen_Profile fill:white +Chosen_Profile(Chosen_Profile) -->|Go back or Error| Got_Config + +style Got_Config fill:white Got_Config(Got_Config) -->|Choose a new server| No_Server -style Got_Config fill:cyan +style Got_Config fill:white Got_Config(Got_Config) -->|Get a new configuration| Loading_Server + +style Got_Config fill:white +Got_Config(Got_Config) -->|VPN is connecting| Connecting + +style Connecting fill:white +Connecting(Connecting) -->|Go back or Error| Got_Config + +style Connecting fill:white +Connecting(Connecting) -->|Done connecting| Connected + +style Disconnecting fill:white +Disconnecting(Disconnecting) -->|Done disconnecting| Got_Config + +style Disconnecting fill:white +Disconnecting(Disconnecting) -->|Go back or Error| Connected + +style Connected fill:white +Connected(Connected) -->|The VPN is disconnecting| Disconnecting ```