From 54439a870e45d358dc778a9ed5a8c20984bba10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=A2?= =?UTF-8?q?=D1=83=D1=85=D1=82=D0=B0=D1=80=D0=BE=D0=B2?= Date: Mon, 10 Mar 2025 08:22:01 +0500 Subject: [PATCH] v1.0.2 --- app.go | 19 ++- frontend/src/App.svelte | 207 +++++++++++++++++------------- frontend/wailsjs/go/main/App.d.ts | 2 + frontend/wailsjs/go/main/App.js | 4 + main.go | 2 +- 5 files changed, 140 insertions(+), 94 deletions(-) diff --git a/app.go b/app.go index 1723e20..83b71d9 100644 --- a/app.go +++ b/app.go @@ -6,6 +6,7 @@ import ( "fmt" "io/fs" "os" + //"path/filepath" //"time" @@ -53,7 +54,8 @@ func NewApp() *App { // startup вызывается при запуске приложения func (a *App) startup(ctx context.Context) { a.ctx = ctx - runtime.WindowSetTitle(ctx, "v1.0.1") + runtime.WindowSetTitle(ctx, "v1.0.2") + runtime.WindowSetPosition(ctx, 1500, 80) } // GetProjects возвращает список последних проектов @@ -92,6 +94,19 @@ func (a *App) StartServer(s string) string { return "starting server" } +// StartServer - запускает сервер на выполнение +func (a *App) StartFar(s string) string { + runtime.LogInfo(a.ctx, s) + cmd := fmt.Sprintf("far \"%s\" \"%s\"", s, s) + far := subprocess.New(cmd) + err := far.Exec() + if err != nil { + runtime.LogError(a.ctx, err.Error()) + } + runtime.LogInfo(a.ctx, fmt.Sprintf("команда выполнена успешно")) + return "ok" +} + func (a *App) Weed() { os.Chdir("d:\\projects\\nano\\sw4-nano\\util") //s := subprocess.New(".\\"+name+".exe") @@ -101,7 +116,7 @@ func (a *App) Weed() { if err != nil { runtime.LogError(a.ctx, err.Error()) } - runtime.LogInfo(a.ctx, fmt.Sprintf("команда выполнена успешно")) + runtime.LogInfo(a.ctx, "команда выполнена успешно") } func getCountPics(dir string) int { diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index b655f80..39162b5 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -1,52 +1,58 @@ @@ -69,53 +75,72 @@ {/each} + + +
+ +
+

УТИЛИТЫ

+
+
+
+ + +
+ + {cnt_pic} + +
+
+
+
-
- -
-

УТИЛИТЫ

-
-
-
- - -
- - {cnt_pic} - -
-
-
+
+ +
+

ПРОЕКТЫ

+ {#each projects as project} +
+ + +
+ {project.name} +
+ {/each} +
- - - -
+ + diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts index e5c9337..468a314 100644 --- a/frontend/wailsjs/go/main/App.d.ts +++ b/frontend/wailsjs/go/main/App.d.ts @@ -8,6 +8,8 @@ export function GetStatus():Promise; export function Greet(arg1:string):Promise; +export function StartFar(arg1:string):Promise; + export function StartServer(arg1:string):Promise; export function Weed():Promise; diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js index 7816e82..9869d7e 100644 --- a/frontend/wailsjs/go/main/App.js +++ b/frontend/wailsjs/go/main/App.js @@ -14,6 +14,10 @@ export function Greet(arg1) { return window['go']['main']['App']['Greet'](arg1); } +export function StartFar(arg1) { + return window['go']['main']['App']['StartFar'](arg1); +} + export function StartServer(arg1) { return window['go']['main']['App']['StartServer'](arg1); } diff --git a/main.go b/main.go index 96827e3..d94d8d9 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ func main() { err := wails.Run(&options.App{ Title: "server", Width: 300, - Height: 918, + Height: 800, MinWidth: 200, MinHeight: 400, // Frameless: true,