Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit97cd0f0

Browse files
authored
fix: access the settings page for the auth. wizard (#105)
The Settings menu is only available after we successfully authenticate.This can be somewhat problematic if we want to configure something likecoder cli path, or certificate path before doing the authentication.A new "Settings" button at the bottom of the page can now access theSettings page. Toolbox is a bit inflexible with the API because:- I could not find a way to delimit or separate the Settings button fromthe Back and Sign In/Connect button- we can't put a button or anything else in the top right corner, thetraditional place for a settings icon.-resolves#90
1 parentdb08dfa commit97cd0f0

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

‎CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
- rendering glitches when a Workspace is stopped while SSH connection is alive
1212
- misleading message saying that there are no workspaces rendered during manual authentication
13+
- Coder Settings can now be accessed from the authentication wizard
1314

1415
##0.2.0 - 2025-04-24
1516

‎src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ class CoderRemoteProvider(
296296
if (autologin&& lastDeploymentURL.isNotBlank()&& (lastToken.isNotBlank()||!settings.requireTokenAuth)) {
297297
try {
298298
AuthWizardState.goToStep(WizardStep.LOGIN)
299-
returnAuthWizardPage(context,true, ::onConnect)
299+
returnAuthWizardPage(context,settingsPage,true, ::onConnect)
300300
}catch (ex:Exception) {
301301
errorBuffer.add(ex)
302302
}
@@ -306,7 +306,7 @@ class CoderRemoteProvider(
306306
firstRun=false
307307

308308
// Login flow.
309-
val authWizard=AuthWizardPage(context,false, ::onConnect)
309+
val authWizard=AuthWizardPage(context,settingsPage,false, ::onConnect)
310310
// We might have navigated here due to a polling error.
311311
errorBuffer.forEach {
312312
authWizard.notify("Error encountered", it)

‎src/main/kotlin/com/coder/toolbox/views/AuthWizardPage.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ import kotlinx.coroutines.flow.update
1212

1313
classAuthWizardPage(
1414
privatevalcontext:CoderToolboxContext,
15+
privatevalsettingsPage:CoderSettingsPage,
1516
initialAutoLogin:Boolean =false,
1617
onConnect: (
1718
client:CoderRestClient,
1819
cli:CoderCLIManager,
1920
)->Unit,
20-
) : CoderPage(context, context.i18n.ptrl("Authenticate toCoder")) {
21+
) : CoderPage(context, context.i18n.ptrl("Authenticate toCoder"),false) {
2122
privateval shouldAutoLogin=MutableStateFlow(initialAutoLogin)
22-
23+
privateval settingsAction=Action(context.i18n.ptrl("Settings"), actionBlock= {
24+
context.ui.showUiPage(settingsPage)
25+
})
2326
privateval signInStep=SignInStep(context,this::notify)
2427
privateval tokenStep=TokenStep(context)
2528
privateval connectStep=ConnectStep(context, shouldAutoLogin,this::notify,this::displaySteps, onConnect)
@@ -47,7 +50,8 @@ class AuthWizardPage(
4750
if (signInStep.onNext()) {
4851
displaySteps()
4952
}
50-
})
53+
}),
54+
settingsAction
5155
)
5256
}
5357
signInStep.onVisible()
@@ -64,6 +68,7 @@ class AuthWizardPage(
6468
displaySteps()
6569
}
6670
}),
71+
settingsAction,
6772
Action(context.i18n.ptrl("Back"), closesPage=false, actionBlock= {
6873
tokenStep.onBack()
6974
displaySteps()
@@ -79,6 +84,7 @@ class AuthWizardPage(
7984
}
8085
actionButtons.update {
8186
listOf(
87+
settingsAction,
8288
Action(context.i18n.ptrl("Back"), closesPage=false, actionBlock= {
8389
connectStep.onBack()
8490
shouldAutoLogin.update {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp