FQDN support for allocations, and JS bug fix.
This commit is contained in:
parent
176d92176e
commit
ad906e0680
3 changed files with 51 additions and 37 deletions
|
@ -12,6 +12,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
* New API endpoints for individual users to control their servers with at `/api/me/*`.
|
* New API endpoints for individual users to control their servers with at `/api/me/*`.
|
||||||
* Typeahead support for owner email when adding a new server.
|
* Typeahead support for owner email when adding a new server.
|
||||||
* Scheduled command to clear out task log every month (configurable timespan).
|
* Scheduled command to clear out task log every month (configurable timespan).
|
||||||
|
* Support for allocating a FQDN as an allocation (panel will convert to IP and assign the FQDN as the alias automatically).
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
* Creating a user, server, or node now returns `HTTP/1.1 200` and a JSON element with the user/server/node's ID.
|
* Creating a user, server, or node now returns `HTTP/1.1 200` and a JSON element with the user/server/node's ID.
|
||||||
|
@ -23,6 +24,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
### Fixed
|
### Fixed
|
||||||
* Server overview listing the location short-code as the name of the node.
|
* Server overview listing the location short-code as the name of the node.
|
||||||
* Server task manager only sending commands every 5 minutes at the quickest.
|
* Server task manager only sending commands every 5 minutes at the quickest.
|
||||||
|
* Fixes additional port allocation from removing the wrong row when clicking 'x'.
|
||||||
|
|
||||||
## v0.5.0-pre.2 (Bodacious Boreopterus)
|
## v0.5.0-pre.2 (Bodacious Boreopterus)
|
||||||
|
|
||||||
|
|
|
@ -164,7 +164,17 @@ class NodeRepository {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
foreach($allocations as $rawIP => $ports) {
|
foreach($allocations as $rawIP => $ports) {
|
||||||
|
try {
|
||||||
|
$setAlias = null;
|
||||||
$parsedIP = Network::parse($rawIP);
|
$parsedIP = Network::parse($rawIP);
|
||||||
|
} catch (\Exception $ex) {
|
||||||
|
try {
|
||||||
|
$setAlias = $rawIP;
|
||||||
|
$parsedIP = Network::parse(gethostbyname($rawIP));
|
||||||
|
} catch (\Exception $ex) {
|
||||||
|
throw $ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
foreach($parsedIP as $ip) {
|
foreach($parsedIP as $ip) {
|
||||||
foreach($ports as $port) {
|
foreach($ports as $port) {
|
||||||
if (!is_int($port) && !preg_match('/^(\d{1,5})-(\d{1,5})$/', $port)) {
|
if (!is_int($port) && !preg_match('/^(\d{1,5})-(\d{1,5})$/', $port)) {
|
||||||
|
@ -182,6 +192,7 @@ class NodeRepository {
|
||||||
'node' => $node->id,
|
'node' => $node->id,
|
||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'port' => $assignPort,
|
'port' => $assignPort,
|
||||||
|
'ip_alias' => $setAlias,
|
||||||
'assigned_to' => null
|
'assigned_to' => null
|
||||||
]);
|
]);
|
||||||
$alloc->save();
|
$alloc->save();
|
||||||
|
@ -198,6 +209,7 @@ class NodeRepository {
|
||||||
'node' => $node->id,
|
'node' => $node->id,
|
||||||
'ip' => $ip,
|
'ip' => $ip,
|
||||||
'port' => $port,
|
'port' => $port,
|
||||||
|
'ip_alias' => $setAlias,
|
||||||
'assigned_to' => null
|
'assigned_to' => null
|
||||||
]);
|
]);
|
||||||
$alloc->save();
|
$alloc->save();
|
||||||
|
@ -208,7 +220,7 @@ class NodeRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
return true;
|
// return true;
|
||||||
} catch (\Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
throw $ex;
|
throw $ex;
|
||||||
|
|
|
@ -312,7 +312,7 @@
|
||||||
<form action="{{ route('admin.nodes.post.allocations', $node->id) }}" method="POST">
|
<form action="{{ route('admin.nodes.post.allocations', $node->id) }}" method="POST">
|
||||||
<div class="row" id="duplicate">
|
<div class="row" id="duplicate">
|
||||||
<div class="col-md-4 fuelux">
|
<div class="col-md-4 fuelux">
|
||||||
<label for="" class="control-label">IP Address</label>
|
<label for="" class="control-label">IP Address or FQDN</label>
|
||||||
<div class="input-group input-append dropdown combobox allocationComboBox" data-initialize="combobox">
|
<div class="input-group input-append dropdown combobox allocationComboBox" data-initialize="combobox">
|
||||||
<input type="text" name="allocate_ip[]" class="form-control pillbox_ip" style="border-right:0;">
|
<input type="text" name="allocate_ip[]" class="form-control pillbox_ip" style="border-right:0;">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
|
@ -509,27 +509,27 @@ $(document).ready(function () {
|
||||||
|
|
||||||
$('.cloneElement').on('click', function (event) {
|
$('.cloneElement').on('click', function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var cloned = $('#duplicate').clone();
|
|
||||||
var rnd = randomKey(10);
|
var rnd = randomKey(10);
|
||||||
|
var cloned = $('#duplicate').clone().attr('id', rnd);
|
||||||
cloned.find('.allocationPillbox').removeClass('allocationPillbox').addClass('allocationPillbox_' + rnd);
|
cloned.find('.allocationPillbox').removeClass('allocationPillbox').addClass('allocationPillbox_' + rnd);
|
||||||
cloned.find('.pillboxMain').removeClass('pillboxMain').addClass('pillbox_' + rnd);
|
cloned.find('.pillboxMain').removeClass('pillboxMain').addClass('pillbox_' + rnd);
|
||||||
cloned.find('.removeClone').removeClass('disabled');
|
cloned.find('.removeClone').removeClass('disabled').attr('data-parent', rnd);
|
||||||
cloned.find('.pillbox_ip').removeClass('pillbox_ip').addClass('pillbox_ip_' + rnd);
|
cloned.find('.pillbox_ip').removeClass('pillbox_ip').addClass('pillbox_ip_' + rnd);
|
||||||
cloned.insertAfter('#duplicate');
|
cloned.insertAfter('#duplicate');
|
||||||
$('.allocationPillbox_' + rnd).pillbox();
|
$('.allocationPillbox_' + rnd).pillbox();
|
||||||
$('.allocationPillbox_' + rnd).on('added.fu.pillbox edited.fu.pillbox removed.fu.pillbox', function pillboxChanged() {
|
$('.allocationPillbox_' + rnd).on('added.fu.pillbox edited.fu.pillbox removed.fu.pillbox', function pillboxChanged() {
|
||||||
$('.pillbox_' + rnd).val(JSON.stringify($('.allocationPillbox_' + rnd).pillbox('items')));
|
$('.pillbox_' + rnd).val(JSON.stringify($('.allocationPillbox_' + rnd).pillbox('items')));
|
||||||
});
|
});
|
||||||
$('.removeClone').on('click', function (event) {
|
$('.removeClone').unbind().on('click', function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var element = $(this);
|
var element = $(this);
|
||||||
element.parent().parent().slideUp(function () {
|
$('#' + element.attr('data-parent')).slideUp(function () {
|
||||||
element.remove();
|
element.remove();
|
||||||
$('.pillbox_' + rnd).remove();
|
$('.pillbox_' + element.attr('data-parent')).remove();
|
||||||
$('.pillbox_ip_' + rnd).remove();
|
$('.pillbox_ip_' + element.attr('data-parent')).remove();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
|
||||||
|
|
||||||
$('.allocationPillbox').pillbox();
|
$('.allocationPillbox').pillbox();
|
||||||
$('.allocationComboBox').combobox();
|
$('.allocationComboBox').combobox();
|
||||||
|
@ -628,35 +628,35 @@ $(document).ready(function () {
|
||||||
|
|
||||||
socket.on('live-stats', function (data) {
|
socket.on('live-stats', function (data) {
|
||||||
|
|
||||||
if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) {
|
// if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) {
|
||||||
memoryGraphSettings.data[0].shift();
|
// memoryGraphSettings.data[0].shift();
|
||||||
}
|
// }
|
||||||
if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) {
|
// if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) {
|
||||||
cpuGraphSettings.data[0].shift();
|
// cpuGraphSettings.data[0].shift();
|
||||||
}
|
// }
|
||||||
if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) {
|
// if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) {
|
||||||
playersGraphSettings.data[0].shift();
|
// playersGraphSettings.data[0].shift();
|
||||||
}
|
// }
|
||||||
|
|
||||||
memoryGraphSettings.data[0].push({
|
// memoryGraphSettings.data[0].push({
|
||||||
'date': new Date(),
|
// 'date': new Date(),
|
||||||
'memory': parseInt(data.stats.memory / (1024 * 1024))
|
// 'memory': parseInt(data.stats.memory / (1024 * 1024))
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
cpuGraphSettings.data[0].push({
|
// cpuGraphSettings.data[0].push({
|
||||||
'date': new Date(),
|
// 'date': new Date(),
|
||||||
'cpu': data.stats.cpu
|
// 'cpu': data.stats.cpu
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
playersGraphSettings.data[0].push({
|
// playersGraphSettings.data[0].push({
|
||||||
'date': new Date(),
|
// 'date': new Date(),
|
||||||
'players': data.stats.players
|
// 'players': data.stats.players
|
||||||
});
|
// });
|
||||||
|
|
||||||
MG.data_graphic(memoryGraphSettings);
|
|
||||||
MG.data_graphic(cpuGraphSettings);
|
|
||||||
MG.data_graphic(playersGraphSettings);
|
|
||||||
|
|
||||||
|
// MG.data_graphic(memoryGraphSettings);
|
||||||
|
// MG.data_graphic(cpuGraphSettings);
|
||||||
|
// MG.data_graphic(playersGraphSettings);
|
||||||
|
//
|
||||||
$.each(data.servers, function (uuid, info) {
|
$.each(data.servers, function (uuid, info) {
|
||||||
var element = $('tr[data-server="' + uuid + '"]');
|
var element = $('tr[data-server="' + uuid + '"]');
|
||||||
element.find('[data-action="status"]').html(Status[info.status]);
|
element.find('[data-action="status"]').html(Status[info.status]);
|
||||||
|
|
Loading…
Reference in a new issue