Improve server management
This commit is contained in:
41
application/views/admin/servers/detail.php
Normal file
41
application/views/admin/servers/detail.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php $this->load->view('header');?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2><?=anchor('admin/servers', _('Servers'));?> » <?=$server->id;?></h2>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h3><?=_('Miscellaneous');?></h3>
|
||||
<h4><?=_('Location');?></h4>
|
||||
<?=auto_typography($server->location);?>
|
||||
|
||||
<h4><?=_('Owner');?></h4>
|
||||
<p>
|
||||
<a href="<?=site_url('users/profile/' . urlencode($owner['username']));?>" title="<?=sprintf(_("Show %s's profile"), $owner['firstname'] . ' ' . $owner['lastname']);?>"><?=$owner['firstname'] . ' ' . $owner['lastname'];?></a>
|
||||
</p>
|
||||
|
||||
<h4><?=_('Description');?></h4>
|
||||
<?=auto_typography($server->description);?>
|
||||
|
||||
<h3><?=_('Technical information');?></h3>
|
||||
<h4><?=_('Hardware & OS');?></h4>
|
||||
<p>
|
||||
<?=_('CPU');?>: <?=$server->hardware;?><br />
|
||||
<?=_('Uptime');?>: <?=$server->uptimestring;?><br />
|
||||
<?=_('OS');?>: <?=$server->os;?><br />
|
||||
<?=_('Workload');?>: <?=sprintf('%.02f', $server->workload);?><br />
|
||||
<?=_('Last heartbeat');?>: <?=$server->lastheartbeat;?>
|
||||
</p>
|
||||
|
||||
<h4>ScattPort-<?=_('Statistics');?></h4>
|
||||
<p>
|
||||
<?=_('Completed jobs');?>: 47<br />
|
||||
<?=_('Available programs');?>: ScaTT
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer');?>
|
||||
42
application/views/admin/servers/edit.php
Normal file
42
application/views/admin/servers/edit.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php $this->load->view('header');?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2><?=anchor('admin/servers', _('Servers'));?> » <?=sprintf(_('Edit server "%s"'), $server->id);?></h2>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<form name="editServer" method="post" action="<?=site_url('admin/servers/edit/' . $server->id)?>">
|
||||
<h3><?=_('Required information');?></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<?=form_label(_('Location'), 'location');?> <span class="req">*</span>
|
||||
<div>
|
||||
<input type="text" name="location" id="location" class="medium text" value="<?=set_value('location', $server->location);?>" />
|
||||
<?=form_error('location');?>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<?=form_label(_('Owner'), 'owner');?> <span class="req">*</span>
|
||||
<div>
|
||||
<?=form_dropdown('owner', $users, $server->owner, 'id="owner" class="drop"');?>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<?=form_label(_('Description'), 'description');?> <span class="req">*</span>
|
||||
<div>
|
||||
<textarea name="description" id="description" rows="6" cols="60" class="textarea"><?=set_value('description', $server->description);?></textarea>
|
||||
<?=form_error('description');?>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<p>
|
||||
<a href="javascript:void(0);" onclick="$('form[name=editServer]').submit();" class="button save"><?=_('Save');?></a>
|
||||
<a href="<?=site_url('admin/servers');?>" class="button cancel"><?=_('Cancel');?></a>
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer');?>
|
||||
10
application/views/admin/servers/index.html
Executable file
10
application/views/admin/servers/index.html
Executable file
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>403 Forbidden</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Directory access is forbidden.</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
54
application/views/admin/servers/list.php
Normal file
54
application/views/admin/servers/list.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php $this->load->view('header');?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2><?=_('Servers');?></h2>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h3><?=_('Available servers');?></h3>
|
||||
<table class="tableList paginated">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col"><?=_('ID');?></th>
|
||||
<th scope="col"><?=_('Location');?></th>
|
||||
<th scope="col"><?=_('Status');?></th>
|
||||
<th scope="col"><?=_('Actions');?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($servers as $server):
|
||||
if ($server['available'] != 0) {
|
||||
if ($server['workload'] > 0.8) {
|
||||
$server['class'] = 'pending';
|
||||
$server['status'] = 'busy';
|
||||
} else {
|
||||
$server['class'] = 'active';
|
||||
$server['status'] = 'available';
|
||||
}
|
||||
} else {
|
||||
$server['class'] = 'closed';
|
||||
$server['status'] = 'offline';
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="<?= site_url('admin/servers/detail/' . $server['id']) ?>"><?= $server['id'] ?></a></td>
|
||||
<td><abbr title="Technikum, Raum E10"><?= $server['location'] ?></abbr></td>
|
||||
<td><span class="<?= $server['class'] ?>"><?= $server['status'] ?></span></td>
|
||||
<td>
|
||||
<a href="<?=site_url('admin/servers/detail/' . $server['id']);?>" title="<?=_('Show details');?>"><?=_('Show');?></a> |
|
||||
<a href="<?=site_url('admin/servers/edit/' . $server['id']);?>" title="<?=_('Edit this server');?>"><?=_('Edit');?></a> |
|
||||
<a href="javascript:deleteConfirm('<?=site_url('admin/servers/delete/' . $server['id']);?>');" title="<?=_('Delete this server');?>"><?=_('Delete');?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer');?>
|
||||
Reference in New Issue
Block a user