Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed issue 4

  • Loading branch information...
commit e5f61e16bdc24b538717917ece52cbf238e789eb 1 parent cf8257e
tomek authored
Showing with 307 additions and 58 deletions.
  1. +1 −1  src/main/frontend/contribs/dialog/source/class/dialog/Form.js
  2. +1 −0  src/main/frontend/source/class/helenos/components/RightContentPane.js.js
  3. +5 −2 src/main/frontend/source/class/helenos/components/SchemaPane.js
  4. +7 −1 src/main/frontend/source/class/helenos/components/menu/ColumnFamilyContextMenu.js
  5. +8 −2 src/main/frontend/source/class/helenos/components/menu/KeyspaceContextMenu.js
  6. +4 −1 src/main/frontend/source/class/helenos/components/tab/ColumnFamilyInfoPage.js
  7. +170 −36 src/main/frontend/source/class/helenos/components/tab/ConnectionsEditorPage.js
  8. +4 −1 src/main/frontend/source/class/helenos/components/tab/KeyspaceInfoPage.js
  9. +29 −0 src/main/frontend/source/class/helenos/remote/ConnectionsTableModel.js
  10. +8 −4 src/main/frontend/source/class/helenos/util/Rpc.js
  11. +30 −0 src/main/frontend/source/class/helenos/util/RpcActionsProvider.js
  12. BIN  src/main/frontend/source/resource/helenos/connect.png
  13. +8 −4 src/main/frontend/source/translation/en.po
  14. +9 −0 src/main/java/com/kuprowski/helenos/jdbc/core/support/ClusterConfigDao.java
  15. +6 −2 src/main/java/com/kuprowski/helenos/service/ClusterConnectionProvider.java
  16. +14 −3 src/main/java/com/kuprowski/helenos/service/impl/ClusterConnectionProviderImpl.java
  17. +3 −1 src/main/resources/queries.properties
