Merge branch 'release/v1.11.7' of https://github.com/pterodactyl/panel into release/v1.11.5

This commit is contained in:
Angelillo15 2024-05-11 17:11:39 +02:00
commit c332151c9a
29 changed files with 203 additions and 242 deletions

View file

@ -23,7 +23,7 @@ export interface ServerEggVariable {
description: string;
envVariable: string;
defaultValue: string;
serverValue: string;
serverValue: string | null;
isEditable: boolean;
rules: string[];
}

View file

@ -40,6 +40,7 @@ export const rawDataToFileObject = (data: FractalResponseData): FileObject => ({
'application/x-xz', // .tar.xz, .xz
'application/zstd', // .tar.zst, .zst
'application/zip', // .zip
'application/x-7z-compressed', // .7z
].indexOf(this.mimetype) >= 0
);
},

View file

@ -72,7 +72,7 @@ const EulaModalFeature = () => {
target={'_blank'}
css={tw`text-primary-300 underline transition-colors duration-150 hover:text-primary-400`}
rel={'noreferrer noopener'}
href='https://account.mojang.com/documents/minecraft_eula'
href='https://www.minecraft.net/eula'
>
Minecraft® EULA
</a>

View file

@ -5,7 +5,6 @@ import { usePermissions } from '@/plugins/usePermissions';
import InputSpinner from '@/components/elements/InputSpinner';
import Input from '@/components/elements/Input';
import Switch from '@/components/elements/Switch';
import tw from 'twin.macro';
import { debounce } from 'debounce';
import updateStartupVariable from '@/api/server/updateStartupVariable';
import useFlash from '@/plugins/useFlash';
@ -61,15 +60,15 @@ const VariableBox = ({ variable }: Props) => {
return (
<TitledGreyBox
title={
<p css={tw`text-sm uppercase`}>
<p className="text-sm uppercase">
{!variable.isEditable && (
<span css={tw`bg-neutral-700 text-xs py-1 px-2 rounded-full mr-2 mb-1`}>Read Only</span>
<span className="bg-neutral-700 text-xs py-1 px-2 rounded-full mr-2 mb-1">Read Only</span>
)}
{variable.name}
</p>
}
>
<FlashMessageRender byKey={FLASH_KEY} css={tw`mb-2 md:mb-4`} />
<FlashMessageRender byKey={FLASH_KEY} className="mb-2 md:mb-4" />
<InputSpinner visible={loading}>
{useSwitch ? (
<>
@ -97,7 +96,7 @@ const VariableBox = ({ variable }: Props) => {
<Select
onChange={(e) => setVariableValue(e.target.value)}
name={variable.envVariable}
defaultValue={variable.serverValue}
defaultValue={variable.serverValue ?? variable.defaultValue}
disabled={!canEdit || !variable.isEditable}
>
{selectValues.map((selectValue) => (
@ -120,7 +119,7 @@ const VariableBox = ({ variable }: Props) => {
}}
readOnly={!canEdit || !variable.isEditable}
name={variable.envVariable}
defaultValue={variable.serverValue}
defaultValue={variable.serverValue ?? ''}
placeholder={variable.defaultValue}
/>
</>
@ -128,7 +127,10 @@ const VariableBox = ({ variable }: Props) => {
</>
)}
</InputSpinner>
<p css={tw`mt-1 text-xs text-neutral-300`}>{variable.description}</p>
<p className="mt-1 text-xs text-neutral-300">
{variable.description}
</p>
</TitledGreyBox>
);
};

View file

@ -145,14 +145,20 @@
@section('footer-scripts')
@parent
<script>
function escapeHtml(str) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(str));
return div.innerHTML;
}
(function getInformation() {
$.ajax({
method: 'GET',
url: '/admin/nodes/view/{{ $node->id }}/system-information',
timeout: 5000,
}).done(function (data) {
$('[data-attr="info-version"]').html(data.version);
$('[data-attr="info-system"]').html(data.system.type + ' (' + data.system.arch + ') <code>' + data.system.release + '</code>');
$('[data-attr="info-version"]').html(escapeHtml(data.version));
$('[data-attr="info-system"]').html(escapeHtml(data.system.type) + ' (' + escapeHtml(data.system.arch) + ') <code>' + escapeHtml(data.system.release) + '</code>');
$('[data-attr="info-cpus"]').html(data.system.cpus);
}).fail(function (jqXHR) {

View file

@ -107,6 +107,12 @@
@parent
{!! Theme::js('vendor/lodash/lodash.js') !!}
<script>
function escapeHtml(str) {
var div = document.createElement('div');
div.appendChild(document.createTextNode(str));
return div.innerHTML;
}
$(document).ready(function () {
$('#pEggId').select2({placeholder: 'Select a Nest Egg'}).on('change', function () {
var selectedEgg = _.isNull($(this).val()) ? $(this).find('option').first().val() : $(this).val();
@ -119,7 +125,7 @@
for (let i = 0; i < keys.length; i++) {
let opt = document.createElement('option');
opt.value = images[keys[i]];
opt.innerHTML = keys[i] + " (" + images[keys[i]] + ")";
opt.innerText = keys[i] + " (" + images[keys[i]] + ")";
if (objectChain.id === parseInt(Pterodactyl.server.egg_id) && Pterodactyl.server.image == opt.value) {
opt.selected = true
}
@ -149,15 +155,15 @@
<div class="col-xs-12"> \
<div class="box"> \
<div class="box-header with-border"> \
<h3 class="box-title">' + isRequired + item.name + '</h3> \
<h3 class="box-title">' + isRequired + escapeHtml(item.name) + '</h3> \
</div> \
<div class="box-body"> \
<input name="environment[' + item.env_variable + ']" class="form-control" type="text" id="egg_variable_' + item.env_variable + '" /> \
<p class="no-margin small text-muted">' + item.description + '</p> \
<input name="environment[' + escapeHtml(item.env_variable) + ']" class="form-control" type="text" id="egg_variable_' + escapeHtml(item.env_variable) + '" /> \
<p class="no-margin small text-muted">' + escapeHtml(item.description) + '</p> \
</div> \
<div class="box-footer"> \
<p class="no-margin text-muted small"><strong>Startup Command Variable:</strong> <code>' + item.env_variable + '</code></p> \
<p class="no-margin text-muted small"><strong>Input Rules:</strong> <code>' + item.rules + '</code></p> \
<p class="no-margin text-muted small"><strong>Startup Command Variable:</strong> <code>' + escapeHtml(item.env_variable) + '</code></p> \
<p class="no-margin text-muted small"><strong>Input Rules:</strong> <code>' + escapeHtml(item.rules) + '</code></p> \
</div> \
</div> \
</div>';