Current time: 05-09-2024, 06:56 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HOWTO] Show cpu cores in admin system tools
Author Message
qisback Offline
Junior Member
*

Posts: 13
Joined: Jan 2009
Reputation: 0
Post: #1
[HOWTO] Show cpu cores in admin system tools
Currently the system info page only shows

CPU model
CPU MHz
CPU cache
CPU bogomips

This howto will show how to add "Number of CPU cores" to that list.

This is only a quick edit of 2 files

Edit:
/var/www/ispcp/gui/admin/system_info.php

locate
Code:
if (!isset($cpu['cpuspeed'])) {
$cpu['cpuspeed'] = "n.a.";
}

add
Code:
if (!isset($cpu['cpus'])) {
$cpu['cpus'] = "n.a.";
}

locate
Code:
'TR_CPU_MHZ' => tr('CPU MHz'),
'TR_CPU_CACHE' => tr('CPU cache'),
'TR_CPU_BOGOMIPS' => tr('CPU bogomips'),

add
Code:
'TR_CPU_COUNT' => tr('Number of CPU Cores'),

Locate
Code:
'CPU_MODEL' => $cpu['model'],
'CPU_MHZ' => $cpu['cpuspeed'],
'CPU_CACHE' => $cpu['cache'],
'CPU_BOGOMIPS' => $cpu['bogomips'],

add
Code:
'CPU_COUNT' => $cpu['cpus'],

Edit:
/var/www/ispcp/gui/themes/omega_original/system_info.tpl

locate
Code:
<tr>
        <td width="25">&nbsp;</td>
        <td width="200" class="content2">{TR_CPU_MODEL}</td>
        <td class="content2">{CPU_MODEL}</td>
</tr>

add above
Code:
<tr>
        <td width="25">&nbsp;</td>
        <td width="200" class="content2">{TR_CPU_COUNT}</td>
        <td class="content2">{CPU_COUNT}</td>
</tr>

Tidy the colours up

because you've added a new table row in the table colors will look off i.e. two rows the same colour)

to correct this change the class="content" tags to alternate

i.e.
Code:
<tr>
        <td width="25">&nbsp;</td>
        <td width="200" class="content2">{TR_CPU_COUNT}</td>
        <td class="content2">{CPU_COUNT}</td>
      </tr>
      <tr>
        <td width="25">&nbsp;</td>
        <td width="200" class="content">{TR_CPU_MODEL}</td>
        <td class="content">{CPU_MODEL}</td>
      </tr>
      <tr>
        <td width="25">&nbsp;</td>
        <td width="200" class="content2">{TR_CPU_MHZ}</td>
        <td class="content2">{CPU_MHZ}</td>
      </tr>
      <tr>
        <td width="25">&nbsp;</td>
        <td width="200" class="content">{TR_CPU_CACHE}</td>
        <td class="content">{CPU_CACHE}</td>
      </tr>
      <tr>
        <td width="25">&nbsp;</td>
        <td width="200" class="content2">{TR_CPU_BOGOMIPS}</td>
        <td class="content2">{CPU_BOGOMIPS}</td>
      </tr>

Now you should have the following showing
[Image: cpucores.jpg]

Bare in mind you colours will look different as I've created my own colour scheme

I've also attached my edited files.


Attached File(s)
.zip  CPU Cores.zip (Size: 3.97 KB / Downloads: 34)
04-30-2009 12:52 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
[HOWTO] Show cpu cores in admin system tools - qisback - 04-30-2009 12:52 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)