Skip to content

Commit 129a0f5

Browse files
committed
impl: allow network info dir to be configurable
This patch provides UI support for the network inf dir where ssh metrics will be saved. Users can configure the default location for this place.
1 parent b96a188 commit 129a0f5

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

src/main/kotlin/com/coder/toolbox/store/CoderSettingsStore.kt

+4
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ class CoderSettingsStore(
237237
store[SSH_LOG_DIR] = path
238238
}
239239

240+
fun updateNetworkInfoDir(path: String) {
241+
store[NETWORK_INFO_DIR] = path
242+
}
243+
240244
fun updateSshConfigOptions(options: String) {
241245
store[SSH_CONFIG_OPTIONS] = options
242246
}

src/main/kotlin/com/coder/toolbox/views/CoderSettingsPage.kt

+4
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ class CoderSettingsPage(context: CoderToolboxContext, triggerSshConfig: Channel<
5656
TextField(context.i18n.ptrl("Extra SSH options"), settings.sshConfigOptions ?: "", TextType.General)
5757
private val sshLogDirField =
5858
TextField(context.i18n.ptrl("SSH proxy log directory"), settings.sshLogDirectory ?: "", TextType.General)
59+
private val networkInfoDirField =
60+
TextField(context.i18n.ptrl("SSH network metrics directory"), settings.networkInfoDir, TextType.General)
5961

6062

6163
override val fields: StateFlow<List<UiField>> = MutableStateFlow(
@@ -73,6 +75,7 @@ class CoderSettingsPage(context: CoderToolboxContext, triggerSshConfig: Channel<
7375
disableAutostartField,
7476
enableSshWildCardConfig,
7577
sshLogDirField,
78+
networkInfoDirField,
7679
sshExtraArgs,
7780
)
7881
)
@@ -104,6 +107,7 @@ class CoderSettingsPage(context: CoderToolboxContext, triggerSshConfig: Channel<
104107
}
105108
}
106109
context.settingsStore.updateSshLogDir(sshLogDirField.textState.value)
110+
context.settingsStore.updateNetworkInfoDir(networkInfoDirField.textState.value)
107111
context.settingsStore.updateSshConfigOptions(sshExtraArgs.textState.value)
108112
}
109113
)

src/main/resources/localization/defaultMessages.po

+3
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,7 @@ msgid "Extra SSH options"
128128
msgstr ""
129129

130130
msgid "SSH proxy log directory"
131+
msgstr ""
132+
133+
msgid "SSH network metrics directory"
131134
msgstr ""

0 commit comments

Comments
 (0)