├── README.md ├── config ├── config.info ├── docker-init.pl ├── images └── icon.gif ├── index.cgi ├── lang └── en ├── module.info └── pkg.sh /README.md: -------------------------------------------------------------------------------- 1 | Module to learn Webmin Modules 2 | -------------------------------------------------------------------------------- /config: -------------------------------------------------------------------------------- 1 | mode=/test 2 | -------------------------------------------------------------------------------- /config.info: -------------------------------------------------------------------------------- 1 | mode=the mode 2 | -------------------------------------------------------------------------------- /docker-init.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # my $version = `docker --version`; 3 | # my $status = `service docker status | grep Active`; 4 | 5 | #printf "$version"; 6 | #printf "$status"; 7 | 8 | sub get_docker_version{ 9 | $version = `docker --version`; 10 | return $version; 11 | } 12 | 13 | sub get_docker_status{ 14 | $status = `service docker status | grep Active`; 15 | return $status; 16 | } 17 | 18 | sub get_active{ 19 | @active = `docker ps --format '{{.Names}}'`; 20 | return @active; 21 | } 22 | 23 | sub get_container_details_status{ 24 | my $name = $ARGV[0]; 25 | my $details = `docker ps -f name="$name" --format '{{.Status}}'`; 26 | return $details; 27 | } 28 | 29 | #my $info = `docker ps -f name=xrdp --format '{{.Status}}'`; 30 | #printf "$info"; 31 | #print $ARGV[0]; 32 | -------------------------------------------------------------------------------- /images/icon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pknw1/webmin-docker-module/f126e688d4a81483fde65718d95821eeebde5d69/images/icon.gif -------------------------------------------------------------------------------- /index.cgi: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # 3 | 4 | do '../web-lib.pl'; 5 | do './docker-init.pl'; 6 | require './docker-init.pl'; 7 | 8 | my $version = get_docker_version(); 9 | my $status = get_docker_status(); 10 | my @active = get_active(); 11 | 12 | 13 | &init_config("dockerinfo"); 14 | 15 | %access=&get_module_acl; 16 | 17 | 18 | &header($text{'index_title'}, "", "intro", 1, 1, undef,""); 19 | 20 | 21 | print "
1 | 2 | 3 |
$container | "; 34 | printf "$status | "; 35 | printf "|