Skip to content

Commit 7c4c1b7

Browse files
authored
v0.4.3 (#44)
## [0.4.3] - 2025-03-24 ### Added - Introduced a new `app:update-system` command to automate project updates. - Added configuration options to enable/disable dark mode and specify a default mode. ### Changed - Refined default theme colors for dark mode. - Minor CSS changes in the default theme for improved layout consistency. ### Fixed - Resolved an issue preventing emails from being sent. - Addressed a bug that caused Stripe payments to fail.
1 parent d6be162 commit 7c4c1b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1004
-112
lines changed

.github/workflows/symfony.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,18 @@ jobs:
8787
with:
8888
name: junit-test-report
8989
path: junit.xml
90+
91+
- name: Check Missing Translations
92+
run: |
93+
set -e
94+
for FILE in src/Core/Resources/translations/messages.*.yaml; do
95+
if [ "$FILE" != "src/Core/Resources/translations/messages.en.yaml" ]; then
96+
echo "Checking for missing translations in $FILE"
97+
php bin/console app:show-missing-translations \
98+
src/Core/Resources/translations/messages.en.yaml \
99+
"$FILE" \
100+
--env=test
101+
fi
102+
done
103+
env:
104+
DATABASE_URL: 'mysql://test_user:[email protected]:3306/test_db'

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
---
44

5+
## [0.4.3] - 2025-03-24
6+
7+
### Added
8+
- Introduced a new `app:update-system` command to automate project updates.
9+
- Added configuration options to enable/disable dark mode and specify a default mode.
10+
11+
### Changed
12+
- Refined default theme colors for dark mode.
13+
- Minor CSS changes in the default theme for improved layout consistency.
14+
15+
### Fixed
16+
- Resolved an issue preventing emails from being sent.
17+
- Addressed a bug that caused Stripe payments to fail.
18+
19+
---
20+
521
## [0.4.2] - 2025-03-16
622

723
### Added

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "pteroca/panel",
33
"description": "PteroCA.com is a free, open-source client area and management panel designed specifically for Pterodactyl server users and hosting providers. The platform simplifies and automates server management with a user-friendly interface and robust billing features.",
4-
"version": "0.4.2",
4+
"version": "0.4.3",
55
"type": "project",
66
"license": "MIT",
77
"minimum-stability": "stable",
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use App\Core\Enum\SettingEnum;
8+
use Doctrine\DBAL\Schema\Schema;
9+
use Doctrine\Migrations\AbstractMigration;
10+
11+
final class Version20250318092258 extends AbstractMigration
12+
{
13+
public function getDescription(): string
14+
{
15+
return 'Disable web wizard if already configured';
16+
}
17+
18+
public function up(Schema $schema): void
19+
{
20+
if ($this->isPterodactylApiKeyExist()) {
21+
$this->addSql('UPDATE setting SET value = 1 WHERE name = "is_configured"');
22+
}
23+
}
24+
25+
public function down(Schema $schema): void
26+
{
27+
if (!$this->isPterodactylApiKeyExist()) {
28+
$this->addSql('UPDATE setting SET value = 0 WHERE name = "is_configured"');
29+
}
30+
}
31+
32+
private function isPterodactylApiKeyExist(): bool
33+
{
34+
$setting = $this->connection->fetchAssociative(
35+
'SELECT * FROM setting WHERE name = :name',
36+
['name' => SettingEnum::PTERODACTYL_API_KEY->value]
37+
);
38+
39+
return !empty($setting['value']);
40+
}
41+
}
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
final class Version20250318102118 extends AbstractMigration
11+
{
12+
private const NEW_SETTINGS = [
13+
[
14+
'name' => 'theme_disable_dark_mode',
15+
'value' => '0',
16+
'type' => 'boolean',
17+
'context' => 'theme_settings',
18+
'hierarchy' => 30,
19+
],
20+
[
21+
'name' => 'theme_default_mode',
22+
'value' => 'light',
23+
'type' => 'string',
24+
'context' => 'theme_settings',
25+
'hierarchy' => 30,
26+
],
27+
[
28+
'name' => 'theme_default_background_color',
29+
'value' => '#ffffff',
30+
'type' => 'color',
31+
'context' => 'theme_settings',
32+
'hierarchy' => 30,
33+
],
34+
[
35+
'name' => 'theme_default_link_color',
36+
'value' => '#5c70d6',
37+
'type' => 'color',
38+
'context' => 'theme_settings',
39+
'hierarchy' => 30,
40+
],
41+
[
42+
'name' => 'theme_default_link_hover_color',
43+
'value' => '#99a6e6',
44+
'type' => 'color',
45+
'context' => 'theme_settings',
46+
'hierarchy' => 30,
47+
],
48+
[
49+
'name' => 'theme_default_dark_background_color',
50+
'value' => '#14172e',
51+
'type' => 'color',
52+
'context' => 'theme_settings',
53+
'hierarchy' => 30,
54+
],
55+
[
56+
'name' => 'theme_default_dark_link_color',
57+
'value' => '#5d6bc6',
58+
'type' => 'color',
59+
'context' => 'theme_settings',
60+
'hierarchy' => 30,
61+
],
62+
[
63+
'name' => 'theme_default_dark_link_hover_color',
64+
'value' => '#7c8bfd',
65+
'type' => 'color',
66+
'context' => 'theme_settings',
67+
'hierarchy' => 30,
68+
],
69+
[
70+
'name' => 'theme_default_secondary_color',
71+
'value' => '#f8fafc',
72+
'type' => 'color',
73+
'context' => 'theme_settings',
74+
'hierarchy' => 30,
75+
],
76+
[
77+
'name' => 'theme_default_dark_secondary_color',
78+
'value' => '#1c222c',
79+
'type' => 'color',
80+
'context' => 'theme_settings',
81+
'hierarchy' => 30,
82+
],
83+
];
84+
85+
private const SETTINGS_TO_UPDATE = [
86+
[
87+
'name' => 'theme_default_dark_primary_color',
88+
'oldValue' => '#2e59d9',
89+
'newValue' => '#1f2347',
90+
]
91+
];
92+
public function getDescription(): string
93+
{
94+
return 'New appearance settings';
95+
}
96+
97+
public function up(Schema $schema): void
98+
{
99+
foreach (self::NEW_SETTINGS as $setting) {
100+
$this->addSql('INSERT INTO setting (name, value, type, context, hierarchy) VALUES (:name, :value, :type, :context, :hierarchy)', $setting);
101+
}
102+
103+
foreach (self::SETTINGS_TO_UPDATE as $setting) {
104+
$this->addSql('UPDATE setting SET value = :newValue WHERE name = :name', $setting);
105+
}
106+
}
107+
108+
public function down(Schema $schema): void
109+
{
110+
foreach (self::NEW_SETTINGS as $setting) {
111+
$this->addSql('DELETE FROM setting WHERE name = :name', $setting);
112+
}
113+
114+
foreach (self::SETTINGS_TO_UPDATE as $setting) {
115+
$this->addSql('UPDATE setting SET value = :oldValue WHERE name = :name', $setting);
116+
}
117+
}
118+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
final class Version20250318192450 extends AbstractMigration
11+
{
12+
private const NEW_HIERARCHY = [
13+
[
14+
'name' => 'theme_disable_dark_mode',
15+
'hierarchy' => 25,
16+
'old_hierarchy' => 30,
17+
],
18+
[
19+
'name' => 'theme_default_mode',
20+
'hierarchy' => 26,
21+
'old_hierarchy' => 30,
22+
],
23+
[
24+
'name' => 'customer_motd_enabled',
25+
'hierarchy' => 50,
26+
'old_hierarchy' => 100,
27+
],
28+
[
29+
'name' => 'customer_motd_title',
30+
'hierarchy' => 51,
31+
'old_hierarchy' => 100,
32+
],
33+
[
34+
'name' => 'customer_motd_message',
35+
'hierarchy' => 52,
36+
'old_hierarchy' => 100,
37+
],
38+
[
39+
'name' => 'theme_default_primary_color',
40+
'hierarchy' => 70,
41+
'old_hierarchy' => 30,
42+
],
43+
[
44+
'name' => 'theme_default_secondary_color',
45+
'hierarchy' => 71,
46+
'old_hierarchy' => 30,
47+
],
48+
[
49+
'name' => 'theme_default_background_color',
50+
'hierarchy' => 72,
51+
'old_hierarchy' => 30,
52+
],
53+
[
54+
'name' => 'theme_default_link_color',
55+
'hierarchy' => 73,
56+
'old_hierarchy' => 30,
57+
],
58+
[
59+
'name' => 'theme_default_link_hover_color',
60+
'hierarchy' => 74,
61+
'old_hierarchy' => 30,
62+
],
63+
[
64+
'name' => 'theme_default_dark_primary_color',
65+
'hierarchy' => 80,
66+
'old_hierarchy' => 30,
67+
],
68+
[
69+
'name' => 'theme_default_dark_secondary_color',
70+
'hierarchy' => 81,
71+
'old_hierarchy' => 30,
72+
],
73+
[
74+
'name' => 'theme_default_dark_background_color',
75+
'hierarchy' => 82,
76+
'old_hierarchy' => 30,
77+
],
78+
[
79+
'name' => 'theme_default_dark_link_color',
80+
'hierarchy' => 83,
81+
'old_hierarchy' => 30,
82+
],
83+
[
84+
'name' => 'theme_default_dark_link_hover_color',
85+
'hierarchy' => 84,
86+
'old_hierarchy' => 30,
87+
],
88+
];
89+
90+
public function getDescription(): string
91+
{
92+
return 'Update hierarchy of theme settings';
93+
}
94+
95+
public function up(Schema $schema): void
96+
{
97+
foreach (self::NEW_HIERARCHY as $setting) {
98+
$this->addSql('UPDATE setting SET hierarchy = :hierarchy WHERE name = :name', $setting);
99+
}
100+
}
101+
102+
public function down(Schema $schema): void
103+
{
104+
foreach (self::NEW_HIERARCHY as $setting) {
105+
$this->addSql('UPDATE setting SET hierarchy = :old_hierarchy WHERE name = :name', $setting);
106+
}
107+
}
108+
}

public/assets/theme/default/css/panel.css

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,6 @@
3636
background-color: var(--bs-secondary-bg);
3737
}
3838

39-
a {
40-
color: var(--primary-color);
41-
}
42-
43-
a:hover {
44-
color: var(--primary-color);
45-
}
46-
47-
.dropdown-settings .dropdown-item.active, .dropdown-settings .dropdown-item.active i {
48-
color: var(--primary-color);
49-
background: rgba(89, 134, 165, 0.05);
50-
}
5139

5240
.dropdown-settings .dropdown-item.active {
5341
box-shadow: inset 0 0 0 1px rgba(89, 134, 165, 0.5);
@@ -161,6 +149,7 @@ a:hover {
161149
}
162150

163151
input#command {
152+
border: 0.1 solid var(--secondary-color);
164153
border-bottom: 0.13rem solid var(--primary-color);
165154
border-bottom-left-radius: 0;
166155
border-bottom-right-radius: 0;
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace App\Core\Command;
4+
5+
use App\Core\Handler\UpdateSystemHandler;
6+
use Symfony\Component\Console\Attribute\AsCommand;
7+
use Symfony\Component\Console\Command\Command;
8+
use Symfony\Component\Console\Input\InputInterface;
9+
use Symfony\Component\Console\Output\OutputInterface;
10+
use Symfony\Component\Console\Style\SymfonyStyle;
11+
12+
#[AsCommand(
13+
name: 'app:update-system',
14+
description: 'Update system command',
15+
)]
16+
class UpdateSystemCommand extends Command
17+
{
18+
public function __construct(
19+
private readonly UpdateSystemHandler $updateSystemHandler
20+
)
21+
{
22+
parent::__construct();
23+
}
24+
25+
protected function execute(InputInterface $input, OutputInterface $output): int
26+
{
27+
$io = new SymfonyStyle($input, $output);
28+
$this->updateSystemHandler
29+
->setIo($io)
30+
->handle();
31+
32+
if ($this->updateSystemHandler->hasError()) {
33+
$io->error(sprintf(
34+
'Update process has been finished with errors. Current version: %s',
35+
$this->updateSystemHandler->getCurrentVersion(),
36+
));
37+
38+
return Command::FAILURE;
39+
} else {
40+
$io->success(sprintf(
41+
'Update process has been finished successfully. Current version: %s',
42+
$this->updateSystemHandler->getCurrentVersion(),
43+
));
44+
45+
return Command::SUCCESS;
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)