View
2  src/main/frontend/contribs/dialog/source/class/dialog/Form.js
@@ -644,7 +644,7 @@ qx.Class.define("dialog.Form",
this.hide();
if( this.getCallback() )
{
- this.getCallback()( qx.util.Serializer.toNativeObject( this.getModel() ) );
+ this.getCallback()(this.getContext(), qx.util.Serializer.toNativeObject( this.getModel() ) );
}
this.resetCallback();
}
View
1  src/main/frontend/source/class/helenos/components/RightContentPane.js.js
@@ -20,6 +20,7 @@ qx.Class.define("helenos.components.RightContentPane",
construct : function()
{
this.base(arguments);
+ this.setContentPadding(3);
this.add(new helenos.components.tab.WelcomePage());
}
});
View
7 src/main/frontend/source/class/helenos/components/SchemaPane.js
@@ -62,6 +62,9 @@ qx.Class.define("helenos.components.SchemaPane",
this.refreshSchemaTree();
},
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
__addKeyspace : function() {
var formData = {
'keyspaceName' : {
@@ -90,12 +93,12 @@ qx.Class.define("helenos.components.SchemaPane",
}
}
};
- dialog.Dialog.form('<h4>Create new keyspace</h4>', formData, function(result) {
+ dialog.Dialog.form('<h3>Create new keyspace</h3>', formData, function(context, result) {
if (result != null) {
helenos.util.RpcActionsProvider.createKeyspace(result);
helenos.util.GuiObserver.refreshSchemaTree();
}
- });
+ }, this);
},
refreshSchemaTree : function() {
View
8 src/main/frontend/source/class/helenos/components/menu/ColumnFamilyContextMenu.js
@@ -71,13 +71,16 @@ qx.Class.define('helenos.components.menu.ColumnFamilyContextMenu',
return menu;
},
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
__truncateColumnFamily : function(e) {
var ksName = e.getTarget().getUserData('KSNAME');
var cfName = e.getTarget().getUserData('CFNAME');
dialog.Dialog.confirm(this.tr('loss.data.alert'), function(ret) {
if (ret == true) {
helenos.util.RpcActionsProvider.truncateColumnFamily(ksName, cfName);
- //helenos.util.GuiObserver.refreshSchemaTree();
+ helenos.util.GuiObserver.refreshSchemaTree();
}
}, this);
},
@@ -94,6 +97,9 @@ qx.Class.define('helenos.components.menu.ColumnFamilyContextMenu',
helenos.util.GuiObserver.showBrowseBySliceTab(ksName, cfName);
},
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
__dropColumnFamily : function(e) {
var ksName = e.getTarget().getUserData('KSNAME');
var cfName = e.getTarget().getUserData('CFNAME');
View
10 src/main/frontend/source/class/helenos/components/menu/KeyspaceContextMenu.js
@@ -43,6 +43,9 @@ qx.Class.define('helenos.components.menu.KeyspaceContextMenu',
helenos.util.GuiObserver.showKeyspaceInfoTab(ksName);
},
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
__dropKeyspace : function(e) {
var ksName = e.getTarget().getUserData('KSNAME');
dialog.Dialog.confirm(this.tr('loss.data.alert'), function(ret) {
@@ -53,6 +56,9 @@ qx.Class.define('helenos.components.menu.KeyspaceContextMenu',
}, this);
},
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
__addColumnFamily : function(e) {
var ksName = e.getTarget().getUserData('KSNAME');
var formData = {
@@ -124,13 +130,13 @@ qx.Class.define('helenos.components.menu.KeyspaceContextMenu',
'value' : ''
}
};
- dialog.Dialog.form('<h4>Create new column family</h4>', formData, function(result) {
+ dialog.Dialog.form('<h4>Create new column family</h4>', formData, function(context, result) {
if (result != null) {
result['keyspaceName'] = ksName;
helenos.util.RpcActionsProvider.createColumnFamily(result);
helenos.util.GuiObserver.refreshSchemaTree();
}
- });
+ }, this);
}
}
});
View
5 src/main/frontend/source/class/helenos/components/tab/ColumnFamilyInfoPage.js
@@ -114,7 +114,10 @@ qx.Class.define("helenos.components.tab.ColumnFamilyInfoPage",
var gb = new qx.ui.groupbox.GroupBox('Column metadata');
gb.setLayout(new qx.ui.layout.VBox());
- gb.add(table, {flex : 1});
+ var sp = new qx.ui.core.scroll.ScrollPane();
+ sp.add(table);
+
+ gb.add(sp, {flex : 1});
this.add(gb, {flex : 1});
}
}
View
206 src/main/frontend/source/class/helenos/components/tab/ConnectionsEditorPage.js
@@ -8,6 +8,9 @@ Authors:
************************************************************************ */
/*
#asset(qx/icon/${qx.icontheme}/16/devices/network-wired.png)
+#asset(qx/icon/${qx.icontheme}/16/actions/list-add.png)
+#asset(qx/icon/${qx.icontheme}/16/actions/edit-cut.png)
+#asset(qx/icon/${qx.icontheme}/16/actions/list-remove.png)
*/
qx.Class.define("helenos.components.tab.ConnectionsEditorPage",
{
@@ -27,57 +30,188 @@ qx.Class.define("helenos.components.tab.ConnectionsEditorPage",
icon: 'icon/16/devices/network-wired.png',
layout: new qx.ui.layout.VBox(3, 'top')
});
-
-
+
+ this.__addConnectionsTable();
},
members :
{
- __addNameAtom : function(ksDef) {
- var atom = new helenos.ui.RichAtom('Keyspace: <b>' + ksDef.name + '</b>', "icon/64/status/dialog-information.png");
- atom.setFont(new qx.bom.Font(22, ["OpenSansRegular", "Helvetica Neue", "Helvetica", "Arial", "sans-serif"]));
- this.add(atom);
- },
-
- __addBasicInfoGroup : function(ksDef) {
- var gb = new qx.ui.groupbox.GroupBox('Basic');
- gb.setLayout(new qx.ui.layout.VBox());
+ __connectionsTable : null,
+ __addButton : null,
+ __connectButton : null,
+ __editButton : null,
+ __deleteButton : null,
+
+ __addConnectionsTable : function() {
+ this.__connectionsTable = new qx.ui.table.Table(new helenos.remote.ConnectionsTableModel());
+ this.__connectionsTable.getTableColumnModel().setDataCellRenderer(3, new qx.ui.table.cellrenderer.Boolean());
+ this.__connectionsTable.getSelectionModel().addListener('changeSelection', this.__onTableSelectionChanged, this);
- var a1 = new helenos.ui.RichAtom('Strategy class: <b>' + ksDef.strategyClass + '</b>');
- var a2 = new helenos.ui.RichAtom('Replication factor: <b>' + ksDef.replicationFactor + '</b>');
+ var gb = new qx.ui.groupbox.GroupBox('Available connections');
+ gb.setLayout(new qx.ui.layout.VBox(5));
- gb.add(a1);
- gb.add(a2);
- this.add(gb);
+ var sp = new qx.ui.core.scroll.ScrollPane();
+ sp.add(this.__connectionsTable);
+
+ gb.add(sp, {
+ flex : 1
+ });
+ gb.add(this.__getActionButtonsPane());
+ this.add(gb, {
+ flex : 1
+ });
},
- __addCFTable : function(ksDef) {
- var tableModel = new qx.ui.table.model.Simple();
- tableModel.setColumns(['Id','Name','Type', 'Comparator', 'Sub comparator', 'Key validation','Default validation','Row cache', 'Key cache', 'GC grace sec'],['id','name','columnType','comparatorType_typeName', 'subComparatorType_typeName', 'keyValidationClass_normalized','defaultValidationClass_normalized','rowCacheSize', 'keyCacheSize', 'gcGraceSeconds']);
-
- // qx.lang.Core.arrayForEach(this.__convertCF, ksDef.cfDefs);
+ __getActionButtonsPane : function() {
+ var pane = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, 'right'));
+ this.__addButton = new qx.ui.form.Button('Add', 'icon/16/actions/list-add.png');
+ this.__addButton.addListener('execute', this.__onAddConnection, this);
- tableModel.setDataAsMapArray(ksDef.cfDefs.map(this.__convertCF));
- //alert(qx.lang.Object.getKeysAsString(ksDef.cfDefs[0]));
- var table = new qx.ui.table.Table(tableModel);
+ this.__connectButton = new qx.ui.form.Button('Connect to', 'helenos/connect.png');
+ this.__connectButton.addListener('execute', this.__onConnectToConnection, this);
+ this.__connectButton.setEnabled(false);
- var gb = new qx.ui.groupbox.GroupBox('Column families');
- gb.setLayout(new qx.ui.layout.VBox());
+ this.__deleteButton = new qx.ui.form.Button('Delete', 'icon/16/actions/list-remove.png');
+ this.__deleteButton.addListener('execute', this.__ondeleteConnection, this);
+ this.__deleteButton.setEnabled(false);
- gb.add(table, {flex : 1});
+ this.__editButton = new qx.ui.form.Button('Edit', 'icon/16/actions/edit-cut.png');
+ this.__editButton.addListener('execute', this.__onEditConnection, this);
+ this.__editButton.setEnabled(false);
- this.add(gb, {flex : 1});
+ pane.add(this.__addButton);
+ pane.add(this.__editButton);
+ pane.add(this.__connectButton);
+ pane.add(this.__deleteButton);
+ return pane;
+ },
+
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
+ __onAddConnection : function(e) {
+ var formData = {
+ 'alias' : {
+ 'type' : 'TextField',
+ 'label' : 'Alias (unique)',
+ 'value' : '',
+ 'validation' : {
+ 'required' : true
+ }
+ },
+ 'hosts' : {
+ 'type' : 'TextField',
+ 'label' : 'Hosts (comma separated)',
+ 'value' : '',
+ 'validation' : {
+ 'required' : true
+ }
+ },
+ 'clusterName' :
+ {
+ 'type' : 'TextArea',
+ 'label' : 'Cluster name',
+ 'lines' : 4,
+ 'value' : '',
+ 'validation' : {
+ 'required' : true
+ }
+ }
+ };
+ dialog.Dialog.form('<h3>Create connection</h3>', formData, function(context, result) {
+ if (result != null) {
+ result['active'] = false;
+ helenos.util.RpcActionsProvider.storeConnection(result);
+ context._reloadConnectionsTable();
+ }
+ }, this);
+ },
+
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
+ __onEditConnection : function(e) {
+ var alias = this.__getSelectedAlias();
+ var cc = helenos.util.RpcActionsProvider.getConnectionByAlias(alias);
+ var formData = {
+ 'hosts' : {
+ 'type' : 'TextField',
+ 'label' : 'Hosts (comma separated)',
+ 'value' : cc.hosts,
+ 'validation' : {
+ 'required' : true
+ }
+ },
+ 'clusterName' :
+ {
+ 'type' : 'TextField',
+ 'label' : 'Cluster name',
+ 'value' : cc.clusterName,
+ 'validation' : {
+ 'required' : true
+ }
+ }
+ };
+ dialog.Dialog.form('<h3>Edit connection</h3>', formData, function(context, result) {
+ if (result != null) {
+ result['alias'] = cc.alias;
+ result['active'] = cc.active;
+ helenos.util.RpcActionsProvider.storeConnection(result);
+ context._reloadConnectionsTable();
+ }
+ }, this);
},
- //TODO move 'replace' code to some helper obj
- __convertCF : function(obj ) {
- obj['comparatorType_typeName'] = obj.comparatorType.typeName;
- obj['subComparatorType_typeName'] = obj.subComparatorType ? obj.subComparatorType.typeName : '';
- obj['keyValidationClass_normalized'] = obj.keyValidationClass.replace('org.apache.cassandra.db.marshal.','');
- obj['defaultValidationClass_normalized'] = obj.defaultValidationClass.replace('org.apache.cassandra.db.marshal.','');
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
+ __ondeleteConnection : function(e) {
+ var selectionModel = this.__connectionsTable.getSelectionModel();
+ var selectedRow = selectionModel.getSelectedRanges()[0].minIndex;
+ var active = this.__connectionsTable.getTableModel().getValue(3, selectedRow);
- return obj;
- }
+ if (active == true) {
+ dialog.Dialog.error('Active connection can not be deleted !');
+ } else {
+ var alias = this.__connectionsTable.getTableModel().getValue(0, selectedRow);
+ dialog.Dialog.confirm(this.tr('are.you.sure'), function(ret) {
+ if (ret == true) {
+ helenos.util.RpcActionsProvider.deleteConnection(alias);
+ this._reloadConnectionsTable();
+ }
+ }, this);
+ }
+ },
+
+ _reloadConnectionsTable : function() {
+ this.__connectionsTable.resetSelection();
+ this.__connectionsTable.getTableModel().reloadData();
+ },
+ __getSelectedAlias : function() {
+ var selectedRow = this.__connectionsTable.getSelectionModel().getSelectedRanges()[0].minIndex;
+ return this.__connectionsTable.getTableModel().getValue(0, selectedRow);
+ },
+
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
+ __onConnectToConnection : function(e) {
+ var alias = this.__getSelectedAlias();
+ dialog.Dialog.confirm(this.tr('are.you.sure'), function(ret) {
+ if (ret == true) {
+ helenos.util.RpcActionsProvider.activate(alias);
+ this._reloadConnectionsTable();
+ helenos.util.GuiObserver.refreshSchemaTree();
+ }
+ }, this);
+ },
+
+ __onTableSelectionChanged : function(e) {
+ var isSelected = !this.__connectionsTable.getSelectionModel().isSelectionEmpty();
+ this.__connectButton.setEnabled(isSelected);
+ this.__deleteButton.setEnabled(isSelected);
+ this.__editButton.setEnabled(isSelected);
+ }
}
});
View
5 src/main/frontend/source/class/helenos/components/tab/KeyspaceInfoPage.js
@@ -70,7 +70,10 @@ qx.Class.define("helenos.components.tab.KeyspaceInfoPage",
var gb = new qx.ui.groupbox.GroupBox('Column families');
gb.setLayout(new qx.ui.layout.VBox());
- gb.add(table, {flex : 1});
+ var sp = new qx.ui.core.scroll.ScrollPane();
+ sp.add(table);
+
+ gb.add(sp, {flex : 1});
this.add(gb, {flex : 1});
},
View
29 src/main/frontend/source/class/helenos/remote/ConnectionsTableModel.js
@@ -0,0 +1,29 @@
+/* ************************************************************************
+Copyright:
+ 2012 Tomek Kuprowski
+License:
+ GPLv2: http://www.gnu.org/licences/gpl.html
+Authors:
+ Tomek Kuprowski (tomekkuprowski at gmail dot com)
+ ************************************************************************ */
+
+qx.Class.define('helenos.remote.ConnectionsTableModel',
+{
+ extend: qx.ui.table.model.Remote,
+
+ construct: function() {
+ this.base(arguments);
+ this.setColumns(['Alias','Hosts','Cluster name', 'Active'],['alias','hosts','clusterName', 'active']);
+ },
+
+ members:
+ {
+ _loadRowCount : function() {
+ this._onRowCountLoaded(helenos.util.RpcActionsProvider.getConnectionsCount());
+ },
+
+ _loadRowData : function() {
+ this._onRowDataLoaded(helenos.util.RpcActionsProvider.getAllConnections());
+ }
+ }
+});
View
12 src/main/frontend/source/class/helenos/util/Rpc.js
@@ -26,6 +26,7 @@ qx.Class.define('helenos.util.Rpc',
},
members : {
+
__getRemoteUri : function(serviceName) {
if (helenos.util.Rpc.serverPath == undefined) {
var pathIdx = window.location.href.indexOf('/helenos/index.html');
@@ -35,11 +36,14 @@ qx.Class.define('helenos.util.Rpc',
return helenos.util.Rpc.serverPath + serviceName;
},
+ /**
+ * @lint ignoreUndefined(dialog)
+ */
showDetails : function(details) {
- dialog.Dialog.alert('RPC ERROR: ' +
- 'origin: ' + details.origin +
- '; code: ' + details.code +
- '; message: ' + details.message
+ dialog.Dialog.error('<b>RPC ERROR:</b><br/>' +
+ 'Origin: ' + details.origin + '<br/>' +
+ 'Code: ' + details.code + '<br/>' +
+ 'Message:<br/><p><i>' + details.message + '</i></p>'
);
},
View
30 src/main/frontend/source/class/helenos/util/RpcActionsProvider.js
@@ -21,6 +21,36 @@ qx.Class.define('helenos.util.RpcActionsProvider', {
return rpc.callSync('getConnectionStatus');
},
+ getAllConnections : function() {
+ var rpc = new helenos.util.Rpc(this._CLUSTERCONNECTION);
+ return rpc.callSync('loadAll');
+ },
+
+ getConnectionByAlias : function(alias) {
+ var rpc = new helenos.util.Rpc(this._CLUSTERCONNECTION);
+ return rpc.callSync('getConnectionByAlias', alias);
+ },
+
+ deleteConnection : function(alias) {
+ var rpc = new helenos.util.Rpc(this._CLUSTERCONNECTION);
+ return rpc.callSync('delete', alias);
+ },
+
+ storeConnection : function(connection) {
+ var rpc = new helenos.util.Rpc(this._CLUSTERCONNECTION);
+ return rpc.callSync('store', connection);
+ },
+
+ activate : function(alias) {
+ var rpc = new helenos.util.Rpc(this._CLUSTERCONNECTION);
+ return rpc.callSync('activate', alias);
+ },
+
+ getConnectionsCount : function() {
+ var rpc = new helenos.util.Rpc(this._CLUSTERCONNECTION);
+ return rpc.callSync('getConnectionsCount');
+ },
+
dropKeyspace : function(keyspaceName) {
var rpc = new helenos.util.Rpc(this._SCHEMA);
rpc.callSync('dropKeyspace', keyspaceName);
View
BIN  src/main/frontend/source/resource/helenos/connect.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
12 src/main/frontend/source/translation/en.po
@@ -16,8 +16,12 @@ msgstr ""
msgid "error"
msgstr "Error"
-#: helenos/components/menu/KeyspaceContextMenu.js:48
-#: helenos/components/menu/ColumnFamilyContextMenu.js:77
-#: helenos/components/menu/ColumnFamilyContextMenu.js:100
+#: helenos/components/menu/KeyspaceContextMenu.js:51
+#: helenos/components/menu/ColumnFamilyContextMenu.js:80
+#: helenos/components/menu/ColumnFamilyContextMenu.js:106
msgid "loss.data.alert"
-msgstr "<h4>Are you sure ?! You will lose all your data !!!</h4>"
+msgstr "<h3>Are you sure ?! You will lose all your data !!!</h3>"
+
+#: helenos/components/tab/ConnectionsEditorPage.js:97
+msgid "are.you.sure"
+msgstr "<h3>Are you sure ?</h3>"
View
9 src/main/java/com/kuprowski/helenos/jdbc/core/support/ClusterConfigDao.java
@@ -3,6 +3,7 @@
import com.kuprowski.helenos.ClusterConfiguration;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.util.HashMap;
import java.util.List;
import java.util.Properties;
import javax.sql.DataSource;
@@ -39,6 +40,10 @@ public void setQueries(Properties queries) {
this.queries = queries;
}
+ public ClusterConfiguration get(String alias) {
+ return jdbcTemplate.queryForObject(queries.getProperty("clusterconfig.get.by.alias"), new MapSqlParameterSource("alias", alias), new ClusterConfigurationMapper());
+ }
+
public ClusterConfiguration getActive() {
List<ClusterConfiguration> configuration = jdbcTemplate.query(queries.getProperty("clusterconfig.select.star.wa"), new MapSqlParameterSource("active", true), new ClusterConfigurationMapper());
@@ -54,6 +59,10 @@ public ClusterConfiguration getActive() {
return jdbcTemplate.query(queries.getProperty("clusterconfig.select.star"), new MapSqlParameterSource(), new ClusterConfigurationMapper());
}
+ public long getConnectionsCount() {
+ return jdbcTemplate.queryForLong(queries.getProperty("clusterconfig.count"), new HashMap<String, Object>());
+ }
+
private void createDefaultConfiguration() {
jdbcTemplate.update(queries.getProperty("clusterconfig.insert"), prepareParameterSource(new ClusterConfiguration("default", "localhost:9160", "TestCluster", true)));
}
View
8 src/main/java/com/kuprowski/helenos/service/ClusterConnectionProvider.java
@@ -18,12 +18,16 @@
public interface ClusterConnectionProvider {
List<ClusterConfiguration> loadAll();
+
+ ClusterConfiguration getConnectionByAlias(String alias);
+
+ long getConnectionsCount();
void store(ClusterConfiguration configuration);
- void delete(String hosts);
+ void delete(String alias);
- void activate(ClusterConfiguration configuration);
+ void activate(String alias);
Map<String, Set<CassandraHost>> getConnectionStatus();
}
View
17 src/main/java/com/kuprowski/helenos/service/impl/ClusterConnectionProviderImpl.java
@@ -43,18 +43,29 @@ public void setClusterConfigDao(ClusterConfigDao clusterConfigDao) {
public List<ClusterConfiguration> loadAll() {
return clusterConfigDao.loadAll();
}
+
+ @Override
+ public long getConnectionsCount() {
+ return clusterConfigDao.getConnectionsCount();
+ }
@Override
public void store(ClusterConfiguration configuration) {
clusterConfigDao.store(configuration);
}
+
+ @Override
+ public ClusterConfiguration getConnectionByAlias(String alias) {
+ return clusterConfigDao.get(alias);
+ }
@Override
- public void activate(ClusterConfiguration configuration) {
+ public void activate(String alias) {
if (cluster != null) {
cluster.getConnectionManager().shutdown();
cluster = null;
}
+ ClusterConfiguration configuration = getConnectionByAlias(alias);
if (!configuration.isActive()) {
configuration.setActive(true);
store(configuration);
@@ -63,8 +74,8 @@ public void activate(ClusterConfiguration configuration) {
}
@Override
- public void delete(String hosts) {
- clusterConfigDao.delete(hosts);
+ public void delete(String alias) {
+ clusterConfigDao.delete(alias);
}
@Override
View
4 src/main/resources/queries.properties
@@ -1,6 +1,8 @@
clusterconfig.select.star=SELECT * FROM CLUSTERCONFIG
clusterconfig.select.star.wa=SELECT * FROM CLUSTERCONFIG WHERE ACTIVE=:active
clusterconfig.insert=INSERT INTO CLUSTERCONFIG VALUES(:alias,:hosts,:clustername,:active)
-clusterconfig.merge=MERGE INTO CLUSTERCONFIG(ALIAS, HOSTS ,CLUSTERNAME ,ACTIVE) KEY (ALIAS,HOSTS,CLUSTERNAME) VALUES (:alias,:hosts,:clustername,:active)
+clusterconfig.merge=MERGE INTO CLUSTERCONFIG(ALIAS, HOSTS ,CLUSTERNAME ,ACTIVE) KEY (ALIAS) VALUES (:alias,:hosts,:clustername,:active)
clusterconfig.update.all.active.false=UPDATE CLUSTERCONFIG SET ACTIVE=FALSE
clusterconfig.delete=DELETE FROM CLUSTERCONFIG WHERE ALIAS=:alias
+clusterconfig.count=SELECT COUNT(*) FROM CLUSTERCONFIG
+clusterconfig.get.by.alias=SELECT * FROM CLUSTERCONFIG WHERE ALIAS=:alias
Please sign in to comment.
Something went wrong with that request. Please try again.