Compare commits

...
Sign in to create a new pull request.

114 commits

Author SHA1 Message Date
Eric Wang
b095525cf8 Add full env file to release.yml 2024-11-07 21:34:32 -05:00
Eric Wang
e6566cbd54 Update migrations to be agnostic 2024-11-07 21:34:07 -05:00
Eric Wang
ebe6a65c56 Update default environment file 2024-11-07 21:33:46 -05:00
Eric Wang
5496e0ed04 Remove ApiController.php 2024-11-07 19:37:29 -05:00
Eric Wang
258eff794e Remove unnecessary authenticate middleware 2024-11-07 19:26:03 -05:00
Eric Wang
dc6d6cce6b idk 2024-11-06 19:35:42 -05:00
Shift
9bf61c8bbe
Shift cleanup 2024-10-15 00:33:35 +00:00
Shift
19b662e271
Remove CreatesApplication testing trait 2024-10-15 00:33:25 +00:00
Shift
c5eabf6c8f
Mark base controller as abstract 2024-10-15 00:33:25 +00:00
Shift
b1cd122c8f
Convert $casts property to method 2024-10-15 00:33:19 +00:00
Shift
a3fb951a43
Bump Composer dependencies 2024-10-15 00:33:15 +00:00
Shift
713c9c11db
Re-register scheduled commands 2024-10-15 00:33:14 +00:00
Shift
7f3d2dd7f7
Re-register routes 2024-10-15 00:33:13 +00:00
Shift
ca0a90e775
Re-register service providers 2024-10-15 00:33:12 +00:00
Shift
100c62f4f2
Consolidate service providers 2024-10-15 00:33:12 +00:00
Shift
e780f8778e
Re-register HTTP middleware 2024-10-15 00:33:11 +00:00
Shift
0b6715b9d6
Default new bootstrap/app.php 2024-10-15 00:33:11 +00:00
Shift
6be445c7dc
Set new ENV variables 2024-10-15 00:33:10 +00:00
Shift
822bd42748
Streamline config files 2024-10-15 00:33:09 +00:00
Shift
299e52b8da
Shift core files 2024-10-15 00:33:02 +00:00
Shift
0679acd7f3
Remove default app files 2024-10-15 00:33:01 +00:00
Shift
e309038e0f
Convert route options to fluent methods
Laravel 8 adopts the tuple syntax for controller actions. Since the old options array is incompatible with this syntax, Shift converted them to use modern, fluent methods.
2024-10-15 00:32:43 +00:00
Shift
f76e21f278
Remove unnecessary $model property 2024-10-15 00:32:43 +00:00
Shift
efd277608d
Use Faker methods
Accessing Faker properties was deprecated in Faker 1.14.
2024-10-15 00:32:42 +00:00
Shift
669b536c65
Apply code style 2024-10-15 00:32:39 +00:00
Eric Wang
3b8431b523 Template & Templates WIP 2024-10-14 20:29:04 -04:00
Eric Wang
3898ebc5b0 Delete weird file 2024-10-14 20:26:59 -04:00
Eric Wang
b84c6afaef Merge branch 'develop' into next 2024-10-14 20:26:29 -04:00
Eric Wang
5ff272fd5a Fix namespace in NetworkService.php 2024-10-12 21:20:08 -04:00
Eric Wang
12d1435a89 Merge branch 'develop' into next
# Conflicts:
#	.gitignore
#	app/Repositories/Proxmox/Server/ProxmoxBackupRepository.php
#	app/Repositories/Proxmox/Server/ProxmoxConfigRepository.php
#	app/Services/Servers/NetworkService.php
#	package-lock.json
2024-10-12 18:03:06 -04:00
Eric Wang
77be077bf5 Fix no compression backup failures 2024-10-12 17:57:13 -04:00
Eric Wang
393c86aaac Revert to App namespace 2024-10-12 12:17:20 -04:00
Eric Wang
3ed6bbd699 Update AllocationService types 2024-10-11 23:31:19 -04:00
Eric Wang
c09128537f Add PHP CS Fixer 2024-10-11 23:30:03 -04:00
Eric Wang
a3b68aba98 Update composer packages 2024-10-11 19:19:20 -04:00
Eric Wang
55c25c4ffc So much WIP 2024-10-11 18:57:18 -04:00
Eric Wang
679c456421 Make some column types consistent 2024-10-10 16:00:04 -04:00
Eric Wang
666969068a Rename is_shared to is_shareable 2024-10-10 00:07:50 -04:00
Eric Wang
54e58ff185 Node multi-storage WIP 2024-10-10 00:01:36 -04:00
Eric Wang
7b1390f10e Snapshots/Backups WIP 2024-10-03 19:10:48 -04:00
Eric Wang
4b1059f28c Add all graphs 2024-09-22 14:28:41 -04:00
Eric Wang
baf0e9f9b9 Add historical cpu usage card 2024-08-28 13:13:07 -04:00
Eric Wang
4417ddea8c Change int to float for ServerTimepointData.php 2024-08-28 13:12:48 -04:00
Eric Wang
1f16ad467a Use rem instead of px 2024-08-28 13:10:46 -04:00
Eric Wang
52d415b939 Add tabs component 2024-08-28 12:04:53 -04:00
Eric Wang
084374ceb7 Add server stats to frontend WIP 2024-08-28 12:01:21 -04:00
Eric Wang
d84ed76c24 Fix casing in data object 2024-08-28 12:01:11 -04:00
Eric Wang
88bcd8a027 Fix casing in data object 2024-08-28 12:01:06 -04:00
Eric Wang
ee4018e0b3 Make text center 2024-08-27 19:13:13 -04:00
Eric Wang
123448817c Add statistics endpoint 2024-08-27 19:06:57 -04:00
Eric Wang
289ba37b64 Make statistics font size responsive 2024-08-27 19:06:09 -04:00
Eric Wang
44e5614976 Refactor ProxmoxStatisticsRepository.php 2024-08-13 23:11:16 -05:00
Eric Wang
4fe3803570 Rename metrics to statistics 2024-08-13 22:32:53 -05:00
Eric Wang
d3941bb95d Add live graphs 2024-08-13 22:26:32 -05:00
Eric Wang
049b6fc3ec Make padding consistent 2024-08-13 21:38:28 -05:00
Eric Wang
fbaa7b10ea Add graphs WIP 2024-08-13 16:43:31 -05:00
Eric Wang
a5d45ccbb8 Add console button dialog 2024-08-13 15:42:19 -05:00
Eric Wang
47ed8cde3a Change wifi icon 2024-08-13 15:10:38 -05:00
Eric Wang
c66139f913 Add everything so far 2024-08-13 15:09:38 -05:00
Eric Wang
2b9dd876dc Add bandwidth usage radial graph 2024-08-13 11:22:17 -05:00
Eric Wang
ea333eba0a Add charts 2024-08-13 11:22:06 -05:00
Eric Wang
683e04ac50 Add charts 2024-08-13 11:20:09 -05:00
Eric Wang
a7725e1fae Refactor toaster hook 2024-08-13 11:04:17 -05:00
Eric Wang
2f69dcc3c7 Refactor toaster hook 2024-08-13 11:03:55 -05:00
Eric Wang
9a6cb97feb Finish power actions 2024-08-13 10:36:06 -05:00
Eric Wang
5bd6f99cac Allow go to home 2024-08-13 09:37:26 -05:00
Eric Wang
eb3a5d5763 Truncate uptime text if overflows 2024-08-13 00:36:41 -05:00
Eric Wang
03d9bebde0 Make total memory muted 2024-08-13 00:36:30 -05:00
Eric Wang
b341bb0b24 Add confirmation dialog 2024-08-13 00:19:11 -05:00
Eric Wang
639fd8ccfe Fix toaster types importing 2024-08-13 00:18:44 -05:00
Eric Wang
3f1832926f Update sidebar exports 2024-08-13 00:18:30 -05:00
Eric Wang
1e87b7b8fc Add alert dialog 2024-08-12 23:29:35 -05:00
Eric Wang
e26f1bc83b Fix security breakpoints 2024-08-12 23:22:41 -05:00
Eric Wang
a11615fbb5 Redo statistics cards 2024-08-12 23:19:57 -05:00
Eric Wang
f21df09282 idk everything so far 2024-08-12 21:57:43 -05:00
Eric Wang
9b255a5f45 Add credenza 2024-08-12 21:57:30 -05:00
Eric Wang
8e49e3fd2a Add drawer 2024-08-03 11:45:45 -05:00
Eric Wang
a18acba0c5 Add dialog component 2024-08-03 11:07:29 -05:00
Eric Wang
0d4ac50e0e Add dialog component 2024-08-03 11:07:19 -05:00
Eric Wang
6db31f110f Lower refresh interval 2024-08-03 10:54:35 -05:00
Eric Wang
6582687f4f Remove scrollbar 2024-08-03 10:54:26 -05:00
Eric Wang
40b9d6324a wadafuk 2024-07-29 23:35:41 -05:00
Eric Wang
9401b1a4ad Change bandwidth text spacing 2024-07-09 23:19:33 -05:00
Eric Wang
381f8635c6 Make bandwidth text smaller 2024-07-09 22:24:40 -05:00
Eric Wang
52f67b23b9 Ughhhhhh 2024-07-09 22:21:56 -05:00
Eric Wang
8c744f84d3 Fix index route active styling & add 404 2024-07-09 20:45:17 -05:00
Eric Wang
907f227b65 Make sidebar permanently expandable 2024-07-08 23:26:46 -05:00
Eric Wang
fc39daa521 Add everything 2024-07-02 22:12:40 -05:00
Eric Wang
e78c413d4a Formatting 2024-06-29 23:54:55 -05:00
Eric Wang
a36e4ddaf8 Formatting 2024-06-29 23:52:39 -05:00
Eric Wang
3725d155c5 Formatting 2024-06-29 23:52:16 -05:00
Eric Wang
a87955c292 Some formatting & strict types 2024-06-24 22:46:47 -05:00
Eric Wang
4515d66df3 Server deployments WIP 2024-06-24 22:46:21 -05:00
Eric Wang
24aad273e2 Make vm password required internally 2024-06-24 22:46:03 -05:00
Eric Wang
43fcfec4bc Server deployments WIP 2024-06-24 22:45:45 -05:00
Eric Wang
92ba6d9f5e Add pagination 2024-06-24 22:45:07 -05:00
Eric Wang
6390a3ba6e Add Sheet 2024-06-09 21:52:06 -05:00
Eric Wang
c58422b1d7 Fix login meta tag 2024-05-08 19:08:27 -05:00
Eric Wang
cd1fc3dc28 Add everything 2024-05-08 18:53:20 -05:00
Eric Wang
00cce95c24 Add sign out functionality 2024-05-06 16:50:45 -05:00
Eric Wang
6e47afcbc3 Remove LargeSidebar 2024-05-06 16:44:27 -05:00
Eric Wang
a9af4df049 Add logout route 2024-05-06 16:44:14 -05:00
Eric Wang
88cee5cc24 Organize routes 2024-05-06 16:41:54 -05:00
Eric Wang
1277e1b284 Add working titles & everything else 2024-05-06 16:30:44 -05:00
Eric Wang
2f2acf0814 Add Sheet, Badge, Tooltip 2024-05-02 12:46:02 -05:00
Eric Wang
aa9dfe7548 Fix broken login redirect 2024-05-02 12:13:16 -05:00
Eric Wang
a5b04ac3ef Move use-user-swr.ts 2024-03-16 16:24:36 -05:00
Eric Wang
194feda2a5 WIP LargeSidebar.tsx 2024-03-16 16:24:26 -05:00
Eric Wang
0b6763ce03 add ContentContainer.tsx 2024-03-16 16:23:57 -05:00
Eric Wang
70d01d8c0b add login redirect 2024-03-16 16:23:47 -05:00
Eric Wang
de7a6cc42a Refactor ui components 2024-03-16 15:46:52 -05:00
Eric Wang
a8249a456a TBD 2024-03-14 23:58:31 -05:00
Eric Wang
fc9050dc3e Fix tailwind+postcss 2024-03-12 22:41:04 -05:00
Eric Wang
b337b38914 Start of UI overhaul 2024-03-12 22:30:54 -05:00
1076 changed files with 30478 additions and 14101 deletions

