feat(core/css): attempt at completely removing the need for modifying pterodactyl.css

This commit is contained in:
prplwtf 2023-12-03 18:48:41 +01:00
parent 454ac89379
commit b5b62ae643
4 changed files with 12 additions and 9 deletions

View file

@ -230,9 +230,9 @@ if [[ $1 != "-bash" ]]; then
# Inject custom Blueprint css into Pterodactyl's admin panel.
log_bright "[INFO] Modifying admin panel css."
sed -i "s!@import url(/assets/extensions/blueprint/blueprint.style.css);!!g" $FOLDER/public/themes/pterodactyl/css/pterodactyl.css
sed -i "s!/\* admin.css \*/!!g" $FOLDER/public/themes/pterodactyl/css/pterodactyl.css
sed -i '1i@import url(/assets/extensions/blueprint/blueprint.style.css);\n/* admin.css */' $FOLDER/public/themes/pterodactyl/css/pterodactyl.css
sed -i "s!@import url(/assets/extensions/blueprint/blueprint.style.css);!!g" $FOLDER/.blueprint/extensions/blueprint/assets/admin.extensions.css
sed -i "s!/\* admin.css \*/!!g" $FOLDER/.blueprint/extensions/blueprint/assets/admin.extensions.css
sed -i '1i@import url(/assets/extensions/blueprint/blueprint.style.css);\n/* admin.css */' $FOLDER/.blueprint/extensions/blueprint/assets/admin.extensions.css
# Clear view cache.
log_bright "[INFO] Clearing view cache.."
@ -587,15 +587,15 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) ]]; then VCMD="y"
if [[ $admin_css != "" ]]; then
log_bright "[INFO] Placing admin css.."
updateCacheReminder
sed -i "s~@import url(/assets/extensions/$identifier/admin.style.css);~~g" "public/themes/pterodactyl/css/pterodactyl.css"
sed -i "s~/\* admin.css \*/~/\* admin.css \*/\n@import url(/assets/extensions/$identifier/admin.style.css);~g" "public/themes/pterodactyl/css/pterodactyl.css"
sed -i "s~@import url(/assets/extensions/$identifier/admin.style.css);~~g" ".blueprint/extensions/blueprint/assets/admin.extensions.css"
echo -e "@import url(/assets/extensions/$identifier/admin.style.css);" >> ".blueprint/extensions/blueprint/assets/admin.extensions.css"
cp ".blueprint/tmp/$n/$admin_css" ".blueprint/extensions/$identifier/assets/admin.style.css"
fi
if [[ $dashboard_css != "" ]]; then
log_bright "[INFO] Placing dashboard css.."
YARN="y"
sed -i "s~@import url($identifier.css);~~g" "resources/scripts/css/extensions.css"
sed -i "s~/\* client.css \*/~/\* client.css \*/\n@import url($identifier.css);~g" "resources/scripts/css/extensions.css"
echo -e "@import url($identifier.css);" >> "resources/scripts/css/extensions.css"
cp ".blueprint/tmp/$n/$dashboard_css" "resources/scripts/css/$identifier.css"
fi
@ -871,8 +871,8 @@ if [[ ( $2 == "-r" ) || ( $2 == "-remove" ) ]]; then VCMD="y"
if [[ $admin_css != "" ]]; then
log_bright "[INFO] Removing admin css.."
updateCacheReminder
sed -i "s~@import url(/assets/extensions/$identifier/admin.style.css);~~g" "public/themes/pterodactyl/css/pterodactyl.css"
sed -i "s~@import url(/assets/extensions/$identifier/$identifier.style.css);~~g" "public/themes/pterodactyl/css/pterodactyl.css"; #this removes changes made in older versions of blueprint
sed -i "s~@import url(/assets/extensions/$identifier/admin.style.css);~~g" ".blueprint/extensions/blueprint/assets/admin.extensions.css"
sed -i "s~@import url(/assets/extensions/$identifier/$identifier.style.css);~~g" ".blueprint/extensions/blueprint/assets/admin.extensions.css"; #this removes changes made in older versions of blueprint
fi
# Remove admin wrapper

View file

@ -0,0 +1 @@
/* admin.css */

View file

@ -1,5 +1,5 @@
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css");
@import url("/assets/extensions/blueprint/misc/cacheOverlay-1.css");
@import url("/assets/extensions/blueprint/admin.extensions.css");
@keyframes notification {
0% { right:-300px; top:62px; opacity:0; background-color: #1f2933; }

View file

@ -38,6 +38,8 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" href="https://unpkg.com/boxicons@latest/css/boxicons.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
<link rel="stylesheet" href="/assets/extensions/blueprint/admin.extensions.css">
<link rel="stylesheet" href="/assets/extensions/blueprint/blueprint.style.css">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>