37 lines
859 B
Go
37 lines
859 B
Go
|
package database
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
|
||
|
"bunker/client/internal/services/core/options/dto"
|
||
|
|
||
|
"fyne.io/fyne/v2/widget"
|
||
|
)
|
||
|
|
||
|
func (d *database) initializeOptions() error {
|
||
|
databaseMaxIdleConnsEntry := widget.NewEntry()
|
||
|
databaseMaxIdleConns := widget.NewFormItem("Maximum idle connections", databaseMaxIdleConnsEntry)
|
||
|
|
||
|
databaseMaxOpenedConnsEntry := widget.NewEntry()
|
||
|
databaseMaxOpenedConns := widget.NewFormItem("Maximum opened connections", databaseMaxOpenedConnsEntry)
|
||
|
|
||
|
optionsWidgetForm := widget.NewForm(
|
||
|
databaseMaxIdleConns,
|
||
|
databaseMaxOpenedConns,
|
||
|
)
|
||
|
|
||
|
if err := d.options.RegisterOptionsWidget(&dto.OptionPane{
|
||
|
Widget: optionsWidgetForm,
|
||
|
SaveHandler: d.saveOptions,
|
||
|
Name: "Database",
|
||
|
}); err != nil {
|
||
|
return fmt.Errorf("register options widget: %w", err)
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (d *database) saveOptions() error {
|
||
|
return nil
|
||
|
}
|