mirror of
https://github.com/tiny-craft/tiny-rdm.git
synced 2025-11-02 11:24:06 +08:00
feat: support import keys from csv file
This commit is contained in:
@@ -44,10 +44,16 @@ func (s *systemService) Start(ctx context.Context) {
|
||||
}
|
||||
|
||||
// SelectFile open file dialog to select a file
|
||||
func (s *systemService) SelectFile(title string) (resp types.JSResp) {
|
||||
func (s *systemService) SelectFile(title string, extensions []string) (resp types.JSResp) {
|
||||
filters := sliceutil.Map(extensions, func(i int) runtime.FileFilter {
|
||||
return runtime.FileFilter{
|
||||
Pattern: "*." + extensions[i],
|
||||
}
|
||||
})
|
||||
filepath, err := runtime.OpenFileDialog(s.ctx, runtime.OpenDialogOptions{
|
||||
Title: title,
|
||||
ShowHiddenFiles: true,
|
||||
Filters: filters,
|
||||
})
|
||||
if err != nil {
|
||||
resp.Msg = err.Error()
|
||||
|
||||
Reference in New Issue
Block a user