0.3.0: clickable breadcrumb + tabs, images, templates (CRUD), create wizard
This commit is contained in:
1 parent
dea7668fd8
commit
3eb5e6d013
14 files changed
+729
-22
No files matched your search
+24
-6
@@ -11,12 +11,30 @@ if ($name === '' || !vmm_valid_name($name)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (strtoupper((string)($_SERVER['REQUEST_METHOD'] ?? '')) === 'POST' && isset($_POST['act'])) {
|
||||
$act = (string)$_POST['act'];
|
||||
[$verb, $vmName] = array_pad(explode(':', $act, 2), 2, '');
|
||||
if ($vmName !== $name) {
|
||||
$vmName = $name;
|
||||
}
|
||||
$check = vmm_action_check($verb, $vmName, (string)($_POST['confirm'] ?? ''));
|
||||
if (!$check['ok']) {
|
||||
$_SESSION['vmmngr_error'] = $check['error'];
|
||||
header('Location: vmmngr_vm.php?name=' . urlencode($name));
|
||||
exit;
|
||||
}
|
||||
$job = vmm_job_new($verb, $vmName);
|
||||
header('Location: vmmngr_jobs.php?id=' . urlencode((string)$job['id']));
|
||||
exit;
|
||||
}
|
||||
|
||||
$info = vmm_info($name);
|
||||
$pgtitle = [gettext('Extensions'), gettext('VM Manager'), $name];
|
||||
$jobs = vmm_job_list(10, $name);
|
||||
|
||||
include 'fbegin.inc';
|
||||
vmm_css();
|
||||
vmm_nav('dashboard');
|
||||
?>
|
||||
|
||||
<form action="vmmngr_vm.php" method="post" name="iform" id="iform"><table id="area_data"><tbody><tr><td id="area_data_frame">
|
||||
@@ -53,14 +71,14 @@ vmm_css();
|
||||
<td class="celldata">
|
||||
<span class="vmm-actions">
|
||||
<?php if ($isRunning): ?>
|
||||
<button type="submit" class="formbtn" formaction="vmmngr_do.php" formmethod="post" name="act" value="stop:<?=vmm_h($name);?>" onclick="return confirm('Stop <?=vmm_h($name);?>?')"><?=gettext('Stop');?></button>
|
||||
<button type="submit" class="formbtn" formaction="vmmngr_do.php" formmethod="post" name="act" value="restart:<?=vmm_h($name);?>" onclick="return confirm('Restart <?=vmm_h($name);?>?')"><?=gettext('Restart');?></button>
|
||||
<button type="submit" class="formbtn" formaction="vmmngr_do.php" formmethod="post" name="act" value="poweroff:<?=vmm_h($name);?>" onclick="return confirm('Force power off <?=vmm_h($name);?>? Unsaved guest data may be lost.')"><?=gettext('Power off');?></button>
|
||||
<button type="submit" class="formbtn" formaction="vmmngr_do.php" formmethod="post" name="act" value="reset:<?=vmm_h($name);?>" onclick="return confirm('Hard reset <?=vmm_h($name);?>?')"><?=gettext('Reset');?></button>
|
||||
<button type="submit" class="formbtn" name="act" value="stop:<?=vmm_h($name);?>" onclick="return confirm('Stop <?=vmm_h($name);?>?')"><?=gettext('Stop');?></button>
|
||||
<button type="submit" class="formbtn" name="act" value="restart:<?=vmm_h($name);?>" onclick="return confirm('Restart <?=vmm_h($name);?>?')"><?=gettext('Restart');?></button>
|
||||
<button type="submit" class="formbtn" name="act" value="poweroff:<?=vmm_h($name);?>" onclick="return confirm('Force power off <?=vmm_h($name);?>? Unsaved guest data may be lost.')"><?=gettext('Power off');?></button>
|
||||
<button type="submit" class="formbtn" name="act" value="reset:<?=vmm_h($name);?>" onclick="return confirm('Hard reset <?=vmm_h($name);?>?')"><?=gettext('Reset');?></button>
|
||||
<?php else: ?>
|
||||
<button type="submit" class="formbtn" formaction="vmmngr_do.php" formmethod="post" name="act" value="start:<?=vmm_h($name);?>"><?=gettext('Start');?></button>
|
||||
<button type="submit" class="formbtn" name="act" value="start:<?=vmm_h($name);?>"><?=gettext('Start');?></button>
|
||||
<input type="text" name="confirm" value="" placeholder="<?=gettext('type name to destroy');?>" style="width:150px"/>
|
||||
<button type="submit" class="formbtn" formaction="vmmngr_do.php" formmethod="post" name="act" value="destroy:<?=vmm_h($name);?>" onclick="return confirm('Destroy <?=vmm_h($name);?>? All disks and snapshots are deleted.')"><?=gettext('Destroy');?></button>
|
||||
<button type="submit" class="formbtn" name="act" value="destroy:<?=vmm_h($name);?>" onclick="return confirm('Destroy <?=vmm_h($name);?>? All disks and snapshots are deleted.')"><?=gettext('Destroy');?></button>
|
||||
<?php endif; ?>
|
||||
<a class="formbtn" href="vmmngr.php"><?=gettext('Back');?></a>
|
||||
</span>
|
||||
|
||||
Reference in new issue
Block a user