[AT-785] static route moved under 'static' path as it interfier with luc hierarchy rout

GitOrigin-RevId: 996c3650622ce3519e2e0b24031036920956fb01
This commit is contained in:
eugene.nizienko
2024-02-21 15:20:39 +01:00
committed by intellij-monorepo-bot
parent 723b441b94
commit 034d2087e9
4 changed files with 8 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ internal class UiHierarchyWebService : RestService() {
val component = UiHierarchyWebServiceExtension.EP_NAME.extensionList.firstNotNullOf { it.getComponentById(id) } val component = UiHierarchyWebServiceExtension.EP_NAME.extensionList.firstNotNullOf { it.getComponentById(id) }
partialHierarchy(component) partialHierarchy(component)
} }
static() static("/static")
} }
private fun partialHierarchy(component: Component): String { private fun partialHierarchy(component: Component): String {

View File

@@ -17,8 +17,8 @@ internal class Routing(private val uriPrefix: String) {
handlers.add(PathHandler(HttpMethod.POST, uriPrefix + path, handler)) handlers.add(PathHandler(HttpMethod.POST, uriPrefix + path, handler))
} }
fun static() { fun static(path: String) {
handlers.add(StaticHandler(uriPrefix)) handlers.add(StaticHandler(uriPrefix + path))
} }
fun handleRequest(urlDecoder: QueryStringDecoder, request: FullHttpRequest, context: ChannelHandlerContext): Any { fun handleRequest(urlDecoder: QueryStringDecoder, request: FullHttpRequest, context: ChannelHandlerContext): Any {

View File

@@ -319,7 +319,7 @@ internal class XpathDataModelCreator(private val textToKeyCache: TextToKeyCache,
fun Element.addIcon(iconName: String, size: Int, onClickFunction: String) { fun Element.addIcon(iconName: String, size: Int, onClickFunction: String) {
val doc = this.ownerDocument val doc = this.ownerDocument
val icon = doc.createElement("img") val icon = doc.createElement("img")
icon.setAttribute("src", "img/$iconName.png") icon.setAttribute("src", "static/img/$iconName.png")
icon.setAttribute("width", size.toString()) icon.setAttribute("width", size.toString())
icon.setAttribute("height", size.toString()) icon.setAttribute("height", size.toString())

View File

@@ -13,11 +13,11 @@ import javax.xml.transform.stream.StreamResult
internal fun Document.convertToHtml(): String { internal fun Document.convertToHtml(): String {
return try { return try {
val sw = StringWriter() val sw = StringWriter()
sw.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">") sw.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"static/styles.css\">")
sw.append("<script src=\"scripts.js\"></script>\n") sw.append("<script src=\"static/scripts.js\"></script>\n")
sw.append("<script src=\"xpathEditor.js\"></script>\n") sw.append("<script src=\"static/xpathEditor.js\"></script>\n")
sw.append("<script src=\"updateButton.js\"></script>\n") sw.append("<script src=\"static/updateButton.js\"></script>\n")
sw.append("<div id=\"updateButton\"></div>\n") sw.append("<div id=\"updateButton\"></div>\n")
val tf = TransformerFactory.newInstance() val tf = TransformerFactory.newInstance()