X-Wrt
July 29, 2010, 07:27:29 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the X-Wrt Forums
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: WoL page shows wol command although package not installed (rev 4778)  (Read 1636 times)
maddes.b
Newbie
*
Offline Offline

Posts: 9


View Profile WWW
« on: July 18, 2009, 03:24:36 PM »

It would be great if not installed packages (=not existent binaries) would not be given as a select option.

Thanks
Maddes
Logged

maddes.b
Newbie
*
Offline Offline

Posts: 9


View Profile WWW
« Reply #1 on: July 18, 2009, 03:37:07 PM »

Just recognized that this is caused due to "-n" comparison not working with Busybox 1.13.4 (here on Marvell Orion) from OpenWrt trunk revision 16902.

But "! -z" is working fine.
Logged

maddes.b
Newbie
*
Offline Offline

Posts: 9


View Profile WWW
« Reply #2 on: July 18, 2009, 03:45:48 PM »

To make it work use the following code.
It also fixes the html code by adding the missing closing tag for <option>, puts the source code on one line (echo -n) and only prints the space in front of SELECTED when necessary.

Code:
<form>
<table><tr><th>@TR<<WOL application>>:</th><td><select name="wolapp">
<?
for i in ether-wake etherwake wol; do
[ -n "`which $i`" ] && {
echo -n "<option value=\"$i\"";
[ "$i" = "$FORM_wolapp" ] && echo -n " SELECTED";
echo ">$i</option>";
}
done
?>

Update:
Patch attached for repository.

Update 2:
The correct syntax is [ -n "${var}" ] (notice the quotes). Thanks to Vasilis.
Attached patch is updated.
« Last Edit: July 18, 2009, 04:41:49 PM by maddes.b » Logged

maddes.b
Newbie
*
Offline Offline

Posts: 9


View Profile WWW
« Reply #3 on: July 19, 2009, 06:38:40 AM »

Sent the final patch to the X-Wrt developers mailing list. I hope that it gets applied to the repository.
It's attached if you want to check it out in advance.
Logged

lubek
X-Wrt Developer
Hero Member
*****
Offline Offline

Posts: 972


View Profile
« Reply #4 on: July 20, 2009, 09:37:41 AM »

Well, you managed to wake up the sleeping OpenWrt mailing list.  Roll Eyes

Thank for your work.

This page is the ugliest one in webif2 for Kamikaze.
Unfortunately your changes do not repair it enough. You are only pushing your demands like others before.
Compare it with the White Russian page (there is no screenshot for etherwake).

This page was only a quick hack (I think that it was even inherited from the old OpenWrt webif).
It does not adhere to the standards, it does not use webif2 style/format. The developers have been only fixing errors so far.

Where do you get ether-wake? Is it built at default in OpenWrt despite of my complaints? Or are you using it in your own build?

Additional complaints:
  • the page should not show the form when there is no wol/etherwake (an empty select is wrong)
  • echo -n - you are solving useless things; it does not matter how many lines the tag is covering
  • SELECTED - there is no such tag or attribute in X-HTML 1.0 Transitional; when you use the predefined form, it will do it for you
  • interfaces - interfaces are dynamic in OpenWrt, the user does not necessarily know what eth0.3 or ath2 is but he probably knows what the "medialan" network is designed for in his config.

I can help you to enhance the page, to get the native look in webif2 but I do not want to do everything alone.
« Last Edit: July 20, 2009, 09:39:24 AM by lubek » Logged
maddes.b
Newbie
*
Offline Offline

Posts: 9


View Profile WWW
« Reply #5 on: July 20, 2009, 03:12:48 PM »

The current X-Wrt r4778 WoL page with Kamikaze looks exactly the same as the X-Wrt r2687 WoL page with White Russian (see attached screenshots), but looks different to the screenshot you linked to.

ether-wake (with dash) from busybox is not in the default build of OpenWrt.
But it can be added easily to your own OpenWrt build under "Base System" --> "busybox" --> "Configuration" --> "Networking Utilities"

Would be great if I can help to get the WoL page fixed. Will PM you.
Logged

lubek
X-Wrt Developer
Hero Member
*****
Offline Offline

Posts: 972


View Profile
« Reply #6 on: July 21, 2009, 04:28:21 AM »

The last WR was Milestone 3 RC2 which did not make it to the release.
Logged
thepeople
X-Wrt Developer
Administrator
Hero Member
*****
Offline Offline

Posts: 1138


View Profile
« Reply #7 on: July 23, 2009, 05:52:36 PM »

I have committed your patch as an interm solution. I hope to see a revamped page similar to the last WR RC.

Thanks
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.115 seconds with 18 queries.