mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add button for dns_update_system_records command
Part of: https://fedorahosted.org/freeipa/ticket/5905 Reviewed-By: Petr Vobornik <pvoborni@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
committed by
Petr Vobornik
parent
3c40d3aa9e
commit
31a13c9e98
@@ -100,7 +100,9 @@ return {
|
||||
]
|
||||
}
|
||||
],
|
||||
needs_update: true
|
||||
needs_update: true,
|
||||
actions: [ 'update_dns_records' ],
|
||||
header_actions: [ 'update_dns_records' ]
|
||||
}
|
||||
]
|
||||
};};
|
||||
@@ -554,6 +556,45 @@ var make_dnsserver_spec = function() {
|
||||
};
|
||||
|
||||
|
||||
IPA.dns.update_dns_records_action = function(spec) {
|
||||
|
||||
spec = spec || {};
|
||||
|
||||
spec.name = spec.name || 'update_dns_records';
|
||||
spec.label = spec.label || '@i18n:objects.dnsconfig.update_dns';
|
||||
|
||||
var that = IPA.action(spec);
|
||||
|
||||
that.execute_action = function() {
|
||||
var spec = {
|
||||
title: '@i18n:objects.dnsconfig.update_dns',
|
||||
message: '@i18n:objects.dnsconfig.update_dns_dialog_msg',
|
||||
ok_label: '@i18n:buttons.update'
|
||||
};
|
||||
|
||||
that.dialog = IPA.confirm_dialog(spec);
|
||||
|
||||
that.dialog.on_ok = function() {
|
||||
|
||||
var command = rpc.command({
|
||||
entity: 'dns',
|
||||
method: 'update_system_records',
|
||||
on_success: function(data) {
|
||||
var status = data.result.value;
|
||||
if (status) IPA.notify_success(
|
||||
'@i18n:objects.dnsconfig.updated_dns');
|
||||
}
|
||||
});
|
||||
|
||||
command.execute();
|
||||
};
|
||||
|
||||
that.dialog.open();
|
||||
};
|
||||
|
||||
return that;
|
||||
};
|
||||
|
||||
IPA.dnszone_details_facet = function(spec, no_init) {
|
||||
|
||||
spec = spec || {};
|
||||
@@ -2617,6 +2658,7 @@ exp.register = function() {
|
||||
|
||||
a.register('dns_add_permission', IPA.dns.add_permission_action);
|
||||
a.register('dns_remove_permission', IPA.dns.remove_permission_action);
|
||||
a.register('update_dns_records', IPA.dns.update_dns_records_action);
|
||||
};
|
||||
|
||||
phases.on('registration', exp.register);
|
||||
|
||||
@@ -317,7 +317,10 @@
|
||||
"forward_first": "Forward first",
|
||||
"forward_none": "Forwarding disabled",
|
||||
"forward_only": "Forward only",
|
||||
"options": "Options"
|
||||
"options": "Options",
|
||||
"update_dns": "Update System DNS Records",
|
||||
"update_dns_dialog_msg": "Do you want to update system DNS records?",
|
||||
"updated_dns": "System DNS records updated"
|
||||
},
|
||||
"dnsrecord": {
|
||||
"data": "Data",
|
||||
|
||||
@@ -462,6 +462,9 @@ class i18n_messages(Command):
|
||||
"forward_none": _("Forwarding disabled"),
|
||||
"forward_only": _("Forward only"),
|
||||
"options": _("Options"),
|
||||
"update_dns": _("Update System DNS Records"),
|
||||
"update_dns_dialog_msg": _("Do you want to update system DNS records?"),
|
||||
"updated_dns": _("System DNS records updated"),
|
||||
},
|
||||
"dnsrecord": {
|
||||
"data": _("Data"),
|
||||
|
||||
Reference in New Issue
Block a user