]> PHS Git Server - phs-admin.git/commitdiff
Fixing docker container get.
authorcharleswrayjr <charleswrayjr@gmail.com>
Sat, 6 Sep 2025 01:34:26 +0000 (20:34 -0500)
committercharleswrayjr <charleswrayjr@gmail.com>
Sat, 6 Sep 2025 01:34:26 +0000 (20:34 -0500)
src/app/services/Docker/DockerService.js

index d1c8d7d18b1f8705ca9131bb4aa22290ddad436a..57c46ed2edb26121806a3e0c9c822bd3cd9edf7f 100644 (file)
@@ -4,10 +4,12 @@ import DockerConfig from './DockerConfig';
 
 class DockerService {
 
-  fetchContainers = () => {
+  fetchContainers = ( { all = true } ) => {
     return new Promise( async ( resolve, reject ) => {
       try {
-        const response = await axios.get( `${ base_url }${ DockerConfig.containers }` );
+        let containersUrl = new URL( `${ base_url }${ DockerConfig.containers }` );
+        containersUrl.searchParams.append('all', all ? "true" : "false" );
+        const response = await axios.get( containersUrl.toString() );
         resolve( response.data.containers ); // Resolve the promise with the data
       } catch (error) {
         reject( `Error fetching containers: ${ error.message }` ); // Reject the promise with an error message