@@ -5,14 +5,14 @@ console.log("Script loaded"); // This should fire immediately if the script load
55document . addEventListener ( 'DOMContentLoaded' , function ( ) {
66 console . log ( "DOMContentLoaded event fired" ) ;
77
8- const disableSSHButton = document . getElementById ( 'disable-ssh -button' ) ;
8+ const disableSSHButton = document . getElementById ( 'disable-systems -button' ) ;
99 if ( disableSSHButton ) {
1010
1111
1212 fetch ( `/api/v1/system/settings/lockdownEnabled` )
1313 . then ( response => response . json ( ) )
1414 . then ( data => {
15- if ( data . lockdownEnabled ) {
15+ if ( ! data . lockdownEnabled ) {
1616 disableSSHButton . innerText = 'LockDown Systems' ;
1717 }
1818 else {
@@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', function () {
2222 . catch ( error => {
2323
2424 } ) ;
25- document . getElementById ( 'disable-ssh -button' ) . addEventListener ( 'click' , function ( event ) {
25+ document . getElementById ( 'disable-systems -button' ) . addEventListener ( 'click' , function ( event ) {
2626 event . preventDefault ( ) ; // Prevent the default anchor behavior
2727 const csrfToken = document . getElementById ( 'csrf-token' ) . value ; // Get CSRF token value
2828 fetch ( '/api/v1/system/settings/lockdown/toggle' , {
@@ -33,7 +33,7 @@ document.addEventListener('DOMContentLoaded', function () {
3333 }
3434 } ) . then ( response => response . json ( ) )
3535 . then ( data => {
36- if ( data . sshEnabled ) {
36+ if ( ! data . lockdownEnabled ) {
3737 disableSSHButton . innerText = 'LockDown Systems' ;
3838 }
3939 else {
0 commit comments