Improve server management
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
<?php $this->load->view('header'); ?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2>Serververwaltung: <?=$server->id?></h2>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h3>Miscellaneous</h3>
|
||||
<h4>Location</h4>
|
||||
<p><?=nl2br($server->location)?></p>
|
||||
|
||||
<h4>Owner</h4>
|
||||
<p><a href="#" title="Profil von Jörg Thomaschewski anzeigen">Jörg Thomaschewski</a></p>
|
||||
|
||||
<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: PYTHA, ABC, DEF
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer'); ?>
|
||||
@@ -1,54 +0,0 @@
|
||||
<?php $this->load->view('header'); ?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2>Server management</h2>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h3>List of all available servers</h3>
|
||||
<table>
|
||||
<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 class="tableList">
|
||||
<?
|
||||
foreach ($servers as $server):
|
||||
if ($server['available']) {
|
||||
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="#">Edit</a> | <a href="#">Delete</a></td>
|
||||
</tr>
|
||||
<?
|
||||
endforeach;
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer'); ?>
|
||||
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');?>
|
||||
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