View file

@ -15,7 +15,7 @@ DB_DATABASE=convoy
DB_USERNAME=convoy_user
DB_PASSWORD=YzLa2BCBwDGWVkpG
CACHE_DRIVER=redis
CACHE_STORE=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis

View file

@ -4,9 +4,9 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
APP_TIMEZONE=UTC
APP_LOCALE=en
APP_MAINTENANCE_DRIVER=cache
DB_CONNECTION=mysql
DB_HOST=database
@ -15,7 +15,7 @@ DB_DATABASE=convoy
DB_USERNAME=convoy_user
DB_PASSWORD=
CACHE_DRIVER=redis
CACHE_STORE=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis

50
.env.full_example Normal file
View file

@ -0,0 +1,50 @@
APP_NAME=Convoy
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=UTC
APP_LOCALE=en
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file
APP_MAINTENANCE_STORE=database
BCRYPT_ROUNDS=12
LOG_CHANNEL=stack
LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=database
DB_PORT=3306
DB_DATABASE=convoy
DB_USERNAME=convoy_user
DB_PASSWORD=
CACHE_STORE=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
SESSION_LIFETIME=525600
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=null
REDIS_HOST=redis
REDIS_PASSWORD=
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
PHP_XDEBUG=false
PHP_XDEBUG_MODE='debug'

