diff --git a/deploy.sh b/deploy.sh index d45c23c..5faa24f 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,16 +1,27 @@ #!/bin/bash + set -e -if [ "$(hostname)" = "stein2" ]; then - echo "stein2 is not allowed to do this" +_hostname=$(hostname) + +if [ "$_hostname" = "stein2" ]; then + cd /home/node/.openclaw/workspace/projects/gott +elif [ "$_hostname" = "meleki" ]; then + cd ~/.openclaw/workspace/projects/gott +else + echo "$_hostname: deployment not allowed" exit fi export PATH="$HOME/.dotnet:$PATH" -cd ~/.openclaw/workspace/projects/gott dotnet publish -c Release -o publish cp wwwroot/index.html publish/wwwroot/index.html -ssh -o ConnectTimeout=5 meleki@192.168.100.200 "nohup sudo systemctl restart gott > /dev/null 2>&1 &" +if [ "$_hostname" = "stein2" ]; then + systemctl restart gott +elif [ "$_hostname" = "meleki" ]; then + ssh -o ConnectTimeout=5 meleki@192.168.100.200 "nohup sudo systemctl restart gott > /dev/null 2>&1 &" +fi + echo "Service restarted" diff --git a/gott.csproj b/gott.csproj index d617c3e..00bc08f 100755 --- a/gott.csproj +++ b/gott.csproj @@ -1,7 +1,7 @@  - net10.0 + net9.0 ASP0015;IDE0017;IDE0028;IDE0130;IDE0305;IDE1006;SYSLIB1045 @@ -19,10 +19,10 @@ - - - - + + + + diff --git a/wwwroot/css/chat.css b/wwwroot/css/chat.css index 3053f61..c158c3d 100644 --- a/wwwroot/css/chat.css +++ b/wwwroot/css/chat.css @@ -1,3 +1,45 @@ +/* Header Menu */ + +.header-menu { + position: relative; + margin-left: auto; +} + +.header-menu-trigger { + padding: var(--s1) var(--s2); + line-height: 1; +} + +.header-menu-dropdown { + position: absolute; + top: 100%; + right: 0; + margin-top: var(--s1); + background: var(--f3-bg); + border: var(--border-width) solid var(--f3-border); + min-width: 10em; + z-index: 100; + display: flex; + flex-direction: column; +} + +.header-menu-dropdown[hidden] { + display: none; +} + +.header-menu-item { + border: none; + text-align: left; + padding: var(--s2) var(--s3); + background: none; + white-space: nowrap; +} + +.header-menu-item:not(:disabled):hover { + background: var(--f2-bg); + border: none; +} + #chat { flex: 1; overflow-y: auto; @@ -56,10 +98,10 @@ } .tool-box { - align-self: center; padding: var(--s2); background: var(--f3-bg); border: var(--border-width) solid var(--f3-border); + opacity: 0.5; } .input-area { diff --git a/wwwroot/index.html b/wwwroot/index.html index f15d885..c6232ad 100644 --- a/wwwroot/index.html +++ b/wwwroot/index.html @@ -122,7 +122,12 @@

-

- +
+ + +
diff --git a/wwwroot/js/pages/chat-page.js b/wwwroot/js/pages/chat-page.js index ab75eef..2be5d97 100644 --- a/wwwroot/js/pages/chat-page.js +++ b/wwwroot/js/pages/chat-page.js @@ -93,9 +93,25 @@ registerPage('chat', { }); } + // Header-Menü (3-Dot) + const chatMenuBtn = document.getElementById('chatMenuBtn'); + const chatMenuDropdown = document.getElementById('chatMenuDropdown'); + if (chatMenuBtn && chatMenuDropdown) { + chatMenuBtn.addEventListener('click', (e) => { + e.stopPropagation(); + chatMenuDropdown.hidden = !chatMenuDropdown.hidden; + }); + document.addEventListener('click', this._closeMenu = () => { + chatMenuDropdown.hidden = true; + }); + } + // Archivieren const archiveBtn = document.getElementById('archiveBtn'); - if (archiveBtn) archiveBtn.addEventListener('click', clearChat); + if (archiveBtn) archiveBtn.addEventListener('click', () => { + if (chatMenuDropdown) chatMenuDropdown.hidden = true; + clearChat(); + }); // State zurücksetzen und History laden messages.length = 0; @@ -107,6 +123,10 @@ registerPage('chat', { }, destroy() { + if (this._closeMenu) { + document.removeEventListener('click', this._closeMenu); + this._closeMenu = null; + } stopHistoryPolling(); messages.length = 0; lastKnownMessageId = 0;