mirror of
https://github.com/unraid/webgui.git
synced 2026-03-13 14:30:29 -05:00
Merge remote-tracking branch 'upstream/master' into Virtual-Sound-Card
This commit is contained in:
@@ -39,6 +39,7 @@ $i = 0;
|
||||
$kvm = ['var kvm=[];'];
|
||||
$show = explode(',',unscript(_var($_GET,'show')));
|
||||
$path = _var($domain_cfg,'MEDIADIR');
|
||||
$pci_device_changes = comparePCIData();
|
||||
|
||||
foreach ($vms as $vm) {
|
||||
$res = $lv->get_domain_by_name($vm);
|
||||
@@ -52,6 +53,11 @@ foreach ($vms as $vm) {
|
||||
$image = substr($icon,-4)=='.png' ? "<img src='$icon' class='img'>" : (substr($icon,0,5)=='icon-' ? "<i class='$icon img'></i>" : "<i class='fa fa-$icon img'></i>");
|
||||
$arrConfig = domain_to_config($uuid);
|
||||
$snapshots = getvmsnapshots($vm) ;
|
||||
$vmpciids = $lv->domain_get_vm_pciids($vm);
|
||||
$pcierror = false;
|
||||
foreach($vmpciids as $pciid => $pcidetail) {
|
||||
if (isset($pci_device_changes["0000:".$pciid])) $pcierror = true;
|
||||
}
|
||||
$cdroms = $lv->get_cdrom_stats($res,true,true) ;
|
||||
if ($state == 'running') {
|
||||
$mem = $dom['memory']/1024;
|
||||
@@ -117,7 +123,7 @@ foreach ($vms as $vm) {
|
||||
unset($dom);
|
||||
if (!isset($domain_cfg["CONSOLE"])) $vmrcconsole = "web" ; else $vmrcconsole = $domain_cfg["CONSOLE"] ;
|
||||
if (!isset($domain_cfg["RDPOPT"])) $vmrcconsole .= ";no" ; else $vmrcconsole .= ";".$domain_cfg["RDPOPT"] ;
|
||||
$menu = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s', '%s')\"", addslashes($vm),addslashes($uuid),addslashes($template),$state,addslashes($vmrcurl),strtoupper($vmrcprotocol),addslashes($log),addslashes($fstype), $vmrcconsole,false,addslashes(str_replace('"',"'",$WebUI)));
|
||||
$menu = sprintf("onclick=\"addVMContext('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s', '%s', %s)\"", addslashes($vm),addslashes($uuid),addslashes($template),$state,addslashes($vmrcurl),strtoupper($vmrcprotocol),addslashes($log),addslashes($fstype), $vmrcconsole,false,addslashes(str_replace('"',"'",$WebUI)),$pcierror);
|
||||
$kvm[] = "kvm.push({id:'$uuid',state:'$state'});";
|
||||
switch ($state) {
|
||||
case 'running':
|
||||
@@ -196,7 +202,10 @@ foreach ($vms as $vm) {
|
||||
$title = _('Select ISO image');
|
||||
$cdstr = $cdromcount." / 2<a class='hand' title='$title' href='#' onclick='$changemedia'><i class='fa fa-dot-circle-o'></i></a>";
|
||||
echo "<tr parent-id='$i' class='sortable'><td class='vm-name' style='width:220px;padding:8px'><i class='fa fa-arrows-v mover orange-text'></i>";
|
||||
echo "<span class='outer'><span id='vm-$uuid' $menu class='hand'>$image</span><span class='inner'><a href='#' onclick='return toggle_id(\"name-$i\")' title='click for more VM info'>$vm</a><br><i class='fa fa-$shape $status $color'></i><span class='state'>"._($status)." </span></span></span></td>";
|
||||
echo "<span class='outer'><span id='vm-$uuid' $menu class='hand'>$image</span>";
|
||||
echo "<span class='inner'><a href='#' onclick='return toggle_id(\"name-$i\")' title='click for more VM info'>$vm</a>";
|
||||
if ($pcierror) echo "<i class=\"fa fa-warning fa-fw orange-text\" title=\""._('PCI Changed')."\n"._('Start disabled')."\"></i>";
|
||||
echo "<br><i class='fa fa-$shape $status $color'></i><span class='state'>"._($status)." </span></span></span></td>";
|
||||
echo "<td>$desc</td>";
|
||||
echo "<td><a class='vcpu-$uuid' style='cursor:pointer'>$vcpu</a></td>";
|
||||
echo "<td>$mem</td>";
|
||||
|
||||
@@ -22,7 +22,7 @@ if (substr($_SERVER['REQUEST_URI'],0,4) != '/VMs') {
|
||||
require_once "$docroot/webGui/include/Translations.php";
|
||||
}
|
||||
|
||||
switch ($display['theme']) {
|
||||
switch ($themeHelper->getThemeName()) { // $themeHelper set in DefaultPageLayout.php
|
||||
case 'gray' : $bgcolor = '#121510'; $border = '#606e7f'; $top = -44; break;
|
||||
case 'azure': $bgcolor = '#edeaef'; $border = '#606e7f'; $top = -44; break;
|
||||
case 'black': $bgcolor = '#212121'; $border = '#2b2b2b'; $top = -64; break;
|
||||
@@ -110,6 +110,7 @@ if (strpos($strSelectedTemplate,"User-") !== false) {
|
||||
<form id="vmform" method="POST">
|
||||
<input type="hidden" name="domain[type]" value="kvm" />
|
||||
<input type="hidden" name="template[name]" value="<?=htmlspecialchars($strSelectedTemplateUT)?>" />
|
||||
<input type="hidden" name="template[iconold]" value="<?=htmlspecialchars($arrLoad['icon'])?>" />
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
@@ -2283,6 +2283,17 @@ class Libvirt {
|
||||
return $soundcardslist;
|
||||
}
|
||||
|
||||
function domain_get_vm_pciids($domain) {
|
||||
$hostdevs=$this->domain_get_host_devices_pci($domain);
|
||||
$vmpcidevs=[];
|
||||
foreach($hostdevs as $key => $dev) {
|
||||
$vmpcidevs[$dev['id']] = [
|
||||
'vendor_id' => ltrim($dev['vendor_id'] ?? "", '0x'),
|
||||
'device_id' => ltrim($dev['product_id'] ?? "", '0x'),
|
||||
];
|
||||
}
|
||||
return $vmpcidevs;
|
||||
}
|
||||
|
||||
function get_nic_info($domain) {
|
||||
$macs = $this->get_xpath($domain, "//domain/devices/interface/mac/@address", false);
|
||||
|
||||
Reference in New Issue
Block a user