@@ -21,14 +21,14 @@ <h3>Please choose software, version, and command to view the data.</h3>
2121            < option  value =""> Select Software</ option > 
2222        </ select > 
2323      </ div > 
24-      
24+ 
2525        < div  class ="form-group "> 
2626            < label  for ="version "> Version:</ label > 
2727            < select  id ="version " name ="version " class ="form-control "> 
2828                < option  value =""> Select Version</ option > 
2929            </ select > 
3030        </ div > 
31-      
31+ 
3232        < div  class ="form-group "> 
3333            < label  for ="command "> Command:</ label > 
3434            < select  id ="command " name ="command " class ="form-control "> 
@@ -89,15 +89,15 @@ <h3>Generated on: {{time}} </h3>
8989            </ tr > 
9090        </ table > 
9191    </ div > 
92-      
92+ 
9393</ div > 
9494
9595< script > 
9696
9797    function  toggleDataVisibility ( showData )  { 
9898        const  defaultMessage  =  document . getElementById ( 'default-message' ) ; 
9999        const  dataContainer  =  document . getElementById ( 'data-container' ) ; 
100-          
100+ 
101101        if  ( showData )  { 
102102            defaultMessage . style . display  =  'none' ; 
103103            dataContainer . style . display  =  'block' ; 
@@ -106,17 +106,15 @@ <h3>Generated on: {{time}} </h3>
106106            dataContainer . style . display  =  'none' ; 
107107        } 
108108    } 
109-      
109+ 
110110    // Call this function on initial load 
111111    { %  if  initial_load  % } 
112112        toggleDataVisibility ( false ) ; 
113113    { %  else  % } 
114114        toggleDataVisibility ( true ) ; 
115115    { %  end  % } 
116116
117-   const  commandsConst  =  JSON . parse ( '{% raw commands %}' ) ; 
118-   console . log ( commandsConst ) ; 
119- 
117+   const  commandsConst  =  JSON . parse ( `{% raw commands %}` ) ; 
120118  const  softwareSelect  =  document . getElementById ( 'software' ) ; 
121119  const  versionSelect  =  document . getElementById ( 'version' ) ; 
122120  const  commandSelect  =  document . getElementById ( 'command' ) ; 
@@ -133,7 +131,7 @@ <h3>Generated on: {{time}} </h3>
133131  function  populateVersions ( software )  { 
134132      versionSelect . innerHTML  =  '<option value="">Select Version</option>' ; 
135133      commandSelect . innerHTML  =  '<option value="">Select Command</option>' ; 
136-        
134+ 
137135      if  ( software  &&  commandsConst [ software ] )  { 
138136          for  ( const  version  in  commandsConst [ software ] )  { 
139137              const  option  =  document . createElement ( 'option' ) ; 
@@ -147,7 +145,7 @@ <h3>Generated on: {{time}} </h3>
147145
148146  function  populateCommands ( software ,  version )  { 
149147      commandSelect . innerHTML  =  '<option value="">Select Command</option>' ; 
150-        
148+ 
151149      if  ( software  &&  version  &&  commandsConst [ software ] [ version ] )  { 
152150          commandsConst [ software ] [ version ] . forEach ( command  =>  { 
153151              const  option  =  document . createElement ( 'option' ) ; 
@@ -167,7 +165,6 @@ <h3>Generated on: {{time}} </h3>
167165
168166    $ . post ( window . location . href ,  JSON . stringify ( data ) ,  function ( response ,  textStatus ,  jqXHR )  { 
169167        if  ( response . status  ===  "success" )  { 
170-             console . log ( response . time ) 
171168            // Toggle visibility based on the response 
172169            toggleDataVisibility ( true ) ; 
173170
@@ -227,7 +224,7 @@ <h3>Generated on: {{time}} </h3>
227224            } 
228225
229226            bootstrapAlert ( "Data updated successfully" ,  "success" ,  2200 ) ; 
230-         }   
227+         } 
231228        else  if  ( response . status  ===  "no_data" )  { 
232229            toggleDataVisibility ( false ) ; 
233230            $ ( '#default-message' ) . html ( '<h3>No data available for the selected options.</h3>' ) ; 
@@ -238,7 +235,6 @@ <h3>Generated on: {{time}} </h3>
238235        } 
239236    } ,  'json' ) 
240237    . fail ( function ( jqXHR ,  textStatus ,  errorThrown )  { 
241-         console . error ( 'Error:' ,  errorThrown ) ; 
242238        toggleDataVisibility ( false ) ; 
243239        bootstrapAlert ( "An error occurred while processing your request" ,  "danger" ,  2200 ) ; 
244240    } ) ; 
@@ -269,4 +265,4 @@ <h3>Generated on: {{time}} </h3>
269265      } 
270266  } ) ; 
271267</ script > 
272- {% end %}
268+ {% end %}
0 commit comments