Fix notifications for custom folder Pterodactyl installations.

This commit is contained in:
purple 2023-05-06 16:31:31 +02:00
parent 4ac2930ab1
commit f2cdfc9046
2 changed files with 9 additions and 7 deletions

View file

@ -1,6 +1,7 @@
#!/bin/bash
# This should allow Blueprint to run in docker.
# This should allow Blueprint to run in docker. Please note that changing the $FOLDER variable after running
# the Blueprint installation script will not change anything in any files besides blueprint.sh.
FOLDER="pterodactyl"
if [[ -f ".dockerenv" ]]; then
@ -83,6 +84,7 @@ if [[ $1 != "-bash" ]]; then
fi;
sed -i "s!&bp.folder&!$FOLDER!g" /var/www/$FOLDER/app/Http/Services/Helpers/BlueprintPlaceholderService;
sed -i "s!&bp.folder&!$FOLDER!g" /var/www/$FOLDER/resources/views/layouts/admin.blade.php;
clr_bright "php artisan down";
php artisan down;
@ -332,7 +334,7 @@ if [[ ( $2 == "-v" ) || ( $2 == "-version" ) ]]; then
fi;
if [[ $2 == "-init" ]]; then
error "-init is currently not available";
error "-init is currently not available";exit 1;
fi;
if [[ $2 == "-reinstall" ]]; then

View file

@ -58,7 +58,7 @@
</a>
</li>
<li>
<li><a href="{{ route('admin.extensions') }}" data-toggle="tooltip" data-placement="bottom" title="Extensions"><i class='fa fa-puzzle-piece <?php if(shell_exec("cd /var/www/pterodactyl;cat .blueprint/.flags/onboarding.md") == "*blueprint*"){ echo "bx-flashing"; } ?>'></i></a></li>
<li><a href="{{ route('admin.extensions') }}" data-toggle="tooltip" data-placement="bottom" title="Extensions"><i class='fa fa-puzzle-piece <?php if(shell_exec("cd /var/www/&bp.folder&;cat .blueprint/.flags/onboarding.md") == "*blueprint*"){ echo "bx-flashing"; } ?>'></i></a></li>
</li>
<li>
<li><a href="{{ route('index') }}" data-toggle="tooltip" data-placement="bottom" title="Exit Admin Control"><i class="fa fa-server"></i></a></li>
@ -158,22 +158,22 @@
@yield('content')
<?php
if(shell_exec("cd /var/www/pterodactyl;cat .blueprint/.flags/onboarding.md") == "*blueprint*") {
if(shell_exec("cd /var/www/&bp.folder&;cat .blueprint/.flags/onboarding.md") == "*blueprint*") {
echo "
<div class=\"notification\">
<p>Blueprint has now been installed, click the extension icon to take a look.</p>
</div>";
`cd /var/www/pterodactyl;rm .blueprint/.flags/onboarding.md;`;
`cd /var/www/&bp.folder&;rm .blueprint/.flags/onboarding.md;`;
}
$notification = shell_exec("cd /var/www/pterodactyl;cat .blueprint/.storage/notification");
$notification = shell_exec("cd /var/www/&bp.folder&;cat .blueprint/.storage/notification");
if($notification != null) {
echo "<div class=\"notification\">
<p>".$notification."</p>
</div>
";
shell_exec("cd /var/www/pterodactyl;rm .blueprint/.storage/notification;touch .blueprint/.storage/notification;");
shell_exec("cd /var/www/&bp.folder&;rm .blueprint/.storage/notification;touch .blueprint/.storage/notification;");
}
?>
</section>