|
312 | 312 | <form action="{{ route('admin.nodes.post.allocations', $node->id) }}" method="POST"> |
313 | 313 | <div class="row" id="duplicate"> |
314 | 314 | <div class="col-md-4 fuelux"> |
315 | | - <label for="" class="control-label">IP Address</label> |
| 315 | + <label for="" class="control-label">IP Address or FQDN</label> |
316 | 316 | <div class="input-group input-append dropdown combobox allocationComboBox" data-initialize="combobox"> |
317 | 317 | <input type="text" name="allocate_ip[]" class="form-control pillbox_ip" style="border-right:0;"> |
318 | 318 | <div class="input-group-btn"> |
|
509 | 509 |
|
510 | 510 | $('.cloneElement').on('click', function (event) { |
511 | 511 | event.preventDefault(); |
512 | | - var cloned = $('#duplicate').clone(); |
513 | 512 | var rnd = randomKey(10); |
| 513 | + var cloned = $('#duplicate').clone().attr('id', rnd); |
514 | 514 | cloned.find('.allocationPillbox').removeClass('allocationPillbox').addClass('allocationPillbox_' + rnd); |
515 | 515 | cloned.find('.pillboxMain').removeClass('pillboxMain').addClass('pillbox_' + rnd); |
516 | | - cloned.find('.removeClone').removeClass('disabled'); |
| 516 | + cloned.find('.removeClone').removeClass('disabled').attr('data-parent', rnd); |
517 | 517 | cloned.find('.pillbox_ip').removeClass('pillbox_ip').addClass('pillbox_ip_' + rnd); |
518 | 518 | cloned.insertAfter('#duplicate'); |
519 | 519 | $('.allocationPillbox_' + rnd).pillbox(); |
520 | 520 | $('.allocationPillbox_' + rnd).on('added.fu.pillbox edited.fu.pillbox removed.fu.pillbox', function pillboxChanged() { |
521 | 521 | $('.pillbox_' + rnd).val(JSON.stringify($('.allocationPillbox_' + rnd).pillbox('items'))); |
522 | 522 | }); |
523 | | - $('.removeClone').on('click', function (event) { |
| 523 | + $('.removeClone').unbind().on('click', function (event) { |
524 | 524 | event.preventDefault(); |
525 | 525 | var element = $(this); |
526 | | - element.parent().parent().slideUp(function () { |
| 526 | + $('#' + element.attr('data-parent')).slideUp(function () { |
527 | 527 | element.remove(); |
528 | | - $('.pillbox_' + rnd).remove(); |
529 | | - $('.pillbox_ip_' + rnd).remove(); |
| 528 | + $('.pillbox_' + element.attr('data-parent')).remove(); |
| 529 | + $('.pillbox_ip_' + element.attr('data-parent')).remove(); |
530 | 530 | }); |
531 | 531 | }); |
532 | | - }) |
| 532 | + }); |
533 | 533 |
|
534 | 534 | $('.allocationPillbox').pillbox(); |
535 | 535 | $('.allocationComboBox').combobox(); |
|
628 | 628 |
|
629 | 629 | socket.on('live-stats', function (data) { |
630 | 630 |
|
631 | | - if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) { |
632 | | - memoryGraphSettings.data[0].shift(); |
633 | | - } |
634 | | - if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) { |
635 | | - cpuGraphSettings.data[0].shift(); |
636 | | - } |
637 | | - if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) { |
638 | | - playersGraphSettings.data[0].shift(); |
639 | | - } |
640 | | -
|
641 | | - memoryGraphSettings.data[0].push({ |
642 | | - 'date': new Date(), |
643 | | - 'memory': parseInt(data.stats.memory / (1024 * 1024)) |
644 | | - }); |
645 | | -
|
646 | | - cpuGraphSettings.data[0].push({ |
647 | | - 'date': new Date(), |
648 | | - 'cpu': data.stats.cpu |
649 | | - }); |
650 | | -
|
651 | | - playersGraphSettings.data[0].push({ |
652 | | - 'date': new Date(), |
653 | | - 'players': data.stats.players |
654 | | - }); |
| 631 | + // if (typeof memoryGraphSettings.data[0][100] !== 'undefined' || memoryGraphSettings.data[0][0].memory === -1) { |
| 632 | + // memoryGraphSettings.data[0].shift(); |
| 633 | + // } |
| 634 | + // if (typeof cpuGraphSettings.data[0][100] !== 'undefined' || cpuGraphSettings.data[0][0].cpu === -1) { |
| 635 | + // cpuGraphSettings.data[0].shift(); |
| 636 | + // } |
| 637 | + // if (typeof playersGraphSettings.data[0][100] !== 'undefined' || playersGraphSettings.data[0][0].players === -1) { |
| 638 | + // playersGraphSettings.data[0].shift(); |
| 639 | + // } |
655 | 640 |
|
656 | | - MG.data_graphic(memoryGraphSettings); |
657 | | - MG.data_graphic(cpuGraphSettings); |
658 | | - MG.data_graphic(playersGraphSettings); |
| 641 | + // memoryGraphSettings.data[0].push({ |
| 642 | + // 'date': new Date(), |
| 643 | + // 'memory': parseInt(data.stats.memory / (1024 * 1024)) |
| 644 | + // }); |
| 645 | + // |
| 646 | + // cpuGraphSettings.data[0].push({ |
| 647 | + // 'date': new Date(), |
| 648 | + // 'cpu': data.stats.cpu |
| 649 | + // }); |
| 650 | + // |
| 651 | + // playersGraphSettings.data[0].push({ |
| 652 | + // 'date': new Date(), |
| 653 | + // 'players': data.stats.players |
| 654 | + // }); |
659 | 655 |
|
| 656 | + // MG.data_graphic(memoryGraphSettings); |
| 657 | + // MG.data_graphic(cpuGraphSettings); |
| 658 | + // MG.data_graphic(playersGraphSettings); |
| 659 | + // |
660 | 660 | $.each(data.servers, function (uuid, info) { |
661 | 661 | var element = $('tr[data-server="' + uuid + '"]'); |
662 | 662 | element.find('[data-action="status"]').html(Status[info.status]); |
|
0 commit comments