-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev UI make sure to work on custom http root
Signed-off-by: Phillip Kruger <[email protected]>
- Loading branch information
1 parent
a4f329b
commit e184046
Showing
10 changed files
with
105 additions
and
47 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
50 changes: 50 additions & 0 deletions
50
extensions/vertx-http/dev-ui-resources/src/main/resources/dev-ui/qui/qui-code-block.js
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import {LitElement, html, css} from 'lit'; | ||
|
||
import { observeState } from 'lit-element-state'; | ||
import { themeState } from 'theme-state'; | ||
import '@vanillawc/wc-codemirror'; | ||
import '@vanillawc/wc-codemirror/mode/yaml/yaml.js'; | ||
import '@vanillawc/wc-codemirror/mode/properties/properties.js'; | ||
import '@vanillawc/wc-codemirror/mode/javascript/javascript.js'; | ||
|
||
export class QuiCodeBlock extends observeState(LitElement) { | ||
|
||
static styles = css``; | ||
|
||
static properties = { | ||
mode: {type: String}, // yaml / js / etc | ||
src: {type: String}, // src (optional) | ||
content: {type: String} // content (optional) | ||
}; | ||
|
||
constructor() { | ||
super(); | ||
this.mode = null; | ||
this.src = null; | ||
this.content = null; | ||
} | ||
|
||
render() { | ||
let currentPath = window.location.pathname; | ||
currentPath = currentPath.substring(0, currentPath.indexOf('/dev')); | ||
|
||
if(this.src){ | ||
return html`<wc-codemirror mode='${this.mode}' | ||
src='${this.src}' | ||
theme='base16-${themeState.theme.name}' | ||
readonly> | ||
<link rel='stylesheet' href='${currentPath}/_static/wc-codemirror/theme/base16-${themeState.theme.name}.css'> | ||
</wc-codemirror>`; | ||
}else if(this.content){ | ||
return html`<wc-codemirror mode='${this.mode}' | ||
theme='base16-${themeState.theme.name}' | ||
readonly> | ||
<link rel='stylesheet' href='${currentPath}/_static/wc-codemirror/theme/base16-${themeState.theme.name}.css'> | ||
<script type='wc-content'>${this.content}</script> | ||
</wc-codemirror>`; | ||
} | ||
} | ||
|
||
} | ||
|
||
customElements.define('qui-code-block', QuiCodeBlock); |
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