diff --git a/postgresql/CHANGELOG b/postgresql/CHANGELOG index e13da54e3..7334a3dea 100644 --- a/postgresql/CHANGELOG +++ b/postgresql/CHANGELOG @@ -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. diff --git a/postgresql/config.info b/postgresql/config.info index 0a39c6da2..5819f09fc 100644 --- a/postgresql/config.info +++ b/postgresql/config.info @@ -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 diff --git a/postgresql/edit_dbase.cgi b/postgresql/edit_dbase.cgi index 02ed56240..9bd1e922b 100755 --- a/postgresql/edit_dbase.cgi +++ b/postgresql/edit_dbase.cgi @@ -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]). + " ". + &html_escape($all[$i])." ".$descs[$i].""); + } + print &ui_grid_table(\@grid, 4, 100, undef, undef, + $text{'dbase_header'}); + } else { # Show as icons @checks = map { &ui_checkbox("d", $_) } @checks; diff --git a/postgresql/edit_index.cgi b/postgresql/edit_index.cgi index 98e0a012f..e507de33f 100755 --- a/postgresql/edit_index.cgi +++ b/postgresql/edit_index.cgi @@ -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'}, diff --git a/postgresql/edit_seq.cgi b/postgresql/edit_seq.cgi index 2c892090f..41a20fe02 100755 --- a/postgresql/edit_seq.cgi +++ b/postgresql/edit_seq.cgi @@ -22,7 +22,7 @@ $desc = "$in{'db'}"; 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'}, diff --git a/postgresql/edit_view.cgi b/postgresql/edit_view.cgi index 3731db918..fd8a38de3 100755 --- a/postgresql/edit_view.cgi +++ b/postgresql/edit_view.cgi @@ -18,7 +18,7 @@ $desc = "$in{'db'}"; 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'}, diff --git a/postgresql/index.cgi b/postgresql/index.cgi index 797a91938..33b364484 100755 --- a/postgresql/index.cgi +++ b/postgresql/index.cgi @@ -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]). + " ". + &html_escape($titles[$i]).""); + } + print &ui_grid_table(\@grid, 4, 100, undef, undef, ""); + } else { # Show databases as icons @checks = map { &ui_checkbox("d", $_) } @checks; diff --git a/postgresql/lang/en b/postgresql/lang/en index 57220894b..1bb488f90 100644 --- a/postgresql/lang/en +++ b/postgresql/lang/en @@ -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