177 lines
6.0 KiB
Plaintext
177 lines
6.0 KiB
Plaintext
Title="Create LXC Container from Template"
|
|
Markdown="false"
|
|
---
|
|
<link rel="stylesheet" href="<? autov('/plugins/lxc/css/lxc.css') ?>">
|
|
<link type="text/css" rel="stylesheet" href="<? autov('/webGui/styles/jquery.switchbutton.css') ?>">
|
|
<script src="<? autov('/webGui/javascript/jquery.switchbutton.js') ?>"></script>
|
|
|
|
|
|
<?php
|
|
require_once '/usr/local/emhttp/plugins/lxc/include/functions.php';
|
|
require_once '/usr/local/emhttp/plugins/lxc/include/Settings.php';
|
|
$settings = new Settings();
|
|
|
|
$lxc = simplexml_load_file("/tmp/lxc_container_template.xml");
|
|
?>
|
|
|
|
<div>
|
|
<form id="addContainerCAApp" autocomplete="off">
|
|
<p />
|
|
<div>
|
|
<dl>
|
|
<dt>Name:</dt>
|
|
<dd>
|
|
<input type="text" name="contName" pattern="[a-zA-Z0-9][A-Za-z0-9 \-_.]{0,49}" required="true" value="<? echo $lxc->Name; ?>" placeholder="Container Name" class="forbidSpace">
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
<dl>
|
|
<dt>Container Description:</dt>
|
|
<dd>
|
|
<input type="text" name="contDesc" pattern="[A-Za-z0-9 \-_,.]{1,50}" value="<? echo $lxc->Description; ?>" placeholder="Your Description or empty">
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Description:</dt>
|
|
<dd>
|
|
<span id="lxcOverview" class="boxed blue-text" style="display: inline-block; max-width: 600px; white-space: normal;">
|
|
<p><? echo nl2br(html_entity_decode($lxc->Overview)); ?></p>
|
|
<br>
|
|
</span>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Autostart:</dt>
|
|
<dd>
|
|
<?php
|
|
if ($lxc->Autostart == "true") {
|
|
$checked = "checked";
|
|
} else {
|
|
$checked = "";
|
|
}
|
|
?>
|
|
<input class='autostart' id="contAutostart" type='checkbox' <?= $checked ?>>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Repository:</dt>
|
|
<dd>
|
|
<input type="text" name="contRepo" style="width: 600px;" pattern="^[a-zA-Z0-9\-_:.\/]*$" value="<? echo $lxc->Repository; ?>" disabled>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Distribution Details:</dt>
|
|
<details class="spoiler" close>
|
|
<summary data-open="Hide Distribution Details" data-close="Show Distribution Details"></summary>
|
|
<div>
|
|
<dl>
|
|
<dt>Distribution:</dt>
|
|
<dd>
|
|
<input type="text" name="contDistribution" pattern="[a-zA-Z0-9][a-zA-Z0-9_.]+" value="<? echo $lxc->Distribution; ?>" disabled>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Release:</dt>
|
|
<dd>
|
|
<input type="text" name="contRelease" pattern="[a-zA-Z0-9][a-zA-Z0-9_.]+" value="<? echo $lxc->Release; ?>" disabled>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Architecture:</dt>
|
|
<dd>
|
|
<input type="text" name="contArchitecture" pattern="[a-zA-Z0-9][a-zA-Z0-9_.]+" value="<? echo $lxc->Architecture; ?>" disabled>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
</details>
|
|
</dl>
|
|
<dd>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Advanced:</dt>
|
|
<details class="spoiler" close>
|
|
<summary data-open="Hide Advanced Configuration" data-close="Show/Edit Advanced Configuration"></summary>
|
|
<div>
|
|
<dl>
|
|
<dt>WebUI:</dt>
|
|
<dd>
|
|
<input type="text" name="contWebUI" value="<? echo $lxc->WebUI; ?>" pattern="^[a-zA-Z0-9\-_:.\/\[\]]?*$" placeholder="Full URL to WebGUI or empty for none" class="forbidSpace">
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Icon URL:</dt>
|
|
<dd>
|
|
<input type="text" name="contIcon" value="<? echo $lxc->Icon; ?>" pattern="^[a-zA-Z0-9\-_:.\/]*$" placeholder="Empty for default icon or URL for custom .png" class="forbidSpace">
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Requires:</dt>
|
|
<dd>
|
|
<input type="text" name="contRequires" pattern="[A-Za-z0-9 \-_.]" value="<? echo $lxc->Requires; ?>" disabled>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
</details>
|
|
</dl>
|
|
<dd>
|
|
</div>
|
|
<?php if(preg_match('/\b(btrfs|zfs)\b/', $settings->default_bdevtype)) {
|
|
echo '<div><dl><dt>Convert container to ' . ((strpos($settings->default_bdevtype, "zfs") !== false) ? "ZFS" : ((strpos($settings->default_bdevtype, "btrfs") !== false) ? "BTRFS" : "")) . ':</dt><dd><input name="contConvBDEV" type="checkbox" checked>';
|
|
} else {
|
|
echo '<input name="contConvBDEV" type="checkbox" hidden>';
|
|
} ?>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt>Start after creation:</dt>
|
|
<dd>
|
|
<input name="contStart" type='checkbox' checked>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div class="">
|
|
<dl>
|
|
<dt>Mac Address:</dt>
|
|
<dd>
|
|
<input type="text" name="contMac" required="true" id="mac" style="text-transform:uppercase" value="<?= getNewMacAddress(); ?>" class="forbidSpace">
|
|
<div id="emac" class="emac">Invalid MAC address</div>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<div>
|
|
<dl>
|
|
<dt><br/></dt>
|
|
<dd>
|
|
<input type="submit" value="Create">
|
|
<a href="/LXC" class="button">Done</a>
|
|
</dd>
|
|
</dl>
|
|
</div>
|
|
<input type="text" name="supportLink" value="<? echo $lxc->Support; ?>" hidden>
|
|
<input type="text" name="donateLink" value="<? echo $lxc->DonateLink; ?>" hidden>
|
|
</form>
|
|
</div>
|
|
|
|
<script src="<? autov('/plugins/lxc/js/lxc.js') ?>"></script>
|