@@ -73,19 +73,22 @@ APP.maintenance = (function($) {
73
73
74
74
function rebootCamera ( ) {
75
75
$ ( '#button-reboot' ) . attr ( "disabled" , true ) ;
76
- $ . ajax ( {
77
- type : "GET" ,
78
- url : 'cgi-bin/reboot.sh' ,
79
- dataType : "json" ,
80
- error : function ( response ) {
81
- console . log ( 'error' , response ) ;
82
- $ ( '#button-reboot' ) . attr ( "disabled" , false ) ;
83
- } ,
84
- success : function ( data ) {
85
- setRebootStatus ( "Camera is rebooting." ) ;
86
- waitForBoot ( ) ;
87
- }
88
- } ) ;
76
+ var x = confirm ( "Are you sure you want to reboot?" ) ;
77
+ if ( x ) {
78
+ $ . ajax ( {
79
+ type : "GET" ,
80
+ url : 'cgi-bin/reboot.sh' ,
81
+ dataType : "json" ,
82
+ error : function ( response ) {
83
+ console . log ( 'error' , response ) ;
84
+ $ ( '#button-reboot' ) . attr ( "disabled" , false ) ;
85
+ } ,
86
+ success : function ( data ) {
87
+ setRebootStatus ( "Camera is rebooting." ) ;
88
+ waitForBoot ( ) ;
89
+ }
90
+ } ) ;
91
+ }
89
92
}
90
93
91
94
function waitForBoot ( ) {
@@ -108,18 +111,21 @@ APP.maintenance = (function($) {
108
111
109
112
function resetCamera ( ) {
110
113
$ ( '#button-reset' ) . attr ( "disabled" , true ) ;
111
- $ . ajax ( {
112
- type : "GET" ,
113
- url : 'cgi-bin/reset.sh' ,
114
- dataType : "json" ,
115
- error : function ( response ) {
116
- console . log ( 'error' , response ) ;
117
- $ ( '#button-reset' ) . attr ( "disabled" , false ) ;
118
- } ,
119
- success : function ( data ) {
120
- setResetStatus ( "Reset completed, reboot your camera." ) ;
121
- }
122
- } ) ;
114
+ var x = confirm ( "Are you sure you want to reset?" ) ;
115
+ if ( x ) {
116
+ $ . ajax ( {
117
+ type : "GET" ,
118
+ url : 'cgi-bin/reset.sh' ,
119
+ dataType : "json" ,
120
+ error : function ( response ) {
121
+ console . log ( 'error' , response ) ;
122
+ $ ( '#button-reset' ) . attr ( "disabled" , false ) ;
123
+ } ,
124
+ success : function ( data ) {
125
+ setResetStatus ( "Reset completed, reboot your camera." ) ;
126
+ }
127
+ } ) ;
128
+ }
123
129
}
124
130
125
131
function upgradeFirmware ( ) {
0 commit comments