improve path processing
This commit is contained in:
@@ -295,7 +295,7 @@ const SidePanel: FC = observer(() => {
|
||||
OpenSaveFileDialog('*.txt', 'conversation.txt', savedContent).then((path) => {
|
||||
if (path)
|
||||
toastWithButton(t('Conversation Saved'), t('Open'), () => {
|
||||
OpenFileFolder(path, false);
|
||||
OpenFileFolder(path);
|
||||
});
|
||||
}).catch(e => {
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
|
||||
@@ -426,7 +426,7 @@ const CompositionPanel: FC = observer(() => {
|
||||
OpenSaveFileDialog('*.txt', 'abc-music.txt', commonStore.compositionParams.prompt).then((path) => {
|
||||
if (path)
|
||||
toastWithButton(t('File Saved'), t('Open'), () => {
|
||||
OpenFileFolder(path, false);
|
||||
OpenFileFolder(path);
|
||||
});
|
||||
}).catch((e) => {
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
@@ -437,7 +437,7 @@ const CompositionPanel: FC = observer(() => {
|
||||
OpenSaveFileDialogBytes('*.mid', 'music.mid', Array.from(new Uint8Array(params.midi))).then((path) => {
|
||||
if (path)
|
||||
toastWithButton(t('File Saved'), t('Open'), () => {
|
||||
OpenFileFolder(path, false);
|
||||
OpenFileFolder(path);
|
||||
});
|
||||
}).catch((e) => {
|
||||
toast(t('Error') + ' - ' + (e.message || e), { type: 'error', autoClose: 2500 });
|
||||
|
||||
@@ -67,7 +67,7 @@ const Downloads: FC = observer(() => {
|
||||
AddToDownloadList(status.path, status.url);
|
||||
}} />}
|
||||
<ToolTipButton desc={t('Open Folder')} icon={<Folder20Regular />} onClick={() => {
|
||||
OpenFileFolder(status.path, false);
|
||||
OpenFileFolder(status.path);
|
||||
}} />
|
||||
</div>
|
||||
</Field>
|
||||
|
||||
@@ -132,7 +132,7 @@ const columns: TableColumnDefinition<ModelSourceItem>[] = [
|
||||
{
|
||||
item.isComplete &&
|
||||
<ToolTipButton desc={t('Open Folder')} icon={<Folder20Regular />} onClick={() => {
|
||||
OpenFileFolder(`${commonStore.settings.customModelsPath}/${item.name}`, true);
|
||||
OpenFileFolder(`${commonStore.settings.customModelsPath}/${item.name}`);
|
||||
}} />
|
||||
}
|
||||
{item.downloadUrl && !item.isComplete &&
|
||||
|
||||
@@ -398,7 +398,7 @@ const LoraFinetune: FC = observer(() => {
|
||||
'Even for multi-turn conversations, they must be written in a single line using `\\n` to indicate line breaks. ' +
|
||||
'If they are different dialogues or topics, they should be written in separate lines.')} />
|
||||
<ToolTipButton desc={t('Open Folder')} icon={<Folder20Regular />} onClick={() => {
|
||||
OpenFileFolder(dataParams.dataPath, false);
|
||||
OpenFileFolder(dataParams.dataPath);
|
||||
}} />
|
||||
</div>
|
||||
<div className="flex gap-2 items-center">
|
||||
|
||||
4
frontend/wailsjs/go/backend_golang/App.d.ts
generated
vendored
4
frontend/wailsjs/go/backend_golang/App.d.ts
generated
vendored
@@ -28,6 +28,8 @@ export function DownloadFile(arg1:string,arg2:string):Promise<void>;
|
||||
|
||||
export function FileExists(arg1:string):Promise<boolean>;
|
||||
|
||||
export function GetAbsPath(arg1:string):Promise<string>;
|
||||
|
||||
export function GetPlatform():Promise<string>;
|
||||
|
||||
export function GetPyError():Promise<string>;
|
||||
@@ -40,7 +42,7 @@ export function ListDirFiles(arg1:string):Promise<Array<backend_golang.FileInfo>
|
||||
|
||||
export function MergeLora(arg1:string,arg2:boolean,arg3:number,arg4:string,arg5:string,arg6:string):Promise<string>;
|
||||
|
||||
export function OpenFileFolder(arg1:string,arg2:boolean):Promise<void>;
|
||||
export function OpenFileFolder(arg1:string):Promise<void>;
|
||||
|
||||
export function OpenMidiPort(arg1:number):Promise<void>;
|
||||
|
||||
|
||||
8
frontend/wailsjs/go/backend_golang/App.js
generated
8
frontend/wailsjs/go/backend_golang/App.js
generated
@@ -54,6 +54,10 @@ export function FileExists(arg1) {
|
||||
return window['go']['backend_golang']['App']['FileExists'](arg1);
|
||||
}
|
||||
|
||||
export function GetAbsPath(arg1) {
|
||||
return window['go']['backend_golang']['App']['GetAbsPath'](arg1);
|
||||
}
|
||||
|
||||
export function GetPlatform() {
|
||||
return window['go']['backend_golang']['App']['GetPlatform']();
|
||||
}
|
||||
@@ -78,8 +82,8 @@ export function MergeLora(arg1, arg2, arg3, arg4, arg5, arg6) {
|
||||
return window['go']['backend_golang']['App']['MergeLora'](arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
|
||||
export function OpenFileFolder(arg1, arg2) {
|
||||
return window['go']['backend_golang']['App']['OpenFileFolder'](arg1, arg2);
|
||||
export function OpenFileFolder(arg1) {
|
||||
return window['go']['backend_golang']['App']['OpenFileFolder'](arg1);
|
||||
}
|
||||
|
||||
export function OpenMidiPort(arg1) {
|
||||
|
||||
Reference in New Issue
Block a user