mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-03-09 15:40:18 +00:00
Somes changes
This commit is contained in:
parent
d7ad4d8cfd
commit
e432112724
5 changed files with 33 additions and 193 deletions
|
@ -3,7 +3,7 @@
|
||||||
* Author : Tlams
|
* Author : Tlams
|
||||||
* Date : 2017/2018
|
* Date : 2017/2018
|
||||||
* Status: Dev
|
* Status: Dev
|
||||||
* Object : Massive LXC CT / KVM deployment system and for Proxmox clusters.
|
* Object : Massive LXC CT / KVM deployment and management system for Proxmox clusters.
|
||||||
* Information :
|
* Information :
|
||||||
This project is currently in active development.
|
This project is currently in active development.
|
||||||
You shouldn't use in production mode, use at your risks !
|
You shouldn't use in production mode, use at your risks !
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
[system]
|
[system]
|
||||||
; System configurations
|
; System configurations
|
||||||
user: hosting
|
user: hyperproxmox
|
||||||
|
|
||||||
; If not exist on start, the key is auto-generate.
|
; If not exist on start, the key will be auto-generate.
|
||||||
key_pvt: private/keys/Ragnarok.pvt.key
|
key_pvt: private/keys/Ragnarok.pvt.key
|
||||||
key_pub: private/keys/Ragnarok.pub.key
|
key_pub: private/keys/Ragnarok.pub.key
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ key_pub: private/keys/Ragnarok.pub.key
|
||||||
user: www-data
|
user: www-data
|
||||||
|
|
||||||
[api]:
|
[api]:
|
||||||
user: hosting_api
|
user: hyperproxmox
|
||||||
|
|
||||||
[databases]
|
[databases]
|
||||||
; Databases configurations
|
; Databases configurations
|
||||||
|
@ -45,11 +45,11 @@ walker_lock: /tmp/hyperproxmoxwalker.lock
|
||||||
|
|
||||||
|
|
||||||
[logger]
|
[logger]
|
||||||
; Active or not(True/False)
|
; Active or not(True/False - Case !)
|
||||||
debug = True
|
debug = True
|
||||||
|
|
||||||
; debug level 1: "INFO", 2: "WARNING", 3: "ERROR", 4: "CRITICAL", 5: "DEBUG"
|
; debug level 1: "INFO", 2: "WARNING", 3: "ERROR", 4: "CRITICAL", 5: "DEBUG"
|
||||||
debug_level = 5
|
debug_level = 2
|
||||||
|
|
||||||
; log output
|
; log output
|
||||||
logs_dir = /var/log/hyperproxmox/
|
logs_dir = /var/log/hyperproxmox/
|
|
@ -75,14 +75,12 @@ if __name__ == "__main__":
|
||||||
'/api/v1/instance', 'Instance',
|
'/api/v1/instance', 'Instance',
|
||||||
'/api/v1/instance/new', 'Instance',
|
'/api/v1/instance/new', 'Instance',
|
||||||
'/api/v1/instance/([0-9]+)', 'Instance',
|
'/api/v1/instance/([0-9]+)', 'Instance',
|
||||||
'/api/v1/instance/([0-9]+)/status/([a-z]+)', 'Instance',
|
'/api/v1/instance/([a-z0-9]+)/status/(start|stop|status|restart|reset|shutdown)', 'Instance',
|
||||||
|
|
||||||
'/api/v1/instance/([0-9]+)/package', 'package',
|
'/api/v1/instance/([0-9]+)/package', 'package',
|
||||||
'/api/v1/instance/([0-9]+)/vhost(?:/([0-9]+))', 'vhost',
|
'/api/v1/instance/([0-9]+)/vhost(?:/([0-9]+))', 'vhost',
|
||||||
'/api/v1/instance/([0-9]+)/database(?:/([0-9]+))', 'database',
|
'/api/v1/instance/([0-9]+)/database(?:/([0-9]+))', 'database',
|
||||||
|
|
||||||
# MAPPING NODES
|
|
||||||
'/api/v1/nodes(?:/([0-9]+))', 'node',
|
|
||||||
|
|
||||||
# MAPPING SERVICES
|
# MAPPING SERVICES
|
||||||
'/api/v1/service/([a-z]+)/instance/([0-9]+)/vhost(?:/([0-9]+))', 'service',
|
'/api/v1/service/([a-z]+)/instance/([0-9]+)/vhost(?:/([0-9]+))', 'service',
|
||||||
|
@ -90,7 +88,7 @@ if __name__ == "__main__":
|
||||||
# AUTH
|
# AUTH
|
||||||
'/api/v1/auth', 'Auth',
|
'/api/v1/auth', 'Auth',
|
||||||
|
|
||||||
# MANAGEMENT
|
# MANAGEMENT CLUSTER
|
||||||
'/api/v1/administration/cluster/(?:[0-9a-zA-Z\_\-]+)', 'Cluster',
|
'/api/v1/administration/cluster/(?:[0-9a-zA-Z\_\-]+)', 'Cluster',
|
||||||
'/api/v1/administration/cluster/', 'Cluster',
|
'/api/v1/administration/cluster/', 'Cluster',
|
||||||
'/api/v1/administration/cluster/new', 'Cluster',
|
'/api/v1/administration/cluster/new', 'Cluster',
|
||||||
|
|
|
@ -14,117 +14,15 @@ include(dirname(__DIR__).'/pages/includes/header.php');
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="panel panel-default">
|
<h3>
|
||||||
|
- Author : Tlams <br/>
|
||||||
<!--
|
- Date : 2017/2018 <br/>
|
||||||
|
- Status: Dev <br/>
|
||||||
<div class="col-lg-3 col-md-6">
|
- Object : Massive LXC CT / KVM deployment system and for Proxmox clusters. <br/>
|
||||||
<div class="panel panel-green">
|
Information : This project is currently in active development. <br/>
|
||||||
<div class="panel-heading">
|
You shouldn't use in production mode, use at your risks ! <br/>
|
||||||
<div class="row">
|
</h3>
|
||||||
<div class="col-xs-3">
|
|
||||||
<i class="fa fa-tasks fa-5x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge">12</div>
|
|
||||||
<div>Nodes in your insfrastucture</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a href="#">
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">View Details</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-3 col-md-6">
|
|
||||||
<div class="panel panel-green">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-3">
|
|
||||||
<i class="fa fa-tasks fa-5x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge">12</div>
|
|
||||||
<div>VMs in your insfrastucture</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a href="#">
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">View Details</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-lg-3 col-md-6">
|
|
||||||
<div class="panel panel-green">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-3">
|
|
||||||
<i class="fa fa-tasks fa-5x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge">12</div>
|
|
||||||
<div>New Tasks!</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a href="#">
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">View Details</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-lg-3 col-md-6">
|
|
||||||
<div class="panel panel-green">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-3">
|
|
||||||
<i class="fa fa-tasks fa-5x"></i>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge">12</div>
|
|
||||||
<div>New Tasks!</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<a href="#">
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">View Details</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<h3>Clusters may be dead</h3>
|
|
||||||
<div id="clusterdead" style="height: 300px;"></div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-12">
|
|
||||||
<h3>Hypervisors ressources critical</h3>
|
|
||||||
<div id="hypfull" style="height: 300px;"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -128,87 +128,30 @@ $(document).ready(function()
|
||||||
{
|
{
|
||||||
|
|
||||||
/* VM GESTION */
|
/* VM GESTION */
|
||||||
var dialog, form,
|
function sendrequest()
|
||||||
name = $( "#name" ),
|
{
|
||||||
password = $( "#password" ),
|
|
||||||
allFields = $( [] ).add( name ).add( password );
|
|
||||||
|
|
||||||
function sendrequest() {
|
|
||||||
// J'initialise le variable box
|
|
||||||
var box = $('.result');
|
|
||||||
|
|
||||||
var action = $( "#action" );
|
var action = $( "#action" );
|
||||||
var vmid = $( "#vmid" );
|
var id = $( "#bbaction" );
|
||||||
var node = $( "#node" );
|
var box = $('.result');
|
||||||
|
|
||||||
var commandinfo = "The status available in the table is not dynamically update, you must wait the next cron rotate. <br /> You can play the status command to have an updated informations";
|
var commandinfo = "The status available in the table is not dynamically update, you must wait the next cron rotate. <br /> You can play the status command to have an updated informations";
|
||||||
box.html('<center> <img src="images/icon-load.gif" height="60" width="60"></center>');
|
box.html('<center> <img src="images/icon-load.gif" height="60" width="60"></center>');
|
||||||
$('.selectaction').prop('selectedIndex',0);
|
|
||||||
// Je définis ma requête ajax
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
url: 'requires/pveaction.php?id='+id.val()+'&action=status',
|
||||||
// Adresse à laquelle la requête est envoyée
|
type : 'GET',
|
||||||
url: 'requires/pveaction.php',
|
|
||||||
type : 'POST',
|
|
||||||
data : 'user=' + name.val() + '&password=' + password.val() + '&action=' + action.val() + '&vmid=' + vmid.val() + '&node=' + node.val(),
|
|
||||||
// Le délai maximun en millisecondes de traitement de la demande
|
|
||||||
timeout: 32000,
|
timeout: 32000,
|
||||||
|
|
||||||
// La fonction à apeller si la requête aboutie
|
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
// Je charge les données dans box
|
|
||||||
box.html('<div class="alert alert-info"> <strong>Command return: </strong> '+data+' <br /> '+ commandinfo +'</div>');
|
box.html('<div class="alert alert-info"> <strong>Command return: </strong> '+data+' <br /> '+ commandinfo +'</div>');
|
||||||
},
|
},
|
||||||
|
|
||||||
// La fonction à appeler si la requête n'a pas abouti
|
|
||||||
error: function() {
|
error: function() {
|
||||||
// J'affiche un message d'erreur
|
|
||||||
box.html('<div class="alert alert-danger"> <strong>Error: </strong> Command failed, try again or contact an true admin. </div>');
|
box.html('<div class="alert alert-danger"> <strong>Error: </strong> Command failed, try again or contact an true admin. </div>');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.dialog( "close" );
|
|
||||||
$("html, body").animate({ scrollTop: $(document).height() }, "slow");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog = $( "#dialog-form" ).dialog({
|
|
||||||
autoOpen: false,
|
|
||||||
height: 250,
|
|
||||||
width: 350,
|
|
||||||
modal: true,
|
|
||||||
resizable: false,
|
|
||||||
buttons: {
|
|
||||||
"Send": sendrequest,
|
|
||||||
Cancel: function() {
|
|
||||||
dialog.dialog( "close" );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
close: function() {
|
|
||||||
form[ 0 ].reset();
|
|
||||||
allFields.removeClass( "ui-state-error" );
|
|
||||||
$('.selectaction').prop('selectedIndex',0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
form = dialog.find( "form" ).on( "submit", function( event ) {
|
|
||||||
event.preventDefault();
|
|
||||||
sendrequest();
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.dataTables-vm').on('change', '.selectaction',function() {
|
|
||||||
var jsonout = JSON.parse(this.value.replace(/'/g, '"'));
|
|
||||||
if (jsonout["action"] != "none") {
|
|
||||||
|
|
||||||
$('#action').val(jsonout["action"]);
|
|
||||||
$('#vmid').val(jsonout["vmid"]);
|
|
||||||
$('#node').val(jsonout["node"]);
|
|
||||||
dialog.dialog( "open" );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* NODE NON GRATA */
|
/* NODE NON GRATA */
|
||||||
|
|
||||||
function nongrataswitch(node, action) {
|
function nongrataswitch(node, action) {
|
||||||
|
@ -258,12 +201,13 @@ $(document).ready(function()
|
||||||
return false; // return false so the browser will not scroll your page
|
return false; // return false so the browser will not scroll your page
|
||||||
});
|
});
|
||||||
/* NEWVM -- SEARCH NODES */
|
/* NEWVM -- SEARCH NODES */
|
||||||
|
|
||||||
form = dialog.find( "form" ).on( "submit", function( event ) {
|
|
||||||
event.preventDefault();
|
$('#bbaction').on('click', function(event) {
|
||||||
sendrequest();
|
event.preventDefault(); // To prevent following the link (optional)
|
||||||
|
sendrequest();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function newvm() {
|
function newvm() {
|
||||||
// J'initialise le variable box
|
// J'initialise le variable box
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue