Search in sources :

Example 1 with AppServiceMonitorPanel

use of com.microsoft.azure.toolkit.intellij.appservice.AppServiceMonitorPanel in project azure-tools-for-java by Microsoft.

the class FunctionAppConfigFormPanelAdvance method createUIComponents.

private void createUIComponents() {
    // TODO: place custom component creation code here
    appServiceConfigPanelAdvanced = new AppServiceInfoAdvancedPanel<>(project, () -> FunctionAppConfig.builder().build());
    appServiceConfigPanelAdvanced.setValidRuntime(Runtime.FUNCTION_APP_RUNTIME);
    appServiceConfigPanelAdvanced.setValidPricingTier(new ArrayList<>(PricingTier.FUNCTION_PRICING), PricingTier.CONSUMPTION);
    // Function does not support file deployment
    appServiceConfigPanelAdvanced.setDeploymentVisible(false);
    insightsConfig = ApplicationInsightsConfig.builder().newCreate(true).name(appServiceConfigPanelAdvanced.getTextName().getValue()).build();
    appServiceMonitorPanel = new AppServiceMonitorPanel(project);
    appServiceMonitorPanel.setWebServerLogVisible(false);
    appServiceMonitorPanel.setData(MonitorConfig.builder().applicationInsightsConfig(insightsConfig).build());
    appServiceConfigPanelAdvanced.getSelectorSubscription().addActionListener(event -> appServiceMonitorPanel.getApplicationInsightsComboBox().setSubscription(appServiceConfigPanelAdvanced.getSelectorSubscription().getValue()));
    appServiceConfigPanelAdvanced.getSelectorRuntime().addActionListener(event -> {
        final OperatingSystem operatingSystem = Optional.ofNullable(appServiceConfigPanelAdvanced.getSelectorRuntime().getValue()).map(Runtime::getOperatingSystem).orElse(null);
        appServiceMonitorPanel.setApplicationLogVisible(operatingSystem == OperatingSystem.WINDOWS);
    });
}
Also used : OperatingSystem(com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem) AppServiceMonitorPanel(com.microsoft.azure.toolkit.intellij.appservice.AppServiceMonitorPanel)

Example 2 with AppServiceMonitorPanel

use of com.microsoft.azure.toolkit.intellij.appservice.AppServiceMonitorPanel in project azure-tools-for-java by Microsoft.

the class WebAppConfigFormPanelAdvance method createUIComponents.

private void createUIComponents() {
    // TODO: place custom component creation code here
    appServiceConfigPanelAdvanced = new AppServiceInfoAdvancedPanel(project, WebAppConfig::getWebAppDefaultConfig);
    final List<PricingTier> validPricing = AzureMvpModel.getInstance().listPricingTier();
    appServiceConfigPanelAdvanced.setValidPricingTier(validPricing, WebAppConfig.DEFAULT_PRICING_TIER);
    appServiceMonitorPanel = new AppServiceMonitorPanel(project);
    // Application Insights is not supported in Web App
    appServiceMonitorPanel.setApplicationInsightsVisible(false);
    appServiceMonitorPanel.setData(MonitorConfig.builder().build());
    appServiceConfigPanelAdvanced.getSelectorRuntime().addActionListener(event -> {
        final Runtime runtime = appServiceConfigPanelAdvanced.getSelectorRuntime().getValue();
        appServiceMonitorPanel.setApplicationLogVisible(runtime != null && runtime.getOperatingSystem() == OperatingSystem.WINDOWS);
    });
}
Also used : PricingTier(com.microsoft.azure.toolkit.lib.appservice.model.PricingTier) Runtime(com.microsoft.azure.toolkit.lib.appservice.model.Runtime) AppServiceInfoAdvancedPanel(com.microsoft.azure.toolkit.intellij.appservice.AppServiceInfoAdvancedPanel) AppServiceMonitorPanel(com.microsoft.azure.toolkit.intellij.appservice.AppServiceMonitorPanel)

Aggregations

AppServiceMonitorPanel (com.microsoft.azure.toolkit.intellij.appservice.AppServiceMonitorPanel)2 AppServiceInfoAdvancedPanel (com.microsoft.azure.toolkit.intellij.appservice.AppServiceInfoAdvancedPanel)1 OperatingSystem (com.microsoft.azure.toolkit.lib.appservice.model.OperatingSystem)1 PricingTier (com.microsoft.azure.toolkit.lib.appservice.model.PricingTier)1 Runtime (com.microsoft.azure.toolkit.lib.appservice.model.Runtime)1