diff --git a/DAMON.md b/DAMON.md index 7608a6d9..9b4a0dbb 100644 --- a/DAMON.md +++ b/DAMON.md @@ -2,18 +2,29 @@ - sofascore grapper - COM.NUH.GRAPPER + Sofascore Grapper + com.sofascore.grapper ProgramArguments /Users/hermanntelser/Sites/nuhodds_fi4/setup.sh 13 StartCalendarInterval - Hour - 02 - Minute - 15 + Hour + 2 + Minute + 30 - \ No newline at end of file + + +1) Sicher an diesem Ort: +Für einen bestimmten Benutzer: ~/Library/LaunchAgents/ +Für alle Benutzer (Systemweit): /Library/LaunchAgents/ +Für das gesamte Betriebssystem: /Library/LaunchDaemons/ + +2) Die Datei: Speichern Sie den Code oben in einer +.plist-Datei (z.B. com.beispiel.skript.plist). + +3) Aktivieren: Laden Sie den Prozess im Terminal mit dem Befehl: +launchctl load ~/Library/LaunchAgents/com.beispiel.skript.plist \ No newline at end of file diff --git a/app/Filament/Clusters/Grapper/Resources/Supervisors/Tables/SupervisorsTable.php b/app/Filament/Clusters/Grapper/Resources/Supervisors/Tables/SupervisorsTable.php index a6596724..20b02320 100644 --- a/app/Filament/Clusters/Grapper/Resources/Supervisors/Tables/SupervisorsTable.php +++ b/app/Filament/Clusters/Grapper/Resources/Supervisors/Tables/SupervisorsTable.php @@ -172,8 +172,9 @@ class SupervisorsTable ->allowOptionsHtml() ->native(false) ->options([ - '0' => 'Cronjob', - '1' => 'Supervisor', + '0' => 'Cronjob', + '1' => 'Supervisor', + '2' => 'LaunchAgents', ]), ToggleColumn::make('is_active')->label('Active')->tooltip(('On/Off'))->onColor('success')->offColor('danger'), TextColumn::make('runtime')->badge()->prefix('Runtime: '), @@ -190,6 +191,7 @@ class SupervisorsTable TernaryFilter::make('is_active'), ], layout: FiltersLayout::AboveContent) ->deferFilters(false) + ->persistFiltersInSession() ->recordActions([ EditAction::make()->hiddenLabel(), DeleteAction::make()->hiddenLabel(), diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/CreateSofaScoreTask.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/CreateSofaScoreTask.php new file mode 100644 index 00000000..28041305 --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/CreateSofaScoreTask.php @@ -0,0 +1,11 @@ +label('New Task') + ->icon('phosphor-plus') + ->createAnother(false), + ]; + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php new file mode 100644 index 00000000..84a25d0b --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php @@ -0,0 +1,41 @@ +columns(1) + ->components([ + Select::make('sport_id') + ->default(1) + ->selectablePlaceholder(false) + ->label('Sport') + ->options(Sport::where('is_active', 1)->pluck('name', 'id')), + Select::make('mode') + ->live() + ->native() + ->allowHtml() + ->required() + ->options([ + 'yesterday' => 'Every yesterday', + 'date' => 'Grap a date', + 'range' => 'Grap a date range', + ]), + DatePicker::make('day_from') + ->native() + ->visible(fn (Get $get): bool => in_array($get('mode'), ['date', 'range'])), + DatePicker::make('day_to') + ->native() + ->visible(fn (Get $get): bool => $get('mode') === 'range'), + ]); + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/SofaScoreTaskResource.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/SofaScoreTaskResource.php new file mode 100644 index 00000000..64aeb285 --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/SofaScoreTaskResource.php @@ -0,0 +1,57 @@ +count(); + } + + public static function getPages(): array + { + return [ + 'index' => ListSofaScoreTasks::route('/'), + ]; + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php new file mode 100644 index 00000000..121de300 --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php @@ -0,0 +1,48 @@ +columns([ + IconColumn::make('sport.icon') + ->label('') + ->grow(false) + ->width(30) + ->icon(fn ($record) => $record->sport->icon), + TextColumn::make('sport.name'), + TextColumn::make('mode') + ->label('Grapping dates') + ->badge() + ->color(fn ($state): string => match ($state) { + 'yesterday' => 'warning', + 'date' => 'primary', + 'range' => 'success', + }) + ->formatStateUsing(fn (string $state, $record): string => match ($state) { + 'yesterday' => 'Every yesterday', + 'date' => $record->day_from->format('Y-m-d'), + 'range' => $record->day_from.' - '.$record->day_to, + }), + ToggleColumn::make('is_active')->alignCenter(), + ToggleColumn::make('run_slow')->alignCenter(), + ToggleColumn::make('run_repeatedly')->alignCenter(), + ToggleColumn::make('compleated')->alignCenter(), + ]) + ->filters([ + // + ]) + ->recordActions([ + EditAction::make(), + ]); + } +} diff --git a/app/Models/SofaScoreTask.php b/app/Models/SofaScoreTask.php new file mode 100644 index 00000000..ac70e3f6 --- /dev/null +++ b/app/Models/SofaScoreTask.php @@ -0,0 +1,27 @@ +belongsTo(Sport::class); + } +} diff --git a/composer.lock b/composer.lock index f5fbcb6f..6f3429ce 100644 --- a/composer.lock +++ b/composer.lock @@ -396,16 +396,16 @@ }, { "name": "blade-ui-kit/blade-icons", - "version": "1.10.0", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/driesvints/blade-icons.git", - "reference": "74189a80bbaa4966aebaee54fec3a3c2ef0a5f3a" + "reference": "6e072d021ea6249986c330b93293c33d0c4f0e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/driesvints/blade-icons/zipball/74189a80bbaa4966aebaee54fec3a3c2ef0a5f3a", - "reference": "74189a80bbaa4966aebaee54fec3a3c2ef0a5f3a", + "url": "https://api.github.com/repos/driesvints/blade-icons/zipball/6e072d021ea6249986c330b93293c33d0c4f0e34", + "reference": "6e072d021ea6249986c330b93293c33d0c4f0e34", "shasum": "" }, "require": { @@ -473,7 +473,7 @@ "type": "paypal" } ], - "time": "2026-04-23T19:03:45+00:00" + "time": "2026-06-30T09:44:12+00:00" }, { "name": "brick/math", @@ -2196,16 +2196,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.12.3", + "version": "7.13.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "9aa17bcdd777ee31df9fc83c337ca4ca2340def3" + "reference": "55901a76dfd2006a0cc012b9e3c5b487f796478d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/9aa17bcdd777ee31df9fc83c337ca4ca2340def3", - "reference": "9aa17bcdd777ee31df9fc83c337ca4ca2340def3", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/55901a76dfd2006a0cc012b9e3c5b487f796478d", + "reference": "55901a76dfd2006a0cc012b9e3c5b487f796478d", "shasum": "" }, "require": { @@ -2224,7 +2224,7 @@ "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", "guzzle/client-integration-tests": "3.0.2", - "guzzlehttp/test-server": "^0.5.1", + "guzzlehttp/test-server": "^0.6", "php-http/message-factory": "^1.1", "phpunit/phpunit": "^8.5.52 || ^9.6.34", "psr/log": "^1.1 || ^2.0 || ^3.0" @@ -2304,7 +2304,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.12.3" + "source": "https://github.com/guzzle/guzzle/tree/7.13.1" }, "funding": [ { @@ -2320,7 +2320,7 @@ "type": "tidelift" } ], - "time": "2026-06-23T15:29:02+00:00" + "time": "2026-06-29T20:14:18+00:00" }, { "name": "guzzlehttp/promises", @@ -4457,24 +4457,24 @@ }, { "name": "mongodb/mongodb", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", - "url": "https://github.com/mongodb/mongo-php-library.git", - "reference": "bbb13f969e37e047fd822527543df55fdc1c9298" + "url": "https://github.com/mongodb/mongo-php-library", + "reference": "12e56461166d915e3dd8e4969ad0940ed5207d88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/bbb13f969e37e047fd822527543df55fdc1c9298", - "reference": "bbb13f969e37e047fd822527543df55fdc1c9298", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/12e56461166d915e3dd8e4969ad0940ed5207d88", + "reference": "12e56461166d915e3dd8e4969ad0940ed5207d88", "shasum": "" }, "require": { "composer-runtime-api": "^2.0", - "ext-mongodb": "^2.2", + "ext-mongodb": "^2.3", "php": "^8.1", "psr/log": "^1.1.4|^2|^3", - "symfony/polyfill-php85": "^1.32" + "symfony/polyfill-php85": "^1.33" }, "replace": { "mongodb/builder": "*" @@ -4526,11 +4526,7 @@ "mongodb", "persistence" ], - "support": { - "issues": "https://github.com/mongodb/mongo-php-library/issues", - "source": "https://github.com/mongodb/mongo-php-library/tree/2.2.0" - }, - "time": "2026-02-11T11:39:56+00:00" + "time": "2026-04-28T12:50:06+00:00" }, { "name": "monolog/monolog", @@ -5957,16 +5953,16 @@ }, { "name": "psy/psysh", - "version": "v0.12.23", + "version": "v0.12.24", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "4dcc0f08047d52bbde475eda481146fd8e27e1a4" + "reference": "ca0fdcf8a7617afa3adfdf1b5fef573dffb69ca1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/4dcc0f08047d52bbde475eda481146fd8e27e1a4", - "reference": "4dcc0f08047d52bbde475eda481146fd8e27e1a4", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/ca0fdcf8a7617afa3adfdf1b5fef573dffb69ca1", + "reference": "ca0fdcf8a7617afa3adfdf1b5fef573dffb69ca1", "shasum": "" }, "require": { @@ -6030,9 +6026,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.12.23" + "source": "https://github.com/bobthecow/psysh/tree/v0.12.24" }, - "time": "2026-05-23T13:41:31+00:00" + "time": "2026-06-29T15:41:09+00:00" }, { "name": "ralouphie/getallheaders", @@ -8027,6 +8023,90 @@ ], "time": "2026-04-10T16:19:22+00:00" }, + { + "name": "symfony/polyfill-iconv", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-iconv.git", + "reference": "2c5729fd241b4b22f6e4b436bc3354a4f262df57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/2c5729fd241b4b22f6e4b436bc3354a4f262df57", + "reference": "2c5729fd241b4b22f6e4b436bc3354a4f262df57", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-iconv": "*" + }, + "suggest": { + "ext-iconv": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Iconv\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Iconv extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "iconv", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, { "name": "symfony/polyfill-intl-grapheme", "version": "v1.38.1", @@ -11677,11 +11757,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.2.2", + "version": "2.2.3", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5cc34d491a90e79c216d824f60fe21fd4d93bd6", - "reference": "e5cc34d491a90e79c216d824f60fe21fd4d93bd6", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/4048833dd47b377287818841877fb3087289509c", + "reference": "4048833dd47b377287818841877fb3087289509c", "shasum": "" }, "require": { @@ -11737,7 +11817,7 @@ "type": "github" } ], - "time": "2026-06-05T09:00:01+00:00" + "time": "2026-06-30T21:15:26+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/database/migrations/2026_07_01_062922_create_sofa_score_tasks_table.php b/database/migrations/2026_07_01_062922_create_sofa_score_tasks_table.php new file mode 100644 index 00000000..ec5bb970 --- /dev/null +++ b/database/migrations/2026_07_01_062922_create_sofa_score_tasks_table.php @@ -0,0 +1,38 @@ +id(); + $table->string('name'); + $table->string('mode'); + $table->integer('sport_id')->index()->references('id')->on('sports'); + $table->date('day_from')->nullable(); + $table->date('day_to')->nullable(); + $table->boolean('is_active')->default(0); + $table->boolean('compleated')->default(0); + $table->boolean('run_repeatedly')->default(0); + $table->boolean('run_slow')->default(0); + $table->dateTime('last_start')->nullable(); + $table->dateTime('last_end')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('sofa_score_tasks'); + } +}; diff --git a/setup.sh b/setup.sh index 0504b48a..dfdf95bb 100755 --- a/setup.sh +++ b/setup.sh @@ -152,23 +152,23 @@ case "$1" in "13") ## AUTO GRAPPER SOFASCORE # -i ~/.ssh/id_rsa - echo "\n⚽ close all open vpn" - killall ssh + # echo "\n⚽ close all open vpn" + # killall ssh - echo "\n⚽ open vpn tunnel to prod" - ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190 + # echo "\n⚽ open vpn tunnel to prod" + # ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190 - echo "\n⚽ copy active tournaments" - php artisan nuh --d --f 73 --prc=2 + # echo "\n⚽ copy active tournaments" + # php artisan nuh --d --f 73 --prc=2 - echo "\n⚽ close tunnel" - killall ssh + # echo "\n⚽ close tunnel" + # killall ssh - echo "\n⚽ grapp data sofascore" - php artisan nuh --d --f --y 72 + # echo "\n⚽ grapp data sofascore" + # php artisan nuh --d --f --y 72 - echo "\n⚽ create zip archive" - php artisan nuh --d --f --y 73 --prc=3 + # echo "\n⚽ create zip archive" + # php artisan nuh --d --f --y 73 --prc=3 echo "\n⚽ mail archive" php artisan nuh --d --f --y 73 --prc=4 diff --git a/storage/zip_sofascore_data/2026-06-30.zip b/storage/zip_sofascore_data/2026-06-30.zip new file mode 100644 index 00000000..75d804c9 Binary files /dev/null and b/storage/zip_sofascore_data/2026-06-30.zip differ