新增: 文件操作增强与预览扩展
- 文件剪贴板复制剪切粘贴,重名自动副本 - SFTP下载到本机与外部文件拖入,目录递归 - 传输进度浮动面板,transfer-progress事件链 - Drawio预览,Excel工作线程,冻结看门狗 - cmd与bat自写batch语法高亮,psm1等映射补齐
This commit is contained in:
@@ -7,7 +7,9 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/wailsapp/wails/v3/pkg/application"
|
||||
"github.com/wailsapp/wails/v3/pkg/events"
|
||||
"u-desk/internal/hotkey"
|
||||
"u-desk/internal/service"
|
||||
)
|
||||
|
||||
//go:embed all:frontend/dist
|
||||
@@ -21,6 +23,9 @@ var (
|
||||
)
|
||||
|
||||
func main() {
|
||||
// 启动时完成上次更新遗留的 exe 替换
|
||||
service.ReplacePendingFile()
|
||||
|
||||
app := NewApp()
|
||||
|
||||
wailsApp := application.New(application.Options{
|
||||
@@ -74,6 +79,7 @@ func main() {
|
||||
BackgroundColour: application.NewRGB(45, 45, 45),
|
||||
URL: "/",
|
||||
Frameless: true,
|
||||
EnableFileDrop: true,
|
||||
Windows: application.WindowsWindow{
|
||||
Theme: application.SystemDefault,
|
||||
CustomTheme: application.ThemeSettings{
|
||||
@@ -99,6 +105,15 @@ func main() {
|
||||
|
||||
app.SetMainWindow(window)
|
||||
|
||||
// 外部文件拖入窗口(OS 资源管理器拖放):把本地路径转发给前端处理
|
||||
// (本机面板=复制进当前目录,SFTP 面板=上传)
|
||||
window.OnWindowEvent(events.Common.WindowFilesDropped, func(event *application.WindowEvent) {
|
||||
files := event.Context().DroppedFiles()
|
||||
if len(files) > 0 {
|
||||
app.emitEvent("external-file-drop", files)
|
||||
}
|
||||
})
|
||||
|
||||
if err := wailsApp.Run(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user