View file

@ -45,6 +45,7 @@ jobs:
files_to_include=(
".editorconfig"
".env.example"
".env.full_example"
".gitattributes"
".gitignore"
".prettierignore"

6
.gitignore vendored
View file

@ -19,4 +19,10 @@ _ide_*.php
stats.html
.fleet
lang/php_*.json
/resources/scripts/routeTree.gen.ts
.DS_Store
._.DS_Store
**/.DS_Store
**/._.DS_Store
.php-cs-fixer.cache
.phpunit.cache

165
.php-cs-fixer.php Normal file
View file

@ -0,0 +1,165 @@
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => null],
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => ['return'],
],
'braces' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'const' => 'one',
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
],
],
'class_definition' => [
'multi_line_extends_each_single_line' => true,
'single_item_single_line' => true,
'single_line' => true,
],
'concat_space' => [
'spacing' => 'none',
],
'constant_case' => ['case' => 'lower'],
'declare_equal_normalize' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true, // added by Shift
'function_declaration' => true,
'function_typehint_space' => true,
'general_phpdoc_tag_rename' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'increment_style' => ['style' => 'post'],
'indentation_type' => true,
'linebreak_after_opening_tag' => true,
'line_ending' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true, // added from Symfony
'magic_method_casing' => true, // added from Symfony
'magic_constant_casing' => true,
'method_argument_space' => [
'on_multiline' => 'ignore',
],
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'native_function_casing' => true,
'no_alias_functions' => true,
'no_extra_blank_lines' => [
'tokens' => [
'extra',
'throw',
'use',
],
],
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => [
'use' => 'echo',
],
'no_multiline_whitespace_around_double_arrow' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => [
'positions' => ['inside', 'outside'],
],
'no_spaces_inside_parenthesis' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => [
'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'],
],
'no_unreachable_default_argument_value' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'psr_autoloading' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => false,
'phpdoc_to_comment' => false, // override to preserve user preference
'phpdoc_tag_type' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
'self_accessor' => true,
'short_scalar_cast' => true,
'simplified_null_return' => false, // disabled as "risky"
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_class_element_per_statement' => [
'elements' => ['const', 'property'],
],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => ['method', 'property'],
],
'whitespace_after_comma_in_array' => true,
];
$finder = Finder::create()
->in([
__DIR__ . '/app',
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/resources',
__DIR__ . '/routes',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);
return (new Config())
->setFinder($finder)
->setRules($rules)
->setRiskyAllowed(true)
->setUsingCache(true);

View file

@ -1,29 +1,37 @@
{
"arrowParens": "avoid",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "consistent",
"requirePragma": false,
"semi": false,
"singleAttributePerLine": false,
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false,
"tabWidth": 4,
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrder": [
"^@/api/(.*)$",
"^@/components/elements/(.*)$",
"^@/components/(.*)$",
"^[./]"
],
"plugins": ["@trivago/prettier-plugin-sort-imports"]
"arrowParens": "avoid",
"bracketSameLine": false,
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "consistent",
"requirePragma": false,
"semi": false,
"singleAttributePerLine": false,
"singleQuote": true,
"trailingComma": "es5",
"useTabs": false,
"vueIndentScriptAndStyle": false,
"tabWidth": 4,
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrder": [
"<THIRD_PARTY_MODULES>",
"^@/lib/(.*)$",
"^@/api/(.*)$",
"^@/components/layouts/(.*)$",
"^@/components/interfaces/(.*)$",
"^@/components/ui/(.*)$",
"^@/components/(.*)$",
"^@/assets/(.*)$",
"^[./]"
],
"plugins": [
"@trivago/prettier-plugin-sort-imports",
"prettier-plugin-tailwindcss"
]
}

View file

@ -1,11 +1,11 @@
<?php
namespace Convoy\Actions\Fortify;
namespace App\Actions\Fortify;
use Convoy\Models\User;
use Illuminate\Validation\Rule;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\CreatesNewUsers;
class CreateNewUser implements CreatesNewUsers

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Actions\Fortify;
namespace App\Actions\Fortify;
use Laravel\Fortify\Rules\Password;

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Actions\Fortify;
namespace App\Actions\Fortify;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Actions\Fortify;
namespace App\Actions\Fortify;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;

View file

@ -1,10 +1,10 @@
<?php
namespace Convoy\Actions\Fortify;
namespace App\Actions\Fortify;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Validator;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Laravel\Fortify\Contracts\UpdatesUserProfileInformation;
class UpdateUserProfileInformation implements UpdatesUserProfileInformation

View file

@ -1,10 +1,10 @@
<?php
namespace Convoy\Casts;
namespace App\Casts;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Database\Eloquent\Model;
class NullableEncrypter implements CastsAttributes
{
@ -15,7 +15,7 @@ class NullableEncrypter implements CastsAttributes
*/
public function get(Model $model, string $key, mixed $value, array $attributes): ?string
{
return !empty($value) ? app(Encrypter::class)->decrypt($value) : null;
return ! empty($value) ? app(Encrypter::class)->decrypt($value) : null;
}
/**
@ -25,6 +25,6 @@ class NullableEncrypter implements CastsAttributes
*/
public function set(Model $model, string $key, mixed $value, array $attributes): ?string
{
return !empty($value) ? app(Encrypter::class)->encrypt($value) : null;
return ! empty($value) ? app(Encrypter::class)->encrypt($value) : null;
}
}

