From 73c441534bbf5864ac2274486b667d5687187ba7 Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Sat, 26 Nov 2022 13:10:37 -0300 Subject: [PATCH 1/2] improved network handling Detects if it is a CORS problem, checks for invalid saved host configuration, webui connection status indicator Signed-off-by: Victor Seiji Hariki --- css/index.css | 60 +++++++++++++++ index.html | 13 +++- js/index.js | 207 +++++++++++++++++++++++++++++++++++++++++++------- 3 files changed, 249 insertions(+), 31 deletions(-) diff --git a/css/index.css b/css/index.css index 069c7e2..0797745 100644 --- a/css/index.css +++ b/css/index.css @@ -162,6 +162,66 @@ body { text-overflow: ellipsis; } +/* Host input */ +.host-field-wrapper { + position: relative; + display: flex; + + align-items: center; + justify-content: space-between; + + width: 100%; + height: fit-content; +} + +.host-field-wrapper input { + display: block; +} + +.host-field-wrapper .connection-status { + width: 15px; + height: 15px; + + box-sizing: inherit; + + border-radius: 50%; + margin: 5px; + + cursor: pointer; + + aspect-ratio: 1; +} + +.host-field-wrapper .connection-status:hover { + width: 19px; + height: 19px; + + margin: 3px; +} + +.host-field-wrapper .connection-status:active { + width: 17px; + height: 17px; + + margin: 4px; +} + +.host-field-wrapper .connection-status.online { + background-color: #49dd49; +} + +.host-field-wrapper .connection-status.offline { + background-color: #dd4949; +} + +.host-field-wrapper .connection-status.cors-issue { + background-color: #dddd49; +} + +input#host { + box-sizing: border-box; +} + /* Prompt Fields */ div.prompt-wrapper { diff --git a/index.html b/index.html index d96db2b..dffa80b 100644 --- a/index.html +++ b/index.html @@ -28,10 +28,15 @@ openOutpaint 🐠