summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorPavel Vomacka <pvomacka@redhat.com>2016-06-24 12:08:04 +0200
committerPetr Vobornik <pvoborni@redhat.com>2016-06-30 14:22:51 +0200
commit7f4de88ea1da11d4111a917672c0cb7ab9866c90 (patch)
treee2f24f156b205bd5efe19bca62a07b37f3215769 /install
parente65ce4fedc8e8e4f16c8d0c56f7618a84e8e7f85 (diff)
downloadfreeipa-7f4de88ea1da11d4111a917672c0cb7ab9866c90.tar.gz
freeipa-7f4de88ea1da11d4111a917672c0cb7ab9866c90.tar.xz
freeipa-7f4de88ea1da11d4111a917672c0cb7ab9866c90.zip
Add button for server-del command
WebUI counterpart of: https://fedorahosted.org/freeipa/ticket/5588 Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'install')
-rw-r--r--install/ui/src/freeipa/topology.js65
-rw-r--r--install/ui/test/data/ipa_init.json4
2 files changed, 68 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/topology.js b/install/ui/src/freeipa/topology.js
index a9776a556..7e501eb35 100644
--- a/install/ui/src/freeipa/topology.js
+++ b/install/ui/src/freeipa/topology.js
@@ -222,6 +222,7 @@ return {
},
{
$type: 'details',
+ $factory: topology.servers_facet,
disable_facet_tabs: true,
sections: [
{
@@ -253,6 +254,30 @@ return {
}
]
}
+ ],
+ actions: [
+ {
+ $factory: IPA.delete_action,
+ name: 'server_del',
+ method: 'del',
+ label: '@i18n:objects.servers.remove_server',
+ needs_confirm: true,
+ confirm_msg: '@i18n:objects.servers.remove_server_msg',
+ confirm_dialog: {
+ $factory: IPA.confirm_dialog,
+ title: '@i18n:objects.servers.remove_server',
+ ok_label: '@i18n:buttons.remove',
+ ok_button_class: 'btn btn-danger'
+ }
+ }
+ ],
+ control_buttons_right: [
+ {
+ name: 'server_del',
+ label: '@i18n:objects.servers.remove_server',
+ icon: 'fa-exclamation-circle',
+ button_class: 'btn btn-danger'
+ }
]
}
]
@@ -458,6 +483,45 @@ topology.location_adapter = declare([mod_field.Adapter], {
}
});
+topology.servers_facet = function(spec, no_init) {
+ spec = spec || {};
+
+ var that = IPA.details_facet(spec, no_init);
+
+ /**
+ * Creates buttons on the right side of facet.
+ */
+ that.create_controls = function() {
+
+ that.create_control_buttons(that.controls_left);
+ that.create_action_dropdown(that.controls_left);
+
+ that.control_buttons = that.control_buttons_right;
+ that.create_control_buttons(that.controls_right);
+ };
+
+ /**
+ * Inits right facet buttons.
+ */
+ that.init_servers_facet = function() {
+
+ that.init_details_facet();
+ var buttons_spec = {
+ $factory: IPA.control_buttons_widget,
+ name: 'control-buttons',
+ css_class: 'control-buttons',
+ buttons: spec.control_buttons_right
+ };
+
+ that.control_buttons_right = IPA.build(buttons_spec);
+ that.control_buttons_right.init(that);
+ };
+
+ if (!no_init) that.init_servers_facet();
+
+ return that;
+};
+
topology.serverroles_search_facet = function(spec) {
spec = spec || {};
@@ -1404,7 +1468,6 @@ topology.register = function() {
ctor: topology.TopologyGraphFacet,
spec: topology.topology_graph_facet_spec
});
-
};
phases.on('registration', topology.register);
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index dbbce26d9..8768766ed 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -545,6 +545,10 @@
"label": "Server Roles",
"label_singular": "Server Role",
},
+ "servers": {
+ "remove_server": "Delete Server",
+ "remove_server_msg": "Deleting a server removes it permanently from the topology. Note that this is a non-reversible action."
+ },
"service": {
"certificate": "Service Certificate",
"delete_key_unprovision": "Delete Key, Unprovision",