clean up region editor status indicator
parent
99cfb0dc61
commit
a850133477
|
|
@ -1017,6 +1017,10 @@ function onDashboardReadyExecute(theAction){
|
|||
function popImage(imageSrc){
|
||||
$('body').append(`<div class="popped-image"><img src="${imageSrc}"></div>`)
|
||||
}
|
||||
function setSubmitButton(editorForm,text,icon,toggle){
|
||||
var submitButtons = editorForm.find('[type="submit"]').prop('disabled',toggle)
|
||||
submitButtons.html(`<i class="fa fa-${icon}"></i> ${text}`)
|
||||
}
|
||||
$(document).ready(function(){
|
||||
onInitWebsocket(function(){
|
||||
loadMonitorsIntoMemory(function(data){
|
||||
|
|
|
|||
|
|
@ -758,10 +758,6 @@ monitorEditorWindow.on('change','[detail="auto_host"]',function(e){
|
|||
}
|
||||
})
|
||||
editorForm.submit(function(e){
|
||||
function setSubmitButton(text,icon,toggle){
|
||||
var submitButtons = editorForm.find('[type="submit"]').prop('disabled',toggle)
|
||||
submitButtons.html(`<i class="fa fa-${icon}"></i> ${text}`)
|
||||
}
|
||||
e.preventDefault();
|
||||
var validation = getMonitorEditFormFields()
|
||||
if(!validation.ok){
|
||||
|
|
@ -770,7 +766,7 @@ editorForm.submit(function(e){
|
|||
new PNotify({title:'Configuration Invalid',text:errorsFound.join('<br>'),type:'error'});
|
||||
}
|
||||
var monitorConfig = validation.monitorConfig
|
||||
setSubmitButton(lang[`Please Wait...`], `spinner fa-pulse`, true)
|
||||
setSubmitButton(editorForm, lang[`Please Wait...`], `spinner fa-pulse`, true)
|
||||
$.post(getApiPrefix()+'/configureMonitor/'+$user.ke+'/'+monitorConfig.mid,{data:JSON.stringify(monitorConfig)},function(d){
|
||||
if(d.ok === false){
|
||||
new PNotify({
|
||||
|
|
@ -780,7 +776,7 @@ editorForm.submit(function(e){
|
|||
})
|
||||
}
|
||||
debugLog(d)
|
||||
setSubmitButton(lang.Save, `check`, false)
|
||||
setSubmitButton(editorForm, lang.Save, `check`, false)
|
||||
})
|
||||
//
|
||||
if(copySettingsSelector.val() === '1'){
|
||||
|
|
|
|||
|
|
@ -113,13 +113,19 @@ $(document).ready(function(e){
|
|||
});
|
||||
monitorConfig.details.cords = JSON.stringify(regionCoordinates)
|
||||
monitorConfig.details = JSON.stringify(monitorConfig.details)
|
||||
setSubmitButton(regionEditorForm, lang[`Please Wait...`], `spinner fa-pulse`, true)
|
||||
$.post(getApiPrefix(`configureMonitor`)+ '/' + monitorId,{
|
||||
data: JSON.stringify(monitorConfig)
|
||||
},function(d){
|
||||
debugLog(d)
|
||||
if(d.ok){
|
||||
|
||||
if(d.ok === false){
|
||||
new PNotify({
|
||||
title: lang['Action Failed'],
|
||||
text: d.msg,
|
||||
type: 'danger'
|
||||
})
|
||||
}
|
||||
debugLog(d)
|
||||
setSubmitButton(regionEditorForm, lang.Save, `check`, false)
|
||||
})
|
||||
}
|
||||
var initiateRegionList = function(presetVal){
|
||||
|
|
|
|||
Loading…
Reference in New Issue