diff --git a/backend-golang/file.go b/backend-golang/file.go index 05c5552..18858d1 100644 --- a/backend-golang/file.go +++ b/backend-golang/file.go @@ -119,8 +119,14 @@ func (a *App) CopyFile(src string, dst string) error { return nil } -func (a *App) OpenFileFolder(path string) error { - absPath, err := filepath.Abs(a.exDir + path) +func (a *App) OpenFileFolder(path string, relative bool) error { + var absPath string + var err error + if relative { + absPath, err = filepath.Abs(a.exDir + path) + } else { + absPath, err = filepath.Abs(path) + } if err != nil { return err } diff --git a/frontend/src/pages/Downloads.tsx b/frontend/src/pages/Downloads.tsx index 624f2c7..3021a01 100644 --- a/frontend/src/pages/Downloads.tsx +++ b/frontend/src/pages/Downloads.tsx @@ -62,7 +62,7 @@ export const Downloads: FC = observer(() => { ContinueDownload(status.url); }} />} } onClick={() => { - OpenFileFolder(`${commonStore.settings.customModelsPath}/${status.name}`); + OpenFileFolder(status.path, false); }} /> diff --git a/frontend/src/pages/Models.tsx b/frontend/src/pages/Models.tsx index d094570..f9d3856 100644 --- a/frontend/src/pages/Models.tsx +++ b/frontend/src/pages/Models.tsx @@ -142,7 +142,7 @@ const columns: TableColumnDefinition[] = [ { item.isLocal && } onClick={() => { - OpenFileFolder(`${commonStore.settings.customModelsPath}/${item.name}`); + OpenFileFolder(`${commonStore.settings.customModelsPath}/${item.name}`, true); }} /> } {item.downloadUrl && !item.isLocal && diff --git a/frontend/wailsjs/go/backend_golang/App.d.ts b/frontend/wailsjs/go/backend_golang/App.d.ts index f90a5f5..84dc7a1 100755 --- a/frontend/wailsjs/go/backend_golang/App.d.ts +++ b/frontend/wailsjs/go/backend_golang/App.d.ts @@ -24,7 +24,7 @@ export function InstallPyDep(arg1:string,arg2:boolean):Promise; export function ListDirFiles(arg1:string):Promise>; -export function OpenFileFolder(arg1:string):Promise; +export function OpenFileFolder(arg1:string,arg2:boolean):Promise; export function PauseDownload(arg1:string):Promise; diff --git a/frontend/wailsjs/go/backend_golang/App.js b/frontend/wailsjs/go/backend_golang/App.js index 5b7bc5f..178c882 100755 --- a/frontend/wailsjs/go/backend_golang/App.js +++ b/frontend/wailsjs/go/backend_golang/App.js @@ -46,8 +46,8 @@ export function ListDirFiles(arg1) { return window['go']['backend_golang']['App']['ListDirFiles'](arg1); } -export function OpenFileFolder(arg1) { - return window['go']['backend_golang']['App']['OpenFileFolder'](arg1); +export function OpenFileFolder(arg1, arg2) { + return window['go']['backend_golang']['App']['OpenFileFolder'](arg1, arg2); } export function PauseDownload(arg1) {