Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/monitoring/prometheus/index/basic.html
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/monitoring/prometheus/index/basic.html	(revision 40170)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/apv/templates/monitoring/prometheus/index/basic.html	(working copy)
@@ -678,21 +678,22 @@
                 }
 
                 return $.ajax({
-                url: '/api/apv/prometheus/BasicSetting/_field_group?name=get',
-                type: 'GET',
-                cache: false,
-                dataType: 'json'
-            }).then(function(data){
-                if (!skipLoading) {
-                    hideLoading();
-                }
-                updateFormStateByData(data);
-            }).catch(function(error) {
-                if (!skipLoading) {
-                    hideLoading();
-                }
-                console.error('Failed to get basic settings:', error);
-            });
+                    url: '/api/apv/prometheus/BasicSetting/_field_group?name=get',
+                    type: 'GET',
+                    cache: false,
+                    dataType: 'json'
+                }).then(function(data){
+                    if (!skipLoading) {
+                        hideLoading();
+                    }
+                    updateFormStateByData(data);
+                }).catch(function(error) {
+                    if (!skipLoading) {
+                        hideLoading();
+                    }
+                    console.error('Failed to get basic settings:', error);
+                });
+            }
         }
 
         function updateFormStateByData(data) {
@@ -1301,43 +1302,44 @@
                     // Update loading message for next phase
                     showLoading();
 
-                // After successful certificate removal, disable HTTPS and refresh all settings
-                // First disable HTTPS since certificate is removed (skip events to avoid showing Save Changes)
-                formState.enable_https = false;
-                enableHttpsSwitch.bootstrapSwitch('setState', false, true);
+                    // After successful certificate removal, disable HTTPS and refresh all settings
+                    // First disable HTTPS since certificate is removed (skip events to avoid showing Save Changes)
+                    formState.enable_https = false;
+                    enableHttpsSwitch.bootstrapSwitch('setState', false, true);
 
-                // Update local storage immediately to reflect HTTPS disabled state
-                updateLocalStorageBasicSetting({ enable_https: false });
+                    // Update local storage immediately to reflect HTTPS disabled state
+                    updateLocalStorageBasicSetting({ enable_https: false });
 
-                // Update the HTTPS setting on server
-                try {
-                    const httpsParams = {
-                        'enable_https': false
-                    };
-                    const httpsData = {
-                        post_data: JSON.stringify(httpsParams)
-                    };
-                    await $.ajax({
-                        url: '/api/apv/prometheus/BasicSetting/_update',
-                        type: 'POST',
-                        data: $.param(httpsData),
-                        contentType: 'application/x-www-form-urlencoded',
-                        dataType: 'json'
-                    });
-                } catch (httpsError) {
-                    console.error('Failed to disable HTTPS after certificate removal:', httpsError);
-                }
+                    // Update the HTTPS setting on server
+                    try {
+                        const httpsParams = {
+                            'enable_https': false
+                        };
+                        const httpsData = {
+                            post_data: JSON.stringify(httpsParams)
+                        };
+                        await $.ajax({
+                            url: '/api/apv/prometheus/BasicSetting/_update',
+                            type: 'POST',
+                            data: $.param(httpsData),
+                            contentType: 'application/x-www-form-urlencoded',
+                            dataType: 'json'
+                        });
+                    } catch (httpsError) {
+                        console.error('Failed to disable HTTPS after certificate removal:', httpsError);
+                    }
 
-                // Refresh certificate status and get latest settings
-                await checkCertificateStatus();
-                // Re-get basic setting data to ensure all states are synchronized
-                await getBasicSetting(true);
+                    // Refresh certificate status and get latest settings
+                    await checkCertificateStatus();
+                    // Re-get basic setting data to ensure all states are synchronized
+                    await getBasicSetting(true);
 
-                // Clear any cached data to force fresh state
-                localStorage.removeItem('basicSettingData');
+                    // Clear any cached data to force fresh state
+                    localStorage.removeItem('basicSettingData');
 
-                // Hide loading after all operations complete
-                hideLoading();
+                    // Hide loading after all operations complete
+                    hideLoading();
+                }
             } catch (error) {
                 console.error('API call failed:', error);
                 hideLoading();
