mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 22:44:21 +01:00
Display port
This commit is contained in:
@@ -67,6 +67,13 @@ customElements.define('developer-tooling', class extends HTMLElement {
|
|||||||
float:right;
|
float:right;
|
||||||
max-width:40%;
|
max-width:40%;
|
||||||
}
|
}
|
||||||
|
#server-message {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
|
#server-message.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
h2 { margin: 0 }
|
h2 { margin: 0 }
|
||||||
p {
|
p {
|
||||||
@@ -136,6 +143,9 @@ customElements.define('developer-tooling', class extends HTMLElement {
|
|||||||
<h2>Apps</h2>
|
<h2>Apps</h2>
|
||||||
<h3 id="no-apps">No apps added. Add an inspect key to start debugging.</h3>
|
<h3 id="no-apps">No apps added. Add an inspect key to start debugging.</h3>
|
||||||
<div id="apps"></div>
|
<div id="apps"></div>
|
||||||
|
<div id="server-message" class="hidden">
|
||||||
|
Pear DevTools connection running on <span id="server-location">localhost</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -199,6 +209,11 @@ customElements.define('developer-tooling', class extends HTMLElement {
|
|||||||
} else {
|
} else {
|
||||||
this.noAppsElem.classList.remove('hidden')
|
this.noAppsElem.classList.remove('hidden')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.port) {
|
||||||
|
this.root.querySelector('#server-location').textContent = `location:${this.port}`
|
||||||
|
this.root.querySelector('#server-message').classList.remove('hidden')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addApp (inspectorKey) {
|
addApp (inspectorKey) {
|
||||||
@@ -242,6 +257,7 @@ customElements.define('developer-tooling', class extends HTMLElement {
|
|||||||
devtoolsHttpServer.listen(0, () => {
|
devtoolsHttpServer.listen(0, () => {
|
||||||
this.port = devtoolsHttpServer.address().port
|
this.port = devtoolsHttpServer.address().port
|
||||||
console.log(`[devtoolsHttpServer] running on port ${this.port}`)
|
console.log(`[devtoolsHttpServer] running on port ${this.port}`)
|
||||||
|
this.render()
|
||||||
})
|
})
|
||||||
devtoolsHttpServer.on('request', (req, res) => {
|
devtoolsHttpServer.on('request', (req, res) => {
|
||||||
if (req.url !== '/json/list') {
|
if (req.url !== '/json/list') {
|
||||||
|
|||||||
Reference in New Issue
Block a user