mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 23:03:45 +02:00
Merge branch 'release/v0.7.14' into feature/react
This commit is contained in:
@@ -255,6 +255,31 @@ $(document).ready(function () {
|
||||
|
||||
TimeLabels.push($.format.date(new Date(), 'HH:mm:ss'));
|
||||
|
||||
|
||||
// memory.cmax is the maximum given by the container
|
||||
// memory.amax is given by the json config
|
||||
// use the maximum of both
|
||||
// with no limit memory.cmax will always be higher
|
||||
// but with limit memory.amax is sometimes still smaller than memory.total
|
||||
MemoryChart.config.options.scales.yAxes[0].ticks.max = Math.max(proc.data.memory.cmax, proc.data.memory.amax) / (1000 * 1000);
|
||||
|
||||
if (Pterodactyl.server.cpu > 0) {
|
||||
// if there is a cpu limit defined use 100% as maximum
|
||||
CPUChart.config.options.scales.yAxes[0].ticks.max = 100;
|
||||
} else {
|
||||
// if there is no cpu limit defined use linux percentage
|
||||
// and find maximum in all values
|
||||
var maxCpu = 1;
|
||||
for(var i = 0; i < CPUData.length; i++) {
|
||||
maxCpu = Math.max(maxCpu, parseFloat(CPUData[i]))
|
||||
}
|
||||
|
||||
maxCpu = Math.ceil(maxCpu / 100) * 100;
|
||||
CPUChart.config.options.scales.yAxes[0].ticks.max = maxCpu;
|
||||
}
|
||||
|
||||
|
||||
|
||||
CPUChart.update();
|
||||
MemoryChart.update();
|
||||
});
|
||||
@@ -301,6 +326,13 @@ $(document).ready(function () {
|
||||
},
|
||||
animation: {
|
||||
duration: 1,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -346,6 +378,13 @@ $(document).ready(function () {
|
||||
},
|
||||
animation: {
|
||||
duration: 1,
|
||||
},
|
||||
scales: {
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -29,6 +29,10 @@ class ActionsClass {
|
||||
this.element = undefined;
|
||||
}
|
||||
|
||||
sanitizedString(value) {
|
||||
return $('<div>').text(value).html();
|
||||
}
|
||||
|
||||
folder(path) {
|
||||
let inputValue
|
||||
if (path) {
|
||||
@@ -296,7 +300,7 @@ class ActionsClass {
|
||||
swal({
|
||||
type: 'warning',
|
||||
title: '',
|
||||
text: 'Are you sure you want to delete <code>' + delName + '</code>?',
|
||||
text: 'Are you sure you want to delete <code>' + this.sanitizedString(delName) + '</code>?',
|
||||
html: true,
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
@@ -394,7 +398,7 @@ class ActionsClass {
|
||||
let formattedItems = "";
|
||||
let i = 0;
|
||||
$.each(selectedItems, function(key, value) {
|
||||
formattedItems += ("<code>" + value + "</code>, ");
|
||||
formattedItems += ("<code>" + this.sanitizedString(value) + "</code>, ");
|
||||
i++;
|
||||
return i < 5;
|
||||
});
|
||||
@@ -407,7 +411,7 @@ class ActionsClass {
|
||||
swal({
|
||||
type: 'warning',
|
||||
title: '',
|
||||
text: 'Are you sure you want to delete the following files: ' + formattedItems + '?',
|
||||
text: 'Are you sure you want to delete the following files: ' + this.sanitizedString(formattedItems) + '?',
|
||||
html: true,
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
@@ -536,7 +540,7 @@ class ActionsClass {
|
||||
type: 'error',
|
||||
title: 'Whoops!',
|
||||
html: true,
|
||||
text: error
|
||||
text: this.sanitizedString(error)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class ContextMenuClass {
|
||||
|
||||
if (Pterodactyl.permissions.createFiles) {
|
||||
buildMenu += '<li class="divider"></li> \
|
||||
<li data-action="file"><a href="/server/'+ Pterodactyl.server.uuidShort +'/files/add/?dir=' + newFilePath + '" class="text-muted"><i class="fa fa-fw fa-plus"></i> New File</a></li> \
|
||||
<li data-action="file"><a href="/server/'+ Pterodactyl.server.uuidShort +'/files/add/?dir=' + $('<div>').text(newFilePath).html() + '" class="text-muted"><i class="fa fa-fw fa-plus"></i> New File</a></li> \
|
||||
<li data-action="folder"><a tabindex="-1" href="#"><i class="fa fa-fw fa-folder"></i> New Folder</a></li>';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user