From d5f62e4f821b1153143a02cff6d11d60bffe86f6 Mon Sep 17 00:00:00 2001 From: Shalom Ben Zvi Kazaz Date: Wed, 11 Dec 2024 19:28:20 +0200 Subject: [PATCH] update ui --- ide-common/build.gradle.kts | 1 - .../intellij/plugin/paths/DigmaPathManager.kt | 4 --- .../plugin/updates/ui/UIVersioningService.kt | 2 -- .../DashboardSchemeHandlerFactory.java | 7 ++--- .../jcef/common/CustomResourceHandler.kt | 29 ------------------- .../ui/jcef/BaseSchemeHandlerFactory.kt | 3 -- 6 files changed, 2 insertions(+), 44 deletions(-) diff --git a/ide-common/build.gradle.kts b/ide-common/build.gradle.kts index 88d630a2a..e7aeb8ecd 100644 --- a/ide-common/build.gradle.kts +++ b/ide-common/build.gradle.kts @@ -18,7 +18,6 @@ plugins { val platformType: IntelliJPlatformType by extra(dynamicPlatformType(project)) - dependencies { api(libs.threeten) diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/paths/DigmaPathManager.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/paths/DigmaPathManager.kt index 2d73e88ec..05a021f3e 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/paths/DigmaPathManager.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/paths/DigmaPathManager.kt @@ -1,6 +1,5 @@ package org.digma.intellij.plugin.paths -import com.intellij.openapi.application.ApplicationInfo import com.intellij.openapi.application.ApplicationNamesInfo import com.intellij.openapi.application.PathManager import com.intellij.openapi.util.SystemInfo @@ -66,9 +65,6 @@ class DigmaPathManager { digmaDir.mkdirs() digmaDir } - } } - - } \ No newline at end of file diff --git a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIVersioningService.kt b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIVersioningService.kt index f264d95d0..7bc8e53ca 100644 --- a/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIVersioningService.kt +++ b/ide-common/src/main/kotlin/org/digma/intellij/plugin/updates/ui/UIVersioningService.kt @@ -441,6 +441,4 @@ class UIVersioningService(val cs: CoroutineScope) : DisposableAdaptor { tempFile.deleteIfExists() } } - - } \ No newline at end of file diff --git a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java index ba29299f0..3421294d2 100644 --- a/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java +++ b/src/main/java/org/digma/intellij/plugin/dashboard/DashboardSchemeHandlerFactory.java @@ -1,17 +1,14 @@ package org.digma.intellij.plugin.dashboard; import com.intellij.openapi.project.Project; -import org.cef.browser.CefBrowser; -import org.cef.browser.CefFrame; +import org.cef.browser.*; import org.cef.callback.CefSchemeHandlerFactory; import org.cef.handler.CefResourceHandler; import org.cef.network.CefRequest; -import org.digma.intellij.plugin.troubleshooting.*; import org.digma.intellij.plugin.updates.ui.UIResourcesService; import org.jetbrains.annotations.Nullable; -import java.net.MalformedURLException; -import java.net.URL; +import java.net.*; public class DashboardSchemeHandlerFactory implements CefSchemeHandlerFactory { diff --git a/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt b/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt index c4a4ac60f..3d79b792b 100644 --- a/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt +++ b/src/main/java/org/digma/intellij/plugin/jcef/common/CustomResourceHandler.kt @@ -21,7 +21,6 @@ import java.net.URLConnection const val INDEX_TEMPLATE_FILE_NAME: String = "indextemplate.ftl" const val BASE_PACKAGE_PATH: String = "webview/" const val IS_JAEGER_ENABLED: String = "isJaegerEnabled" -const val COMMON_FILES_FOLDER_NAME: String = "common" class CustomResourceHandler( private var domainNameName: String, @@ -55,32 +54,6 @@ class CustomResourceHandler( state = OpenedConnection(inputStream, resourceName) } } - - -// when { -// processedUrl.equals("$resourceUrlPrefix/index.html", true) -> { -// val html = loadFreemarkerTemplate(templateFolderName, indexTemplateData) -// state = StringData(html) -// } -// -// processedUrl.contains("fonts") || processedUrl.contains("images") -> { -// val pathToResource = -// processedUrl.replace(resourceUrlPrefix, "${BASE_PACKAGE_PATH}${COMMON_FILES_FOLDER_NAME}") -// val newUrl = javaClass.classLoader.getResource(pathToResource) -// if (newUrl != null) { -// state = OpenedConnection(newUrl.openConnection()) -// } -// } -// -// else -> { -// val pathToResource = -// processedUrl.replace(resourceUrlPrefix, "${BASE_PACKAGE_PATH}${resourceFolderName}") -// val newUrl = javaClass.classLoader.getResource(pathToResource) -// if (newUrl != null) { -// state = OpenedConnection(newUrl.openConnection()) -// } -// } -// } cefCallback.Continue() true } else { @@ -135,9 +108,7 @@ fun readResponse( return CustomResourceHandlerUtil.readResponse(inputStream, dataOut, designedBytesToRead, bytesRead, callback) } -//data class OpenedConnection(val connection: URLConnection) : ResourceHandlerState { data class OpenedConnection(private val inputStream: InputStream, private val resourceName: String) : ResourceHandlerState { - // private val inputStream: InputStream = connection.getInputStream() override fun getResponseHeaders(cefResponse: CefResponse, responseLength: IntRef, redirectUrl: StringRef) { try { cefResponse.mimeType = URLConnection.guessContentTypeFromName(resourceName) diff --git a/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt b/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt index 98260618b..a87774a9d 100644 --- a/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt +++ b/src/main/kotlin/org/digma/intellij/plugin/ui/jcef/BaseSchemeHandlerFactory.kt @@ -14,9 +14,6 @@ import java.net.MalformedURLException import java.net.URL -private const val COMMON_FILES_FOLDER: String = "assets" - - abstract class BaseSchemeHandlerFactory : CefSchemeHandlerFactory { private val logger: Logger = Logger.getInstance(this::class.java)