View file

@ -1,18 +1,18 @@
<?php
namespace Convoy\Casts;
namespace App\Casts;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
use Illuminate\Database\Eloquent\Model;
class MebibytesToAndFromBytes implements CastsAttributes
class StorageSizeCast implements CastsAttributes
{
/**
* Cast the given value.
*/
public function get(Model $model, string $key, mixed $value, array $attributes): ?int
{
return !is_null($value) ? $value * 1048576 : $value; // Convert from megabytes to bytes
return $value >= 0 ? $value * 1048576 : -1; // Convert from megabytes to bytes
}
/**
@ -20,6 +20,8 @@ class MebibytesToAndFromBytes implements CastsAttributes
*/
public function set(Model $model, string $key, mixed $value, array $attributes): ?int
{
return !is_null($value) ? intval(floor($value / 1048576)) : $value; // Convert from bytes to megabytes to prevent overflow
return $value >= 0 ? intval(
floor($value / 1048576),
) : -1; // Convert from bytes to megabytes to prevent overflow
}
}

View file

@ -1,11 +1,11 @@
<?php
namespace Convoy\Console\Commands\Maintenance;
namespace App\Console\Commands\Maintenance;
use App\Repositories\Eloquent\BackupRepository;
use Carbon\CarbonImmutable;
use InvalidArgumentException;
use Illuminate\Console\Command;
use Convoy\Repositories\Eloquent\BackupRepository;
use InvalidArgumentException;
class PruneOrphanedBackupsCommand extends Command
{

View file

@ -1,10 +1,10 @@
<?php
namespace Convoy\Console\Commands\Maintenance;
namespace App\Console\Commands\Maintenance;
use Convoy\Models\Node;
use App\Jobs\Node\PruneUsersJob;
use App\Models\Node;
use Illuminate\Console\Command;
use Convoy\Jobs\Node\PruneUsersJob;
use Illuminate\Console\View\Components\Task;
class PruneUsersCommand extends Command

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Console\Commands\Server;
namespace App\Console\Commands\Server;
use Convoy\Models\Server;
use App\Models\Server;
use Illuminate\Console\Command;
class ResetUsagesCommand extends Command

View file

@ -1,11 +1,11 @@
<?php
namespace Convoy\Console\Commands\Server;
namespace App\Console\Commands\Server;
use Convoy\Models\Node;
use App\Jobs\Node\SyncServerRateLimitsJob;
use App\Models\Node;
use Illuminate\Console\Command;
use Illuminate\Console\View\Components\Task;
use Convoy\Jobs\Node\SyncServerRateLimitsJob;
class UpdateRateLimitsCommand extends Command
{

View file

@ -1,10 +1,10 @@
<?php
namespace Convoy\Console\Commands\Server;
namespace App\Console\Commands\Server;
use Convoy\Models\Node;
use App\Jobs\Node\SyncServerUsagesJob;
use App\Models\Node;
use Illuminate\Console\Command;
use Convoy\Jobs\Node\SyncServerUsagesJob;
use Illuminate\Console\View\Components\Task;
class UpdateUsagesCommand extends Command

View file

@ -23,13 +23,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
namespace Convoy\Console\Commands\User;
namespace App\Console\Commands\User;
use App\Exceptions\Model\DataValidationException;
use App\Models\User;
use Exception;
use Convoy\Models\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Hash;
use Convoy\Exceptions\Model\DataValidationException;
class MakeUserCommand extends Command
{

View file

@ -1,48 +0,0 @@
<?php
namespace Convoy\Console;
use Convoy\Models\ActivityLog;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Database\Console\PruneCommand;
use Convoy\Console\Commands\Server\ResetUsagesCommand;
use Convoy\Console\Commands\Server\UpdateUsagesCommand;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Convoy\Console\Commands\Maintenance\PruneUsersCommand;
use Convoy\Console\Commands\Server\UpdateRateLimitsCommand;
use Convoy\Console\Commands\Maintenance\PruneOrphanedBackupsCommand;
class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*/
protected function schedule(Schedule $schedule): void
{
$schedule->command('queue:prune-batches')->daily();
if (config('backups.prune_age')) {
// Every 30 minutes, run the backup pruning command so that any abandoned backups can be deleted.
$schedule->command(PruneOrphanedBackupsCommand::class)->everyThirtyMinutes();
}
if (config('activity.prune_days')) {
$schedule->command(PruneCommand::class, ['--model' => [ActivityLog::class]])->daily();
}
$schedule->command(ResetUsagesCommand::class)->daily();
$schedule->command(PruneUsersCommand::class)->daily();
$schedule->command(UpdateUsagesCommand::class)->everyFiveMinutes();
$schedule->command(UpdateRateLimitsCommand::class)->everyTenMinutes();
}
/**
* Register the commands for the application.
*/
protected function commands(): void
{
$this->load(__DIR__.'/Commands');
//require base_path('routes/console.php');
}
}

View file

@ -1,9 +1,9 @@
<?php
namespace Convoy\Contracts\Repository;
namespace App\Contracts\Repository;
use Convoy\Models\Server;
use Convoy\Models\ActivityLog;
use App\Models\ActivityLog;
use App\Models\Server;
interface ActivityRepositoryInterface extends RepositoryInterface
{

View file

@ -1,12 +1,12 @@
<?php
namespace Convoy\Contracts\Repository;
namespace App\Contracts\Repository;
use App\Exceptions\Model\DataValidationException;
use App\Exceptions\Repository\RecordNotFoundException;
use Closure;
use Illuminate\Support\Collection;
use Convoy\Exceptions\Model\DataValidationException;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Convoy\Exceptions\Repository\RecordNotFoundException;
use Illuminate\Support\Collection;
interface RepositoryInterface
{

View file

@ -1,9 +1,9 @@
<?php
namespace Convoy\Contracts\Repository;
namespace App\Contracts\Repository;
use Convoy\Models\Server;
use Convoy\Exceptions\Repository\RecordNotFoundException;
use App\Exceptions\Repository\RecordNotFoundException;
use App\Models\Server;
interface ServerRepositoryInterface extends RepositoryInterface
{

View file

@ -1,16 +1,15 @@
<?php
namespace Convoy\Data\Helpers;
namespace App\Data\Helpers;
use App\Enums\Helpers\ChecksumAlgorithm;
use Spatie\LaravelData\Data;
use Convoy\Enums\Helpers\ChecksumAlgorithm;
class ChecksumData extends Data
{
public function __construct(
public string $checksum,
public string $checksum,
public ChecksumAlgorithm $algorithm,
)
{
) {
}
}

View file

@ -1,27 +1,26 @@
<?php
namespace Convoy\Data\Node\Access;
namespace App\Data\Node\Access;
use App\Enums\Node\Access\RealmType;
use Carbon\Carbon;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Casts\EnumCast;
use Convoy\Enums\Node\Access\RealmType;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Attributes\Validation\Min;
use Spatie\LaravelData\Attributes\Validation\Max;
use Spatie\LaravelData\Attributes\Validation\Min;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Casts\EnumCast;
use Spatie\LaravelData\Data;
class CreateUserData extends Data
{
public function __construct(
#[WithCast(EnumCast::class)]
public RealmType $realm_type,
public bool $enabled,
public bool $enabled,
#[Min(1), Max(60)]
public ?string $username = null,
public ?string $username = null,
#[Min(1), Max(64)]
public ?string $password = null,
public ?Carbon $expires_at = null,
)
{
public ?string $password = null,
public ?Carbon $expires_at = null,
) {
}
}

View file

@ -1,23 +1,21 @@
<?php
namespace Convoy\Data\Node\Access;
namespace App\Data\Node\Access;
use App\Enums\Node\Access\RealmType;
use Spatie\LaravelData\Data;
use Convoy\Enums\Node\Access\RealmType;
class UserCredentialsData extends Data
{
public function __construct(
public string $username,
public string $username,
public RealmType $realm_type,
public string $ticket,
public string $csrf_token,
)
{
public string $ticket,
public string $csrf_token,
) {
}
public static function fromRaw(array $raw): UserCredentialsData
public static function fromRaw(array $raw): self
{
return new self(...[
'username' => explode('@', $raw['username'])[0],
@ -26,4 +24,4 @@ class UserCredentialsData extends Data
'csrf_token' => $raw['CSRFPreventionToken'],
]);
}
}
}

View file

@ -1,34 +1,33 @@
<?php
namespace Convoy\Data\Node\Access;
namespace App\Data\Node\Access;
use App\Enums\Node\Access\RealmType;
use Carbon\Carbon;
use Illuminate\Support\Arr;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Casts\EnumCast;
use Convoy\Enums\Node\Access\RealmType;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Casts\EnumCast;
use Spatie\LaravelData\Data;
class UserData extends Data
{
public function __construct(
public string $username,
public ?string $email,
public string $username,
public ?string $email,
#[WithCast(EnumCast::class)]
public RealmType $realm_type,
public bool $enabled,
public ?Carbon $expires_at,
)
{
public bool $enabled,
public ?Carbon $expires_at,
) {
}
public static function fromRaw(array $raw): UserData
public static function fromRaw(array $raw): self
{
return new self(...[
'username' => explode('@', $raw['userid'])[0],
'email' => Arr::get($raw, 'email'),
'realm_type' => RealmType::from($raw['realm-type']),
'enabled' => (bool)$raw['enable'],
'enabled' => (bool) $raw['enable'],
'expires_at' => Arr::get($raw, 'expire') ? Carbon::createFromTimestamp($raw['expire']) : null,
]);
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Node\Storage;
namespace App\Data\Node\Storage;
use Spatie\LaravelData\Data;
@ -9,8 +9,7 @@ class FileMetaData extends Data
public function __construct(
public string $file_name,
public string $mime_type,
public int $size,
)
{
public int $size,
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Node\Storage;
namespace App\Data\Node\Storage;
use Carbon\CarbonInterface;
use Spatie\LaravelData\Data;
@ -8,10 +8,9 @@ use Spatie\LaravelData\Data;
class IsoData extends Data
{
public function __construct(
public string $file_name,
public int $size,
public string $file_name,
public int $size,
public CarbonInterface $created_at,
)
{
) {
}
}

View file

@ -0,0 +1,24 @@
<?php
namespace App\Data\Node\Storage;
use Spatie\LaravelData\Data;
class StorageData extends Data
{
public function __construct(
public string $name,
public int $used,
public int $free,
public int $total,
public bool $enabled,
public bool $online,
public bool $has_kvm,
public bool $has_lxc,
public bool $has_lxc_templates,
public bool $has_backups,
public bool $has_iso,
public bool $has_snippets,
) {
}
}

View file

@ -1,16 +1,15 @@
<?php
namespace Convoy\Data\Server\Deployments;
namespace App\Data\Server\Deployments;
use App\Data\Server\Eloquent\AddressData;
use Spatie\LaravelData\Data;
use Convoy\Data\Server\Eloquent\AddressData;
class CloudinitAddressConfigData extends Data
{
public function __construct(
public ?AddressData $ipv4,
public ?AddressData $ipv6,
)
{
) {
}
}

View file

@ -1,20 +1,19 @@
<?php
namespace Convoy\Data\Server\Deployments;
namespace App\Data\Server\Deployments;
use Convoy\Models\Server;
use Convoy\Models\Template;
use App\Models\Server;
use App\Models\Template;
use Spatie\LaravelData\Data;
class ServerDeploymentData extends Data
{
public function __construct(
public Server $server,
public Server $server,
public ?Template $template,
public ?string $account_password,
public bool $should_create_server,
public bool $start_on_completion,
)
{
public string $account_password,
public bool $should_create_server,
public bool $start_on_completion,
) {
}
}

View file

@ -1,25 +1,24 @@
<?php
namespace Convoy\Data\Server\Eloquent;
namespace App\Data\Server\Eloquent;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Attributes\Validation\IP;
use Spatie\LaravelData\Attributes\Validation\In;
use Spatie\LaravelData\Attributes\Validation\IP;
use Spatie\LaravelData\Data;
class AddressData extends Data
{
public function __construct(
public int $id,
public int $address_pool_id,
public ?int $server_id,
public int $id,
public int $address_pool_id,
public ?int $server_id,
#[In(['ipv4', 'ipv6'])]
public string $type,
public string $type,
#[IP]
public string $address,
public int $cidr,
public string $gateway,
public string $address,
public int $cidr,
public string $gateway,
public ?string $mac_address,
)
{
) {
}
}

View file

@ -1,10 +1,10 @@
<?php
namespace Convoy\Data\Server\Eloquent;
namespace App\Data\Server\Eloquent;
use Spatie\LaravelData\Attributes\DataCollectionOf;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\DataCollection;
use Spatie\LaravelData\Attributes\DataCollectionOf;
class ServerAddressesData extends Data
{
@ -13,7 +13,6 @@ class ServerAddressesData extends Data
public DataCollection $ipv4,
#[DataCollectionOf(AddressData::class)]
public DataCollection $ipv6,
)
{
) {
}
}

View file

@ -1,23 +1,22 @@
<?php
namespace Convoy\Data\Server\Eloquent;
namespace App\Data\Server\Eloquent;
use Spatie\LaravelData\Data;
class ServerEloquentData extends Data
{
public function __construct(
public int $id,
public string $uuid_short,
public string $uuid,
public int $node_id,
public string $hostname,
public string $name,
public ?string $description,
public ?string $status,
public int $id,
public string $uuid_short,
public string $uuid,
public int $node_id,
public string $hostname,
public string $name,
public ?string $description,
public ?string $status,
public ServerUsagesData $usages,
public ServerLimitsData $limits,
)
{
) {
}
}

View file

@ -1,21 +1,20 @@
<?php
namespace Convoy\Data\Server\Eloquent;
namespace App\Data\Server\Eloquent;
use Spatie\LaravelData\Data;
class ServerLimitsData extends Data
{
public function __construct(
public int $cpu,
public int $memory,
public int $disk,
public ?int $snapshots,
public ?int $backups,
public ?int $bandwidth,
public int $cpu,
public int $memory,
public int $disk,
public ?int $snapshots,
public ?int $backups,
public ?int $bandwidth,
public ServerAddressesData $addresses,
public ?string $mac_address,
)
{
public ?string $mac_address,
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Server\Eloquent;
namespace App\Data\Server\Eloquent;
use Spatie\LaravelData\Data;
@ -8,7 +8,6 @@ class ServerUsagesData extends Data
{
public function __construct(
public int $bandwidth,
)
{
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Server;
namespace App\Data\Server;
use Spatie\LaravelData\Data;
@ -9,7 +9,6 @@ class MacAddressData extends Data
public function __construct(
public ?string $proxmox,
public ?string $eloquent,
)
{
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Server\Proxmox\Config;
namespace App\Data\Server\Proxmox\Config;
use Spatie\LaravelData\Data;
@ -9,7 +9,6 @@ class AddressConfigData extends Data
public function __construct(
public ?AddressData $ipv4,
public ?AddressData $ipv6,
)
{
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Server\Proxmox\Config;
namespace App\Data\Server\Proxmox\Config;
use Spatie\LaravelData\Data;
@ -8,9 +8,8 @@ class AddressData extends Data
{
public function __construct(
public string $address,
public int $cidr,
public int $cidr,
public string $gateway,
)
{
) {
}
}

View file

@ -1,24 +1,21 @@
<?php
namespace Convoy\Data\Server\Proxmox\Config;
namespace App\Data\Server\Proxmox\Config;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Casts\EnumCast;
use Convoy\Enums\Server\DiskInterface;
use App\Enums\Server\DiskInterface;
use Spatie\LaravelData\Attributes\WithCast;
use Spatie\LaravelData\Casts\EnumCast;
use Spatie\LaravelData\Data;
class DiskData extends Data
{
public function __construct(
#[WithCast(EnumCast::class)]
public DiskInterface $interface,
public bool $is_primary_disk,
public bool $is_media,
public ?string $media_name,
public int $size,
)
{
public bool $is_primary_disk,
public bool $is_media,
public ?string $media_name,
public int $size,
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Server\Proxmox\Config;
namespace App\Data\Server\Proxmox\Config;
use Spatie\LaravelData\Data;
@ -8,7 +8,6 @@ class MediaData extends Data
{
public function __construct(
//
)
{
) {
}
}

View file

@ -1,21 +1,20 @@
<?php
namespace Convoy\Data\Server\Proxmox\Config;
namespace App\Data\Server\Proxmox\Config;
use Spatie\LaravelData\Attributes\DataCollectionOf;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\DataCollection;
use Spatie\LaravelData\Attributes\DataCollectionOf;
class ServerConfigData extends Data
{
public function __construct(
public string $mac_address,
public string $mac_address,
#[DataCollectionOf(DiskData::class)]
public DataCollection $boot_order,
#[DataCollectionOf(DiskData::class)]
public DataCollection $disks,
/* public AddressConfigData $addresses */
)
{
) {
}
}

View file

@ -1,16 +1,15 @@
<?php
namespace Convoy\Data\Server\Proxmox\Console;
namespace App\Data\Server\Proxmox\Console;
use Spatie\LaravelData\Data;
class NoVncCredentialsData extends Data
{
public function __construct(
public int $port,
public int $port,
public string $ticket,
public string $pve_auth_cookie,
)
{
) {
}
}
}

View file

@ -1,19 +1,18 @@
<?php
namespace Convoy\Data\Server\Proxmox\Console;
namespace App\Data\Server\Proxmox\Console;
use App\Enums\Node\Access\RealmType;
use Spatie\LaravelData\Data;
use Convoy\Enums\Node\Access\RealmType;
class XTermCredentialsData extends Data
{
public function __construct(
public int $port,
public string $ticket,
public string $username,
public int $port,
public string $ticket,
public string $username,
public RealmType $realm_type,
public string $pve_auth_cookie,
)
{
public string $pve_auth_cookie,
) {
}
}

View file

@ -1,21 +1,20 @@
<?php
namespace Convoy\Data\Server\Proxmox;
namespace App\Data\Server\Proxmox;
use App\Data\Server\Proxmox\Config\ServerConfigData;
use Spatie\LaravelData\Data;
use Convoy\Data\Server\Proxmox\Config\ServerConfigData;
class ServerProxmoxData extends Data
{
public function __construct(
public int $id,
public string $uuid_short,
public string $uuid,
public int $node_id,
public string $state,
public bool $locked,
public int $id,
public string $uuid_short,
public string $uuid,
public int $node_id,
public string $state,
public bool $locked,
public ServerConfigData $config,
)
{
) {
}
}

View file

@ -1,20 +1,19 @@
<?php
namespace Convoy\Data\Server\Proxmox;
namespace App\Data\Server\Proxmox;
use App\Enums\Server\State;
use Spatie\LaravelData\Data;
use Convoy\Enums\Server\State;
class ServerStateData extends Data
{
public function __construct(
public State $state,
public float $cpu_used,
public int $memory_total,
public int $memory_used,
public int $uptime,
)
{
public int $memory_total,
public int $memory_used,
public int $uptime,
) {
}
public static function fromRaw(array $raw)

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Server\Proxmox\Usages;
namespace App\Data\Server\Proxmox\Usages;
use Spatie\LaravelData\Data;
@ -9,7 +9,6 @@ class ServerDiskData extends Data
public function __construct(
public int $write,
public int $read,
)
{
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Data\Server\Proxmox\Usages;
namespace App\Data\Server\Proxmox\Usages;
use Spatie\LaravelData\Data;
@ -9,7 +9,6 @@ class ServerNetworkData extends Data
public function __construct(
public int $in,
public int $out,
)
{
) {
}
}

View file

@ -0,0 +1,18 @@
<?php
namespace App\Data\Server\Proxmox\Usages;
use Carbon\CarbonImmutable;
use Spatie\LaravelData\Data;
class ServerTimepointData extends Data
{
public function __construct(
public float $cpu_used,
public float $memory_used,
public ServerNetworkData $network,
public ServerDiskData $disk,
public CarbonImmutable $timestamp,
) {
}
}

View file

@ -1,16 +1,15 @@
<?php
namespace Convoy\Data\Server\Proxmox\Usages;
namespace App\Data\Server\Proxmox\Usages;
use Spatie\LaravelData\Data;
class ServerUsagesData extends Data
{
public function __construct(
public int $bandwidth,
public int $bandwidth,
public ServerNetworkData $network,
public ServerDiskData $disk,
)
{
public ServerDiskData $disk,
) {
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Activity;
namespace App\Enums\Activity;
enum Status: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Api;
namespace App\Enums\Api;
enum ApiKeyType: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Helpers;
namespace App\Enums\Helpers;
enum ChecksumAlgorithm: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Network;
namespace App\Enums\Network;
enum AddressType: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Node\Access;
namespace App\Enums\Node\Access;
enum RealmType: string
{

View file

@ -1,9 +1,13 @@
<?php
namespace Convoy\Enums\Node\Storage;
namespace App\Enums\Node\Storage;
enum ContentType: string
{
case KVM_IMAGES = 'images';
case LXC_DATA = 'rootdir';
case LXC_TEMPLATES = 'vztmpl';
case BACKUPS = 'backup';
case ISO = 'iso';
case VZTMPL = 'vztmpl';
case SNIPPETS = 'snippets';
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum AuthenticationType: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum BackupCompressionType: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum BackupMode: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum BiosType: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum ConsoleType: string
{

View file

@ -0,0 +1,9 @@
<?php
namespace App\Enums\Server;
enum DeploymentType: string
{
case INSTALL = 'install';
case REINSTALL = 'reinstall';
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum DiskInterface: string
{

View file

@ -1,9 +0,0 @@
<?php
namespace Convoy\Enums\Server;
enum MetricParameter: string
{
case AVERAGE = 'AVERAGE';
case MAX = 'MAX';
}

View file

@ -1,12 +0,0 @@
<?php
namespace Convoy\Enums\Server;
enum MetricTimeframe: string
{
case HOUR = 'hour';
case DAY = 'day';
case WEEK = 'week';
case MONTH = 'month';
case YEAR = 'year';
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum PowerAction: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum State: string
{

View file

@ -0,0 +1,9 @@
<?php
namespace App\Enums\Server;
enum StatisticConsolidatorFunction: string
{
case AVERAGE = 'AVERAGE';
case MAX = 'MAX';
}

View file

@ -0,0 +1,12 @@
<?php
namespace App\Enums\Server;
enum StatisticTimeRange: string
{
case HOUR_AGO = 'hour';
case DAY_AGO = 'day';
case WEEK_AGO = 'week';
case MONTH_AGO = 'month';
case YEAR_AGO = 'year';
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum Status: string
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Enums\Server;
namespace App\Enums\Server;
enum SuspensionAction: string
{

View file

@ -1,10 +1,10 @@
<?php
namespace Convoy\Events\Activity;
namespace App\Events\Activity;
use Illuminate\Support\Str;
use Convoy\Models\ActivityLog;
use App\Models\ActivityLog;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
abstract class Activity
{

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Exceptions;
namespace App\Exceptions;
use Exception;

View file

@ -1,16 +1,16 @@
<?php
namespace Convoy\Exceptions;
namespace App\Exceptions;
use Exception;
use Throwable;
use Psr\Log\LoggerInterface;
use Illuminate\Container\Container;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Http\JsonResponse;
use Illuminate\Container\Container;
use Illuminate\Http\RedirectResponse;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Throwable;
class DisplayException extends ConvoyException implements HttpExceptionInterface
{

View file

@ -1,11 +1,11 @@
<?php
namespace Convoy\Exceptions;
namespace App\Exceptions;
use Exception;
use Throwable;
use Illuminate\Container\Container;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{

View file

@ -1,10 +1,10 @@
<?php
namespace Convoy\Exceptions\Http\Server;
namespace App\Exceptions\Http\Server;
use Throwable;
use Convoy\Models\Server;
use App\Models\Server;
use Symfony\Component\HttpKernel\Exception\ConflictHttpException;
use Throwable;
class ServerStatusConflictException extends ConflictHttpException
{

View file

@ -1,12 +1,12 @@
<?php
namespace Convoy\Exceptions\Model;
namespace App\Exceptions\Model;
use Illuminate\Support\MessageBag;
use Convoy\Exceptions\ConvoyException;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Contracts\Validation\Validator;
use App\Exceptions\ConvoyException;
use Illuminate\Contracts\Support\MessageProvider;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\MessageBag;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class DataValidationException extends ConvoyException implements HttpExceptionInterface, MessageProvider

View file

@ -0,0 +1,15 @@
<?php
namespace App\Exceptions\Repository\Eloquent;
use App\Exceptions\DisplayException;
class TooManyRootSnapshotsException extends DisplayException
{
public function __construct()
{
parent::__construct(
'The snapshot tree can\'t be constructed because there are too many root snapshots.',
);
}
}

View file

@ -1,15 +1,15 @@
<?php
namespace Convoy\Exceptions\Repository\Proxmox;
namespace App\Exceptions\Repository\Proxmox;
use Illuminate\Http\Client\Response;
use App\Exceptions\Repository\RepositoryException;
use Illuminate\Http\Client\RequestException;
use Convoy\Exceptions\Repository\RepositoryException;
use Illuminate\Http\Client\Response;
class ProxmoxConnectionException extends RepositoryException
{
public function __construct(Response $response, RequestException $exception)
{
parent::__construct($response->reason() . PHP_EOL . $exception->getMessage() . PHP_EOL . $exception->getTraceAsString(), $exception->getCode(), $exception);
}
public function __construct(Response $response, RequestException $exception)
{
parent::__construct($response->reason().PHP_EOL.$exception->getMessage().PHP_EOL.$exception->getTraceAsString(), $exception->getCode(), $exception);
}
}

View file

@ -1,6 +1,6 @@
<?php
namespace Convoy\Exceptions\Repository;
namespace App\Exceptions\Repository;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Repository;
namespace App\Exceptions\Repository;
use Convoy\Exceptions\ConvoyException;
use App\Exceptions\ConvoyException;
class RepositoryException extends ConvoyException
{

View file

@ -1,8 +1,9 @@
<?php
namespace Convoy\Exceptions\Service\Api;
namespace App\Exceptions\Service\Api;
use App\Exceptions\ConvoyException;
use Throwable;
use Convoy\Exceptions\ConvoyException;
class InvalidJWTException extends ConvoyException
{
@ -10,4 +11,4 @@ class InvalidJWTException extends ConvoyException
{
parent::__construct(message: 'Invalid JWT token', previous: $previous);
}
}
}

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Backup;
namespace App\Exceptions\Service\Backup;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class BackupLockedException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Backup;
namespace App\Exceptions\Service\Backup;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class TooManyBackupsException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Deployment;
namespace App\Exceptions\Service\Deployment;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class InvalidTemplateException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Network;
namespace App\Exceptions\Service\Network;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class AddressInUseException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Node\IsoLibrary;
namespace App\Exceptions\Service\Node\IsoLibrary;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class InvalidIsoLinkException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Server\Allocation;
namespace App\Exceptions\Service\Server\Allocation;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class IsoAlreadyMountedException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Server\Allocation;
namespace App\Exceptions\Service\Server\Allocation;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class IsoAlreadyUnmountedException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Server\Allocation;
namespace App\Exceptions\Service\Server\Allocation;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoAvailableDiskInterfaceException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Server\Allocation;
namespace App\Exceptions\Service\Server\Allocation;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoUniqueUuidComboException extends DisplayException
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Exceptions\Service\Server\Allocation;
namespace App\Exceptions\Service\Server\Allocation;
use Convoy\Exceptions\DisplayException;
use App\Exceptions\DisplayException;
class NoUniqueVmidException extends DisplayException
{

View file

@ -1,17 +1,18 @@
<?php
namespace Convoy\Extensions\Lcobucci\JWT\Validation;
namespace App\Extensions\Lcobucci\JWT\Validation;
use DateTimeImmutable;
use Carbon\CarbonInterface;
use Carbon\CarbonImmutable;
use Carbon\CarbonInterface;
use DateTimeImmutable;
use Psr\Clock\ClockInterface;
class Clock implements ClockInterface
{
private CarbonInterface $date;
public function __construct(?CarbonInterface $date = null) {
public function __construct(?CarbonInterface $date = null)
{
$this->date = $date ?? CarbonImmutable::now();
}

View file

@ -0,0 +1,72 @@
<?php
namespace App\Extensions\Spatie\Fractal;
use League\Fractal\Serializer\ArraySerializer;
class RecursiveSerializer extends ArraySerializer
{
/**
* @inheritDoc
*/
public function collection(?string $resourceKey, array $data): array
{
return ['data' => $data];
}
/**
* @inheritDoc
*/
public function item(?string $resourceKey, array $data): array
{
return ['data' => $data];
}
/**
* Recursively serialize included data
*
* @param string $resourceKey
* @param array $data
* @param array $includedData
* @return array
*/
public function recursiveInclude($resourceKey, array $data, array $includedData): array
{
foreach ($includedData as $include) {
if (isset($data[$include])) {
$data[$include] = $this->recursiveInclude(
$include,
$data[$include],
$includedData[$include],
);
}
}
return $data;
}
/**
* Merges included data with transformed data recursively
*
* @param array $transformedData
* @param array $includedData
* @return array
*/
public function mergeIncludes(array $transformedData, array $includedData): array
{
$transformedData = parent::mergeIncludes($transformedData, $includedData);
// Recursively include any nested data
foreach ($includedData as $key => $value) {
if (isset($transformedData[$key])) {
$transformedData[$key] = $this->recursiveInclude(
$key,
$transformedData[$key],
$value,
);
}
}
return $transformedData;
}
}

View file

@ -1,9 +1,9 @@
<?php
namespace Convoy\Facades;
namespace App\Facades;
use App\Services\Activity\ActivityLogService;
use Illuminate\Support\Facades\Facade;
use Convoy\Services\Activity\ActivityLogService;
class Activity extends Facade
{

View file

@ -1,9 +1,9 @@
<?php
namespace Convoy\Facades;
namespace App\Facades;
use App\Services\Activity\ActivityLogBatchService;
use Illuminate\Support\Facades\Facade;
use Convoy\Services\Activity\ActivityLogBatchService;
class LogBatch extends Facade
{

View file

@ -1,9 +1,9 @@
<?php
namespace Convoy\Facades;
namespace App\Facades;
use App\Services\Activity\ActivityLogTargetableService;
use Illuminate\Support\Facades\Facade;
use Convoy\Services\Activity\ActivityLogTargetableService;
class LogTarget extends Facade
{

View file

@ -1,8 +1,8 @@
<?php
namespace Convoy\Helpers;
namespace App\Helpers;
use Convoy\Enums\Network\AddressType;
use App\Enums\Network\AddressType;
use GMP;
function ipv6ToInteger(string $ip): GMP
@ -42,4 +42,4 @@ function getAddressesFromRange(AddressType $type, string $from, string $to): arr
}
return $addresses;
}
}

Some files were not shown because too many files have changed in this diff Show more