diff --git a/Protest/Front/deviceview.js b/Protest/Front/deviceview.js index 10ab56c0..f691b02b 100644 --- a/Protest/Front/deviceview.js +++ b/Protest/Front/deviceview.js @@ -902,7 +902,7 @@ class DeviceView extends View { const json = JSON.parse(event.data); if (json.info) { - this.CreateInfo(json.info); + this.CreateInfo(json.info, json.source); } else if (json.warning) { this.CreateWarning(json.warning); @@ -986,6 +986,9 @@ class DeviceView extends View { if (found) { LOADER.OpenUserByFile(found); } + else { + this.ConfirmBox("User don't exist in users list", true, "mono/user.svg"); + } }; } }; diff --git a/Protest/Front/userview.js b/Protest/Front/userview.js index 669798a1..42529f08 100644 --- a/Protest/Front/userview.js +++ b/Protest/Front/userview.js @@ -152,7 +152,7 @@ class UserView extends View { const json = JSON.parse(event.data); if (json.info) { - this.CreateInfo(json.info); + this.CreateInfo(json.info, json.source); } else if (json.warning) { this.CreateWarning(json.warning); diff --git a/Protest/Front/view.css b/Protest/Front/view.css index af76f698..ba99bfed 100644 --- a/Protest/Front/view.css +++ b/Protest/Front/view.css @@ -602,7 +602,7 @@ button.view-live-button:active { .view-warning-box { font-weight: 600; margin: 0 0 4px 0; - padding: 6px 0px 6px 36px; + padding: 6px 0 6px 36px; border-radius: 4px; background-position: 4px center; background-size: 24px 24px; @@ -622,6 +622,21 @@ button.view-live-button:active { background-image: url(mono/warning.svg); } +.view-info-box[source]::before, +.view-warning-box[source]::before { /*source*/ + content: attr(source); + right: 8px; + width: 80px; + color: var(--clr-dark); + background-color: #c0c0c0; + border-radius: 4px; + padding: 0 4px; + margin: 0 8px 0 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + .view-side-tools { position: absolute; left: 4px; diff --git a/Protest/Front/view.js b/Protest/Front/view.js index de0a0a5c..0ea938cf 100644 --- a/Protest/Front/view.js +++ b/Protest/Front/view.js @@ -411,18 +411,20 @@ class View extends Window { }; } - CreateInfo(text) { + CreateInfo(text, source) { const info = document.createElement("div"); info.className = "view-info-box"; info.textContent = text; + info.setAttribute("source", source); this.liveB.append(info); return info; } - CreateWarning(text) { + CreateWarning(text, source) { const warning = document.createElement("div"); warning.className = "view-warning-box"; warning.textContent = text; + warning.setAttribute("source", source); this.liveB.prepend(warning); return warning; }