-
+
)
- renderInstances = () => (
+ renderPrefButtons = () => <>
+
+ {!this.isNew && (
+
+ )}
+
+
+
{this.state.error}
+ >
+
+ renderInstances = () => !this.isNew && (
-
Instances
+ {this.state.instances.length > 0 ? "Instances" : "No instances :("}
{this.state.instances.map(instance => (
{instance.id}
@@ -241,28 +247,14 @@ class Client extends Component {
)
- renderInfoContainer = () => (
-
- {this.renderPreferences()}
-
- {!this.isNew && (
-
- )}
-
-
-
{this.state.error}
- {this.renderInstances()}
-
- )
-
render() {
return
- {!this.isNew && this.renderSidebar()}
- {this.renderInfoContainer()}
+ {this.renderSidebar()}
+
+ {this.renderPreferences()}
+ {this.renderPrefButtons()}
+ {this.renderInstances()}
+
}
}
diff --git a/maubot/management/frontend/src/style/base/body.sass b/maubot/management/frontend/src/style/base/body.sass
index ba0406b..c30dd67 100644
--- a/maubot/management/frontend/src/style/base/body.sass
+++ b/maubot/management/frontend/src/style/base/body.sass
@@ -34,34 +34,6 @@ body
right: 0
background-color: $background-dark
- > *
- background-color: $background
-
.maubot-loading
margin-top: 10rem
width: 10rem
-
-//.lindeb
- > header
- position: absolute
- top: 0
- height: $header-height
- left: 0
- right: 0
-
- > main
- position: absolute
- top: $header-height
- bottom: 0
- left: 0
- right: 0
-
- text-align: center
-
- > .lindeb-content
- text-align: left
- display: inline-block
- width: 100%
- max-width: $max-width
- box-sizing: border-box
- padding: 0 1rem
diff --git a/maubot/management/frontend/src/style/base/elements.sass b/maubot/management/frontend/src/style/base/elements.sass
index 6270aba..99a6e5e 100644
--- a/maubot/management/frontend/src/style/base/elements.sass
+++ b/maubot/management/frontend/src/style/base/elements.sass
@@ -22,7 +22,7 @@
background-color: $background
border: none
border-radius: .25rem
- color: $inverted-text-color
+ color: $text-color
box-sizing: border-box
font-size: 1rem
diff --git a/maubot/management/frontend/src/style/lib/switch.sass b/maubot/management/frontend/src/style/lib/switch.sass
index 570320c..ac18689 100644
--- a/maubot/management/frontend/src/style/lib/switch.sass
+++ b/maubot/management/frontend/src/style/lib/switch.sass
@@ -37,7 +37,7 @@
transition: .5s
text-align: center
- color: $inverted-text-color
+ color: $text-color
border-radius: .15rem 0 0 .15rem
background-color: $primary
@@ -50,7 +50,7 @@
text-align: center
vertical-align: middle
- color: $inverted-text-color
+ color: $text-color
font-size: 1rem
user-select: none
@@ -67,14 +67,9 @@
transform: translateX(100%)
border-radius: 0 .15rem .15rem 0
- background-color: $primary
.on
display: inline
.off
display: none
-
-
-
-
diff --git a/maubot/management/frontend/src/style/pages/client/instances.sass b/maubot/management/frontend/src/style/pages/client/instances.sass
index 7d5fb3c..24c5407 100644
--- a/maubot/management/frontend/src/style/pages/client/instances.sass
+++ b/maubot/management/frontend/src/style/pages/client/instances.sass
@@ -32,5 +32,4 @@
border: 1px solid $primary
&:hover
- color: $inverted-text-color
background-color: $primary
diff --git a/maubot/management/frontend/src/style/pages/dashboard.sass b/maubot/management/frontend/src/style/pages/dashboard.sass
index 8ec9563..9eb8ecb 100644
--- a/maubot/management/frontend/src/style/pages/dashboard.sass
+++ b/maubot/management/frontend/src/style/pages/dashboard.sass
@@ -21,6 +21,7 @@
max-width: 60rem
margin: auto
box-shadow: 0 .5rem .5rem rgba(0, 0, 0, 0.5)
+ background-color: $background
> a.title
grid-area: title
diff --git a/maubot/management/frontend/src/style/pages/sidebar.sass b/maubot/management/frontend/src/style/pages/sidebar.sass
index 8015e1a..c086714 100644
--- a/maubot/management/frontend/src/style/pages/sidebar.sass
+++ b/maubot/management/frontend/src/style/pages/sidebar.sass
@@ -29,9 +29,8 @@
div.title
h2
- margin: 0
display: inline-block
-
+ margin: 0 0 .25rem 0
font-size: 1.25rem
a
diff --git a/maubot/server.py b/maubot/server.py
index 501677a..5788d8a 100644
--- a/maubot/server.py
+++ b/maubot/server.py
@@ -13,16 +13,25 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see
.
-from aiohttp import web
import logging
import asyncio
+from aiohttp import web
+from aiohttp.abc import AbstractAccessLogger
+
from mautrix.api import PathBuilder, Method
from .config import Config
from .__meta__ import __version__
+class AccessLogger(AbstractAccessLogger):
+ def log(self, request: web.Request, response: web.Response, time: int):
+ self.logger.info(f'{request.remote} "{request.method} {request.path} '
+ f'{response.status} {response.body_length} '
+ f'in {round(time, 4)}s"')
+
+
class MaubotServer:
log: logging.Logger = logging.getLogger("maubot.server")
@@ -39,7 +48,7 @@ class MaubotServer:
as_path = PathBuilder(config["server.appservice_base_path"])
self.add_route(Method.PUT, as_path.transactions, self.handle_transaction)
- self.runner = web.AppRunner(self.app)
+ self.runner = web.AppRunner(self.app, access_log_class=AccessLogger)
def add_route(self, method: Method, path: PathBuilder, handler) -> None:
self.app.router.add_route(method.value, str(path), handler)