1
1
package com.coder.toolbox.views
2
2
3
3
import com.coder.toolbox.CoderToolboxContext
4
+ import com.coder.toolbox.settings.HttpLoggingVerbosity.BASIC
5
+ import com.coder.toolbox.settings.HttpLoggingVerbosity.BODY
6
+ import com.coder.toolbox.settings.HttpLoggingVerbosity.HEADERS
7
+ import com.coder.toolbox.settings.HttpLoggingVerbosity.NONE
4
8
import com.jetbrains.toolbox.api.ui.actions.RunnableActionDescription
5
9
import com.jetbrains.toolbox.api.ui.components.CheckboxField
10
+ import com.jetbrains.toolbox.api.ui.components.ComboBoxField
11
+ import com.jetbrains.toolbox.api.ui.components.ComboBoxField.LabelledValue
6
12
import com.jetbrains.toolbox.api.ui.components.TextField
7
13
import com.jetbrains.toolbox.api.ui.components.TextType
8
14
import com.jetbrains.toolbox.api.ui.components.UiField
@@ -44,6 +50,18 @@ class CoderSettingsPage(private val context: CoderToolboxContext, triggerSshConf
44
50
settings.fallbackOnCoderForSignatures.isAllowed(),
45
51
context.i18n.ptrl(" Verify binary signature using releases.coder.com when CLI signatures are not available from the deployment" )
46
52
)
53
+
54
+ private val httpLoggingField = ComboBoxField (
55
+ ComboBoxField .Label (context.i18n.ptrl(" HTTP logging level:" )),
56
+ settings.httpClientLogLevel,
57
+ listOf (
58
+ LabelledValue (context.i18n.ptrl(" None" ), NONE , listOf (" " to " No logs" )),
59
+ LabelledValue (context.i18n.ptrl(" Basic" ), BASIC , listOf (" " to " Method, URL and status" )),
60
+ LabelledValue (context.i18n.ptrl(" Header" ), HEADERS , listOf (" " to " Basic + sanitized headers" )),
61
+ LabelledValue (context.i18n.ptrl(" Body" ), BODY , listOf (" " to " Headers + body content" )),
62
+ )
63
+ )
64
+
47
65
private val enableBinaryDirectoryFallbackField =
48
66
CheckboxField (
49
67
settings.enableBinaryDirectoryFallback,
@@ -80,6 +98,7 @@ class CoderSettingsPage(private val context: CoderToolboxContext, triggerSshConf
80
98
enableBinaryDirectoryFallbackField,
81
99
disableSignatureVerificationField,
82
100
signatureFallbackStrategyField,
101
+ httpLoggingField,
83
102
dataDirectoryField,
84
103
headerCommandField,
85
104
tlsCertPathField,
@@ -103,6 +122,7 @@ class CoderSettingsPage(private val context: CoderToolboxContext, triggerSshConf
103
122
context.settingsStore.updateEnableDownloads(enableDownloadsField.checkedState.value)
104
123
context.settingsStore.updateDisableSignatureVerification(disableSignatureVerificationField.checkedState.value)
105
124
context.settingsStore.updateSignatureFallbackStrategy(signatureFallbackStrategyField.checkedState.value)
125
+ context.settingsStore.updateHttpClientLogLevel(httpLoggingField.selectedValueState.value)
106
126
context.settingsStore.updateBinaryDirectoryFallback(enableBinaryDirectoryFallbackField.checkedState.value)
107
127
context.settingsStore.updateHeaderCommand(headerCommandField.contentState.value)
108
128
context.settingsStore.updateCertPath(tlsCertPathField.contentState.value)
0 commit comments