-
Notifications
You must be signed in to change notification settings - Fork 12
/
edit_java.cgi
executable file
·91 lines (67 loc) · 3.02 KB
/
edit_java.cgi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/perl
require './tomcat-lib.pl';
require './java-lib.pl';
require '../webmin/webmin-lib.pl'; #for OS detection
&ReadParse();
&ui_print_header(undef, $text{'java_title'}, "");
# Show tabs
@tabs = ( [ "install", $text{'java_tabinstall'}, "edit_java.cgi?mode=install" ],
[ "uninstall", $text{'java_tabuninstall'}, "edit_java.cgi?mode=uninstall" ],
[ "default", $text{'java_tabdefault'}, "edit_java.cgi?mode=default" ]
);
print &ui_tabs_start(\@tabs, "mode", $in{'mode'} || "install", 1);
print &ui_tabs_start_tab("mode", "install");
print "$text{'java_desc1'}<p>\n";
print &ui_form_start("install_java.cgi", "form-data");
print &ui_table_start($text{'java_install'}, undef, 2);
my %jdk_version = &get_latest_jdk_version();
@opt_avail_jdk = ();
foreach $ver (keys %jdk_version) {
push(@opt_avail_jdk, [ "$ver=$jdk_version{$ver}", $ver]);
}
my %openjdk_version = &get_openjdk_versions();
@opt_avail_openjdk = ();
foreach $ver (reverse sort { $a <=> $b } keys %openjdk_version) {
push(@opt_avail_openjdk, [ "$ver=$openjdk_version{$ver}", $ver]);
}
print &ui_table_row($text{'jdk_installsource'},
&ui_radio_table("source", 200,
[ [ 200, $text{'openjdk_latest'}, &ui_select("openjdk_ver", undef, \@opt_avail_openjdk, 1, 0).
'<br>'.
&ui_checkbox("openjdk_headless", 1,undef, 1).$text{'openjdk_headless'}.
&ui_hr()],
[ 100, $text{'jdk_latest'}, &ui_select("jdk_ver", undef, \@opt_avail_jdk, 1, 0)],
[ 0, $text{'source_local'}, &ui_textbox("file", undef, 40)." ". &file_chooser_button("file", 0) ],
[ 1, $text{'source_uploaded'},&ui_upload("upload", 40) ],
[ 2, $text{'source_ftp'}, &ui_textbox("url", undef, 40) ]
]), 2);
print &ui_table_row($text{'java_def_jdk'},
&ui_checkbox("def_jdk", 1,undef, 1).$text{'java_def_jdk_desc'}
,2);
print &ui_table_end();
print &ui_form_end([ [ "", $text{'java_installok'} ] ]);
print &ui_tabs_end_tab();
print &ui_tabs_start_tab("mode", "uninstall");
print "$text{'java_desc2'}<p>\n";
print &ui_form_start("uninstall_java.cgi", "post");
print &ui_table_start($text{'java_uninstall'}, undef, 2);
@jdk_vlist = &get_installed_jdk_versions();
@opts_inst_jdk = ( );
foreach $jdk_ver (@jdk_vlist) {
push(@opts_inst_jdk, [ $jdk_ver, $jdk_ver ]);
}
print &ui_table_row($text{'java_installed'}, &ui_select("inst_jdk", undef, \@opts_inst_jdk, 1, 0)."<br>\n", 2);
print &ui_table_row($text{'java_rm_def_jdk'}, &ui_checkbox("rm_def_jdk", 1,undef, 1), 2);
print &ui_table_end();
print &ui_form_end([ [ "", $text{'java_deleteok'} ] ]);
print &ui_tabs_end_tab();
print &ui_tabs_start_tab("mode", "default");
print "$text{'java_desc3'}<p>\n";
print &ui_form_start("default_java.cgi", "post");
print &ui_table_start($text{'java_default'}, undef, 2);
print &ui_table_row($text{'java_installed'}, &ui_select("inst_jdk2", undef, \@opts_inst_jdk, 1, 0)."<br>\n", 2);
print &ui_table_end();
print &ui_form_end([ [ "", $text{'java_defaultok'} ] ]);
print &ui_tabs_end_tab();
print &ui_tabs_end(1);
&ui_print_footer("", $text{'index_return'});