1 (function( $, app, i18n ) {
4 var services = app.ns("services");
6 ui.ClusterConnect = ui.AbstractWidget.extend({
12 this.prefs = services.Preferences.instance();
13 this.cluster = this.config.cluster;
14 this.el = $.joey(this._main_template());
15 this.cluster.get( "", this._node_handler );
18 _node_handler: function(data) {
20 this.prefs.set("app-base_uri", this.cluster.base_uri);
24 _reconnect_handler: function() {
25 var base_uri = this.el.find(".uiClusterConnect-uri").val();
26 $("body").empty().append(new app.App("body", { id: "es", base_uri: base_uri }));
29 _main_template: function() {
30 return { tag: "SPAN", cls: "uiClusterConnect", children: [
31 { tag: "INPUT", type: "text", cls: "uiClusterConnect-uri", onkeyup: function( ev ) {
34 this._reconnect_handler();
36 }.bind(this), id: this.id("baseUri"), value: this.cluster.base_uri },
37 { tag: "BUTTON", type: "button", text: i18n.text("Header.Connect"), onclick: this._reconnect_handler }
42 })( this.jQuery, this.app, this.i18n );