Add version number to UI
This commit is contained in:
committed by
Lauri Kasanen
parent
4fd1f19f3b
commit
71fa476514
@@ -647,6 +647,16 @@ select:active {
|
|||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Version */
|
||||||
|
|
||||||
|
.noVNC_version_wrapper {
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noVNC_version {
|
||||||
|
margin-left: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* Connection Controls */
|
/* Connection Controls */
|
||||||
:root:not(.noVNC_connected) #noVNC_disconnect_button {
|
:root:not(.noVNC_connected) #noVNC_disconnect_button {
|
||||||
display: none;
|
display: none;
|
||||||
|
|||||||
@@ -82,6 +82,17 @@ const UI = {
|
|||||||
// Translate the DOM
|
// Translate the DOM
|
||||||
l10n.translateDOM();
|
l10n.translateDOM();
|
||||||
|
|
||||||
|
WebUtil.fetchJSON('../package.json')
|
||||||
|
.then((packageInfo) => {
|
||||||
|
Array.from(document.getElementsByClassName('noVNC_version')).forEach(el => el.innerText = packageInfo.version);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
Log.Error("Couldn't fetch package.json: " + err);
|
||||||
|
Array.from(document.getElementsByClassName('noVNC_version_wrapper'))
|
||||||
|
.concat(Array.from(document.getElementsByClassName('noVNC_version_separator')))
|
||||||
|
.forEach(el => el.style.display = 'none');
|
||||||
|
});
|
||||||
|
|
||||||
// Adapt the interface for touch screen devices
|
// Adapt the interface for touch screen devices
|
||||||
if (isTouchDevice) {
|
if (isTouchDevice) {
|
||||||
document.documentElement.classList.add("noVNC_touch");
|
document.documentElement.classList.add("noVNC_touch");
|
||||||
|
|||||||
@@ -307,6 +307,11 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul></div>
|
</ul></div>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="noVNC_version_separator"><hr></li>
|
||||||
|
<li class="noVNC_version_wrapper">
|
||||||
|
<span>Version:</span>
|
||||||
|
<span class="noVNC_version"></span>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user