mirror of
https://github.com/webmin/webmin.git
synced 2025-07-21 23:40:34 +00:00
Option to show just DB and table names
This commit is contained in:
@ -62,3 +62,5 @@ Re-wrote the backup form to use the new Webmin UI library.
|
||||
Improved support for Debian/Ubuntu systems that can have different PostgreSQL versions.
|
||||
---- Changes since 1.380 ----
|
||||
Fixed a bug that prevented 'Jump to row' from working properly.
|
||||
---- Changes since 1.400 ----
|
||||
Added a Module Config option to show databases and tables using just their names.
|
||||
|
@ -3,7 +3,7 @@ login=Administration login,0
|
||||
pass=Administration password,12
|
||||
sameunix=Unix user to connect to database as,1,1-Same as Administration login,0-root
|
||||
perpage=Number of rows to display per page,0,5
|
||||
style=Show databases and tables as,1,1-List,0-Icons
|
||||
style=Show databases and tables as,1,1-List,0-Icons,2-Names only
|
||||
add_mode=Use vertical row editing interface,1,1-Yes,0-No
|
||||
blob_mode=Show blob and text fields as,1,0-Data in table,1-Links to download
|
||||
nodbi=Use DBI to connect if available?,1,0-Yes,1-No
|
||||
|
@ -79,6 +79,11 @@ elsif (@titles || @indexes || @views || @seqs) {
|
||||
( map { "edit_seq.cgi?db=$in{'db'}&seq=".&urlize($_) }
|
||||
@seqs ),
|
||||
);
|
||||
@descs = ( ( map { "" } @titles ),
|
||||
( map { " ($text{'dbase_index'})" } @indexes),
|
||||
( map { " ($text{'dbase_view'})" } @views),
|
||||
( map { " ($text{'dbase_seq'})" } @seqs),
|
||||
);
|
||||
#&show_buttons();
|
||||
@rowlinks = ( );
|
||||
if ($access{'tables'}) {
|
||||
@ -94,7 +99,7 @@ elsif (@titles || @indexes || @views || @seqs) {
|
||||
}
|
||||
print &ui_links_row(\@rowlinks);
|
||||
@dtitles = map { &html_escape($_) } ( @titles, @indexes, @views,@seqs );
|
||||
if ($displayconfig{'style'}) {
|
||||
if ($displayconfig{'style'} == 1) {
|
||||
# Show as table
|
||||
foreach $t (@titles) {
|
||||
local $c = &execute_sql($in{'db'},
|
||||
@ -122,6 +127,18 @@ elsif (@titles || @indexes || @views || @seqs) {
|
||||
\@checks, \@links, \@dtitles,
|
||||
\@rows, \@fields) if (@titles);
|
||||
}
|
||||
elsif ($displayconfig{'style'} == 2) {
|
||||
# Just show table names
|
||||
@grid = ( );
|
||||
@all = ( @titles, @indexes, @views, @seqs );
|
||||
for(my $i=0; $i<@links; $i++) {
|
||||
push(@grid, &ui_checkbox("d", $checks[$i]).
|
||||
" <a href='$links[$i]'>".
|
||||
&html_escape($all[$i])." ".$descs[$i]."</a>");
|
||||
}
|
||||
print &ui_grid_table(\@grid, 4, 100, undef, undef,
|
||||
$text{'dbase_header'});
|
||||
}
|
||||
else {
|
||||
# Show as icons
|
||||
@checks = map { &ui_checkbox("d", $_) } @checks;
|
||||
|
@ -24,7 +24,7 @@ print &ui_form_start("save_index.cgi", "post");
|
||||
print &ui_hidden("db", $in{'db'}),"\n";
|
||||
print &ui_hidden("table", $table),"\n";
|
||||
print &ui_hidden("old", $in{'index'}),"\n";
|
||||
print &ui_table_start($text{'index_header1'}, undef, 2);
|
||||
print &ui_table_start($text{'index_header1'}, undef, 2, [ "width=30%" ]);
|
||||
|
||||
# Index name
|
||||
print &ui_table_row($text{'index_name'},
|
||||
|
@ -22,7 +22,7 @@ $desc = "<tt>$in{'db'}</tt>";
|
||||
print &ui_form_start("save_seq.cgi", "post");
|
||||
print &ui_hidden("db", $in{'db'}),"\n";
|
||||
print &ui_hidden("old", $in{'seq'}),"\n";
|
||||
print &ui_table_start($text{'seq_header1'}, undef, 2);
|
||||
print &ui_table_start($text{'seq_header1'}, undef, 2, [ "width=30%" ]);
|
||||
|
||||
# Sequence name
|
||||
print &ui_table_row($text{'seq_name'},
|
||||
|
@ -18,7 +18,7 @@ $desc = "<tt>$in{'db'}</tt>";
|
||||
print &ui_form_start("save_view.cgi", "post");
|
||||
print &ui_hidden("db", $in{'db'}),"\n";
|
||||
print &ui_hidden("old", $in{'view'}),"\n";
|
||||
print &ui_table_start($text{'view_header1'}, undef, 2);
|
||||
print &ui_table_start($text{'view_header1'}, undef, 2, [ "width=30%" ]);
|
||||
|
||||
# View name
|
||||
print &ui_table_row($text{'view_name'},
|
||||
|
@ -202,7 +202,8 @@ else {
|
||||
}
|
||||
print &ui_links_row(\@rowlinks);
|
||||
@checks = @titles;
|
||||
if ($config{'style'}) {
|
||||
if ($config{'style'} == 1) {
|
||||
# Show as DB names and table counts
|
||||
@tables = map { if (&accepting_connections($_)) {
|
||||
my @t = &list_tables($_);
|
||||
scalar(@t);
|
||||
@ -217,6 +218,16 @@ else {
|
||||
\@checks, \@links, \@titles, \@tables)
|
||||
if (@titles);
|
||||
}
|
||||
elsif ($config{'style'} == 2) {
|
||||
# Show just DB names
|
||||
@grid = ( );
|
||||
for(my $i=0; $i<@links; $i++) {
|
||||
push(@grid, &ui_checkbox("d", $titles[$i]).
|
||||
" <a href='$links[$i]'>".
|
||||
&html_escape($titles[$i])."</a>");
|
||||
}
|
||||
print &ui_grid_table(\@grid, 4, 100, undef, undef, "");
|
||||
}
|
||||
else {
|
||||
# Show databases as icons
|
||||
@checks = map { &ui_checkbox("d", $_) } @checks;
|
||||
|
@ -54,6 +54,7 @@ login_epass=Incorrect administration username or password
|
||||
|
||||
dbase_title=Edit Database
|
||||
dbase_noconn=This database is not currently accepting connections, so no actions can be performed in it.
|
||||
dbase_header=Database tables, indexes, views and sequences
|
||||
dbase_tables=Database Tables
|
||||
dbase_add=Create Table
|
||||
dbase_vadd=Create View
|
||||
|
Reference in New Issue
Block a user