Skip to content

v0.4.3 #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/symfony.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,18 @@ jobs:
with:
name: junit-test-report
path: junit.xml

- name: Check Missing Translations
run: |
set -e
for FILE in src/Core/Resources/translations/messages.*.yaml; do
if [ "$FILE" != "src/Core/Resources/translations/messages.en.yaml" ]; then
echo "Checking for missing translations in $FILE"
php bin/console app:show-missing-translations \
src/Core/Resources/translations/messages.en.yaml \
"$FILE" \
--env=test
fi
done
env:
DATABASE_URL: 'mysql://test_user:test_password@127.0.0.1:3306/test_db'
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

---

## [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.

---

## [0.4.2] - 2025-03-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pteroca/panel",
"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.",
"version": "0.4.2",
"version": "0.4.3",
"type": "project",
"license": "MIT",
"minimum-stability": "stable",
Expand Down
41 changes: 41 additions & 0 deletions migrations/Version20250318092258.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use App\Core\Enum\SettingEnum;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20250318092258 extends AbstractMigration
{
public function getDescription(): string
{
return 'Disable web wizard if already configured';
}

public function up(Schema $schema): void
{
if ($this->isPterodactylApiKeyExist()) {
$this->addSql('UPDATE setting SET value = 1 WHERE name = "is_configured"');
}
}

public function down(Schema $schema): void
{
if (!$this->isPterodactylApiKeyExist()) {
$this->addSql('UPDATE setting SET value = 0 WHERE name = "is_configured"');
}
}

private function isPterodactylApiKeyExist(): bool
{
$setting = $this->connection->fetchAssociative(
'SELECT * FROM setting WHERE name = :name',
['name' => SettingEnum::PTERODACTYL_API_KEY->value]
);

return !empty($setting['value']);
}
}
118 changes: 118 additions & 0 deletions migrations/Version20250318102118.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20250318102118 extends AbstractMigration
{
private const NEW_SETTINGS = [
[
'name' => 'theme_disable_dark_mode',
'value' => '0',
'type' => 'boolean',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_mode',
'value' => 'light',
'type' => 'string',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_background_color',
'value' => '#ffffff',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_link_color',
'value' => '#5c70d6',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_link_hover_color',
'value' => '#99a6e6',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_dark_background_color',
'value' => '#14172e',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_dark_link_color',
'value' => '#5d6bc6',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_dark_link_hover_color',
'value' => '#7c8bfd',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_secondary_color',
'value' => '#f8fafc',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
[
'name' => 'theme_default_dark_secondary_color',
'value' => '#1c222c',
'type' => 'color',
'context' => 'theme_settings',
'hierarchy' => 30,
],
];

private const SETTINGS_TO_UPDATE = [
[
'name' => 'theme_default_dark_primary_color',
'oldValue' => '#2e59d9',
'newValue' => '#1f2347',
]
];
public function getDescription(): string
{
return 'New appearance settings';
}

public function up(Schema $schema): void
{
foreach (self::NEW_SETTINGS as $setting) {
$this->addSql('INSERT INTO setting (name, value, type, context, hierarchy) VALUES (:name, :value, :type, :context, :hierarchy)', $setting);
}

foreach (self::SETTINGS_TO_UPDATE as $setting) {
$this->addSql('UPDATE setting SET value = :newValue WHERE name = :name', $setting);
}
}

public function down(Schema $schema): void
{
foreach (self::NEW_SETTINGS as $setting) {
$this->addSql('DELETE FROM setting WHERE name = :name', $setting);
}

foreach (self::SETTINGS_TO_UPDATE as $setting) {
$this->addSql('UPDATE setting SET value = :oldValue WHERE name = :name', $setting);
}
}
}
108 changes: 108 additions & 0 deletions migrations/Version20250318192450.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20250318192450 extends AbstractMigration
{
private const NEW_HIERARCHY = [
[
'name' => 'theme_disable_dark_mode',
'hierarchy' => 25,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_mode',
'hierarchy' => 26,
'old_hierarchy' => 30,
],
[
'name' => 'customer_motd_enabled',
'hierarchy' => 50,
'old_hierarchy' => 100,
],
[
'name' => 'customer_motd_title',
'hierarchy' => 51,
'old_hierarchy' => 100,
],
[
'name' => 'customer_motd_message',
'hierarchy' => 52,
'old_hierarchy' => 100,
],
[
'name' => 'theme_default_primary_color',
'hierarchy' => 70,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_secondary_color',
'hierarchy' => 71,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_background_color',
'hierarchy' => 72,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_link_color',
'hierarchy' => 73,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_link_hover_color',
'hierarchy' => 74,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_dark_primary_color',
'hierarchy' => 80,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_dark_secondary_color',
'hierarchy' => 81,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_dark_background_color',
'hierarchy' => 82,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_dark_link_color',
'hierarchy' => 83,
'old_hierarchy' => 30,
],
[
'name' => 'theme_default_dark_link_hover_color',
'hierarchy' => 84,
'old_hierarchy' => 30,
],
];

public function getDescription(): string
{
return 'Update hierarchy of theme settings';
}

public function up(Schema $schema): void
{
foreach (self::NEW_HIERARCHY as $setting) {
$this->addSql('UPDATE setting SET hierarchy = :hierarchy WHERE name = :name', $setting);
}
}

public function down(Schema $schema): void
{
foreach (self::NEW_HIERARCHY as $setting) {
$this->addSql('UPDATE setting SET hierarchy = :old_hierarchy WHERE name = :name', $setting);
}
}
}
13 changes: 1 addition & 12 deletions public/assets/theme/default/css/panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@
background-color: var(--bs-secondary-bg);
}

a {
color: var(--primary-color);
}

a:hover {
color: var(--primary-color);
}

.dropdown-settings .dropdown-item.active, .dropdown-settings .dropdown-item.active i {
color: var(--primary-color);
background: rgba(89, 134, 165, 0.05);
}

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

input#command {
border: 0.1 solid var(--secondary-color);
border-bottom: 0.13rem solid var(--primary-color);
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
Expand Down
48 changes: 48 additions & 0 deletions src/Core/Command/UpdateSystemCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php

namespace App\Core\Command;

use App\Core\Handler\UpdateSystemHandler;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;

#[AsCommand(
name: 'app:update-system',
description: 'Update system command',
)]
class UpdateSystemCommand extends Command
{
public function __construct(
private readonly UpdateSystemHandler $updateSystemHandler
)
{
parent::__construct();
}

protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$this->updateSystemHandler
->setIo($io)
->handle();

if ($this->updateSystemHandler->hasError()) {
$io->error(sprintf(
'Update process has been finished with errors. Current version: %s',
$this->updateSystemHandler->getCurrentVersion(),
));

return Command::FAILURE;
} else {
$io->success(sprintf(
'Update process has been finished successfully. Current version: %s',
$this->updateSystemHandler->getCurrentVersion(),
));

return Command::SUCCESS;
}
}
}
Loading