@@ -140,29 +140,37 @@ function GetTemplates() {
140140 $ files = "" ;
141141 $ counter = 1 ;
142142 $ conf_locations = array (
143+ ".conf " => "https://github.com/linuxserver/docker-swag/blob/master/root/defaults/nginx/ " ,
143144 "subdomain.conf " => "https://github.com/linuxserver/reverse-proxy-confs/blob/master/ " ,
144145 "subfolder.conf " => "https://github.com/linuxserver/reverse-proxy-confs/blob/master/ " ,
145146 "dashboard.subdomain.conf " => "https://github.com/linuxserver/docker-mods/blob/swag-dashboard/root/dashboard/ " ,
147+ "nginx.conf " => "https://github.com/linuxserver/docker-baseimage-alpine-nginx/tree/master/root/defaults/nginx/ " ,
148+ "ssl.conf " => "https://github.com/linuxserver/docker-baseimage-alpine-nginx/tree/master/root/defaults/nginx/ " ,
149+ "default.conf " => "https://github.com/linuxserver/docker-swag/blob/master/root/defaults/nginx/site-confs/ " ,
146150 );
147- $ output = shell_exec ("/etc/cont-init .d/85 -version-checks " );
151+ $ output = shell_exec ("/etc/s6-overlay/s6-rc .d/init -version-checks/run " );
148152
149153 foreach (explode (PHP_EOL , $ output ) as $ line ) {
150154 if (substr ($ line , 0 , 1 ) === "* " ){
151155 $ tooltip .= str_replace ("* " , "" , $ line ).PHP_EOL ;
152- } elseif (substr ($ line , 0 , 1 ) === " / " ) {
156+ } elseif (str_contains ($ line , " /config/ " ) ) {
153157 $ tr_class = ($ counter % 2 == 0 ) ? 'shaded ' : '' ;
154- $ files .= '<tr class=" ' .$ tr_class .'"><td class="left-text"><span class="status-text"> ' .htmlspecialchars ($ line ).'</span></td> ' ;
155- $ file_name = substr ($ line , strrpos ($ line , '/ ' ) + 1 );
156- $ link = "https://github.com/linuxserver/docker-swag/blob/master/root/defaults/nginx/ " .$ file_name ;
158+ $ clean_line = htmlspecialchars ($ line );
159+ list ($ old_date , $ new_date , $ path ) = explode (' │ ' , $ clean_line );
160+ $ old_date = trim ($ old_date , '│ \n\r\t\v\x00 ' );
161+ $ new_date = trim ($ new_date , '│ \n\r\t\v\x00 ' );
162+ $ path = trim ($ path , '│ \n\r\t\v\x00 ' );
163+ $ files .= '<tr class=" ' .$ tr_class .'"> ' ;
164+ $ files .= '<td class="left-text"><span class="status-text"> ' .$ old_date .'</span></td> ' ;
165+ $ files .= '<td class="left-text"><span class="status-text"> ' .$ new_date .'</span></td> ' ;
166+ $ files .= '<td class="left-text"><span class="status-text"> ' .$ path .'</span></td> ' ;
167+ $ file_name = substr ($ path , strrpos ($ path , '/ ' ) + 1 );
157168 foreach ($ conf_locations as $ key =>$ value ) {
158169 if (strpos ($ file_name , $ key ) !== false ) {
159170 $ link = $ value .$ file_name ;
160171 }
161- }
162- if (strpos ($ file_name , 'subdomain.conf ' ) !== false or strpos ($ file_name , 'subfolder.conf ' ) !== false ) {
163- $ link .= '.sample ' ;
164172 }
165- $ files .= '<td><a href=" ' .$ link .'"><i class="fas fa-edit"></i></a></td></tr> ' ;
173+ $ files .= '<td><a href=" ' .$ link .'.sample "><i class="fas fa-edit"></i></a></td></tr> ' ;
166174 $ counter ++;
167175 }
168176 }
@@ -174,6 +182,14 @@ function GetTemplates() {
174182 <div>
175183 <h2>Version Updates <i class="fas fa-info-circle" title=" {$ tooltip }"></i></h2>
176184 <table class="table-hover">
185+ <thead>
186+ <tr>
187+ <td><h3>Old Date</h3></td>
188+ <td><h3>New Date</h3></td>
189+ <td><h3>Path</h3></td>
190+ <td><h3>Link</h3></td>
191+ </tr>
192+ </thead>
177193 <tbody class="tbody-data">
178194 {$ files }
179195 </tbody>
@@ -253,7 +269,7 @@ function GetGoaccess() {
253269 endif ;
254270
255271 $ access_log = file_exists ("/dashboard/logs " ) ? "/dashboard/logs/*.log " : "/config/log/nginx/access.log " ;
256- $ goaccess = shell_exec ("cat $ access_log | /usr/local/ bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf $ geodb - " );
272+ $ goaccess = shell_exec ("cat $ access_log | /usr/bin/goaccess -a -o html --config-file=/dashboard/goaccess.conf $ geodb - " );
257273 $ goaccess = str_replace ("<title>Server Statistics " , "<title>SWAG Dashboard " , $ goaccess );
258274 $ goaccess = str_replace ("<h1 class='h-dashboard'> " , "<h1> " , $ goaccess );
259275 $ goaccess = str_replace ("<i class='fa fa-tachometer'></i> " , "<img src='/icon.svg' width='32' height='32'> SWAG " , $ goaccess );
0 commit comments