Merge branch 'master' of disposed.de:scattport
This commit is contained in:
61
application/controllers/admin/servers.php
Normal file
61
application/controllers/admin/servers.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 Karsten Heiken <karsten@disposed.de>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Server management.
|
||||
*
|
||||
* @author Karsten Heiken <karsten@disposed.de>
|
||||
*/
|
||||
class Servers extends CI_Controller {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('server');
|
||||
}
|
||||
|
||||
/**
|
||||
* List all servers.
|
||||
*/
|
||||
function index() {
|
||||
$tpl->servers = $this->server->getAll();
|
||||
|
||||
$this->load->view('admin/server/list', $tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve details of a server.
|
||||
*
|
||||
* @param type $server_id
|
||||
*/
|
||||
function detail($server_id) {
|
||||
$tpl->server = $this->server->where('id', $server_id)->get();
|
||||
|
||||
$this->load->view('admin/server/detail', $tpl);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,6 +44,9 @@ class MY_Lang extends CI_Lang {
|
||||
log_message('debug', 'Gettext Class path chosen is: ' . $this->_gettext_path);
|
||||
|
||||
$filename = $this->_gettext_path . '/' . $this->_gettext_language . '/LC_MESSAGES/' . $this->_gettext_domain . '.mo';
|
||||
|
||||
// if there is no language file, we can't load anything
|
||||
if (file_exists($filename)) {
|
||||
$mtime = filemtime($filename);
|
||||
|
||||
$newFilename = $this->_gettext_path . '/' . $this->_gettext_language . '/LC_MESSAGES/' . $this->_gettext_domain . '_' . $mtime . '.mo';
|
||||
@@ -65,6 +68,7 @@ class MY_Lang extends CI_Lang {
|
||||
bindtextdomain($newDomain, $this->_gettext_path);
|
||||
bind_textdomain_codeset($newDomain, "UTF-8");
|
||||
textdomain($newDomain);
|
||||
}
|
||||
|
||||
log_message('debug', 'The gettext domain chosen is: '. $this->_gettext_domain);
|
||||
|
||||
|
||||
43
application/language/english/admin/servers_lang.php
Normal file
43
application/language/english/admin/servers_lang.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (c) 2011 Karsten Heiken <karsten@disposed.de>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Headings
|
||||
*/
|
||||
$lang['location'] = 'Location';
|
||||
$lang['owner'] = 'Owner';
|
||||
$lang['actions'] = 'Actions';
|
||||
$lang['technical_info'] = 'Technical information';
|
||||
$lang['hardware_os'] = 'Hardware & OS';
|
||||
$lang['scattport_stats'] = 'ScattPort statistics';
|
||||
|
||||
/*
|
||||
* server status
|
||||
*/
|
||||
$lang['busy'] = 'busy';
|
||||
$lang['offline'] = 'offline';
|
||||
$lang['available'] = 'available';
|
||||
|
||||
$lang['workload'] = 'Workload';
|
||||
$lang['completed_jobs'] = 'Completed jobs';
|
||||
35
application/views/admin/server/detail.php
Normal file
35
application/views/admin/server/detail.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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: Intel Xeon E5540, 2533 MHz<br />
|
||||
Uptime: 254 Tage, 13 Stunden<br />
|
||||
OS: Debian/GNU 5.0r1<br />
|
||||
Workload: 2.01, 1.05, 0.85
|
||||
</p>
|
||||
|
||||
<h4>ScattPort-Statistics</h4>
|
||||
<p>
|
||||
Completed jobs: 47<br />
|
||||
Available programs: PYTHA, ABC, DEF
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer'); ?>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?php $this->load->view('header'); ?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2>Serververwaltung</h2>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="box">
|
||||
<h3>SP-EMD-01</h3>
|
||||
<h4>Standort</h4>
|
||||
<p>Hochschule Emden, Technikum, Raum E10</p>
|
||||
|
||||
<h4>Besitzer</h4>
|
||||
<p><a href="#" title="Profil von Jörg Thomaschewski anzeigen">Jörg Thomaschewski</a></p>
|
||||
|
||||
<h4>Serverinformationen</h4>
|
||||
<p>
|
||||
Prozessor: Intel Xeon E5540, 2533 MHz<br />
|
||||
Uptime: 254 Tage, 13 Stunden<br />
|
||||
Betriebssystem: Debian/GNU 5.0r1<br />
|
||||
Workload: 2.01, 1.05, 0.85
|
||||
</p>
|
||||
|
||||
<h4>ScattPort-Statistik</h4>
|
||||
<p>
|
||||
Durchgeführte Berechnungen: 47<br />
|
||||
Verfügbare Programme: PYTHA, ABC, DEF
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('footer'); ?>
|
||||
@@ -3,66 +3,50 @@
|
||||
<div id="content">
|
||||
|
||||
<div class="title">
|
||||
<h2>Serververwaltung</h2>
|
||||
<h2>Server management</h2>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<h3>Übersicht aller Server</h3>
|
||||
<h3>List of all available servers</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Bezeichnung</th>
|
||||
<th scope="col">Ort</th>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col">Location</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col">Aktion</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="odd">
|
||||
<td><a href="#"><abbr title="ScattPort Server 01, Emden">SP-EMD-01</abbr></a></td>
|
||||
<td><abbr title="Technikum, Raum E10">Emden, Deutschland</abbr></td>
|
||||
<td><span class="active">Idle</span></td>
|
||||
<td><a href="#">Bearbeiten</a> | <a href="#">Entfernen</a></td>
|
||||
</tr>
|
||||
<tbody class="tableList">
|
||||
<?
|
||||
foreach ($servers as $server):
|
||||
if ($server['available']) {
|
||||
if ($server['workload'] > 2) {
|
||||
$server['class'] = "pending";
|
||||
$server['status'] = 'busy';
|
||||
} else {
|
||||
$server['class'] = "active";
|
||||
$server['status'] = 'available';
|
||||
}
|
||||
} else {
|
||||
$server['class'] = "closed";
|
||||
$server['status'] = "offline";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><a href="#"><abbr title="ScattPort Server 02, Emden">SP-EMD-02</abbr></a></td>
|
||||
<td><abbr title="Technikum, Raum E10">Emden, Deutschland</abbr></td>
|
||||
<td><span class="pending">Ausgelastet</span></td>
|
||||
<td><a href="#">Bearbeiten</a> | <a href="#">Entfernen</a></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#"><abbr title="ScattPort Server 01, Bremen">SP-HB-01</abbr></a></td>
|
||||
<td><abbr title="Rechenzentrum, Raum 42, Rack 17">Bremen, Deutschland</abbr></td>
|
||||
<td><span class="closed">Nicht erreichbar</span></td>
|
||||
<td><a href="#">Bearbeiten</a> | <a href="#">Entfernen</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a href="#"><abbr title="ScattPort Server 01, Bremen">SP-HB-02</abbr></a></td>
|
||||
<td><abbr title="Rechenzentrum, Raum 42, Rack 17">Bremen, Deutschland</abbr></td>
|
||||
<td><span class="active">Idle</span></td>
|
||||
<td><a href="#">Bearbeiten</a> | <a href="#">Entfernen</a></td>
|
||||
</tr>
|
||||
<tr class="odd">
|
||||
<td><a href="#"><abbr title="ScattPort Server 01, Bremen">SP-HB-03</abbr></a></td>
|
||||
<td><abbr title="Rechenzentrum, Raum 42, Rack 17">Bremen, Deutschland</abbr></td>
|
||||
<td><span class="pending">Ausgelastet</span></td>
|
||||
<td><a href="#">Bearbeiten</a> | <a href="#">Entfernen</a></td>
|
||||
<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 class="pagination">
|
||||
<ul>
|
||||
<li class="pages">Seite:</li>
|
||||
<li>1</li>
|
||||
<li><a href="#">2</a></li>
|
||||
<li><a href="#">3</a></li>
|
||||
<li><a href="#">4</a></li>
|
||||
<li><a href="#">5</a></li>
|
||||
<li>...</li>
|
||||
<li><a href="#">10</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
<div id="footer">
|
||||
<span class="left"><?=anchor('', "Dashboard");?> | <a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link</a></span>
|
||||
<?
|
||||
if($this->session->userdata('group') == 'admins'):
|
||||
?>
|
||||
<span class="left"><strong>Administration - </strong>
|
||||
<a href="<?=site_url('admin/settings')?>">Globale Einstellungen</a> |
|
||||
<a href="<?=site_url('admin/servers')?>">Berechnungsserver verwalten</a> |
|
||||
<a href="<?=site_url('admin/users')?>">Benutzer verwalten</a> |
|
||||
<a href="<?=site_url('admin/programs')?>">Programme verwalten</a>
|
||||
</span>
|
||||
<?
|
||||
endif;
|
||||
?>
|
||||
<span class="right">© 2011 Karsten Heiken.</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>ScattPort | Dashboard</title>
|
||||
|
||||
@@ -46,9 +46,9 @@
|
||||
?>
|
||||
<li>Projekt <?=$active_project['name']?>
|
||||
<ul>
|
||||
<li><a href="<?=site_url('/projects/detail/'.$active_project['id'])?>" title="Projektübersicht öffnen">Übersicht</a></li>
|
||||
<li><a href="<?=site_url('/trials/create/'.$active_project['id'])?>" title="Neuen Versuch für das Projekt "<?=$active_project['name']?>" anlegen">Neuer Versuch</a></li>
|
||||
<li><a href="<?=site_url('/results/project/'.$active_project['id'])?>" title="Alle Ergebnisse für das Projekt "<?=$active_project['name']?>" öffnen">Ergebnisse</a></li>
|
||||
<li><a href="<?=site_url('projects/detail'.$active_project['id'])?>" title="Projektübersicht öffnen">Übersicht</a></li>
|
||||
<li><a href="<?=site_url('trials/create'.$active_project['id'])?>" title="Neuen Versuch für das Projekt "<?=$active_project['name']?>" anlegen">Neuer Versuch</a></li>
|
||||
<li><a href="<?=site_url('results/project'.$active_project['id'])?>" title="Alle Ergebnisse für das Projekt "<?=$active_project['name']?>" öffnen">Ergebnisse</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?
|
||||
@@ -56,30 +56,12 @@
|
||||
?>
|
||||
<li>Global
|
||||
<ul>
|
||||
<li><a href="<?=site_url('/projects/create')?>" title="Neues Projekt anlegen">Neues Projekt</a></li>
|
||||
<li><a href="<?=site_url('projects/create')?>" title="Neues Projekt anlegen">Neues Projekt</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?
|
||||
if($this->session->userdata('group') == 'admins'):
|
||||
?>
|
||||
<div class="navigation">
|
||||
<ul>
|
||||
<li>Administration
|
||||
<ul>
|
||||
<li><a href="<?=site_url('servers')?>" title="Manage servers">Calculation servers</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="<?=site_url('users')?>" title="Manage users">Users</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?
|
||||
endif;
|
||||
?>
|
||||
<div class="title">
|
||||
<h2><a href="<?=site_url('projects')?>" title="Alle Projekte anzeigen">Projekte</a></h2>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user