Repository: ignite Updated Branches: refs/heads/ignite-843-rc2 c4901a759 -> fda717c2d
IGNITE-2276 Removed test drive options. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/fda717c2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/fda717c2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/fda717c2 Branch: refs/heads/ignite-843-rc2 Commit: fda717c2d6497732ad1da8d1663272e671178eae Parents: c4901a7 Author: Andrey <[email protected]> Authored: Sat Dec 26 17:33:38 2015 +0700 Committer: Andrey <[email protected]> Committed: Sat Dec 26 17:33:38 2015 +0700 ---------------------------------------------------------------------- modules/control-center-agent/README.txt | 11 +- .../apache/ignite/agent/AgentConfiguration.java | 60 +---- .../org/apache/ignite/agent/AgentLauncher.java | 31 +-- .../ignite/agent/AgentLoggingConfigurator.java | 90 ++++---- .../org/apache/ignite/agent/AgentSocket.java | 15 +- .../org/apache/ignite/agent/AgentUtils.java | 8 +- .../handlers/DatabaseMetadataExtractor.java | 27 ++- .../ignite/agent/handlers/RestExecutor.java | 7 +- .../ignite/agent/remote/RemoteHandler.java | 5 +- .../agent/testdrive/AgentMetadataTestDrive.java | 20 +- .../agent/testdrive/AgentSqlTestDrive.java | 182 +++++++-------- .../src/main/resources/log4j.properties | 34 +++ .../src/main/resources/logging.properties | 31 --- .../src/main/js/controllers/common-module.js | 220 +++++++++---------- .../main/js/controllers/metadata-controller.js | 47 ++-- .../src/main/js/controllers/sql-controller.js | 43 +++- .../src/main/js/routes/agent.js | 36 +-- .../src/main/js/views/sql/cache-metadata.jade | 4 +- .../src/main/js/views/sql/sql.jade | 2 +- .../main/js/views/templates/agent-download.jade | 10 +- .../main/js/views/templates/batch-confirm.jade | 12 +- .../src/main/js/views/templates/clone.jade | 3 +- 22 files changed, 395 insertions(+), 503 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/README.txt ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/README.txt b/modules/control-center-agent/README.txt index d2e6adf..7695614 100644 --- a/modules/control-center-agent/README.txt +++ b/modules/control-center-agent/README.txt @@ -18,7 +18,7 @@ Test drive of Ignite Web Agent: 1) Get security token on Web Console "Profile" screen. - 2) Test drive for metadata load from database. Activated by option: -tm or --test-drive-metadata. + 2) Demp for metadata load from database. In this mode an in-memory H2 database will started. How to evaluate: 2.1) Go to Ignite Web Console "Metadata" screen. @@ -26,7 +26,7 @@ Test drive of Ignite Web Agent: 2.3) Select H2 driver and enter JDBC URL: "jdbc:h2:mem:test-drive-db". 2.4) You should see list of available schemas and tables. Select some of them and click "Save". - 3) Test drive for SQL. Activated by option: -ts or --test-drive-sql. + 3) Demo for SQL. In this mode internal Ignite node will be started. Cache created and populated with data. How to evaluate: 3.1) Go to Ignite Web Console "SQL" menu and select "Create new notebook" menu item. @@ -50,8 +50,6 @@ Configuration file: server-uri node-uri driver-folder - test-drive-metadata - test-drive-sql Example configuration file: token=1a2b3c4d5f @@ -71,11 +69,6 @@ Options: -s, --server-uri URI for connect to Ignite Web Console via web-socket protocol, default value: wss://localhost:3001 - -tm, --test-drive-metadata - Start H2 database with sample tables in same process. JDBC URL for - connecting to sample database: jdbc:h2:mem:test-drive-db - -ts, --test-drive-sql - Create cache and populate it with sample data for use in query -t, --token User's security token http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java index 87d0cdf..cb08fe7 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentConfiguration.java @@ -73,17 +73,6 @@ public class AgentConfiguration { private String driversFolder; /** */ - @Parameter(names = { "-tm", "--test-drive-metadata" }, - description = "Start H2 database with sample tables in same process. " + - "JDBC URL for connecting to sample database: jdbc:h2:mem:test-drive-db") - private Boolean meta; - - /** */ - @Parameter(names = { "-ts", "--test-drive-sql" }, - description = "Create cache and populate it with sample data for use in query") - private Boolean sql; - - /** */ @Parameter(names = { "-h", "--help" }, help = true, description = "Print this help message") private Boolean help; @@ -151,34 +140,6 @@ public class AgentConfiguration { } /** - * @return {@code true} If metadata test drive should be started. - */ - public Boolean testDriveMetadata() { - return meta != null ? meta : false; - } - - /** - * @param meta Set to {@code true} if metadata test drive should be started. - */ - public void testDriveMetadata(Boolean meta) { - this.meta = meta; - } - - /** - * @return {@code true} If SQL test drive should be started. - */ - public Boolean testDriveSql() { - return sql != null ? sql : false; - } - - /** - * @param sql Set to {@code true} if SQL test drive should be started. - */ - public void testDriveSql(Boolean sql) { - this.sql = sql; - } - - /** * @return {@code true} If agent options usage should be printed. */ public Boolean help() { @@ -214,16 +175,6 @@ public class AgentConfiguration { if (val != null) driversFolder(val); - - val = (String)props.remove("test-drive-metadata"); - - if (val != null) - testDriveMetadata(Boolean.valueOf(val)); - - val = (String)props.remove("test-drive-sql"); - - if (val != null) - testDriveSql(Boolean.valueOf(val)); } /** @@ -247,12 +198,6 @@ public class AgentConfiguration { if (driversFolder == null) driversFolder(cmd.driversFolder()); - - if (meta == null) - testDriveMetadata(cmd.testDriveMetadata()); - - if (sql == null) - testDriveSql(cmd.testDriveSql()); } /** {@inheritDoc} */ @@ -286,10 +231,7 @@ public class AgentConfiguration { drvFld = new File(agentHome, "jdbc-drivers").getPath(); } - sb.append("Path to JDBC drivers folder : ").append(drvFld).append('\n'); - - sb.append("Test-drive for load metadata : ").append(testDriveMetadata()).append('\n'); - sb.append("Test-drive for execute query : ").append(testDriveSql()); + sb.append("Path to JDBC drivers folder : ").append(drvFld); return sb.toString(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java index 74abf3d..7d68f81 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLauncher.java @@ -22,11 +22,9 @@ import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; -import java.util.logging.Level; -import java.util.logging.Logger; + import org.apache.ignite.agent.handlers.RestExecutor; -import org.apache.ignite.agent.testdrive.AgentMetadataTestDrive; -import org.apache.ignite.agent.testdrive.AgentSqlTestDrive; +import org.apache.log4j.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.websocket.client.WebSocketClient; @@ -53,7 +51,7 @@ public class AgentLauncher { */ @SuppressWarnings("BusyWait") public static void main(String[] args) throws Exception { - log.log(Level.INFO, "Starting Apache Ignite Web Console Agent..."); + log.info("Starting Apache Ignite Web Console Agent..."); AgentConfiguration cfg = new AgentConfiguration(); @@ -71,13 +69,13 @@ public class AgentLauncher { File f = resolvePath(prop); if (f == null) - log.log(Level.WARNING, "Failed to find agent property file: '" + prop + "'"); + log.warn("Failed to find agent property file: '" + prop + "'"); else propCfg.load(f.toURI().toURL()); } catch (IOException ignore) { if (!AgentConfiguration.DFLT_CFG_PATH.equals(prop)) - log.log(Level.WARNING, "Failed to load agent property file: '" + prop + "'", ignore); + log.warn("Failed to load agent property file: '" + prop + "'", ignore); } cfg.merge(propCfg); @@ -93,15 +91,6 @@ public class AgentLauncher { System.out.println(cfg); System.out.println(); - if (cfg.testDriveSql() && cfg.nodeUri() != null) - log.log(Level.WARNING, - "URI for connect to Ignite REST server will be ignored because --test-drive-sql option was specified."); - - if (!cfg.testDriveSql() && !cfg.testDriveMetadata()) { - System.out.println("To start web-agent in test-drive mode, pass \"-tm\" and \"-ts\" parameters"); - System.out.println(); - } - if (cfg.token() == null) { String webHost; @@ -109,7 +98,7 @@ public class AgentLauncher { webHost = new URI(cfg.serverUri()).getHost(); } catch (URISyntaxException e) { - log.log(Level.SEVERE, "Failed to parse Ignite Web Console uri", e); + log.error("Failed to parse Ignite Web Console uri", e); return; } @@ -122,12 +111,6 @@ public class AgentLauncher { cfg.token(System.console().readLine().trim()); } - if (cfg.testDriveMetadata()) - AgentMetadataTestDrive.testDrive(); - - if (cfg.testDriveSql()) - AgentSqlTestDrive.testDrive(cfg); - RestExecutor restExecutor = new RestExecutor(cfg); restExecutor.start(); @@ -149,7 +132,7 @@ public class AgentLauncher { while (!Thread.interrupted()) { AgentSocket agentSock = new AgentSocket(cfg, restExecutor); - log.log(Level.INFO, "Connecting to: " + cfg.serverUri()); + log.info("Connecting to: " + cfg.serverUri()); URI uri = URI.create(cfg.serverUri()); http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLoggingConfigurator.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLoggingConfigurator.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLoggingConfigurator.java index 3a0084a..3a4cd44 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLoggingConfigurator.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentLoggingConfigurator.java @@ -38,51 +38,51 @@ public class AgentLoggingConfigurator { * Perform configure. */ public static void configure() { - try { - if (System.getProperty(CFG_PATH_PROPERTY) != null) { - File logCfg = new File(System.getProperty(CFG_PATH_PROPERTY)); - - if (!logCfg.isFile()) { - System.err.println("Failed to load logging configuration, file not found: " + logCfg); - - System.exit(1); - } - - readConfiguration(logCfg); - - return; - } - - File agentHome = AgentUtils.getAgentHome(); - - if (agentHome != null) { - File logCfg = new File(agentHome, PROPERTIES_FILE); - - if (logCfg.isFile()) { - readConfiguration(logCfg); - - return; - } - } - - LogManager.getLogManager().readConfiguration(AgentLauncher.class.getResourceAsStream("/" - + PROPERTIES_FILE)); - } - catch (IOException e) { - System.err.println("Failed to load logging configuration."); - - e.printStackTrace(); - - System.exit(1); - } +// try { +// if (System.getProperty(CFG_PATH_PROPERTY) != null) { +// File logCfg = new File(System.getProperty(CFG_PATH_PROPERTY)); +// +// if (!logCfg.isFile()) { +// System.err.println("Failed to load logging configuration, file not found: " + logCfg); +// +// System.exit(1); +// } +// +//// readConfiguration(logCfg); +// +// return; +// } + +// File agentHome = AgentUtils.getAgentHome(); + +// if (agentHome != null) { +// File logCfg = new File(agentHome, PROPERTIES_FILE); +// +// if (logCfg.isFile()) { +// readConfiguration(logCfg); +// +// return; +// } +// } +// +// LogManager.getLogManager().readConfiguration(AgentLauncher.class.getResourceAsStream("/" +// + PROPERTIES_FILE)); +// } +// catch (IOException e) { +// System.err.println("Failed to load logging configuration."); +// +// e.printStackTrace(); +// +// System.exit(1); +// } } - /** - * @param file File. - */ - private static void readConfiguration(File file) throws IOException { - try (InputStream in = new BufferedInputStream(new FileInputStream(file))) { - LogManager.getLogManager().readConfiguration(in); - } - } +// /** +// * @param file File. +// */ +// private static void readConfiguration(File file) throws IOException { +// try (InputStream in = new BufferedInputStream(new FileInputStream(file))) { +// LogManager.getLogManager().readConfiguration(in); +// } +// } } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java index 597c7ed..271a08e 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentSocket.java @@ -24,14 +24,13 @@ import com.google.gson.JsonParser; import java.io.IOException; import java.net.ConnectException; import java.util.concurrent.CountDownLatch; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.net.ssl.SSLHandshakeException; import org.apache.ignite.agent.handlers.DatabaseMetadataExtractor; import org.apache.ignite.agent.handlers.RestExecutor; import org.apache.ignite.agent.remote.Remote; import org.apache.ignite.agent.remote.RemoteHandler; import org.apache.ignite.agent.remote.WebSocketSender; +import org.apache.log4j.Logger; import org.eclipse.jetty.websocket.api.Session; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketClose; import org.eclipse.jetty.websocket.api.annotations.OnWebSocketConnect; @@ -82,7 +81,7 @@ public class AgentSocket implements WebSocketSender { */ @OnWebSocketClose public void onClose(int statusCode, String reason) { - log.log(Level.WARNING, String.format("Connection closed: %d - %s.", statusCode, reason)); + log.warn(String.format("Connection closed: %d - %s.", statusCode, reason)); if (remote != null) remote.close(); @@ -95,7 +94,7 @@ public class AgentSocket implements WebSocketSender { */ @OnWebSocketConnect public void onConnect(Session ses) { - log.log(Level.INFO, "Connection established."); + log.info("Connection established."); this.ses = ses; @@ -128,7 +127,7 @@ public class AgentSocket implements WebSocketSender { return true; } catch (IOException ignored) { - log.log(Level.SEVERE, "Failed to send message to Control Center."); + log.error("Failed to send message to Control Center."); return false; } @@ -141,15 +140,15 @@ public class AgentSocket implements WebSocketSender { @OnWebSocketError public void onError(Session ses, Throwable error) { if (error instanceof ConnectException) - log.log(Level.WARNING, error.getMessage()); + log.warn(error.getMessage()); else if (error instanceof SSLHandshakeException) { - log.log(Level.SEVERE, "Failed to establish SSL connection to Ignite Console. Start agent with " + + log.error("Failed to establish SSL connection to Ignite Console. Start agent with " + "\"-Dtrust.all=true\" to skip certificate validation in case of using self-signed certificate.", error); System.exit(1); } else - log.log(Level.SEVERE, "Connection error.", error); + log.error("Connection error.", error); if (remote != null) remote.close(); http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentUtils.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentUtils.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentUtils.java index 655fd1b..acce22d 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentUtils.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/AgentUtils.java @@ -17,12 +17,12 @@ package org.apache.ignite.agent; +import org.apache.log4j.Logger; + import java.io.File; import java.net.URI; import java.net.URISyntaxException; import java.security.ProtectionDomain; -import java.util.logging.Level; -import java.util.logging.Logger; /** * Utility methods. @@ -55,7 +55,7 @@ public class AgentUtils { // Should not happen, but to make sure our code is not broken. if (domain == null || domain.getCodeSource() == null || domain.getCodeSource().getLocation() == null) { - log.log(Level.WARNING, "Failed to resolve agent jar location!"); + log.warn("Failed to resolve agent jar location!"); return null; } @@ -72,7 +72,7 @@ public class AgentUtils { return new File(classesUri).getParentFile(); } catch (URISyntaxException | SecurityException ignored) { - log.log(Level.WARNING, "Failed to resolve agent jar location!"); + log.warn("Failed to resolve agent jar location!"); return null; } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java index f6f7cec..8860123 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/DatabaseMetadataExtractor.java @@ -30,13 +30,12 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; import org.apache.ignite.agent.AgentConfiguration; import org.apache.ignite.agent.remote.Remote; import org.apache.ignite.agent.testdrive.AgentMetadataTestDrive; import org.apache.ignite.schema.parser.DbMetadataReader; import org.apache.ignite.schema.parser.DbTable; +import org.apache.log4j.Logger; import static org.apache.ignite.agent.AgentUtils.resolvePath; @@ -86,18 +85,18 @@ public class DatabaseMetadataExtractor { @Remote public Collection<String> schemas(String jdbcDriverJarPath, String jdbcDriverCls, String jdbcUrl, Properties jdbcInfo) throws SQLException { - log.log(Level.FINE, "Start collecting database schemas [driver jar=" + jdbcDriverJarPath + + log.debug("Start collecting database schemas [driver jar=" + jdbcDriverJarPath + ", driver class=" + jdbcDriverCls + ", url=" + jdbcUrl + "]"); try (Connection conn = connect(jdbcDriverJarPath, jdbcDriverCls, jdbcUrl, jdbcInfo)) { Collection<String> schemas = DbMetadataReader.getInstance().schemas(conn); - log.log(Level.FINE, "Finished collection of schemas [url=" + jdbcUrl + ", count="+ schemas.size() +"]"); + log.debug("Finished collection of schemas [url=" + jdbcUrl + ", count="+ schemas.size() +"]"); return schemas; } catch (SQLException e) { - log.log(Level.SEVERE, "Failed to collect schemas", e); + log.error("Failed to collect schemas", e); throw e; } @@ -115,18 +114,18 @@ public class DatabaseMetadataExtractor { @Remote public Collection<DbTable> metadata(String jdbcDriverJarPath, String jdbcDriverCls, String jdbcUrl, Properties jdbcInfo, List<String> schemas, boolean tblsOnly) throws SQLException { - log.log(Level.FINE, "Start collecting database metadata [driver jar=" + jdbcDriverJarPath + + log.debug("Start collecting database metadata [driver jar=" + jdbcDriverJarPath + ", driver class=" + jdbcDriverCls + ", url=" + jdbcUrl + "]"); try (Connection conn = connect(jdbcDriverJarPath, jdbcDriverCls, jdbcUrl, jdbcInfo)) { Collection<DbTable> metadata = DbMetadataReader.getInstance().metadata(conn, schemas, tblsOnly); - log.log(Level.FINE, "Finished collection of metadata [url=" + jdbcUrl + ", count="+ metadata.size() +"]"); + log.debug("Finished collection of metadata [url=" + jdbcUrl + ", count="+ metadata.size() +"]"); return metadata; } catch (SQLException e) { - log.log(Level.SEVERE, "Failed to collect metadata", e); + log.error("Failed to collect metadata", e); throw e; } @@ -139,12 +138,12 @@ public class DatabaseMetadataExtractor { @Remote public List<JdbcDriver> availableDrivers() { if (driversFolder == null) { - log.log(Level.INFO, "JDBC drivers folder not specified, returning empty list"); + log.info("JDBC drivers folder not specified, returning empty list"); return Collections.emptyList(); } - log.log(Level.FINE, "Collecting JDBC drivers in folder: " + driversFolder.getPath()); + log.debug("Collecting JDBC drivers in folder: " + driversFolder.getPath()); File[] list = driversFolder.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { @@ -153,7 +152,7 @@ public class DatabaseMetadataExtractor { }); if (list == null) { - log.log(Level.INFO, "JDBC drivers folder has no files, returning empty list"); + log.info("JDBC drivers folder has no files, returning empty list"); return Collections.emptyList(); } @@ -171,14 +170,14 @@ public class DatabaseMetadataExtractor { res.add(new JdbcDriver(file.getName(), jdbcDriverCls)); - log.log(Level.FINE, "Found: [driver=" + file + ", class=" + jdbcDriverCls + "]"); + log.debug("Found: [driver=" + file + ", class=" + jdbcDriverCls + "]"); } } catch (IOException e) { res.add(new JdbcDriver(file.getName(), null)); - log.log(Level.INFO, "Found: [driver=" + file + "]"); - log.log(Level.INFO, "Failed to detect driver class: " + e.getMessage()); + log.info("Found: [driver=" + file + "]"); + log.info("Failed to detect driver class: " + e.getMessage()); } } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/RestExecutor.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/RestExecutor.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/RestExecutor.java index f91c14c..ccdeb9a 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/RestExecutor.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/handlers/RestExecutor.java @@ -24,8 +24,6 @@ import java.net.URISyntaxException; import java.nio.charset.Charset; import java.util.List; import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; import org.apache.commons.codec.Charsets; import org.apache.http.Header; import org.apache.http.NameValuePair; @@ -41,6 +39,7 @@ import org.apache.http.impl.client.HttpClientBuilder; import org.apache.ignite.agent.AgentConfiguration; import org.apache.ignite.agent.remote.Remote; import org.apache.ignite.agent.testdrive.AgentSqlTestDrive; +import org.apache.log4j.Logger; import static org.apache.ignite.agent.AgentConfiguration.DFLT_NODE_PORT; @@ -89,7 +88,7 @@ public class RestExecutor { @Remote public RestResult executeRest(String path, Map<String, String> params, String mtd, Map<String, String> headers, String body) throws IOException, URISyntaxException { - log.log(Level.FINE, "Start execute REST command [url=/" + path + ", method=" + mtd + + log.debug("Start execute REST command [url=/" + path + ", method=" + mtd + ", parameters=" + params + "]"); URIBuilder builder = new URIBuilder(cfg.nodeUri()); @@ -160,7 +159,7 @@ public class RestExecutor { return new RestResult(resp.getStatusLine().getStatusCode(), new String(out.toByteArray(), charset)); } catch (ConnectException e) { - log.log(Level.FINE, "Failed connect to node and execute REST command [uri=" + builder.build() + "]"); + log.debug("Failed connect to node and execute REST command [uri=" + builder.build() + "]"); return new RestResult(404, "Failed connect to node and execute REST command."); } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/remote/RemoteHandler.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/remote/RemoteHandler.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/remote/RemoteHandler.java index d200190..e15280f 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/remote/RemoteHandler.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/remote/RemoteHandler.java @@ -30,9 +30,8 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.logging.Level; -import java.util.logging.Logger; import org.apache.http.auth.AuthenticationException; +import org.apache.log4j.Logger; /** * Allow to execute methods remotely from NodeJS server by web-socket command. @@ -156,7 +155,7 @@ public class RemoteHandler implements AutoCloseable { if (reqId != null) sendException(reqId, e.getClass().getName(), e.getMessage()); else - log.log(Level.SEVERE, "Exception on execute remote method.", e); + log.error("Exception on execute remote method.", e); return; } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentMetadataTestDrive.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentMetadataTestDrive.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentMetadataTestDrive.java index b773a63..872ec70 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentMetadataTestDrive.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentMetadataTestDrive.java @@ -21,11 +21,9 @@ import java.io.File; import java.io.FileReader; import java.sql.Connection; import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.SQLException; import java.util.concurrent.atomic.AtomicBoolean; -import java.util.logging.Level; -import java.util.logging.Logger; + +import org.apache.log4j.Logger; import org.h2.tools.RunScript; import org.h2.tools.Server; @@ -56,7 +54,7 @@ public class AgentMetadataTestDrive { */ public static void testDrive() { if (initLatch.compareAndSet(false, true)) { - log.log(Level.FINE, "TEST-DRIVE: Prepare in-memory H2 database..."); + log.info("TEST-DRIVE: Prepare in-memory H2 database..."); try { Connection conn = DriverManager.getConnection("jdbc:h2:mem:test-drive-db;DB_CLOSE_DELAY=-1", "sa", ""); @@ -64,26 +62,26 @@ public class AgentMetadataTestDrive { File sqlScript = resolvePath("test-drive/test-drive.sql"); if (sqlScript == null) { - log.log(Level.SEVERE, "TEST-DRIVE: Failed to find test drive script file: test-drive/test-drive.sql"); - log.log(Level.SEVERE, "TEST-DRIVE: Test drive for metadata not started"); + log.error("TEST-DRIVE: Failed to find test drive script file: test-drive/test-drive.sql"); + log.error("TEST-DRIVE: Test drive for metadata not started"); return; } RunScript.execute(conn, new FileReader(sqlScript)); - log.log(Level.FINE, "TEST-DRIVE: Sample tables created."); + log.info("TEST-DRIVE: Sample tables created."); conn.close(); Server.createTcpServer("-tcpDaemon").start(); - log.log(Level.INFO, "TEST-DRIVE: TcpServer stared."); + log.info("TEST-DRIVE: TcpServer stared."); - log.log(Level.INFO, "TEST-DRIVE: JDBC URL for test drive metadata load: jdbc:h2:mem:test-drive-db"); + log.info("TEST-DRIVE: JDBC URL for test drive metadata load: jdbc:h2:mem:test-drive-db"); } catch (Exception e) { - log.log(Level.SEVERE, "TEST-DRIVE: Failed to start test drive for metadata!", e); + log.error("TEST-DRIVE: Failed to start test drive for metadata!", e); } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentSqlTestDrive.java ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentSqlTestDrive.java b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentSqlTestDrive.java index 221b586..41c379b 100644 --- a/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentSqlTestDrive.java +++ b/modules/control-center-agent/src/main/java/org/apache/ignite/agent/testdrive/AgentSqlTestDrive.java @@ -21,7 +21,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.LinkedHashMap; -import java.util.Map; import java.util.Random; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -30,8 +29,6 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import java.util.logging.Level; -import java.util.logging.Logger; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; import org.apache.ignite.Ignition; @@ -46,16 +43,18 @@ import org.apache.ignite.agent.testdrive.model.Employee; import org.apache.ignite.agent.testdrive.model.EmployeeKey; import org.apache.ignite.agent.testdrive.model.Parking; import org.apache.ignite.agent.testdrive.model.ParkingKey; -import org.apache.ignite.cache.CacheTypeMetadata; +import org.apache.ignite.cache.QueryEntity; +import org.apache.ignite.cache.QueryIndex; +import org.apache.ignite.cache.QueryIndexType; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.internal.IgniteEx; import org.apache.ignite.internal.IgniteNodeAttributes; import org.apache.ignite.internal.util.typedef.F; -import org.apache.ignite.lang.IgniteBiTuple; import org.apache.ignite.logger.NullLogger; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; +import org.apache.log4j.Logger; /** * Test drive for SQL. @@ -105,37 +104,33 @@ public class AgentSqlTestDrive { CacheConfiguration<K, V> ccfg = new CacheConfiguration<>(name); // Configure cacheEmployee types. - Collection<CacheTypeMetadata> meta = new ArrayList<>(); + Collection<QueryEntity> queryEntities = new ArrayList<>(); // COUNTRY. - CacheTypeMetadata type = new CacheTypeMetadata(); + QueryEntity type = new QueryEntity(); - meta.add(type); + queryEntities.add(type); type.setKeyType(CountryKey.class.getName()); type.setValueType(Country.class.getName()); // Query fields for COUNTRY. - Map<String, Class<?>> qryFlds = new LinkedHashMap<>(); + LinkedHashMap<String, String> qryFlds = new LinkedHashMap<>(); - qryFlds.put("id", int.class); - qryFlds.put("countryName", String.class); + qryFlds.put("id", "java.lang.Integer"); + qryFlds.put("countryName", "java.lang.String"); - type.setQueryFields(qryFlds); + type.setFields(qryFlds); - // Ascending fields for COUNTRY. - Map<String, Class<?>> ascFlds = new LinkedHashMap<>(); + // Indexes for COUNTRY. + type.setIndexes(Collections.singletonList(new QueryIndex("id"))); - ascFlds.put("id", int.class); - - type.setAscendingFields(ascFlds); - - ccfg.setTypeMetadata(meta); + ccfg.setQueryEntities(queryEntities); // DEPARTMENT. - type = new CacheTypeMetadata(); + type = new QueryEntity(); - meta.add(type); + queryEntities.add(type); type.setKeyType(DepartmentKey.class.getName()); type.setValueType(Department.class.getName()); @@ -143,26 +138,22 @@ public class AgentSqlTestDrive { // Query fields for DEPARTMENT. qryFlds = new LinkedHashMap<>(); - qryFlds.put("departmentId", int.class); - qryFlds.put("departmentName", String.class); - qryFlds.put("countryId", Integer.class); - qryFlds.put("managerId", Integer.class); - - type.setQueryFields(qryFlds); + qryFlds.put("departmentId", "java.lang.Integer"); + qryFlds.put("departmentName", "java.lang.String"); + qryFlds.put("countryId", "java.lang.Integer"); + qryFlds.put("managerId", "java.lang.Integer"); - // Ascending fields for DEPARTMENT. - ascFlds = new LinkedHashMap<>(); + type.setFields(qryFlds); - ascFlds.put("departmentId", int.class); + // Indexes for DEPARTMENT. + type.setIndexes(Collections.singletonList(new QueryIndex("departmentId"))); - type.setAscendingFields(ascFlds); - - ccfg.setTypeMetadata(meta); + ccfg.setQueryEntities(queryEntities); // EMPLOYEE. - type = new CacheTypeMetadata(); + type = new QueryEntity(); - meta.add(type); + queryEntities.add(type); type.setKeyType(EmployeeKey.class.getName()); type.setValueType(Employee.class.getName()); @@ -170,46 +161,40 @@ public class AgentSqlTestDrive { // Query fields for EMPLOYEE. qryFlds = new LinkedHashMap<>(); - qryFlds.put("employeeId", int.class); - qryFlds.put("firstName", String.class); - qryFlds.put("lastName", String.class); - qryFlds.put("email", String.class); - qryFlds.put("phoneNumber", String.class); - qryFlds.put("hireDate", java.sql.Date.class); - qryFlds.put("job", String.class); - qryFlds.put("salary", Double.class); - qryFlds.put("managerId", Integer.class); - qryFlds.put("departmentId", Integer.class); - - type.setQueryFields(qryFlds); - - // Ascending fields for EMPLOYEE. - ascFlds = new LinkedHashMap<>(); + qryFlds.put("employeeId", "java.lang.Integer"); + qryFlds.put("firstName", "java.lang.String"); + qryFlds.put("lastName", "java.lang.String"); + qryFlds.put("email", "java.lang.String"); + qryFlds.put("phoneNumber", "java.lang.String"); + qryFlds.put("hireDate", "java.sql.Date"); + qryFlds.put("job", "java.lang.String"); + qryFlds.put("salary", "java.lang.Double"); + qryFlds.put("managerId", "java.lang.Integer"); + qryFlds.put("departmentId", "java.lang.Integer"); - ascFlds.put("employeeId", int.class); + type.setFields(qryFlds); - type.setAscendingFields(ascFlds); + // Indexes for EMPLOYEE. + Collection<QueryIndex> indexes = new ArrayList<>(); - // Desc fields for EMPLOYEE. - Map<String, Class<?>> descFlds = new LinkedHashMap<>(); + indexes.add(new QueryIndex("employeeId")); + indexes.add(new QueryIndex("salary", false)); - descFlds.put("salary", Double.class); + // Group indexes for EMPLOYEE. + LinkedHashMap<String, Boolean> grpItems = new LinkedHashMap<>(); - type.setDescendingFields(descFlds); + grpItems.put("firstName", Boolean.FALSE); + grpItems.put("lastName", Boolean.TRUE); - // Groups for EMPLOYEE. - Map<String, LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>>> grps = new LinkedHashMap<>(); + QueryIndex grpIdx = new QueryIndex(grpItems, QueryIndexType.SORTED); - LinkedHashMap<String, IgniteBiTuple<Class<?>, Boolean>> grpItems = new LinkedHashMap<>(); + grpIdx.setName("EMP_NAMES"); - grpItems.put("firstName", new IgniteBiTuple<Class<?>, Boolean>(String.class, false)); - grpItems.put("lastName", new IgniteBiTuple<Class<?>, Boolean>(String.class, true)); + indexes.add(grpIdx); - grps.put("EMP_NAMES", grpItems); + type.setIndexes(indexes); - type.setGroups(grps); - - ccfg.setTypeMetadata(meta); + ccfg.setQueryEntities(queryEntities); return ccfg; } @@ -222,39 +207,37 @@ public class AgentSqlTestDrive { private static <K, V> CacheConfiguration<K, V> cacheCar(String name) { CacheConfiguration<K, V> ccfg = new CacheConfiguration<>(name); + ccfg.setSqlSchema(name.replace('-', '_')); + // Configure cacheEmployee types. - Collection<CacheTypeMetadata> meta = new ArrayList<>(); + Collection<QueryEntity> queryEntities = new ArrayList<>(); // CAR. - CacheTypeMetadata type = new CacheTypeMetadata(); + QueryEntity type = new QueryEntity(); - meta.add(type); + queryEntities.add(type); type.setKeyType(CarKey.class.getName()); type.setValueType(Car.class.getName()); // Query fields for CAR. - Map<String, Class<?>> qryFlds = new LinkedHashMap<>(); - - qryFlds.put("carId", int.class); - qryFlds.put("parkingId", int.class); - qryFlds.put("carName", String.class); + LinkedHashMap<String, String> qryFlds = new LinkedHashMap<>(); - type.setQueryFields(qryFlds); + qryFlds.put("carId", "java.lang.Integer"); + qryFlds.put("parkingId", "java.lang.Integer"); + qryFlds.put("carName", "java.lang.String"); - // Ascending fields for CAR. - Map<String, Class<?>> ascFlds = new LinkedHashMap<>(); + type.setFields(qryFlds); - ascFlds.put("carId", int.class); + // Indexes for CAR. + type.setIndexes(Collections.singletonList(new QueryIndex("carId"))); - type.setAscendingFields(ascFlds); - - ccfg.setTypeMetadata(meta); + ccfg.setQueryEntities(queryEntities); // PARKING. - type = new CacheTypeMetadata(); + type = new QueryEntity(); - meta.add(type); + queryEntities.add(type); type.setKeyType(ParkingKey.class.getName()); type.setValueType(Parking.class.getName()); @@ -262,19 +245,15 @@ public class AgentSqlTestDrive { // Query fields for PARKING. qryFlds = new LinkedHashMap<>(); - qryFlds.put("parkingId", int.class); - qryFlds.put("parkingName", String.class); - - type.setQueryFields(qryFlds); - - // Ascending fields for PARKING. - ascFlds = new LinkedHashMap<>(); + qryFlds.put("parkingId", "java.lang.Integer"); + qryFlds.put("parkingName", "java.lang.String"); - ascFlds.put("parkingId", int.class); + type.setFields(qryFlds); - type.setAscendingFields(ascFlds); + // Indexes for PARKING. + type.setIndexes(Collections.singletonList(new QueryIndex("parkingId"))); - ccfg.setTypeMetadata(meta); + ccfg.setQueryEntities(queryEntities); return ccfg; } @@ -303,7 +282,7 @@ public class AgentSqlTestDrive { * @param range Time range in milliseconds. */ private static void populateCacheEmployee(Ignite ignite, String name, long range) { - log.log(Level.FINE, "TEST-DRIVE-SQL: Start population cache: '" + name + "' with data..."); + log.trace("TEST-DRIVE-SQL: Start population cache: '" + name + "' with data..."); IgniteCache<CountryKey, Country> cacheCountry = ignite.cache(name); @@ -332,7 +311,7 @@ public class AgentSqlTestDrive { round(r * 5000, 2) , mgrId, rnd.nextInt(DEP_CNT))); } - log.log(Level.FINE, "TEST-DRIVE-SQL: Finished population cache: '" + name + "' with data."); + log.trace("TEST-DRIVE-SQL: Finished population cache: '" + name + "' with data."); } /** @@ -340,7 +319,7 @@ public class AgentSqlTestDrive { * @param name Cache name. */ private static void populateCacheCar(Ignite ignite, String name) { - log.log(Level.FINE, "TEST-DRIVE-SQL: Start population cache: '" + name + "' with data..."); + log.trace("TEST-DRIVE-SQL: Start population cache: '" + name + "' with data..."); IgniteCache<ParkingKey, Parking> cacheParking = ignite.cache(name); @@ -353,7 +332,7 @@ public class AgentSqlTestDrive { cacheCar.put(new CarKey(i), new Car(i, rnd.nextInt(PARK_CNT), "Car " + (i + 1))); - log.log(Level.FINE, "TEST-DRIVE-SQL: Finished population cache: '" + name + "' with data."); + log.trace("TEST-DRIVE-SQL: Finished population cache: '" + name + "' with data."); } /** @@ -422,6 +401,7 @@ public class AgentSqlTestDrive { } } catch (IllegalStateException ignored) { + // No-op. } catch (Throwable e) { if (!e.getMessage().contains("cache is stopped")) @@ -460,7 +440,7 @@ public class AgentSqlTestDrive { */ public static boolean testDrive(AgentConfiguration acfg) { if (initLatch.compareAndSet(false, true)) { - log.log(Level.INFO, "TEST-DRIVE-SQL: Starting embedded node for sql test-drive..."); + log.info("TEST-DRIVE-SQL: Starting embedded node for sql test-drive..."); try { IgniteConfiguration cfg = new IgniteConfiguration(); @@ -484,7 +464,7 @@ public class AgentSqlTestDrive { cfg.setCacheConfiguration(cacheEmployee(EMPLOYEE_CACHE_NAME), cacheCar(CAR_CACHE_NAME)); - log.log(Level.FINE, "TEST-DRIVE-SQL: Start embedded node with indexed enabled caches..."); + log.trace("TEST-DRIVE-SQL: Start embedded node with indexed enabled caches..."); IgniteEx ignite = (IgniteEx)Ignition.start(cfg); @@ -494,19 +474,19 @@ public class AgentSqlTestDrive { Integer port = ignite.localNode().attribute(IgniteNodeAttributes.ATTR_REST_JETTY_PORT); if (F.isEmpty(host) || port == null) { - log.log(Level.SEVERE, "TEST-DRIVE-SQL: Failed to start embedded node with rest!"); + log.error("TEST-DRIVE-SQL: Failed to start embedded node with rest!"); return false; } acfg.nodeUri(String.format("http://%s:%d", "0.0.0.0".equals(host) ? "127.0.0.1" : host, port)); - log.log(Level.INFO, "TEST-DRIVE-SQL: Embedded node for sql test-drive successfully started"); + log.info("TEST-DRIVE-SQL: Embedded node for sql test-drive successfully started"); startLoad(ignite, 20); } catch (Exception e) { - log.log(Level.SEVERE, "TEST-DRIVE-SQL: Failed to start embedded node for sql test-drive!", e); + log.error("TEST-DRIVE-SQL: Failed to start embedded node for sql test-drive!", e); return false; } http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/resources/log4j.properties b/modules/control-center-agent/src/main/resources/log4j.properties new file mode 100644 index 0000000..c262a16 --- /dev/null +++ b/modules/control-center-agent/src/main/resources/log4j.properties @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +log4j.rootLogger=INFO,stdout,file + +log4j.logger.org.apache.http=WARN +log4j.logger.org.apache.commons.beanutils=WARN +log4j.logger.sun.net.www.protocol.http=WARN + +# Configure console appender. +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=[%d{ABSOLUTE}][%-5p][%t][%c{1}] %m%n + +# Direct log messages to a log file +log4j.appender.file=org.apache.log4j.RollingFileAppender +log4j.appender.file.File=logs/ignite-web-agent.log +log4j.appender.file.Threshold=DEBUG +log4j.appender.file.MaxFileSize=10MB +log4j.appender.file.MaxBackupIndex=10 +log4j.appender.file.layout=org.apache.log4j.PatternLayout +log4j.appender.file.layout.ConversionPattern=[%d{ABSOLUTE}][%-5p][%t][%c{1}] %m%n http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-agent/src/main/resources/logging.properties ---------------------------------------------------------------------- diff --git a/modules/control-center-agent/src/main/resources/logging.properties b/modules/control-center-agent/src/main/resources/logging.properties deleted file mode 100644 index e262eb8..0000000 --- a/modules/control-center-agent/src/main/resources/logging.properties +++ /dev/null @@ -1,31 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -handlers=java.util.logging.ConsoleHandler, java.util.logging.FileHandler - -.level=FINE - -org.apache.http.level=INFO -org.apache.commons.beanutils.level=INFO -sun.net.www.protocol.http.level=INFO - -java.util.logging.ConsoleHandler.formatter=org.apache.ignite.logger.java.JavaLoggerFormatter -java.util.logging.ConsoleHandler.level=INFO - -java.util.logging.FileHandler.formatter=org.apache.ignite.logger.java.JavaLoggerFormatter -java.util.logging.FileHandler.pattern=logs/ignite-web-agent.log.%g -java.util.logging.FileHandler.level=FINE -java.util.logging.FileHandler.limit=10485760 -java.util.logging.FileHandler.count=10 http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/controllers/common-module.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js index 3de0fe0..a2cffea 100644 --- a/modules/control-center-web/src/main/js/controllers/common-module.js +++ b/modules/control-center-web/src/main/js/controllers/common-module.js @@ -1061,85 +1061,69 @@ consoleModule.service('$unsavedChangesGuard', function ($rootScope) { consoleModule.service('$confirmBatch', function ($rootScope, $modal, $q) { var scope = $rootScope.$new(); - var contentGenerator = function () { - return 'No content'; - }; - - var deferred; - - var stepConfirmModal = $modal({templateUrl: '/templates/batch-confirm.html', scope: scope, placement: 'center', show: false}); + scope.confirmModal = $modal({templateUrl: '/templates/batch-confirm.html', scope: scope, placement: 'center', show: false}); function _done(cancel) { + scope.confirmModal.hide(); + if (cancel) - deferred.reject('cancelled'); + scope.deferred.reject('cancelled'); else - deferred.resolve(); - - stepConfirmModal.hide(); + scope.deferred.resolve(); } - var items = []; - var curIx = 0; - function _nextElement(skip) { - items[curIx].skip = skip; + scope.items[scope.curIx++].skip = skip; - curIx++; - - if (curIx < items.length) - scope.batchConfirm.content = contentGenerator(items[curIx]); + if (scope.curIx < scope.items.length) + scope.content = scope.contentGenerator(scope.items[scope.curIx]); else _done(); } - scope.batchConfirm = { - applyToAll: false, - cancel: function () { + scope.cancel = function () { _done(true); - }, - skip: function () { - if (this.applyToAll) { - for (var i = curIx; i < items.length; i++) - items[i].skip = true; + }; + + scope.skip = function (applyToAll) { + if (applyToAll) { + for (var i = scope.curIx; i < scope.items.length; i++) + scope.items[i].skip = true; _done(); } else _nextElement(true); - }, - overwrite: function () { - if (this.applyToAll) + }; + + scope.overwrite = function (applyToAll) { + if (applyToAll) _done(); else _nextElement(false); - }, - reset: function (itemsToConfirm) { - items = itemsToConfirm; - curIx = 0; - this.applyToAll = false; - this.content = (items && items.length > 0) ? contentGenerator(items[0]) : undefined; - } }; + return { /** * Show confirm all dialog. * - * @param confirmMessageFx Function to generate a confirm message. + * @param confirmMessageFn Function to generate a confirm message. * @param itemsToConfirm Array of element to process by confirm. */ - stepConfirmModal.confirm = function (confirmMessageFx, itemsToConfirm) { - contentGenerator = confirmMessageFx; + confirm: function (confirmMessageFn, itemsToConfirm) { + scope.deferred = $q.defer(); - scope.batchConfirm.reset(itemsToConfirm); + scope.contentGenerator = confirmMessageFn; - deferred = $q.defer(); + scope.items = itemsToConfirm; + scope.curIx = 0; + scope.content = (scope.items && scope.items.length > 0) ? scope.contentGenerator(scope.items[0]) : undefined; - stepConfirmModal.show(); + scope.confirmModal.$promise.then(scope.confirmModal.show); - return deferred.promise; + return scope.deferred.promise; + } }; - - return stepConfirmModal; }); // 'Clone' popup service. @@ -1935,13 +1919,15 @@ consoleModule.controller('auth', [ }]); // Download agent controller. -consoleModule.controller('agent-download', [ - '$http', '$common', '$scope', '$interval', '$modal', '$loading', '$state', - function ($http, $common, $scope, $interval, $modal, $loading, $state) { - $scope.loadingAgentOptions = { text: 'Enabling test-drive SQL...' }; +consoleModule.service('$agentDownload', [ + '$http', '$interval', '$rootScope', '$state', '$modal', '$loading', '$common', + function ($http, $interval, $rootScope, $state, $modal, $loading, $common) { + var scope = $rootScope.$new(); + + scope.loadingOptions = { text: 'Enabling test-drive SQL...' }; // Pre-fetch modal dialogs. - var _agentDownloadModal = $modal({scope: $scope, templateUrl: '/templates/agent-download.html', show: false, backdrop: 'static'}); + var _agentDownloadModal = $modal({scope: scope, templateUrl: '/templates/agent-download.html', show: false, backdrop: 'static'}); var _agentDownloadHide = _agentDownloadModal.hide; @@ -1957,16 +1943,16 @@ consoleModule.controller('agent-download', [ /** * Close dialog and go by specified link. */ - $scope.goBack = function () { + scope.back = function () { _stopInterval(); _agentDownloadModal.hide(); - if (_agentDownloadModal.backLink) - $state.go(_agentDownloadModal.backLink); + if (_agentDownloadModal.backState) + $state.go(_agentDownloadModal.backState); }; - $scope.downloadAgent = function () { + scope.downloadAgent = function () { var lnk = document.createElement('a'); lnk.setAttribute('href', '/api/v1/agent/download/zip'); @@ -1980,18 +1966,21 @@ consoleModule.controller('agent-download', [ document.body.removeChild(lnk); }; - $scope.enableTestDriveSQL = function () { - $loading.start('loadingAgent'); + scope.enableTestDriveSQL = function () { + $loading.start('startTestDriveSQL'); $http.post('/api/v1/agent/testdrive/sql') - .success(function (result) { - if (!result) - $common.showError('Failed to start test-drive sql', 'top-right', 'body', true); + .success(function (enabled) { + if (!enabled) + $common.showError('Failed to start demo', 'top-right', 'body', true); }) - .error(function (errMsg, status) { - $loading.finish('loadingAgent'); + .catch(function (errMsg, status) { + console.log(errMsg); _handleException(errMsg, status); + }) + .finally(function () { + $loading.finish('startTestDriveSQL'); }); }; @@ -2002,22 +1991,27 @@ consoleModule.controller('agent-download', [ * @param status Error code. * @param timedOut True if request timedOut. */ - var _handleException = function (errMsg, status, timedOut) { + function _handleException (errMsg, status, timedOut) { if (_agentDownloadModal.skipSingleError) _agentDownloadModal.skipSingleError = false; else if (!_agentDownloadModal.$isShown) _agentDownloadModal.$promise.then(_agentDownloadModal.show); - $scope.nodeFailedConnection = status === 404 || timedOut; + scope.nodeFailedConnection = status === 404 || timedOut; if (status === 500) $common.showError(errMsg, 'top-right', 'body', true); - }; + } /** * Start interval to agent listening. */ - function _startInterval() { + function _startInterval(awaitFirstSuccess) { + _agentDownloadModal.skipSingleError = false; + + // Stop refresh after first success. + _agentDownloadModal.awaitFirstSuccess = awaitFirstSuccess; + _agentDownloadModal.updatePromise = $interval(function () { _tryWithAgent(); }, 5000, 0, false); @@ -2036,75 +2030,73 @@ consoleModule.controller('agent-download', [ * Try to access agent and execute specified function. */ function _tryWithAgent() { - var timeout = 3000, - timedOut = false; + var _timeout = 3000, + _timedOut = false; setTimeout(function () { - timedOut = true; - }, timeout); + _timedOut = true; + }, _timeout); - $http.post(_agentDownloadModal.checkUrl, undefined, {timeout: timeout}) + $http.post(_agentDownloadModal.check.url, _agentDownloadModal.check.params, {timeout: _timeout}) .success(function (result) { _agentDownloadModal.skipSingleError = true; - _agentDownloadModal.hide(); - if (_agentDownloadModal.awaitFirstSuccess) _stopInterval(); - $loading.finish('loadingAgent'); + $loading.finish('startTestDriveSQL'); - _agentDownloadModal.checkFn(result, _agentDownloadModal.hide, _handleException); + _agentDownloadModal.check.cb(result, _agentDownloadModal.hide, _handleException); }) .error(function (errMsg, status) { - _handleException(errMsg, status, timedOut); + _handleException(errMsg, status, _timedOut); }); } - /** - * Start awaiting agent start using ping. - * - * @param checkFn Function to execute by timer when agent available. - */ - $scope.awaitAgent = function (checkFn) { - _agentDownloadModal.skipSingleError = false; - - _agentDownloadModal.checkUrl = '/api/v1/agent/ping'; - - _agentDownloadModal.checkFn = checkFn; - - // Stop refresh after first success. - _agentDownloadModal.awaitFirstSuccess = true; - - $scope.agentDownloadBackTo = 'Metadata'; - - _startInterval(); - }; - - /** - * Start listening topology from node. - * - * @param checkFn Function to execute by timer when agent available. - */ - $scope.startTopologyListening = function (checkFn) { - _agentDownloadModal.skipSingleError = false; + return { + /** + * Start listening topology from node. + * + * @param success Function to execute by timer when agent available. + * @param attr + * @param mtr + */ + startTopologyListening: function (success, attr, mtr) { + _agentDownloadModal.check = { + url: '/api/v1/agent/topology', + params: {attr: !!attr, mtr: !!mtr}, + cb: success + }; - _agentDownloadModal.checkUrl = '/api/v1/agent/topology'; + _agentDownloadModal.backState = 'base.configuration.clusters'; - _agentDownloadModal.checkFn = checkFn; + scope.backText = 'Back to Configuration'; - _agentDownloadModal.backLink = 'base.configuration.clusters'; + _startInterval(); + }, + /** + * Start awaiting agent start using ping. + * + * @param success Function to execute by timer when agent available. + */ + awaitAgent: function (success) { + _agentDownloadModal.check = { + url: '/api/v1/agent/ping', + cb: success + }; - $scope.agentDownloadBackTo = 'Configuration'; + _agentDownloadModal.backState = 'base.configuration.metadata'; - _startInterval(); - }; + scope.backText = 'Back to Metadata'; - /** - * Stop listening of agent by ping. - */ - $scope.finishAgentListening = function () { - _stopInterval(); + _startInterval(true); + }, + /** + * Stop listening of agent by ping. + */ + stopAwaitAgent: function () { + _stopInterval(); + } }; }]); http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/controllers/metadata-controller.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js index ced8913..96ac27b 100644 --- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js +++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js @@ -16,24 +16,19 @@ */ // Controller for Metadata screen. -consoleModule.controller('metadataController', [ - '$scope', '$state', '$controller', '$filter', '$http', '$modal', '$common', '$timeout', '$focus', '$confirm', '$confirmBatch', '$clone', '$table', '$preview', '$loading', '$unsavedChangesGuard', - function ($scope, $state, $controller, $filter, $http, $modal, $common, $timeout, $focus, $confirm, $confirmBatch, $clone, $table, $preview, $loading, $unsavedChangesGuard) { +consoleModule.controller('metadataController', function ($filter, $http, $timeout, $state, $scope, $controller, $modal, + $common, $focus, $confirm, $confirmBatch, $clone, $table, $preview, $loading, $unsavedChangesGuard, $agentDownload) { $unsavedChangesGuard.install($scope); // Initialize the super class and extend it. angular.extend(this, $controller('save-remove', {$scope: $scope})); - // Initialize the super class and extend it. - angular.extend(this, $controller('agent-download', {$scope: $scope})); - $scope.ui = $common.formUI(); $scope.ui.packageName = $commonUtils.toJavaPackageName($scope.$root.user.email.replace('@', '.').split('.') .reverse().join('.') + '.model'); $scope.agentGoal = 'load metadata from database schema'; - $scope.agentTestDriveOption = '--test-drive-metadata'; $scope.joinTip = $common.joinTip; $scope.getModel = $common.getModel; @@ -185,10 +180,10 @@ consoleModule.controller('metadataController', [ $scope.ui.showValid = true; function _findPreset(idx) { - var jdbcDriverClass = $scope.jdbcDriverJars[idx].jdbcDriverClass; + var selected = $scope.jdbcDriverJars[idx]; idx = _.findIndex(_dbPresets, function (preset) { - return preset.jdbcDriverClass === jdbcDriverClass; + return preset.jdbcDriverClass === selected.jdbcDriverClass; }); if (idx >= 0) @@ -196,10 +191,10 @@ consoleModule.controller('metadataController', [ return { db: 'unknown', - jdbcDriverClass: jdbcDriverClass, - jdbcDriverJar: '', + jdbcDriverClass: selected.jdbcDriverClass, + jdbcDriverJar: selected.jdbcDriverJar, jdbcUrl: 'jdbc:[database]', - user: 'sa' + user: 'admin' }; } @@ -207,11 +202,14 @@ consoleModule.controller('metadataController', [ if (_.isNumber(drvIdx)) { var preset = $scope.jdbcDriverJars[drvIdx]; + var jdbcDriverJar = preset.jdbcDriverJar; + if (!preset.testDrive) preset = _findPreset(drvIdx); var newPreset = angular.copy(preset); + newPreset.jdbcDriverJar = jdbcDriverJar; newPreset.drvIdx = drvIdx; newPreset.tablesOnly = $scope.preset.tablesOnly; @@ -279,7 +277,7 @@ consoleModule.controller('metadataController', [ var hideLoadMetadata = loadMetaModal.hide; loadMetaModal.hide = function () { - $scope.finishAgentListening(); + $agentDownload.stopAwaitAgent(); hideLoadMetadata(); }; @@ -299,8 +297,8 @@ consoleModule.controller('metadataController', [ $scope.loadMeta.action = 'drivers'; $scope.loadMeta.loadingOptions = LOADING_JDBC_DRIVERS; - $scope.awaitAgent(function (result, onSuccess, onException) { - loadMetaModal.show(); + $agentDownload.awaitAgent(function (result, onSuccess, onException) { + loadMetaModal.$promise.then(loadMetaModal.show); // Get available JDBC drivers via agent. if ($scope.loadMeta.action == 'drivers') { @@ -379,6 +377,7 @@ consoleModule.controller('metadataController', [ preset.password = ''; } + $http.post('/api/v1/agent/schemas', preset) .success(function (schemas) { $scope.loadMeta.schemas = _.map(schemas, function (schema) { @@ -679,21 +678,17 @@ consoleModule.controller('metadataController', [ } $scope.loadMetadataNext = function () { - if ($scope.nextAvailable()) { - if ($scope.loadMeta.action === 'connect') - _loadSchemas(); - else if ($scope.loadMeta.action === 'schemas') - _loadMetadata(); - else if ($scope.loadMeta.action === 'tables' && $scope.nextAvailable()) - _saveMetadata(); - } + if (!$scope.nextAvailable()) + return; + + $scope.loadMeta.action === 'connect' && _loadSchemas(); + $scope.loadMeta.action === 'schemas' && _loadMetadata(); + $scope.loadMeta.action === 'tables' && _saveMetadata(); }; $scope.nextTooltipText = function () { if ($scope.loadMeta.action === 'tables' && !$scope.nextAvailable()) return 'Select tables to continue'; - - return undefined; }; $scope.nextAvailable = function () { @@ -1336,5 +1331,5 @@ consoleModule.controller('metadataController', [ $scope.backupItem = $scope.selectedItem ? angular.copy($scope.selectedItem) : prepareNewItem(); }); }; - }] + } ); http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/controllers/sql-controller.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js index ccc7689..ea91690 100644 --- a/modules/control-center-web/src/main/js/controllers/sql-controller.js +++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js @@ -16,13 +16,10 @@ */ // Controller for SQL notebook screen. -consoleModule.controller('sqlController', function ($animate, $scope, $controller, $http, $timeout, $common, $confirm, - $interval, $modal, $popover, $loading, $location, $anchorScroll, $state, uiGridExporterConstants) { - // Initialize the super class and extend it. - angular.extend(this, $controller('agent-download', {$scope: $scope})); +consoleModule.controller('sqlController', function ($http, $timeout, $interval, $scope, $animate, $location, $anchorScroll, $state, + $modal, $popover, $loading, $common, $confirm, $agentDownload, uiGridExporterConstants) { $scope.agentGoal = 'execute sql statements'; - $scope.agentTestDriveOption = '--test-drive-sql'; $scope.joinTip = $common.joinTip; @@ -61,6 +58,10 @@ consoleModule.controller('sqlController', function ($animate, $scope, $controlle } }; + var _mask = function (cacheName) { + return _.isEmpty(cacheName) ? '<default>' : cacheName; + }; + // Time line X axis descriptor. var TIME_LINE = {value: -1, type: 'java.sql.Date', label: 'TIME_LINE'}; @@ -272,7 +273,7 @@ consoleModule.controller('sqlController', function ($animate, $scope, $controlle else $scope.rebuildScrollParagraphs(); - $scope.startTopologyListening(getTopology); + $agentDownload.startTopologyListening(getTopology); }) .error(function () { $scope.notebook = undefined; @@ -448,10 +449,14 @@ consoleModule.controller('sqlController', function ($animate, $scope, $controlle return panel_idx >= 0; }; - function getTopology(caches, onSuccess) { + function getTopology(clusters, onSuccess) { onSuccess(); - $scope.caches = _.sortBy(caches, 'name'); + var caches = _.flattenDeep(clusters.map(function (cluster) { return cluster._caches; })); + + $scope.caches = _.sortBy(_.uniq(_.reject(caches, { mode: 'LOCAL' }), function (cache) { + return _mask(cache.name); + }), 'name'); _setActiveCache(); } @@ -1442,7 +1447,8 @@ consoleModule.controller('sqlController', function ($animate, $scope, $controlle }; $scope.dblclickMetadata = function (paragraph, node) { - paragraph.ace.insert(node.type == 'type' ? node.fullName : node.name); + paragraph.ace.insert(node.name); + var position = paragraph.ace.selection.getCursor(); paragraph.query = paragraph.ace.getValue(); @@ -1461,7 +1467,24 @@ consoleModule.controller('sqlController', function ($animate, $scope, $controlle $http.post('/api/v1/agent/cache/metadata') .success(function (metadata) { - $scope.metadata = _.sortBy(metadata, 'name'); + $scope.metadata = _.sortBy(metadata, _.filter(metadata, function (meta) { + var cacheName = _mask(meta.cacheName); + + var cache = _.find($scope.caches, { name: cacheName }); + + if (cache) { + meta.name = (cache.sqlSchema ? cache.sqlSchema : (_.isEmpty(cache.cacheName) ? '"' + cacheName + '"' : "")) + '.' + meta.typeName; + + meta.displayMame = _mask(meta.cacheName) + '.' + meta.typeName; + + if (cache.sqlSchema) + meta.children.unshift({type: 'plain', name: 'sqlSchema: ' + cache.sqlSchema}); + + meta.children.unshift({type: 'plain', name: 'mode: ' + cache.mode}); + } + + return cache; + }), 'name'); }) .error(function (errMsg) { $common.showError(errMsg); http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/routes/agent.js ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/routes/agent.js b/modules/control-center-web/src/main/js/routes/agent.js index 96ac706..d28b726 100644 --- a/modules/control-center-web/src/main/js/routes/agent.js +++ b/modules/control-center-web/src/main/js/routes/agent.js @@ -64,8 +64,6 @@ router.get('/download/zip', function (req, res) { prop.push('#Uncomment following options if needed:'); prop.push('#node-uri=http://localhost:8080'); prop.push('#driver-folder=./jdbc-drivers'); - prop.push('#test-drive-metadata=true'); - prop.push('#test-drive-sql=true'); zip.file(agentFld + '/default.properties', prop.join('\n')); @@ -83,17 +81,11 @@ router.post('/topology', function (req, res) { var client = _client(req, res); if (client) { - client.ignite().cluster(false).then(function (clusters) { - var caches = clusters.map(function (cluster) { - return Object.keys(cluster._caches).map(function (key) { - return {name: key, mode: cluster._caches[key]}; - }); - }); - - res.json(_.uniq(_.reject(_.flatten(caches), { mode: 'LOCAL' }), function(cache) { - return cache.name; - })); - }, function (err) { + client.ignite().cluster(req.body.attr, req.body.mtr).then( + function (clusters) { + res.json(clusters); + }, + function (err) { var mStatusCode = /.*Status code:\s+(\d+)(?:\s|$)/g.exec(err); res.status(mStatusCode != null && mStatusCode[1] ? mStatusCode[1] : 500).send(err); @@ -208,10 +200,6 @@ router.post('/cache/metadata', function (req, res) { for (var meta of caches) { var cacheTypes = meta.types.map(function (typeName) { - var cacheName = meta.cacheName ? meta.cacheName : '<default>'; - - var fullTypeName = '"' + (meta.cacheName ? meta.cacheName : "") + '".' + typeName; - var fields = meta.fields[typeName]; var columns = []; @@ -224,7 +212,7 @@ router.post('/cache/metadata', function (req, res) { name: fieldName, clazz: fieldClass, system: fieldName == "_KEY" || fieldName == "_VAL", - cacheName: cacheName, + cacheName: meta.cacheName, typeName: typeName }); } @@ -240,7 +228,7 @@ router.post('/cache/metadata', function (req, res) { name: field, order: index.descendings.indexOf(field) < 0, unique: index.unique, - cacheName: cacheName, + cacheName: meta.cacheName, typeName: typeName }); } @@ -250,7 +238,7 @@ router.post('/cache/metadata', function (req, res) { type: 'index', name: index.name, children: fields, - cacheName: cacheName, + cacheName: meta.cacheName, typeName: typeName }); } @@ -258,9 +246,9 @@ router.post('/cache/metadata', function (req, res) { columns = _.sortBy(columns, 'name'); if (!_.isEmpty(indexes)) - columns = columns.concat({type: 'indexes', name: 'Indexes', cacheName: cacheName, typeName: typeName, children: indexes }); + columns = columns.concat({type: 'indexes', name: 'Indexes', cacheName: meta.cacheName, typeName: typeName, children: indexes }); - return {type: 'type', name: cacheName + '.' + typeName, fullName: fullTypeName, children: columns }; + return {type: 'type', cacheName: meta.cacheName, typeName: typeName, children: columns }; }); if (!_.isEmpty(cacheTypes)) @@ -285,11 +273,11 @@ router.post('/testdrive/sql', function (req, res) { var client = _client(req, res); if (client) { - client.enableTestDriveSQL(function (err, drivers) { + client.enableTestDriveSQL(function (err, enabled) { if (err) return res.status(500).send(err); - res.sendStatus(200); + res.status(200).send(enabled); }); } }); http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade b/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade index 994cf20..260a10e 100644 --- a/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade +++ b/modules/control-center-web/src/main/js/views/sql/cache-metadata.jade @@ -22,7 +22,9 @@ span(ng-switch='' on='node.type') span(ng-switch-when='type' ng-dblclick='dblclickMetadata(paragraph, node)') i.fa.fa-table - label.clickable {{node.name}} + label.clickable {{node.displayMame}} + span(ng-switch-when='plain') + label {{node.name}} span(ng-switch-when='field' ng-dblclick='dblclickMetadata(paragraph, node)') i.fa(ng-class='node.system ? "fa-file-text-o" : "fa-file-o"') label.clickable {{node.name}} [{{node.clazz}}] http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/views/sql/sql.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/sql/sql.jade b/modules/control-center-web/src/main/js/views/sql/sql.jade index beb8137..bd76b93 100644 --- a/modules/control-center-web/src/main/js/views/sql/sql.jade +++ b/modules/control-center-web/src/main/js/views/sql/sql.jade @@ -110,7 +110,7 @@ mixin chart-settings(mdl) lable.labelField.labelFormField Caches: i.fa.fa-database.tipField(title='Click to show cache types metadata dialog' bs-popover data-template-url='/sql/cache-metadata.html', data-placement='bottom', data-trigger='click') .input-tip - input.form-control(type='text' st-search placeholder='Filter caches...') + input.form-control(type='text' st-search='name' placeholder='Filter caches...') table.links tbody.scrollable-y(style='max-height: 15em;display:block;' ng-model='paragraph.cacheName' bs-radio-group) tr(ng-repeat='cache in displayedCaches track by cache.name') http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/views/templates/agent-download.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/templates/agent-download.jade b/modules/control-center-web/src/main/js/views/templates/agent-download.jade index aef3ae7..4138a2f 100644 --- a/modules/control-center-web/src/main/js/views/templates/agent-download.jade +++ b/modules/control-center-web/src/main/js/views/templates/agent-download.jade @@ -14,7 +14,7 @@ .modal.center(tabindex='-1' role='dialog') .modal-dialog - .modal-content(dw-loading='loadingAgent' dw-loading-options='loadingAgentOptions') + .modal-content(dw-loading='startTestDriveSQL' dw-loading-options='loadingOptions') #errors-container.modal-header.header h4.modal-title(ng-if='!nodeFailedConnection') Connection to Ignite Web Agent is not established h4.modal-title(ng-if='nodeFailedConnection') Connection to Ignite Node is not established @@ -28,8 +28,6 @@ b ignite-web-agent li For list of options, run b ignite-web-agent.{sh|bat} --help - li To test drive, run - b ignite-web-agent.{sh|bat} {{::agentTestDriveOption}} li Refer to b README.txt | for more information @@ -42,7 +40,7 @@ i.tipLabel.fa.fa-clipboard(ng-click-copy='{{user.token}}' bs-tooltip='' data-title='Copy security token to clipboard') i.tipLabel.fa.fa-question-circle(ng-if=lines bs-tooltip='' data-title='The security token is used for authorization of web agent') .agent-download(ng-if='nodeFailedConnection') - p Connection to Ignite Web Agent is established but agent failed to connect to Ignite Node + p Connection to Ignite Web Agent is established, but agent failed to connect to Ignite Node p Please check the following: ul li Ignite Grid is up and running @@ -52,6 +50,6 @@ b README.txt | in agent folder for more information .modal-footer - button.btn.btn-default(ng-click='goBack()') Back to {{::agentDownloadBackTo}} - button.btn.btn-primary(ng-if='nodeFailedConnection' ng-click='enableTestDriveSQL()') Start test-drive sql + button.btn.btn-default(ng-click='back()') {{::backText}} + button.btn.btn-primary(ng-if='nodeFailedConnection' ng-click='enableTestDriveSQL()') Start demo button.btn.btn-primary(ng-if='!nodeFailedConnection' ng-click='downloadAgent()') Download zip http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/views/templates/batch-confirm.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/templates/batch-confirm.jade b/modules/control-center-web/src/main/js/views/templates/batch-confirm.jade index c3ca4b4..7451314 100644 --- a/modules/control-center-web/src/main/js/views/templates/batch-confirm.jade +++ b/modules/control-center-web/src/main/js/views/templates/batch-confirm.jade @@ -20,13 +20,13 @@ .modal-header button.close(ng-click='cancel()' aria-hidden='true') × h4.modal-title Confirmation - .modal-body(ng-show='batchConfirm.content') - p(ng-bind-html='batchConfirm.content' style='text-align: center') + .modal-body(ng-show='content') + p(ng-bind-html='content' style='text-align: center') .modal-footer .checkbox.labelField label - input(type='checkbox' ng-model='batchConfirm.applyToAll') + input(type='checkbox' ng-model='applyToAll') | Apply to all - button.btn.btn-default(id='batch-confirm-btn-cancel' ng-click='batchConfirm.cancel()') Cancel - button.btn.btn-default(id='batch-confirm-btn-skip' ng-click='batchConfirm.skip()') Skip - button.btn.btn-primary(id='batch-confirm-btn-overwrite' ng-click='batchConfirm.overwrite()') Overwrite + button.btn.btn-default(id='batch-confirm-btn-cancel' ng-click='cancel()') Cancel + button.btn.btn-default(id='batch-confirm-btn-skip' ng-click='skip(applyToAll)') Skip + button.btn.btn-primary(id='batch-confirm-btn-overwrite' ng-click='overwrite(applyToAll)') Overwrite http://git-wip-us.apache.org/repos/asf/ignite/blob/fda717c2/modules/control-center-web/src/main/js/views/templates/clone.jade ---------------------------------------------------------------------- diff --git a/modules/control-center-web/src/main/js/views/templates/clone.jade b/modules/control-center-web/src/main/js/views/templates/clone.jade index be33821..9628cc5 100644 --- a/modules/control-center-web/src/main/js/views/templates/clone.jade +++ b/modules/control-center-web/src/main/js/views/templates/clone.jade @@ -20,8 +20,7 @@ .modal-header button.close(ng-click='$hide()') × h4.modal-title Clone - form.form-horizontal(name='ui.inputForm' novalidate) - .modal-body.row + form.form-horizontal.modal-body.row(name='ui.inputForm' novalidate) .login .col-sm-3 label.required.labelFormField New name:
