Changeset 7227


Ignorieren:
Zeitstempel:
29.06.2011 22:26:28 (vor 7 Jahren)
Autor:
cuma
Nachricht:

Webif: memory usage at services-page added. Thx M66B, translation by SaschaBr (closes #1308)

Ort:
trunk
Dateien:
5 bearbeitet

Legende:

Unverändert
Hinzugefügt
Entfernt
  • trunk/CHANGELOG

    r7208 r7227  
    332332      + added link to AVM-webinterface to "system"-submenu 
    333333    * create a support-file added 
     334    * memory usage at services-page added 
    334335 
    335336- Other stuff: 
  • trunk/make/mod/files/.language

    r6956 r7227  
    1313    usr/lib/cgi-bin/mod/conf*/*.sh 
    1414    usr/lib/libmodcgi.sh 
     15    usr/lib/mod/service.sh 
    1516    usr/lib/mod/reg-status 
    1617    usr/lib/mod/cgi/*.sh 
  • trunk/make/mod/files/root/etc/default.mod/mod.cfg

    r6886 r7227  
    88export MOD_SWAP_SWAPPINESS='60' 
    99export MOD_CGI_WIDTH='600' 
     10export MOD_SHOW_MEMORY_USAGE='no' 
    1011export MOD_MOUNTED_MAIN='no' 
    1112export MOD_MOUNTED_SUB='no' 
  • trunk/make/mod/files/root/usr/lib/cgi-bin/mod/conf.webcfg/10-webcfg.sh

    r6422 r7227  
    55check "$MOD_MOUNTED_SUB" yes:mounted_sub 
    66check "$MOD_MOUNTED_UMOUNT" yes:mounted_umount 
     7check "$MOD_SHOW_MEMORY_USAGE" yes:show_memory_usage 
    78 
    89sec_begin '$(lang de:"Weboberfläche" en:"Web interface")' 
     
    5556<p><a href="/cgi-bin/skin.cgi" target="_blank">$(lang de:"Aussehen einstellen (Skins)" en:"Change look (skins)")</a></p> 
    5657<p>$(lang de:"Breite des Hauptinhalts" en:"Width of the main content area"): <input type="text" name="cgi_width" size="4" maxlength="4" value="$(html "$MOD_CGI_WIDTH")"></p> 
     58<p><input type="hidden" name="show_memory_usage" value="no"> 
     59<input id="u1" type="checkbox" name="show_memory_usage" value="yes"$show_memory_usage_chk><label for="u1">$(lang de:"Zeige Speicherverbrauch" en:"Show memory usage")</label></p> 
    5760EOF 
    5861 
  • trunk/make/mod/files/root/usr/lib/mod/service.sh

    r5516 r7227  
    11stat_begin() { 
    22    echo '<table class="daemons">' 
     3    if [ "$MOD_SHOW_MEMORY_USAGE" = yes ]; then 
     4cat << EOF 
     5<th align="left">$(lang de:"Name" en:"Name")</th> 
     6<th align="left">$(lang de:"Status" en:"State")</th> 
     7<th align="left" colspan="3">$(lang de:"Kontrolle" en:"Control")</th> 
     8<th align="right">VmSize</th> 
     9<th align="right">VmRSS</th> 
     10EOF 
     11    fi 
    312} 
    413 
     
    7382        start=false; stop=false 
    7483    fi 
    75     stat_button "$pkg" "$daemon" start $start 
    76     stat_button "$pkg" "$daemon" stop $stop 
    77     stat_button "$pkg" "$daemon" restart $stop 
     84    stat_button "$pkg" "$daemon" $(lang de:"start" en:"start") $start 
     85    stat_button "$pkg" "$daemon" $(lang de:"stop" en:"stop") $stop 
     86    stat_button "$pkg" "$daemon" $(lang de:"restart" en:"restart") $stop 
     87 
     88    if [ "$MOD_SHOW_MEMORY_USAGE" = yes ] && [ $class = running ]; then 
     89        pid="" 
     90        pidfile="$(ls /var/run/$daemon*.pid /var/run/$daemon*/*.pid -1 2>/dev/null | head -1)" 
     91        [ -n "$pidfile" ] && pid=$(cat "$pidfile") 
     92        if [ -n "$pid" ] && [ -e "/proc/$pid/status" ]; then 
     93            vmsize=$(cat "/proc/$pid/status" | grep "VmSize" | tr -s " " | cut -d " " -f 2) 
     94            [ -n "$vmsize" ] && vmsize="$vmsize kB" 
     95            echo "<td align='right' style='width: 75px'>$vmsize</td>" 
     96            vmrss=$(cat "/proc/$pid/status" | grep "VmRSS" | tr -s " " | cut -d " " -f 2) 
     97            [ -n "$vmrss" ] && vmrss="$vmrss kB" 
     98            echo "<td align='right' style='width: 75px'>$vmrss</td>" 
     99        fi 
     100    fi 
    78101 
    79102    echo '</tr>' 
Hinweis: Hilfe zur Verwendung der Changeset-Ansicht finden Sie unter TracChangeset.