forked from microsoft/azure-tools-for-java
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #995 from JetBrains/endgame-202410
Merge Endgame 202410
- Loading branch information
Showing
91 changed files
with
362 additions
and
250 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
import com.microsoft.azure.toolkit.ide.common.action.ResourceCommonActionsContributor; | ||
import com.microsoft.azure.toolkit.intellij.common.TerminalUtils; | ||
import com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem; | ||
import com.microsoft.azure.toolkit.lib.appservice.model.Runtime; | ||
import com.microsoft.azure.toolkit.lib.appservice.webapp.WebApp; | ||
import com.microsoft.azure.toolkit.lib.common.action.Action; | ||
import com.microsoft.azure.toolkit.lib.common.action.AzureActionManager; | ||
|
@@ -30,6 +31,7 @@ | |
import java.io.IOException; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.AbstractList; | ||
import java.util.Optional; | ||
|
||
import static com.microsoft.azure.toolkit.intellij.common.AzureBundle.message; | ||
import static com.microsoft.azure.toolkit.lib.common.operation.OperationBundle.description; | ||
|
@@ -47,7 +49,7 @@ public class SSHIntoWebAppAction { | |
private static final String WEB_APP_DOCKER_PREFIX = "DOCKER|"; | ||
private static final String CMD_SSH_TO_LOCAL_PROXY = | ||
"ssh -o StrictHostKeyChecking=no -o \"UserKnownHostsFile /dev/null\" -o \"LogLevel ERROR\" %[email protected] -p %d"; | ||
|
||
private static final Integer TERMINAL_MAX_SIZE = 1024 * 8; | ||
private static final String WEBAPP_TERMINAL_TABLE_NAME = "SSH - %s"; | ||
private static final String RESOURCE_GROUP_PATH_PREFIX = "resourceGroups/"; | ||
private static final String RESOURCE_ELEMENT_PATTERN = "[^/]+"; | ||
|
@@ -70,7 +72,7 @@ public void execute() { | |
final AzureString title = description("user/webapp.connect_ssh.app", webAppName); | ||
AzureTaskManager.getInstance().runInBackground(new AzureTask<>(project, title, false, | ||
() -> { | ||
if (webApp.getRuntime().getOperatingSystem() == OperatingSystem.WINDOWS) { | ||
if (Optional.ofNullable(webApp.getRuntime()).map(Runtime::getOperatingSystem).orElse(null) == OperatingSystem.WINDOWS) { | ||
AzureMessager.getMessager().warning(message("webapp.ssh.windowsNotSupport")); | ||
return; | ||
} | ||
|
@@ -131,12 +133,14 @@ private static boolean waitForInputPassword(TtyConnector connector) throws Illeg | |
final int interval = 500; | ||
final int times = 30000 / interval; | ||
while (count++ < times) { | ||
final AbstractList<Byte> outputCache = (AbstractList<Byte>) FieldUtils.readField(connector, "outputCache", true); | ||
Byte[] bytes = new Byte[outputCache.size()]; | ||
bytes = outputCache.toArray(bytes); | ||
final byte[] myBuf = ArrayUtils.toPrimitive(bytes); | ||
if (myBuf != null && new String(myBuf, StandardCharsets.UTF_8).contains("password:")) { | ||
return true; | ||
try { | ||
final char[] result = new char[TERMINAL_MAX_SIZE]; | ||
connector.read(result, 0, TERMINAL_MAX_SIZE -1 ); | ||
if (new String(result).contains("password:")) { | ||
return true; | ||
} | ||
} catch (final IOException ignore) { | ||
continue; | ||
} | ||
Thread.sleep(interval); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
PluginsAndFeatures/azure-toolkit-for-intellij/azure-intellij-plugin-base/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
xmlns:xi="http://www.w3.org/2001/XInclude"> | ||
<id>com.microsoft.tooling.msservices.intellij.azure</id> | ||
<name>Azure Toolkit</name> | ||
<version>3.92.0</version> | ||
<version>3.93.0</version> | ||
<vendor email="[email protected]" url="http://www.microsoft.com">Microsoft</vendor> | ||
|
||
<description> | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...lkit-for-intellij/azure-intellij-plugin-lib-java/src/main/resources/whatsnew.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.