- yweb: fix 'df'-output to determinate space on mtd

This commit is contained in:
svenhoefer
2012-07-25 11:25:05 +02:00
parent 8ebabe7dc0
commit a4d82f0ddb
7 changed files with 32 additions and 23 deletions

View File

@@ -156,19 +156,21 @@ function do_set_updates2(){
}
var avaiable=0;
function show_free(){
var res=dbox_exec_tools("var_space");
var res=dbox_exec_tools("mtd_space");
var Ausdruck = /([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*).*$/;
Ausdruck.exec(res);
var mtd = RegExp.$1;
var total = RegExp.$2;
var used = RegExp.$3;
avaiable = RegExp.$4;
var percentage = RegExp.$5;
var mtpt = RegExp.$6;
if (total != "") {
str = "Sapce in /var Total: " + total + "k used: " + used + "k Free: " + avaiable + "k part used: " + percentage;
str = "Space in " + mtd + " (mounted on " + mtpt + ") Total: " + total + "kB; Used: " + used + "kB; Free: " + avaiable + "kB (" + percentage + ")";
$('avaiable').update(avaiable);
}
else
str = "Can not determine free space /var is no partition! JFFS2 oder YADD?";
str = "Can not determine free space.";
$("free").update(str);
}
/*uninstall*/

View File

@@ -34,7 +34,7 @@
</form>
<br/>
<div id="free">?</div>
{=L:ext.free=}:&nbsp;<span id="avaiable">?</span>k
{=L:ext.free=}: <span id="avaiable">?</span>k
<form method="post" name="log" action="">
<div class="y_form_header_oline">Log</div>
<table class="lt_table" cellspacing="0" cellpadding="4">

View File

@@ -19,7 +19,7 @@ function do_submit()
alert("{=L:tools.yinstaller.no_file_given=}");
}
function init(){
var res=dbox_exec_tools("var_space");
var res=dbox_exec_tools("mtd_space");
var Ausdruck = /([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*)[ ]*([^ ]*).*$/;
Ausdruck.exec(res);
var total = RegExp.$2;
@@ -27,7 +27,7 @@ function init(){
var avaiable = RegExp.$4;
var percentage = RegExp.$5;
if(total != "")
str="{=L:tools.yinstaller.space.var=}: "+total+"{=L:tools.yinstaller.space.used=}: "+used+"{=L:tools.yinstaller.space.free=}: "+avaiable+"{=L:tools.yinstaller.space.percentage=}: "+percentage;
str="{=L:tools.yinstaller.space.mtd=}: "+total+"kB; {=L:tools.yinstaller.space.used=}: "+used+"kB; {=L:tools.yinstaller.space.free=}: "+avaiable+"kB; {=L:tools.yinstaller.space.percentage=}: "+percentage;
else
str="{=L:tools.yinstaller.not_determine=}";
id("free").innerHTML=str;

View File

@@ -395,11 +395,11 @@ tools.info.version=Version
============ Tools yInstaller
tools.yinstaller.no_file_given=Keine Datei angegeben!
tools.yinstaller.space.var=Platz in /var Gesamt
tools.yinstaller.space.used=k Benutzt
tools.yinstaller.space.free=k Frei
tools.yinstaller.space.percentage=k Anteil benutzt
tools.yinstaller.not_determine=Kann freien Speicherplatz nicht ermitteln /var ist keine Partition! JFFS2 oder YADD?
tools.yinstaller.space.mtd=Platz gesamt
tools.yinstaller.space.used=Benutzt
tools.yinstaller.space.free=Frei
tools.yinstaller.space.percentage=Anteil benutzt
tools.yinstaller.not_determine=Kann freien Speicherplatz nicht ermitteln.
tools.yinstaller.head=yInstaller
tools.yinstaller.tar_file=tar-Datei
tools.yinstaller.upload_install=hochladen und installieren

View File

@@ -398,11 +398,11 @@ tools.info.version=Version
============ Tools yInstaller
tools.yinstaller.no_file_given=No file given!
tools.yinstaller.space.var=Space in /var total
tools.yinstaller.space.used=k used
tools.yinstaller.space.free=k free
tools.yinstaller.space.percentage=k percentage used
tools.yinstaller.not_determine=Can not determine free space. /var is no partition! JFFS2, YADD or USB?
tools.yinstaller.space.mtd=Space total
tools.yinstaller.space.used=used
tools.yinstaller.space.free=free
tools.yinstaller.space.percentage=percentage used
tools.yinstaller.not_determine=Can not determine free space.
tools.yinstaller.head=yInstaller
tools.yinstaller.tar_file=tar-File
tools.yinstaller.upload_install=upload and install

View File

@@ -382,11 +382,11 @@ tools.info.version=Versão
============ Ferramentas yInstaller
tools.yinstaller.no_file_given=Nenhum ficheiro selecionado!
tools.yinstaller.space.var=Total de Espaço em /var
tools.yinstaller.space.used=k usados
tools.yinstaller.space.free=k livres
tools.yinstaller.space.percentage=k percentagem usada
tools.yinstaller.not_determine=Sem puder determinar o espaço livre. /var não é uma partição! JFFS2, YADD ou USB?
tools.yinstaller.space.mtd=Total de espaço
tools.yinstaller.space.used=usados
tools.yinstaller.space.free=livres
tools.yinstaller.space.percentage=percentagem usada
tools.yinstaller.not_determine=Sem puder determinar o espaço livre.
tools.yinstaller.head=yInstaller
tools.yinstaller.tar_file=tar-Ficheiro
tools.yinstaller.upload_install=upload e instalar

View File

@@ -622,8 +622,15 @@ case "$1" in
echo "on"
fi
;;
var_space)
df |grep mtd2
mtd_space|var_space)
df | while read fs rest; do
case ${fs:0:3} in
mtd)
echo "$fs" "$rest"
break
;;
esac
done
;;
tmp_space)
df /tmp|grep /tmp