diff --git a/application/controllers/admin/servers.php b/application/controllers/admin/servers.php new file mode 100644 index 0000000..6379f84 --- /dev/null +++ b/application/controllers/admin/servers.php @@ -0,0 +1,61 @@ + + * + * 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 + */ +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); + } + +} \ No newline at end of file diff --git a/application/core/MY_Lang.php b/application/core/MY_Lang.php index 5716079..99854f9 100644 --- a/application/core/MY_Lang.php +++ b/application/core/MY_Lang.php @@ -44,28 +44,32 @@ 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'; - $mtime = filemtime($filename); - $newFilename = $this->_gettext_path . '/' . $this->_gettext_language . '/LC_MESSAGES/' . $this->_gettext_domain . '_' . $mtime . '.mo'; + // if there is no language file, we can't load anything + if (file_exists($filename)) { + $mtime = filemtime($filename); - if (!file_exists($newFilename)) { - $dir = scandir(dirname($filename)); - foreach ($dir as $file) { - // remove all the old files - if (!in_array($file, array('.', '..', $this->_gettext_domain . '.po', $this->_gettext_domain . '.mo'))) { - @unlink(dirname($filename) . '/' . $file); + $newFilename = $this->_gettext_path . '/' . $this->_gettext_language . '/LC_MESSAGES/' . $this->_gettext_domain . '_' . $mtime . '.mo'; + + if (!file_exists($newFilename)) { + $dir = scandir(dirname($filename)); + foreach ($dir as $file) { + // remove all the old files + if (!in_array($file, array('.', '..', $this->_gettext_domain . '.po', $this->_gettext_domain . '.mo'))) { + @unlink(dirname($filename) . '/' . $file); + } } + + @copy($filename, $newFilename); } - @copy($filename, $newFilename); + $newDomain = $this->_gettext_domain . '_' . $mtime; + + bindtextdomain($newDomain, $this->_gettext_path); + bind_textdomain_codeset($newDomain, "UTF-8"); + textdomain($newDomain); } - - $newDomain = $this->_gettext_domain . '_' . $mtime; - - bindtextdomain($newDomain, $this->_gettext_path); - bind_textdomain_codeset($newDomain, "UTF-8"); - textdomain($newDomain); - + log_message('debug', 'The gettext domain chosen is: '. $this->_gettext_domain); return true; diff --git a/application/language/english/admin/servers_lang.php b/application/language/english/admin/servers_lang.php new file mode 100644 index 0000000..a470790 --- /dev/null +++ b/application/language/english/admin/servers_lang.php @@ -0,0 +1,43 @@ + + * + * 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'; \ No newline at end of file diff --git a/application/views/admin/server/detail.php b/application/views/admin/server/detail.php new file mode 100644 index 0000000..5c047e3 --- /dev/null +++ b/application/views/admin/server/detail.php @@ -0,0 +1,35 @@ +load->view('header'); ?> + +
+ +
+

Serververwaltung: id?>

+
+ +
+

Miscellaneous

+

Location

+

location)?>

+ +

Owner

+

Jörg Thomaschewski

+ +

Technical information

+

Hardware & OS

+

+ CPU: Intel Xeon E5540, 2533 MHz
+ Uptime: 254 Tage, 13 Stunden
+ OS: Debian/GNU 5.0r1
+ Workload: 2.01, 1.05, 0.85 +

+ +

ScattPort-Statistics

+

+ Completed jobs: 47
+ Available programs: PYTHA, ABC, DEF +

+
+ +
+ +load->view('footer'); ?> diff --git a/application/views/admin/server/details.php b/application/views/admin/server/details.php deleted file mode 100644 index 178964a..0000000 --- a/application/views/admin/server/details.php +++ /dev/null @@ -1,35 +0,0 @@ -load->view('header'); ?> - -
- -
-

Serververwaltung

-
- - -
-

SP-EMD-01

-

Standort

-

Hochschule Emden, Technikum, Raum E10

- -

Besitzer

-

Jörg Thomaschewski

- -

Serverinformationen

-

- Prozessor: Intel Xeon E5540, 2533 MHz
- Uptime: 254 Tage, 13 Stunden
- Betriebssystem: Debian/GNU 5.0r1
- Workload: 2.01, 1.05, 0.85 -

- -

ScattPort-Statistik

-

- Durchgeführte Berechnungen: 47
- Verfügbare Programme: PYTHA, ABC, DEF -

-
- -
- -load->view('footer'); ?> diff --git a/application/views/admin/server/list.php b/application/views/admin/server/list.php index 26d3818..b72f29f 100644 --- a/application/views/admin/server/list.php +++ b/application/views/admin/server/list.php @@ -3,66 +3,50 @@
-

Serververwaltung

+

Server management

-

Übersicht aller Server

+

List of all available servers

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + 2) { + $server['class'] = "pending"; + $server['status'] = 'busy'; + } else { + $server['class'] = "active"; + $server['status'] = 'available'; + } + } else { + $server['class'] = "closed"; + $server['status'] = "offline"; + } +?> + + + + + + + +
BezeichnungOrtStatusAktion
SP-EMD-01Emden, DeutschlandIdleBearbeiten | Entfernen
SP-EMD-02Emden, DeutschlandAusgelastetBearbeiten | Entfernen
SP-HB-01Bremen, DeutschlandNicht erreichbarBearbeiten | Entfernen
SP-HB-02Bremen, DeutschlandIdleBearbeiten | Entfernen
SP-HB-03Bremen, DeutschlandAusgelastetBearbeiten | Entfernen
IDLocationStatusActions
+ + Edit | Delete
- -
diff --git a/application/views/footer.php b/application/views/footer.php index 050cf56..c1adceb 100644 --- a/application/views/footer.php +++ b/application/views/footer.php @@ -1,5 +1,16 @@ diff --git a/application/views/header.php b/application/views/header.php index 871912e..c64c76e 100644 --- a/application/views/header.php +++ b/application/views/header.php @@ -1,7 +1,7 @@ - + ScattPort | Dashboard @@ -46,9 +46,9 @@ ?>
  • Projekt
  • Global
  • -session->userdata('group') == 'admins'): -?> - -

    Projekte