mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
add basic db setup, add vm expirations and cron to handle them, and add fields for sweetalert button classes
This commit is contained in:
parent
6debe3d9fd
commit
9beecf12fa
7 changed files with 186 additions and 8 deletions
|
@ -81,6 +81,15 @@ table, th, td {
|
|||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.proxstar-renewbtn {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
padding: 0px 0px 0px 0px;
|
||||
border-radius: 15px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.resource-usage {
|
||||
width: 50%;
|
||||
margin: 0 auto;
|
||||
|
|
|
@ -244,8 +244,13 @@ $("#eject-iso").click(function(){
|
|||
title: `Are you sure you want to eject ${iso}?`,
|
||||
icon: "warning",
|
||||
buttons: {
|
||||
cancel: true,
|
||||
delete: {
|
||||
cancel: {
|
||||
text: "Cancel",
|
||||
visible: true,
|
||||
closeModal: true,
|
||||
className: "",
|
||||
},
|
||||
eject: {
|
||||
text: "Eject",
|
||||
closeModal: false,
|
||||
className: "swal-button--danger",
|
||||
|
@ -262,6 +267,13 @@ $("#eject-iso").click(function(){
|
|||
}).then((response) => {
|
||||
return swal(`${iso} is now ejecting!`, {
|
||||
icon: "success",
|
||||
buttons: {
|
||||
ok: {
|
||||
text: "OK",
|
||||
closeModal: true,
|
||||
className: "",
|
||||
}
|
||||
}
|
||||
});
|
||||
}).then(() => {
|
||||
window.location = `/proxstar/vm/${vmid}`;
|
||||
|
@ -294,11 +306,16 @@ $("#change-iso").click(function(){
|
|||
title: 'Choose an ISO to mount:',
|
||||
content: iso_list,
|
||||
buttons: {
|
||||
cancel: true,
|
||||
cancel: {
|
||||
text: "Cancel",
|
||||
visible: true,
|
||||
closeModal: true,
|
||||
className: "",
|
||||
},
|
||||
select: {
|
||||
text: "Select",
|
||||
closeModal: false,
|
||||
className: "swal-button",
|
||||
className: "swal-button--danger",
|
||||
}
|
||||
},
|
||||
dangerMode: true,
|
||||
|
@ -313,6 +330,13 @@ $("#change-iso").click(function(){
|
|||
}).then((response) => {
|
||||
return swal(`${iso} is now being mounted!`, {
|
||||
icon: "success",
|
||||
buttons: {
|
||||
ok: {
|
||||
text: "OK",
|
||||
closeModal: true,
|
||||
className: "",
|
||||
}
|
||||
}
|
||||
});
|
||||
}).then(() => {
|
||||
window.location = `/proxstar/vm/${vmid}`;
|
||||
|
@ -335,3 +359,25 @@ $("#change-iso").click(function(){
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#renew-vm").click(function(){
|
||||
const vmname = $(this).data('vmname')
|
||||
const vmid = $(this).data('vmid')
|
||||
fetch(`/proxstar/vm/${vmid}/renew`, {
|
||||
credentials: 'same-origin',
|
||||
method: 'post'
|
||||
}).then((response) => {
|
||||
return swal(`${vmname} is now renewing!`, {
|
||||
icon: "success",
|
||||
});
|
||||
}).then(() => {
|
||||
window.location = `/proxstar/vm/${vmid}`;
|
||||
}).catch(err => {
|
||||
if (err) {
|
||||
swal("Uh oh...", `Unable to renew ${vmname}. Please try again later.`, "error");
|
||||
} else {
|
||||
swal.stopLoading();
|
||||
swal.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue