Merge branch 'master' of github.com:hpcloud-mon/mon-ui
This commit is contained in:
commit
f107af4568
@ -15,7 +15,6 @@
|
||||
# under the License.
|
||||
|
||||
|
||||
|
||||
URL_PREFIX = 'horizon:overcloud:alarms:'
|
||||
TEMPLATE_PREFIX = 'overcloud/alarms/'
|
||||
|
||||
|
@ -153,7 +153,7 @@ class NotificationCreateWidget(forms.Select):
|
||||
if options:
|
||||
output += options
|
||||
output += '</select>'
|
||||
output += '<td><a href="" id="remove_notification_button">X</a></td>'
|
||||
output += '<td><a href="" id="remove_notif_button">X</a></td>'
|
||||
output += '</td></tr>'
|
||||
idx += 1
|
||||
else:
|
||||
@ -164,7 +164,7 @@ class NotificationCreateWidget(forms.Select):
|
||||
if options:
|
||||
output += options
|
||||
output += '</select>'
|
||||
output += '<td><a href="" id="remove_notification_button">X</a></td>'
|
||||
output += '<td><a href="" id="remove_notif_button">X</a></td>'
|
||||
output += '</td></tr>'
|
||||
output += '</table>'
|
||||
label = unicode(_("+ Add more"))
|
||||
|
@ -31,11 +31,11 @@ $('#add_notification_button').click(function(){
|
||||
name = "notifications_" + num;
|
||||
options = $("#id_notifications_" + (num - 1)).html();
|
||||
options = options.replace('selected="selected"','');
|
||||
row = '<tr><td><select id="' + id +'" name="' + name + '">' + options + '</select></td><td><a href="" id="remove_notification_button">X</a></td></tr>'
|
||||
row = '<tr><td><select id="' + id +'" name="' + name + '">' + options + '</select></td><td><a href="" id="remove_notif_button">X</a></td></tr>'
|
||||
$('#notification_table tr:last').after(row);
|
||||
return false;
|
||||
});
|
||||
$('#notification_table').on('click', '#remove_notification_button', (function(event){
|
||||
$('#notification_table').on('click', '#remove_notif_button', (function(event){
|
||||
var target = $(event.target.parentNode.parentNode);
|
||||
target.remove();
|
||||
return false;
|
||||
|
@ -31,11 +31,11 @@ $('#add_notification_button').click(function(){
|
||||
name = "notifications_" + num;
|
||||
options = $("#id_notifications_" + (num - 1)).html();
|
||||
options = options.replace('selected="selected"','');
|
||||
row = '<tr><td><select id="' + id +'" name="' + name + '">' + options + '</select></td><td><a href="" id="remove_notification_button">X</a></td></tr>'
|
||||
row = '<tr><td><select id="' + id +'" name="' + name + '">' + options + '</select></td><td><a href="" id="remove_notif_button">X</a></td></tr>'
|
||||
$('#notification_table tr:last').after(row);
|
||||
return false;
|
||||
});
|
||||
$('#notification_table').on('click', '#remove_notification_button', (function(event){
|
||||
$('#notification_table').on('click', '#remove_notif_button', (function(event){
|
||||
var target = $(event.target.parentNode.parentNode);
|
||||
target.remove();
|
||||
return false;
|
||||
|
@ -31,6 +31,7 @@ from horizon import exceptions
|
||||
from horizon import forms
|
||||
from horizon import tables
|
||||
|
||||
import monclient.exc as exc
|
||||
from monitoring import api
|
||||
from .tables import AlarmsTable
|
||||
from .tables import AlarmHistoryTable
|
||||
@ -275,7 +276,8 @@ class AlarmDetailView(forms.ModalFormView):
|
||||
self.request,
|
||||
id)
|
||||
notifications.append(notification)
|
||||
except exceptions.NOT_FOUND:
|
||||
# except exceptions.NOT_FOUND:
|
||||
except exc.HTTPException:
|
||||
msg = _("Notification %s has already been deleted.") % id
|
||||
notifications.append({"id": id,
|
||||
"name": unicode(msg),
|
||||
@ -328,12 +330,9 @@ class AlarmEditView(forms.ModalFormView):
|
||||
self.request,
|
||||
id)
|
||||
notifications.append(notification)
|
||||
except exceptions.NOT_FOUND:
|
||||
# except exceptions.NOT_FOUND:
|
||||
except exc.HTTPException:
|
||||
msg = _("Notification %s has already been deleted.") % id
|
||||
notifications.append({"id": id,
|
||||
"name": unicode(msg),
|
||||
"type": "",
|
||||
"address": ""})
|
||||
self._object["notifications"] = notifications
|
||||
return self._object
|
||||
except Exception:
|
||||
|
Loading…
x
Reference in New Issue
Block a user