python
from ajenti.api import *
from ajenti.plugins.dashboard import *
from ajenti.plugins.main import *
@plugin
class ServerInfoPlugin(CategoryPlugin):
text = 'Server Info'
icon = 'info'
def get_ui(self):
ui = self.app.inflate('serverinfo:main')
info = {
'hostname': self.app.get_hostname(),
'os': self.app.get_os_info(),
'cpu': self.app.get_cpu_info(),
'memory': self.app.get_memory_info()
}
self.parent.ui.populate(info)
return ui
DashboardPlugin.content_type = ServerInfoPlugin