|
11 | 11 | import com.intellij.openapi.progress.ProgressManager; |
12 | 12 | import com.intellij.openapi.project.Project; |
13 | 13 | import com.microsoft.azure.toolkit.ide.appservice.webapp.model.WebAppConfig; |
| 14 | +import com.microsoft.azure.toolkit.intellij.common.RunProcessHandlerMessenger; |
14 | 15 | import com.microsoft.azure.toolkit.intellij.legacy.webapp.WebAppCreationDialog; |
15 | 16 | import com.microsoft.azure.toolkit.lib.appservice.webapp.WebApp; |
16 | 17 | import com.microsoft.azure.toolkit.lib.common.action.Action; |
|
19 | 20 | import com.microsoft.azure.toolkit.lib.common.cache.CacheManager; |
20 | 21 | import com.microsoft.azure.toolkit.lib.common.messager.AzureMessager; |
21 | 22 | import com.microsoft.azure.toolkit.lib.common.operation.AzureOperation; |
| 23 | +import com.microsoft.azure.toolkit.lib.common.operation.OperationContext; |
22 | 24 | import com.microsoft.azure.toolkit.lib.common.task.AzureTask; |
23 | 25 | import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager; |
24 | 26 | import com.microsoft.azure.toolkit.lib.legacy.webapp.WebAppService; |
@@ -78,22 +80,25 @@ private static Single<WebApp> createWebApp(final WebAppConfig config) { |
78 | 80 |
|
79 | 81 | @AzureOperation(name = "webapp.deploy_artifact.app", params = {"webapp.name()"}, type = AzureOperation.Type.ACTION) |
80 | 82 | private static void deploy(final WebApp webapp, final Path application, final Project project) { |
81 | | - final AzureString title = description("webapp.deploy_artifact.app", webapp.name()); |
| 83 | + final AzureString title = description("webapp.deploy_artifact.app", webapp.getName()); |
82 | 84 | final AzureTask<Void> task = new AzureTask<>(null, title, false, () -> { |
83 | 85 | ProgressManager.getInstance().getProgressIndicator().setIndeterminate(true); |
84 | 86 | final RunProcessHandler processHandler = new RunProcessHandler(); |
85 | 87 | processHandler.addDefaultListener(); |
86 | 88 | final ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole(); |
87 | 89 | processHandler.startNotify(); |
88 | 90 | consoleView.attachToProcess(processHandler); |
| 91 | + |
| 92 | + final RunProcessHandlerMessenger messenger = new RunProcessHandlerMessenger(processHandler); |
| 93 | + OperationContext.current().setMessager(messenger); |
89 | 94 | AzureWebAppMvpModel.getInstance().deployArtifactsToWebApp(webapp, application.toFile(), true, processHandler); |
90 | 95 | }); |
91 | | - AzureTaskManager.getInstance().runInModalAsObservable(task).single().subscribe((none) -> notifyDeploymentSuccess(webapp)); // let root exception handler to show the error. |
| 96 | + AzureTaskManager.getInstance().runInBackgroundAsObservable(task).single().subscribe((none) -> notifyDeploymentSuccess(webapp)); // let root exception handler to show the error. |
92 | 97 | } |
93 | 98 |
|
94 | 99 | private static void notifyDeploymentSuccess(final WebApp app) { |
95 | 100 | final String title = message("webapp.deploy.success.title"); |
96 | | - final String message = message("webapp.deploy.success.message", app.name()); |
| 101 | + final String message = message("webapp.deploy.success.message", app.getName()); |
97 | 102 | AzureMessager.getMessager().success(message, title); |
98 | 103 | } |
99 | 104 | } |
0 commit comments