feat: hide NFS option on Windows and refactor NFS implementation for build tagging
Build and Upload Binaries / build-and-upload (push) Successful in 1m1s
Build and Upload Binaries / build-and-upload (push) Successful in 1m1s
This commit is contained in:
@@ -16,6 +16,14 @@ function uuidv4() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
|
if (window.runtime && window.runtime.Environment) {
|
||||||
|
const env = await window.runtime.Environment();
|
||||||
|
if (env.platform === 'windows') {
|
||||||
|
const nfsOpt = document.querySelector('#conn-protocol option[value="nfs"]');
|
||||||
|
if (nfsOpt) nfsOpt.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await loadConnections();
|
await loadConnections();
|
||||||
await loadDirectory(currentConn, currentPath);
|
await loadDirectory(currentConn, currentPath);
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
//go:build !windows
|
||||||
|
|
||||||
package nfs
|
package nfs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
//go:build windows
|
||||||
|
|
||||||
|
package nfs
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
|
||||||
|
"goexplore/internal/config"
|
||||||
|
"goexplore/internal/explorer"
|
||||||
|
)
|
||||||
|
|
||||||
|
type NFSExplorer struct{}
|
||||||
|
|
||||||
|
func New(c *config.ConnectionConfig, secret string) (*NFSExplorer, error) {
|
||||||
|
return nil, fmt.Errorf("NFS is not supported on Windows")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *NFSExplorer) Connect() error { return nil }
|
||||||
|
func (e *NFSExplorer) Disconnect() error { return nil }
|
||||||
|
func (e *NFSExplorer) ListDir(path string) ([]explorer.FileEntry, error) { return nil, nil }
|
||||||
|
func (e *NFSExplorer) Stat(path string) (explorer.FileEntry, error) { return explorer.FileEntry{}, nil }
|
||||||
|
func (e *NFSExplorer) MkDir(path string) error { return nil }
|
||||||
|
func (e *NFSExplorer) Delete(path string) error { return nil }
|
||||||
|
func (e *NFSExplorer) Rename(src, dst string) error { return nil }
|
||||||
|
func (e *NFSExplorer) ReadFile(path string) (io.ReadCloser, error) { return nil, nil }
|
||||||
|
func (e *NFSExplorer) WriteFile(path string, r io.Reader, size int64) error { return nil }
|
||||||
Reference in New Issue
Block a user