mirror of
https://github.com/webmin/webmin.git
synced 2026-06-21 11:50:25 +01:00
Completed ui-lib conversion
This commit is contained in:
@@ -47,24 +47,22 @@ return @rv;
|
||||
sub update_system_form
|
||||
{
|
||||
print &ui_subheading($text{'apt_form'});
|
||||
print "<form action=apt_upgrade.cgi>\n";
|
||||
print "<table>\n";
|
||||
print &ui_form_start("apt_upgrade.cgi");
|
||||
print &ui_table_start($text{'apt_header'}, undef, 2);
|
||||
|
||||
print "<tr> <td><b>$text{'apt_update'}</b></td>\n";
|
||||
print "<td><input type=radio name=update value=1 checked> $text{'yes'}\n";
|
||||
print "<input type=radio name=update value=0> $text{'no'}</td> </tr>\n";
|
||||
print &ui_table_row($text{'apt_update'},
|
||||
&ui_yesno_radio("update", 1));
|
||||
|
||||
print "<tr> <td><b>$text{'apt_mode'}</b></td>\n";
|
||||
print "<td><input type=radio name=mode value=2> $text{'apt_mode2'}\n";
|
||||
print "<input type=radio name=mode value=1> $text{'apt_mode1'}\n";
|
||||
print "<input type=radio name=mode value=0 checked> $text{'apt_mode0'}</td> </tr>\n";
|
||||
print &ui_table_row($text{'apt_mode'},
|
||||
&ui_radio("mode", 0, [ [ 2, $text{'apt_mode2'} ],
|
||||
[ 1, $text{'apt_mode1'} ],
|
||||
[ 0, $text{'apt_mode0'} ] ]));
|
||||
|
||||
print "<tr> <td><b>$text{'apt_sim'}</b></td>\n";
|
||||
print "<td><input type=radio name=sim value=1> $text{'yes'}\n";
|
||||
print "<input type=radio name=sim value=0 checked> $text{'no'}</td> </tr>\n";
|
||||
print &ui_table_row($text{'apt_sim'},
|
||||
&ui_yesno_radio("sim", 0));
|
||||
|
||||
print "</table>\n";
|
||||
print "<input type=submit value='$text{'apt_apply'}'></form>\n";
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'apt_apply'} ] ]);
|
||||
}
|
||||
|
||||
# update_system_resolve(name)
|
||||
|
||||
@@ -53,17 +53,17 @@ else {
|
||||
print "<center>\n";
|
||||
print &text('deletes_rusure', "<tt>".join(" ", @packs)."</tt>"),
|
||||
"<p>\n";
|
||||
print "<form action=delete_packs.cgi method=post>\n";
|
||||
print &ui_form_start("delete_packs.cgi", "post");
|
||||
foreach $d (split(/\0/, $in{'del'})) {
|
||||
print "<input type=hidden name=del value='$d'>\n";
|
||||
print &ui_hidden("del", $d);
|
||||
}
|
||||
print "<input type=hidden name=sure value=1>\n";
|
||||
print "<input type=hidden name=search value=\"$in{'search'}\">\n";
|
||||
print "<input type=submit value=\"$text{'deletes_ok'}\"><p>\n";
|
||||
print &ui_hidden("sure", 1);
|
||||
print &ui_hidden("search", $in{'search'});
|
||||
print &ui_submit($text{'deletes_ok'});
|
||||
if (defined(&delete_options)) {
|
||||
&delete_options($packs[0]);
|
||||
}
|
||||
print "</center></form>\n";
|
||||
print &ui_form_end(),"</center>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -130,6 +130,9 @@ rpm_eroot=Root directory '$1' does not exist
|
||||
rpm_search=Search rpmfind.net for:
|
||||
rpm_none=No packages matching your search were found.
|
||||
rpm_find=Search rpmfind.net ..
|
||||
rpm_findrpm=Package filename
|
||||
rpm_finddistro=Distribution
|
||||
rpm_finddesc=Description
|
||||
|
||||
bsd_unknown=Unknown
|
||||
bsd_scripts=Execute pre and post install scripts?
|
||||
@@ -174,6 +177,7 @@ rhn_title=Select RHN package
|
||||
rhn_pack=Package
|
||||
rhn_version=Version
|
||||
rhn_form=Redhat Network Options
|
||||
rhn_header=Automatic package upgrade options
|
||||
rhn_auto=Automatically check for updates?
|
||||
rhn_interval=Checking interval
|
||||
rhn_secs=minutes
|
||||
@@ -197,6 +201,7 @@ apt_install=Installing package(s) with command $1 ..
|
||||
apt_ok=.. install complete.
|
||||
apt_failed=.. install failed!
|
||||
apt_form=Upgrade All Packages
|
||||
apt_header=APT package upgrade options
|
||||
apt_update=Resynchronize package list (<tt>update</tt>)
|
||||
apt_mode=Upgrade mode
|
||||
apt_mode2=Distribution upgrade (<tt>upgrade-dist</tt>)
|
||||
|
||||
@@ -41,41 +41,38 @@ return @rv;
|
||||
sub update_system_form
|
||||
{
|
||||
print &ui_subheading($text{'rhn_form'});
|
||||
print "<form action=rhn_check.cgi>\n";
|
||||
print "<table>\n";
|
||||
print &ui_form_start("rhn_check.cgi");
|
||||
print &ui_table_start($text{'rhn_header'}, undef, 2);
|
||||
|
||||
# Started at boot?
|
||||
&foreign_require("init", "init-lib.pl");
|
||||
local $auto = &init::action_status("rhnsd");
|
||||
print "<tr> <td><b>$text{'rhn_auto'}</b></td>\n";
|
||||
printf "<td><input type=radio name=auto value=1 %s> %s\n",
|
||||
$auto == 2 ? 'checked' : '', $text{'yes'};
|
||||
printf "<input type=radio name=auto value=0 %s> %s</td> </tr>\n",
|
||||
$auto == 2 ? '' : 'checked', $text{'no'};
|
||||
print &ui_table_row($text{'rhn_auto'},
|
||||
&ui_yesno_radio("auto", $auto == 2 ? 1 : 0));
|
||||
|
||||
# Checking interval
|
||||
local %rhnsd;
|
||||
&read_env_file($rhn_sysconfig, \%rhnsd);
|
||||
print "<tr> <td><b>$text{'rhn_interval'}</b></td>\n";
|
||||
print "<td><input name=interval size=5 value='$rhnsd{'INTERVAL'}'> ",
|
||||
"$text{'rhn_secs'}</td> </tr>\n";
|
||||
print &ui_table_row($text{'rhn_interval'},
|
||||
&ui_textbox("interval", $rhnsd{'INTERVAL'}, 5)." ".$text{'rhn_secs'});
|
||||
|
||||
# Proxy server
|
||||
local $conf = &read_up2date_config();
|
||||
print "<tr> <td><b>$text{'rhn_proxy'}</b></td>\n";
|
||||
printf "<td><input type=radio name=proxy_on value=0 %s> %s\n",
|
||||
$conf->{'enableProxy'}->{'value'} ? '' : 'checked', $text{'rhn_none'};
|
||||
printf "<input type=radio name=proxy_on value=1 %s> %s\n",
|
||||
$conf->{'enableProxy'}->{'value'} ? 'checked' : '';
|
||||
local $prx = $conf->{'pkgProxy'} ? $conf->{'pkgProxy'}->{'value'}
|
||||
: $conf->{'httpProxy'}->{'value'};
|
||||
printf "<input name=proxy size=40 value='%s'></td> </tr>\n", $prx;
|
||||
print &ui_table_row($text{'rhn_proxy'},
|
||||
&ui_radio("proxy_on", $conf->{'enableProxy'}->{'value'} ? 1 : 0,
|
||||
[ [ 0, $text{'rhn_none'} ],
|
||||
[ 1, &ui_textbox("proxy", $prx, 40) ] ]));
|
||||
|
||||
print "<tr> <td valign=top><b>$text{'rhn_skip'}</b></td>\n";
|
||||
print "<td><textarea name=skip rows=3 cols=40>",
|
||||
join("\n", split(/;/, $conf->{'pkgSkipList'}->{'value'})),
|
||||
"</textarea></td> </tr>\n";
|
||||
# Packages to skip
|
||||
print &ui_table_row($text{'rhn_skip'},
|
||||
&ui_textarea("skip",
|
||||
join("\n", split(/;/, $conf->{'pkgSkipList'}->{'value'})), 5, 40));
|
||||
|
||||
print "</table>\n";
|
||||
print "<input type=submit value='$text{'rhn_apply'}'>\n";
|
||||
print "<input type=submit name=now value='$text{'rhn_now'}'></form>\n";
|
||||
print &ui_table_end();
|
||||
print &ui_form_end([ [ undef, $text{'rhn_apply'} ],
|
||||
[ "now", $text{'rhn_now'} ] ]);
|
||||
}
|
||||
|
||||
# read_up2date_config()
|
||||
|
||||
@@ -385,7 +385,7 @@ $has_search_system = 1;
|
||||
|
||||
sub search_system_input
|
||||
{
|
||||
print "<input type=button onClick='window.ifield = document.forms[2].url; chooser = window.open(\"rpmfind.cgi\", \"chooser\", \"toolbar=no,menubar=no,scrollbars=yes,width=600,height=500\")' value=\"$text{'rpm_find'}\">";
|
||||
print "<input type=button onClick='window.ifield = document.forms[2].url; chooser = window.open(\"rpmfind.cgi\", \"chooser\", \"toolbar=no,menubar=no,scrollbars=yes,width=800,height=500\")' value=\"$text{'rpm_find'}\">";
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -21,18 +21,18 @@ return false;
|
||||
</script>
|
||||
EOF
|
||||
|
||||
print "<form action=rpmfind.cgi>\n";
|
||||
print "<input type=submit value='$text{'rpm_search'}'>\n";
|
||||
print "<input name=search size=20 value='$in{'search'}'><br>\n";
|
||||
print "</form><hr>\n";
|
||||
# Search form
|
||||
print &ui_form_start("rpmfind.cgi");
|
||||
print &ui_submit($text{'rpm_search'});
|
||||
print &ui_textbox("search", $in{'search'}, 20);
|
||||
print &ui_form_end();
|
||||
|
||||
if ($in{'search'}) {
|
||||
# Call the rpmfind.net website
|
||||
local $temp = &transname();
|
||||
# Call the rpmfind.net website to get matches
|
||||
print "<hr>\n";
|
||||
$out = "";
|
||||
&http_download($rpmfind_host, $rpmfind_port,
|
||||
$rpmfind_page.&urlize($in{'search'}), $temp);
|
||||
local $out = `cat $temp`;
|
||||
unlink($temp);
|
||||
$rpmfind_page.&urlize($in{'search'}), \$out);
|
||||
while($out =~ /<tr[^>]*>.*?<td[^>]*>([^<]*)<\/td>.*?<td[^>]*>([^<]*)<\/td>.*?((ftp|http|https):[^>]+\.rpm).*?<\/tr>([\000-\377]*)/i) {
|
||||
local $pkg = { 'url' => $3,
|
||||
'dist' => $2,
|
||||
@@ -58,21 +58,25 @@ if ($in{'search'}) {
|
||||
push(@rv, $pkg);
|
||||
}
|
||||
|
||||
# Show the search results
|
||||
@rv = grep { !$_->{'source'} } @rv;
|
||||
@rv = sort { local $vc = $b->{'version'} <=> $a->{'version'};
|
||||
local $rc = $b->{'version'} <=> $a->{'version'};
|
||||
return $vc ? $vc : $rc } @rv;
|
||||
if (@rv) {
|
||||
print "<table width=100%>\n";
|
||||
print &ui_columns_start([ $text{'rpm_findrpm'},
|
||||
$text{'rpm_finddistro'},
|
||||
$text{'rpm_finddesc'} ], 100);
|
||||
foreach $r (@rv) {
|
||||
print "<tr>\n";
|
||||
print "<td><a href='' onClick='sel(\"$r->{'url'}\")'>",
|
||||
"$r->{'file'}</a></td>\n";
|
||||
print "<td>$r->{'dist'}</td>\n";
|
||||
print "<td>$r->{'desc'}</td>\n";
|
||||
print "</tr>\n";
|
||||
print &ui_columns_row([
|
||||
"<a href='' onClick='sel(\"$r->{'url'}\")'>".
|
||||
"$r->{'file'}</a>",
|
||||
$r->{'dist'},
|
||||
$r->{'desc'}
|
||||
]);
|
||||
}
|
||||
print "</table>\n";
|
||||
print &ui_columns_end();
|
||||
}
|
||||
else {
|
||||
print "<b>$text{'rpm_none'}</b> <p>\n";
|
||||
|
||||
@@ -35,8 +35,8 @@ if (@match) {
|
||||
@match = sort { lc($packages{$a,'name'}) cmp lc($packages{$b,'name'}) }
|
||||
@match;
|
||||
print "<b>",&text('search_match', "<tt>$s</tt>"),"</b><p>\n";
|
||||
print "<form action=delete_packs.cgi method=post>\n";
|
||||
print "<input type=hidden name=search value='$in{'search'}'>\n";
|
||||
print &ui_form_start("delete_packs.cgi", "post");
|
||||
print &ui_hidden("search", $in{'search'});
|
||||
@tds = ( "width=5" );
|
||||
@links = ( &select_all_link("del", 0),
|
||||
&select_invert_link("del", 0) );
|
||||
@@ -66,7 +66,7 @@ if (@match) {
|
||||
}
|
||||
print &ui_columns_end();
|
||||
print &ui_links_row(\@links);
|
||||
print "<input type=submit value='$text{'search_delete'}'></form>\n";
|
||||
print &ui_form_end([ [ undef, $text{'search_delete'} ] ]);
|
||||
}
|
||||
else {
|
||||
print "<b>",&text('search_nomatch', "<tt>$s</tt>"),"</b><p>\n";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# software-lib.pl
|
||||
# A generalized system for package management on solaris, linux, etc..
|
||||
# XXX cluster-software module
|
||||
|
||||
do '../web-lib.pl';
|
||||
&init_config();
|
||||
|
||||
@@ -77,8 +77,8 @@ return undef;
|
||||
sub update_system_form
|
||||
{
|
||||
print &ui_subheading($text{'yum_form'});
|
||||
print "<form action=yum_upgrade.cgi>\n";
|
||||
print "<input type=submit value='$text{'yum_apply'}'></form>\n";
|
||||
print &ui_form_start("yum_upgrade.cgi");
|
||||
print &ui_form_end([ [ undef, $text{'yum_apply'} ] ]);
|
||||
}
|
||||
|
||||
# update_system_resolve(name)
|
||||
|
||||
Reference in New Issue
Block a user