Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions application/controllers/control.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ function Start($server,$worker){
$this->_request($server,'startProcess',array($worker,1));
Redirect('/');
}
function Startgroup($server,$worker){
$this->_request($server,'startProcess',array($worker.":*",1));
Redirect('/');
}
function Startall($server){
$this->_request($server,'startAllProcesses',array(1));
Redirect('/');
Expand All @@ -16,10 +20,16 @@ function Stopall($server){
$this->_request($server,'stopAllProcesses',array(1));
Redirect('/');
}
function Stopgroup($server,$worker){
$this->_request($server,'stopProcess',array($worker.":*",1));
Redirect('/');
}
function Restart($server,$worker){
$this->_request($server,'stopProcess',array($worker,1));
sleep(2);
$this->_request($server,'startProcess',array($worker,1));
$this->_request($server,'restart',array($worker,1));
Redirect('/');
}
function Restartgroup($server,$worker){
$this->_request($server,'restart',array($worker.":*",1));
Redirect('/');
}
function Restartall($server){
Expand Down
37 changes: 32 additions & 5 deletions application/views/welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
?>
<div class="span<?php echo ($this->config->item('supervisor_cols')==2?'6':'4');?>">
<table class="table table-bordered table-condensed table-striped">
<tr><th colspan="4">
<tr><th colspan="5">
<a href="<?php echo $ui_url; ?>"><?php echo $name; ?></a> <?php if($this->config->item('show_host')){ ?><i><?php echo $parsed_url['host']; ?></i><?php } ?>
<?php
if(isset($cfg[$name]['username'])){echo '<i class="icon-lock icon-green" style="color:blue" title="Authenticated server connection"></i>';}
Expand All @@ -86,11 +86,22 @@
</th></tr>
<?php
$CI = &get_instance();
$last_group=null;
$group_count=array();
foreach($procs as $item){

if(empty($group_count[$item['group']])){
$group_count[$item['group']]=1;
}else{
$group_count[$item['group']]++;
}
}
foreach($procs as $item){

if($item['group'] != $item['name']) $item_name = $item['group'].":".$item['name'];
else $item_name = $item['name'];



$check = $CI->_request($name,'readProcessStderrLog',array($item_name,-1000,0));
if(is_array($check)) $check = print_r($check,1);

Expand All @@ -113,10 +124,26 @@
else $class = 'error';

$uptime = str_replace("uptime ","",$uptime);

?>
<tr>
<td><?php
echo $item_name;
<?php
if($last_group!=$item['group']){
$last_group=$item['group'];
echo '<td rowspan="'.$group_count[$item['group']].'">'.$last_group;
?>
<div class="actions">
<a href="<?php echo site_url('/control/stopgroup/'.$name.'/'.$last_group);?>" class="btn btn-mini btn-inverse" type="button"><i class="icon-stop icon-white"></i></a>
<a href="<?php echo site_url('/control/restartgroup/'.$name.'/'.$last_group);?>" class="btn btn-mini btn-inverse" type="button"><i class="icon-refresh icon-white"></i></a>

</div>
</td><td>
<?php
}else{
echo '<td>';
}

echo $item['name'];
if($check){
$alert = true;
echo '<span class="pull-right"><a href="'.site_url('/control/clear/'.$name.'/'.$item_name).'" id="'.$name.'_'.$item_name.
Expand All @@ -141,7 +168,7 @@
<div class="actions">
<?php if($status=='RUNNING'){ ?>
<a href="<?php echo site_url('/control/stop/'.$name.'/'.$item_name);?>" class="btn btn-mini btn-inverse" type="button"><i class="icon-stop icon-white"></i></a>
<a href="<?php echo site_url('/control/restart/'.$name.'/'.$item_name);?>" class="btn btn-mini btn-inverse" type="button"><i class="icon-refresh icon-white"></i></a>
<a href="<?php echo site_url('/control/restart/'.$name.'/'.$item['name']);?>" class="btn btn-mini btn-inverse" type="button"><i class="icon-refresh icon-white"></i></a>
<?php } if($status=='STOPPED' || $status == 'EXITED' || $status=='FATAL'){ ?>
<a href="<?php echo site_url('/control/start/'.$name.'/'.$item_name);?>" class="btn btn-mini btn-success" type="button"><i class="icon-play icon-white"></i></a>
<?php } ?>
Expand Down