Skip to content

Commit 7ad6148

Browse files
authored
Better scaling for small screens (#10)
* Add missing button translations * Add missing translations via Google translate * Rework to handle small screen better * Update README.md * Update README.md * Update README.md * Update polish translations * Update polish translations * Make table responsive * Fix header bug, add comments * Update polish translation
1 parent 78ece89 commit 7ad6148

7 files changed

Lines changed: 70 additions & 24 deletions

File tree

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@ Created to manage a local Docker install for a home server. Allows listing of co
44

55
It uses the Docker CLI and abuses the `--format {{}}` arg for output parsing.
66

7+
Currently translated to English, Italian and Polish. UI is responsive across all device sizes.
8+
79
## Install
810

9-
The fastest way to install is to follow the "Http URL" method (https://webmin.com/docs/modules/webmin-configuration/#installing) and the latest `docker.tar.gz` release package from https://github.com/dave-lang/webmin-docker/releases.
11+
The fastest way to install is to follow the "Http URL" method (https://webmin.com/docs/modules/webmin-configuration/#installing) and use the latest release package using [https://github.com/dave-lang/webmin-docker/releases/latest/download/docker.wbm.gz](https://github.com/dave-lang/webmin-docker/releases/latest/download/docker.wbm.gz).
1012

11-
Alternatively you can download and install it directly or build manually, the packaging steps are in the GitHub action in the repo.
13+
Alternatively you can download and install it directly from the [releases page](https://github.com/dave-lang/webmin-docker/releases) or it build manually, the packaging steps are in the GitHub action in the repo.
1214

1315
Once installed a new option 'Docker Containers' will appear in the menu under 'Servers'.
14-
![image](https://github.com/dave-lang/webmin-docker/assets/141998/0fe3bc90-39ac-447a-883e-bfa7c43f9ebe)
1516

16-
## Contibuting
17+
### Container listing/actions
18+
![image](https://github.com/user-attachments/assets/e4eeda35-1800-48d5-8b15-b498f7305311)
19+
20+
### Container inspection
21+
![image](https://github.com/user-attachments/assets/17bdeec8-c285-41bc-a6d1-3ddcffd34e36)
22+
23+
### Host docker information
24+
![image](https://github.com/user-attachments/assets/d059e89b-8f29-4ee1-b0dc-5caac3d3d8bc)
25+
26+
## Contributing
1727

1828
Improvements or fixes are welcome, please raise it under issues and link to your branch.
1929

docker/index.cgi

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,63 @@ if ($fail) {
3939
print &ui_submit(text('label_refresh'));
4040
print &ui_form_end(),"<br>\n";
4141

42-
print '<style>.panel-body tr td { padding: 5px 22px 7px 22px !important} </style>';
43-
print ui_columns_start([
42+
print '<style>.panel-body tr td { padding: 5px 10px 7px 10px !important} </style>';
43+
44+
print &ui_columns_start([
4445
&text('label_name'),
45-
&text('label_label'),
46-
&text('label_running'),
46+
&text('label_label'),
4747
&text('label_runningfor'),
4848
&text('label_cpu'),
4949
&text('label_mem'),
50-
' '
50+
' ',
51+
], undef, 0, [
52+
"", # name
53+
"class='hidden-xs hidden-sm'", #image
54+
"", # running
55+
"class='hidden-xs hidden-sm'", # CPU
56+
"class='hidden-xs'", # MEM
57+
"class='hidden-xs'" # actions
5158
]);
5259

5360
foreach my $u (@containers) {
5461
my ($status) = $u->{'status'};
5562

63+
# columns will be consolidated/hidden across various screen sizes
5664
print ui_columns_row([
57-
html_escape($u->{'name'}),
65+
&ui_link('container.cgi?tab=inspect&container=' . urlize($u->{'id'}), html_escape($u->{'name'})) . "<span class='display-none visible-xs visible-sm'>" . html_escape($u->{'image'}) . "</span>",
5866
html_escape($u->{'image'}),
59-
get_status_icon($status),
60-
html_escape($status),
67+
get_status_icon($status) . " " . html_escape($status),
6168
html_escape($stats{$u->{'id'}}{'cpu'}),
62-
html_escape($stats{$u->{'id'}}{'memUsage'}) . " (" . html_escape($stats{$u->{'id'}}{'mem'}) . ")",
63-
get_container_up($status) ?
64-
sprintf("<a href='command.cgi?c=stop&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_stop'))
65-
: sprintf("<a href='command.cgi?c=start&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_start')),
66-
sprintf("<a href='command.cgi?c=restart&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_restart')),
67-
&ui_link('container.cgi?tab=log&container=' . urlize($u->{'id'}), 'View log'),
68-
&ui_link('container.cgi?tab=inspect&container=' . urlize($u->{'id'}), 'Inspect')
69+
"<span class='display-none visible-xs visible-sm'>CPU: " . html_escape($stats{$u->{'id'}}{'cpu'}) . "<br /></span>"
70+
. html_escape($stats{$u->{'id'}}{'memUsage'}) . " (" . html_escape($stats{$u->{'id'}}{'mem'}) . ")",
71+
(get_container_up($status) ?
72+
sprintf("<a href='command.cgi?c=stop&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_stop')) . ' | ' . sprintf("<a href='command.cgi?c=restart&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_restart'))
73+
: sprintf("<a href='command.cgi?c=start&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_start'))) . ' | ' .
74+
&ui_link('container.cgi?tab=log&container=' . urlize($u->{'id'}), &text('label_viewlog'))
75+
], [
76+
"", # name
77+
"class='hidden-xs hidden-sm'", #image
78+
"", # time
79+
"class='hidden-xs hidden-sm'", #CPU
80+
"class='hidden-xs'", #MEM
81+
"style='text-align: right; word-break: auto-phrase;' class='hidden-xs text-right'", #start/stop/restart
82+
]);
83+
84+
# This row is shown on xs-devices only
85+
print ui_columns_row([
86+
"CPU: " . html_escape($stats{$u->{'id'}}{'cpu'}) . "<br />MEM: "
87+
. html_escape($stats{$u->{'id'}}{'memUsage'}) . " (" . html_escape($stats{$u->{'id'}}{'mem'}) . ")",
88+
(get_container_up($status) ?
89+
sprintf("<a href='command.cgi?c=stop&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_stop')) . ' | ' . sprintf("<a href='command.cgi?c=restart&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_restart'))
90+
: sprintf("<a href='command.cgi?c=start&container=%s'>%s</a>", urlize($u->{'name'}), &text('label_start'))) . ' | ' .
91+
&ui_link('container.cgi?tab=log&container=' . urlize($u->{'id'}), &text('label_viewlog'))
92+
], [
93+
"class='display-none visible-xs'", # Perf
94+
"style='word-break: auto-phrase;' class='display-none visible-xs'", #start/stop/restart
6995
]);
96+
97+
98+
7099
}
71100
print ui_columns_end();
72101
}

docker/lang/en

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ label_start=Start
2323
label_stop=Stop
2424
label_restart=Restart
2525
label_refresh=Refresh
26+
label_viewlog=View log

docker/lang/it

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ label_start=Inizio
2323
label_stop=Fermare
2424
label_restart=Ricomincia
2525
label_refresh=Ricaricare
26+
label_viewlog=Vista del registro

docker/lang/pl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
not_installed=Nie znaleźono dokera na systemie
22

3-
index_title=Zażądzanie kontenerami Dokera
3+
index_title=Zarządzanie kontenerami Dokera
44
index_return=lista kontenerów
55

66
view_container_title=kontener $1
@@ -19,7 +19,8 @@ label_runningfor=Uruchomione od
1919
label_cpu=Procesor
2020
label_mem=Pamięć
2121

22-
label_start=Start
22+
label_start=Uruchom
2323
label_stop=Stop
24-
label_restart=Restart
24+
label_restart=Uruchom ponownie
2525
label_refresh=Odświerz
26+
label_viewlog=Zobacz dziennik

docker/module.info.pl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name=Kontenery Dockera
2+
category=servers
3+
desc=Wyświetl kontenery dokera
4+
longdesc=Wyświetlaj i wykonuj podstawowe czynności na kontenerach dokera na tym hoście.

tools/dind/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.5'
22
services:
33
webmin:
4-
container_name: ubuntu
5-
image: ubuntu:18.04
4+
container_name: alpine
5+
image: alpine:latest
66
restart: on-failure
77
command: ["sleep","infinity"]

0 commit comments

Comments
 (0)