Statistics for Uploading SSH key
authorAndrey Vokin <andrey.vokin@jetbrains.com>
Tue, 13 Jan 2015 11:55:36 +0000 (14:55 +0300)
committerAndrey Vokin <andrey.vokin@jetbrains.com>
Fri, 16 Jan 2015 11:26:27 +0000 (14:26 +0300)
platform/remote-servers/impl/resources/resources/cloud.properties
platform/remote-servers/impl/resources/tips/UploadSshKey.html [new file with mode: 0644]
platform/remote-servers/impl/resources/tips/images/SSHKeyUpload.png [new file with mode: 0644]
platform/remote-servers/impl/src/META-INF/RemoteServers.xml
platform/remote-servers/impl/src/com/intellij/remoteServer/statistics/CloudFeaturesProvider.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/SshKeyChecker.java

index 38329f10f163a0dc1d8a086dc8a42632d3aa79f7..6e2ce1a1c4f151c0e40a39c4960cf3dbdb94d81f 100644 (file)
@@ -12,3 +12,5 @@ choose.account.wizzard.title={0} deployment run configuration
 cloud.support={0} Support
 cloud.support.added=Finished adding {0} support\!
 detect.module.structure=Detecting {0} module structure
+group.display.name=Clouds
+upload.ssh.key.display.name=Upload SSH key
\ No newline at end of file
diff --git a/platform/remote-servers/impl/resources/tips/UploadSshKey.html b/platform/remote-servers/impl/resources/tips/UploadSshKey.html
new file mode 100644 (file)
index 0000000..0558e7b
--- /dev/null
@@ -0,0 +1,11 @@
+<html>
+<head>
+  <link rel="stylesheet" type="text/css" href="css/tips.css">
+</head>
+<body>
+<p>
+  Uploading SSH key to the cloud
+</p>
+<p class="image"><img src="images/SSHKeyUpload.png"></p>
+</body>
+</html>
\ No newline at end of file
diff --git a/platform/remote-servers/impl/resources/tips/images/SSHKeyUpload.png b/platform/remote-servers/impl/resources/tips/images/SSHKeyUpload.png
new file mode 100644 (file)
index 0000000..adb8dfe
Binary files /dev/null and b/platform/remote-servers/impl/resources/tips/images/SSHKeyUpload.png differ
index 64d832417ef6f7c081896d57ff831114727ba34c..287c8c945af89c87ba9989006aeb6f1194e584b6 100644 (file)
@@ -27,6 +27,8 @@
     <projectService serviceInterface="com.intellij.remoteServer.configuration.deployment.DeploymentConfigurationManager"
                     serviceImplementation="com.intellij.remoteServer.impl.configuration.deployment.DeploymentConfigurationManagerImpl"/>
     <remoteServer.deploymentSource.type implementation="com.intellij.remoteServer.impl.configuration.deployment.ModuleDeploymentSourceType"/>
+
+    <productivityFeaturesProvider implementation="com.intellij.remoteServer.statistics.CloudFeaturesProvider"/>
   </extensions>
   <application-components>
     <component>
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/statistics/CloudFeaturesProvider.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/statistics/CloudFeaturesProvider.java
new file mode 100644 (file)
index 0000000..befcd03
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed 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.
+ */
+package com.intellij.remoteServer.statistics;
+
+import com.intellij.featureStatistics.ApplicabilityFilter;
+import com.intellij.featureStatistics.FeatureDescriptor;
+import com.intellij.featureStatistics.GroupDescriptor;
+import com.intellij.featureStatistics.ProductivityFeaturesProvider;
+import com.intellij.remoteServer.util.CloudBundle;
+
+import java.util.Collections;
+
+public class CloudFeaturesProvider extends ProductivityFeaturesProvider {
+  public static final String CLOUDS_GROUP_ID = "clouds";
+  public static final String UPLOAD_SSH_KEY_FEATURE_ID = "upload.ssh.key";
+
+  @Override
+  public FeatureDescriptor[] getFeatureDescriptors() {
+    return new FeatureDescriptor[]{new FeatureDescriptor(UPLOAD_SSH_KEY_FEATURE_ID,
+                                                         CLOUDS_GROUP_ID,
+                                                         "UploadSshKey.html",
+                                                         CloudBundle.getText("upload.ssh.key.display.name"),
+                                                         0,
+                                                         0,
+                                                         Collections.<String>emptySet(),
+                                                         0,
+                                                         this)};
+  }
+
+  @Override
+  public GroupDescriptor[] getGroupDescriptors()
+  {
+    return new GroupDescriptor[] {
+      new GroupDescriptor(CLOUDS_GROUP_ID, CloudBundle.getText("group.display.name"))
+    };
+  }
+
+  @Override
+  public ApplicabilityFilter[] getApplicabilityFilters() {
+    return new ApplicabilityFilter[0];
+  }
+}
index 1aca1ecdc4a99236983a71e1a94d2ce066849fb8..0150395732316e6562574fa382950dcdcea5f9ce 100644 (file)
@@ -16,6 +16,7 @@
 package com.intellij.remoteServer.util.ssh;
 
 import com.intellij.execution.filters.HyperlinkInfo;
+import com.intellij.featureStatistics.FeatureUsageTracker;
 import com.intellij.notification.Notification;
 import com.intellij.notification.NotificationListener;
 import com.intellij.openapi.options.ConfigurationException;
@@ -33,6 +34,7 @@ import com.intellij.remoteServer.runtime.deployment.DeploymentLogManager;
 import com.intellij.remoteServer.runtime.deployment.DeploymentTask;
 import com.intellij.remoteServer.runtime.log.LoggingHandler;
 import com.intellij.remoteServer.runtime.ui.RemoteServersView;
+import com.intellij.remoteServer.statistics.CloudFeaturesProvider;
 import com.intellij.remoteServer.util.*;
 import com.intellij.ui.HyperlinkLabel;
 import com.intellij.util.ParameterizedRunnable;
@@ -254,6 +256,7 @@ public class SshKeyChecker {
 
     @Override
     protected void uploadKey(final File sskKey) {
+      FeatureUsageTracker.getInstance().triggerFeatureUsed(CloudFeaturesProvider.UPLOAD_SSH_KEY_FEATURE_ID);
       try {
         myServerConfigurable.apply();
       }