From f14ef27b9327447d494f12c7f7a4aeaeb90d5c60 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: Sun, 9 Mar 2025 16:00:29 +0500 Subject: [PATCH] v1.0.1 ai --- app.go | 31 +++++++-- frontend/package-lock.json | 9 +-- frontend/package.json.md5 | 2 +- frontend/src/App.svelte | 7 +- frontend/wailsjs/go/main/App.d.ts | 3 + frontend/wailsjs/go/main/App.js | 4 ++ frontend/wailsjs/go/models.ts | 42 ++++++++++++ frontend/wailsjs/runtime/runtime.d.ts | 16 ++++- frontend/wailsjs/runtime/runtime.js | 36 ++++++++++ go.mod | 37 +++++----- go.sum | 97 +++++++++++---------------- last-projects.go | 91 +++++++++++++++++++++++++ main.go | 2 +- 13 files changed, 288 insertions(+), 89 deletions(-) create mode 100644 frontend/wailsjs/go/models.ts create mode 100644 last-projects.go diff --git a/app.go b/app.go index e5ad2c4..1723e20 100644 --- a/app.go +++ b/app.go @@ -6,6 +6,8 @@ import ( "fmt" "io/fs" "os" + //"path/filepath" + //"time" "github.com/estebangarcia21/subprocess" "github.com/wailsapp/wails/v2/pkg/runtime" @@ -27,21 +29,38 @@ func (s *Server) Start() { p.ExecAsync() } +// WindowConfig хранит настройки окна +type WindowConfig struct { + Width int `json:"width"` + Height int `json:"height"` + X int `json:"x"` + Y int `json:"y"` +} + // App struct type App struct { - ctx context.Context + ctx context.Context + windowConfig WindowConfig } -// NewApp creates a new App application struct +// NewApp создает новый экземпляр App func NewApp() *App { - return &App{} + app := &App{} + + return app } -// startup is called when the app starts. The context is saved -// so we can call the runtime methods +// startup вызывается при запуске приложения func (a *App) startup(ctx context.Context) { a.ctx = ctx - // runtime.WindowFullscreen(ctx) + runtime.WindowSetTitle(ctx, "v1.0.1") +} + +// GetProjects возвращает список последних проектов +func (a *App) GetProjects() []Project { + projects := getLastProjects() + runtime.LogInfo(a.ctx, fmt.Sprintf("projects: %v", projects)) + return projects } // Greet returns a greeting for the given name diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 6301eea..17b17dd 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -355,9 +355,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001594", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001594.tgz", - "integrity": "sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==", + "version": "1.0.30001702", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001702.tgz", + "integrity": "sha512-LoPe/D7zioC0REI5W73PeR1e1MLCipRGq/VkovJnd6Df+QVqT+vT33OXCp8QUd7kA7RZrHWxb1B36OQKI/0gOA==", "dev": true, "funding": [ { @@ -372,7 +372,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chokidar": { "version": "3.6.0", diff --git a/frontend/package.json.md5 b/frontend/package.json.md5 index 5d158a0..3377026 100644 --- a/frontend/package.json.md5 +++ b/frontend/package.json.md5 @@ -1 +1 @@ -93e100045c0f29abcefaf0f3cb364fab \ No newline at end of file +a3ccbd9bcbf01972693bbf2fa1f451d6 \ No newline at end of file diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 56ab17d..b655f80 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -1,6 +1,6 @@