mirror of
				https://github.com/optim-enterprises-bv/control-pane.git
				synced 2025-10-31 09:57:57 +00:00 
			
		
		
		
	rollback 7c15bdadce: this change breaks the page
				
					
				
			This commit is contained in:
		| @@ -1,88 +1,108 @@ | |||||||
| <?php | <?php | ||||||
|  | $html=''; | ||||||
|  |  | ||||||
| $db = new Db('base','nodes'); | $db=new Db('base','nodes'); | ||||||
| $nodes = $db->select('select nodename,ip from nodelist order by nodename desc', []); | $nodes=$db->select('select nodename,ip from nodelist order by nodename desc', []); | ||||||
| $nodes[] = ['nodename' => 'local']; | $nodes[]=array('nodename'=>'local'); | ||||||
| $nodes = array_reverse($nodes); | $nodes=array_reverse($nodes); | ||||||
|  |  | ||||||
| $ids = []; | $ids=array(); | ||||||
| $nth = 0; | $nth=0; | ||||||
| $html = ''; | $hres=$this->getTableChunk('baseslist','tbody'); | ||||||
| $html_tpl = ''; | if(!empty($nodes))foreach($nodes as $node) | ||||||
| $hres = $this->getTableChunk('baseslist','tbody'); | { | ||||||
|  | 	$db1=new Db('base',$node['nodename']); | ||||||
| foreach($nodes as $node){ | 	if($db1!==false) | ||||||
|  | 	{ | ||||||
| 	$db1 = new Db('base', $node['nodename']); | 		$bases=$db1->select("SELECT idx,platform,name,arch,targetarch,ver,stable,elf,date FROM bsdbase order by cast(ver AS int)", []); | ||||||
| 	if(!$db1->error){ | 		 | ||||||
|  | 		$num=$nth & 1; | ||||||
| 		$bases = $db1->select("SELECT idx,platform,name,arch,targetarch,ver,stable,elf,date FROM bsdbase order by cast(ver AS int)", []); | 		if(!empty($bases)) foreach($bases as $base) | ||||||
| 		$num = $nth & 1; | 		{ | ||||||
|  | 			$idle=1; | ||||||
| 		foreach($bases as $base){ | 			//print_r($node);exit; | ||||||
| 			$idle = 1; | 			if($node['nodename']!='local') | ||||||
| 			if($node['nodename'] != 'local'){ | 			{ | ||||||
| 				$idle = $this->check_locktime($node['ip']); | 				$idle=$this->check_locktime($node['ip']); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			$ids[] = $base['idx']; |  | ||||||
| 			$id = 'base'.$base['ver'].'-'.$base['arch'].'-'.$base['stable']; |  | ||||||
| 			 | 			 | ||||||
| 			if($hres !== false){ | 			$ids[]=$base['idx']; | ||||||
| 				$vars = [ | 			$id='base'.$base['ver'].'-'.$base['arch'].'-'.$base['stable']; | ||||||
| 					'id' => $id, | 			 | ||||||
| 					'nth-num' => 'nth'.$num, | 			if($hres!==false) | ||||||
| 					'node' => $node['nodename'], | 			{ | ||||||
| 					'name' => $base['name'], | 				$html_tpl=$hres[1]; | ||||||
| 					'platform' => $base['platform'], | 				$vars=array( | ||||||
| 					'arch' => $base['arch'], | 					'id'=>$id, | ||||||
| 					'targetarch' => $base['targetarch'], | 					'nth-num'=>'nth'.$num, | ||||||
| 					'version' => $base['ver'], | 					'node'=>$node['nodename'], | ||||||
| 					'version1' => ($base['stable']==1) ? 'stable' : 'release', | 					'name'=>$base['name'], | ||||||
| 					'elf' => $base['elf'], | 					'platform'=>$base['platform'], | ||||||
| 					'date' => $base['date'], | 					'arch'=>$base['arch'], | ||||||
| 					'jstatus' => '', | 					'targetarch'=>$base['targetarch'], | ||||||
| 					'maintenance' => ($idle == 0) ? ' maintenance' : '', | 					'version'=>$base['ver'], | ||||||
| 					'deltitle' => $this->translate('Delete') | 					'version1'=>($base['stable']==1)?'stable':'release', | ||||||
| 				]; | 					'elf'=>$base['elf'], | ||||||
|  | 					'date'=>$base['date'], | ||||||
| 				foreach($vars as $var => $val){ | 					'jstatus'=>'', | ||||||
| 					$html_tpl = str_replace('#'.$var.'#', $val, $hres[1]); | 					'maintenance'=>($idle==0)?' maintenance':'', | ||||||
| 				} | 					'deltitle'=>$this->translate('Delete'), | ||||||
| 				$html .= $html_tpl; | 				); | ||||||
|  | 				 | ||||||
|  | 				foreach($vars as $var=>$val) | ||||||
|  | 					$html_tpl=str_replace('#'.$var.'#',$val,$html_tpl); | ||||||
|  | 				 | ||||||
|  | 				$html.=$html_tpl; | ||||||
| 			} | 			} | ||||||
|  | 			 | ||||||
|  | 			//$ids[]='#base'.$bid; | ||||||
| 			$ids[]='#'.$id; | 			$ids[]='#'.$id; | ||||||
| 		} | 		} | ||||||
|  | 		 | ||||||
| 		$nth++; | 		$nth++; | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
| $tasks = (empty($ids)) ? '' : $tasks = $this->getRunningTasks($ids); | $html=str_replace(array("\n","\r","\t"),'',$html); | ||||||
|  |  | ||||||
| if($hres !== false){ | $tasks=''; | ||||||
| 	$html_tpl = str_replace(["\n","\r","\t"], '', $hres[1]); | if(!empty($ids)) | ||||||
| 	$vars = [ | { | ||||||
| 		'nth-num' => 'nth0', | 	$tasks=$this->getRunningTasks($ids); | ||||||
| 		'status' => '', |  | ||||||
| 		//'jstatus' => $this->translate('Updating'), |  | ||||||
| 		//'icon' => 'spin6 animate-spin', |  | ||||||
| 		'desktop' => ' s-off', |  | ||||||
| 		'maintenance' => ' maintenance busy', |  | ||||||
| 		'updtitle' => $this->translate('Update'), |  | ||||||
| 		'deltitle' => $this->translate('Delete') |  | ||||||
| 	]; |  | ||||||
|  |  | ||||||
| 	foreach($vars as $var => $val){ |  | ||||||
| 		$html_tpl = str_replace('#'.$var.'#', $val, $html_tpl); |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
|  |  | ||||||
| $included_result_array = [ | $html_tpl=str_replace(array("\n","\r","\t"),'',$hres[1]); | ||||||
| 	'tbody' => str_replace(["\n","\r","\t"], '', $html), | if($hres!==false) | ||||||
| 	'error' => false, | { | ||||||
| 	'func' => 'fillTable', | 	$vars=array( | ||||||
| 	'id' => 'baseslist', | 		'nth-num'=>'nth0', | ||||||
| 	'tasks' => $tasks, | 		'status'=>'', | ||||||
| 	'template' => $html_tpl | 		//'jstatus'=>$this->translate('Updating'), | ||||||
| ]; | 		//'icon'=>'spin6 animate-spin', | ||||||
|  | 		'desktop'=>' s-off', | ||||||
|  | 		'maintenance'=>' maintenance busy', | ||||||
|  | 		'updtitle'=>$this->translate('Update'), | ||||||
|  | 		'deltitle'=>$this->translate('Delete'), | ||||||
|  | 	); | ||||||
|  | 	 | ||||||
|  | 	foreach($vars as $var=>$val) | ||||||
|  | 		$html_tpl=str_replace('#'.$var.'#',$val,$html_tpl); | ||||||
|  | } | ||||||
|  | /* | ||||||
|  | echo json_encode(array( | ||||||
|  | 	'tbody'=>$html, | ||||||
|  | 	'error'=>false, | ||||||
|  | 	'func'=>'fillTable', | ||||||
|  | 	'id'=>'baseslist', | ||||||
|  | 	'tasks'=>$tasks, | ||||||
|  | 	'template'=>$html_tpl, | ||||||
|  | )); | ||||||
|  | */ | ||||||
|  | $included_result_array=array( | ||||||
|  | 	'tbody'=>$html, | ||||||
|  | 	'error'=>false, | ||||||
|  | 	'func'=>'fillTable', | ||||||
|  | 	'id'=>'baseslist', | ||||||
|  | 	'tasks'=>$tasks, | ||||||
|  | 	'template'=>$html_tpl, | ||||||
|  | ); | ||||||
		Reference in New Issue
	
	Block a user
	 ClonOS mybee
					ClonOS mybee