alterator-sysinfo-0.8/000075500000000000000000000000001176307413200150505ustar00rootroot00000000000000alterator-sysinfo-0.8/Makefile000064400000000000000000000001411176307413200165040ustar00rootroot00000000000000NAME=sysinfo all: clean: install: install-module include /usr/share/alterator/build/module.mak alterator-sysinfo-0.8/applications/000075500000000000000000000000001176307413200175365ustar00rootroot00000000000000alterator-sysinfo-0.8/applications/sysinfo.desktop000064400000000000000000000005021176307413200226200ustar00rootroot00000000000000[Desktop Entry] Encoding=UTF-8 Type=Application Categories=X-Alterator-System Icon=sysinfo Terminal=false Name=System information X-Alterator-URI=/sysinfo X-Alterator-Weight=20 X-Alterator-Help=sysinfo Name[ru]=Информация о системе Name[pt_BR]=Informações do sistema Name[es]=Información del sistema: alterator-sysinfo-0.8/backend3/000075500000000000000000000000001176307413200165225ustar00rootroot00000000000000alterator-sysinfo-0.8/backend3/sysinfo000075500000000000000000000031011176307413200201350ustar00rootroot00000000000000#!/bin/sh #turn of auto expansion set -f alterator_api_version=1 . alterator-sh-functions meminfo(){ local name t u f o free -mo | while read name t u f o; do case "$name" in Mem:) write_string_param memory_total "${t}M" write_string_param memory_free "${f}M" write_string_param memory_used "${u}M" write_string_param memory_perc "$((100*$u/$t))" ;; Swap:) write_string_param swap_total "${t}M" write_string_param swap_free "${f}M" write_string_param swap_used "${u}M" write_string_param swap_perc "$((100*$u/$t))" ;; esac done } on_message(){ case "$in_action" in read) write_string_param kernel "$(uname -r)" write_string_param release "$(cat /etc/altlinux-release | sed -e 's/^alt linux[[:space:]]*//i')" meminfo ;; list) if [ $in__objects = "df" ];then df -lhP| awk '(NR!=1)&&!/^udevfs/&&!/^shmfs/ {printf "(name \"%s\" disk_total \"%s\" disk_used \"%s (%s)\" disk_free \"%s\")\n",$6,$2,$3,$5,$4;}' >&3 elif [ $in__objects = "cpu" ];then awk -F ': ' ' BEGIN{n=0;} function dump(){ if (name!=""){ printf "(num \"%d\" name \"%s\" freq \"%d MHz\" cache \"%s\")",n,name,freq,cache } } function clean(){ name=""; freq=0; cache=""; } /^processor/ {dump(); clean(); n++;} /^model name/ {name=$2;} /^cpu MHz/ {freq=$2;} /^cache size/ {cache=$2;} END{dump()}' < /proc/cpuinfo >&3 fi ;; esac } message_loop alterator-sysinfo-0.8/ui/000075500000000000000000000000001176307413200154655ustar00rootroot00000000000000alterator-sysinfo-0.8/ui/sysinfo/000075500000000000000000000000001176307413200171575ustar00rootroot00000000000000alterator-sysinfo-0.8/ui/sysinfo/ajax.scm000064400000000000000000000005361176307413200206120ustar00rootroot00000000000000(define-module (ui sysinfo ajax) :use-module (alterator ajax) :use-module (alterator woo) :export (init)) (define (init) (catch/message (lambda () (form-update-enum "cpu" (woo-list "/sysinfo/cpu")) (form-update-enum "df" (woo-list "/sysinfo/df")) (form-update-value-list (woo-read-first "/sysinfo")) ))) alterator-sysinfo-0.8/ui/sysinfo/index.html000064400000000000000000000061071176307413200211600ustar00rootroot00000000000000

Release:

Kernel version:

Processors:
N Model name Frequency Cache

Memory usage:

Total Free Used
Memory: (%)
Swap space: (%)

Disk usage:
Mount point Total Free Used

alterator-sysinfo-0.8/ui/sysinfo/index.scm000064400000000000000000000035671176307413200210050ustar00rootroot00000000000000(document:surround "/std/frame") margin 100 spacing 10 (define *common-data* (make-cell '())) (define *df-data* (make-cell '())) (define *cpu-data* (make-cell '())) (woo-catch/message (thunk (cell-set! *common-data* (woo-read-first "sysinfo")) (cell-set! *df-data* (woo-list "sysinfo/df")) (cell-set! *cpu-data* (woo-list "sysinfo/cpu")) )) (define (get-ltext n) (bold (woo-get-option (cell-ref *common-data*) n ""))) (define (mktable data . fields) (fold (lambda (data lst) (append lst (map (lambda (x) (label align "left" text (bold (woo-get-option data x "")))) fields))) '() (cell-ref data) ) ) (define (mktable-h . fields) (map (lambda (x) (label align "left" text x)) fields)) (gridbox columns "10;90" (label text (_ "Kernel version:")) (label text (get-ltext 'kernel)) ) (groupbox title (_ "Processors") (apply gridbox columns "0;60;20;20" (mktable-h "N" (_ "Model name") (_ "Frequency") (_ "Cache")) (separator colspan 4) (mktable *cpu-data* 'num 'name 'freq 'cache) )) (groupbox title (_ "Memory usage") (gridbox columns "40;20;20;20" (spacer) (mktable-h (_ "Total") (_ "Free") (_ "Used")) (separator colspan 4) (label text (_ "Memory:")) (label text (get-ltext 'memory_total)) (label text (get-ltext 'memory_free)) (label text (bold (string-append (get-ltext 'memory_used) " (" (get-ltext 'memory_perc) "%)" ))) (label text (_ "Swap space:")) (label text (get-ltext 'swap_total)) (label text (get-ltext 'swap_free)) (label text (bold (string-append (get-ltext 'swap_used) " (" (get-ltext 'swap_perc) "%)" ))) )) (groupbox title (_ "Disk usage") (apply gridbox columns "40;20;20;20" (mktable-h (_ "Mount point") (_ "Total") (_ "Free") (_ "Used")) (separator colspan 4) (mktable *df-data* 'name 'disk_total 'disk_free 'disk_used) ))