diff --git a/htdocs/lib/settings/Profiles.js b/htdocs/lib/settings/Profiles.js index 8b497611..2cef6b47 100644 --- a/htdocs/lib/settings/Profiles.js +++ b/htdocs/lib/settings/Profiles.js @@ -1,20 +1,14 @@ $.fn.profiles = function() { this.each(function() { $(this).on('click', '.move-down', function(e) { - $.ajax(document.URL.replace(/\/profile\//, '/moveprofiledown/'), { - contentType: 'application/json', - method: 'GET' - }).done(function() { + $.ajax(document.URL.replace(/\/profile\//, '/moveprofiledown/')).done(function() { document.location.reload(); }); return false; }); $(this).on('click', '.move-up', function(e) { - $.ajax(document.URL.replace(/\/profile\//, '/moveprofileup/'), { - contentType: 'application/json', - method: 'GET' - }).done(function() { + $.ajax(document.URL.replace(/\/profile\//, '/moveprofileup/')).done(function() { document.location.reload(); }); return false; diff --git a/owrx/controllers/settings/sdr.py b/owrx/controllers/settings/sdr.py index bab8d780..9c5b255b 100644 --- a/owrx/controllers/settings/sdr.py +++ b/owrx/controllers/settings/sdr.py @@ -420,14 +420,18 @@ class SdrProfileController(SdrFormControllerWithModal): return self.send_redirect("{}settings/sdr/{}".format(self.get_document_root(), quote(self.device_id))) def moveProfileUp(self): + logger.debug("@@@ PROFILE UP: " + self.profile_id) return self.moveProfile(self.profile_id, False) def moveProfileDown(self): + logger.debug("@@@ PROFILE DOWN: " + self.profile_id) return self.moveProfile(self.profile_id, True) def moveProfile(self, id: str, moveDown: bool): + logger.debug("@@@ MOVE_PROFILE") if id is None or id not in self.device["profiles"]: return self.send_response("profile not found", code=404) + logger.debug("@@@ ACTION") config = Config.get() profiles = list(self.device["profiles"].keys()) n = profiles.index(id) @@ -437,6 +441,7 @@ class SdrProfileController(SdrFormControllerWithModal): profiles = profiles[:n-1] + [profiles[n] , profiles[n-1]] + profiles[n+1:] self.device["profiles"] = { x: self.device["profiles"][x] for x in profiles } config.store() + logger.debug("@@@ ORDER: {0}".format(profiles)) return self.send_redirect("{}settings/sdr/{}".format(self.get_document_root(), quote(self.device_id)))