Skip to content

Commit

Permalink
Make Table view scrollable.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Aug 27, 2024
1 parent 108d368 commit 66aa85e
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 36 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ lesscpy = "*"
flake8 = "*"
cryptography = "*"
gunicorn = "*"
poetry-plugin-export = "*"
ddtrace = "^2.9.1"
loguru = "^0.7.2"
poetry-plugin-export = "^1.8.0"
ddtrace = "*"
loguru = "*"

[tool.poetry.scripts]
run = "main:app"
Expand Down
1 change: 1 addition & 0 deletions pythonmyadmin/assets.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Build static assets."""

from flask import Flask
from flask_assets import Bundle, Environment

Expand Down
2 changes: 1 addition & 1 deletion pythonmyadmin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Command(db.Model):
command = db.Column(db.String(255), index=True, unique=True)
response = db.Column(db.Text, nullable=False)
type = db.Column(db.String(255), nullable=False)
created_at = db.Column(db.DateTime)
created_at = db.Column(db.DateTime, server_default=app.config["SQLALCHEMY_DATABASE_CREATED_AT"])

def __repr__(self):
return f"<Command id={self.id}, name={self.command}, type={self.type}>"
1 change: 1 addition & 0 deletions pythonmyadmin/routes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core route declaration."""

from typing import List

from flask import Blueprint
Expand Down
2 changes: 1 addition & 1 deletion pythonmyadmin/static/dist/css/style.css

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions pythonmyadmin/static/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@

body,
html {
height: 100% !important;
margin: 0;
padding: 0;
background: @background-color !important;
font-family: @body-font;
max-width: 100%;
overflow: hidden;
@media(max-width: @mobile-breakpoint) {
margin: 0;
}
Expand Down
4 changes: 2 additions & 2 deletions pythonmyadmin/static/less/nav.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ header {
display: flex;
align-items: center;
justify-content: space-between;
width: 1000px;
max-width: 1000px;
margin: auto;

@media(max-width: 800px) {
@media(max-width: 1000px) {
width: 93vw;
max-width: 93vw;
}
Expand Down
23 changes: 18 additions & 5 deletions pythonmyadmin/static/less/table.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}

th {
padding: 25px 15px !important;
padding: 20px 15px !important;
border-top: 0 !important;
border-right: 0 !important;
border-bottom: 1px solid #e5e7eb !important;
Expand All @@ -56,11 +56,11 @@
font-weight: 600 !important;

@media(max-width: 600px) {
padding: 15px !important;
padding: 15px 8px !important
}

.column-header--sort {
margin-right: 7px;
margin-right: 5px;
transition: all 0.2s ease-out;

&:hover {
Expand All @@ -69,7 +69,11 @@

svg {
width: 0.5em;
font-size: 1.6em;
font-size: 1.2em;

@media(max-width: 600px) {
font-size: 1.2em;
}
}
}

Expand Down Expand Up @@ -161,6 +165,10 @@
td[data-dash-column="type"],
th[data-dash-column="type"]{
max-width: 70px !important;

@media(max-width: 600px) {
max-width: 60px !important;
}
}

td[data-dash-column="response"],
Expand Down Expand Up @@ -206,11 +214,12 @@
padding: 0 15px !important;
height: 50px;
border-radius: 4px;
font-size: 1em;
font-size: 1.1em;

@media(max-width: 600px) {
margin-right: 8px !important;
min-width: 45vw;
font-size: .95em;
}

&::placeholder {
Expand Down Expand Up @@ -240,6 +249,10 @@
height: fit-content;
margin: auto;
padding: 10px;
@media(max-width: 600px) {
font-size: .9em;
padding: 8px;
}
}

.Select-value {
Expand Down
1 change: 1 addition & 0 deletions pythonmyadmin/tables/table_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def create_data_table(table_df: DataFrame) -> DataTable:
page_size=9000,
# editable=True,
cell_selectable=True,
markdown_options={"link_target": "_blank", "html": True},
style_cell={
"font-family": "Lato,sans-serif",
"font-size": ".85em",
Expand Down
41 changes: 19 additions & 22 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
async-timeout==4.0.3 ; python_version >= "3.10" and python_full_version < "3.11.3"
attrs==23.2.0 ; python_version >= "3.10" and python_version < "4.0"
black==23.12.1 ; python_version >= "3.10" and python_version < "4.0"
black==24.8.0 ; python_version >= "3.10" and python_version < "4.0"
blinker==1.8.2 ; python_version >= "3.10" and python_version < "4.0"
build==1.2.1 ; python_version >= "3.10" and python_version < "4.0"
bytecode==0.15.1 ; python_version >= "3.10" and python_version < "4.0"
cachecontrol[filecache]==0.14.0 ; python_version >= "3.10" and python_version < "4.0"
cattrs==23.2.3 ; python_version >= "3.10" and python_version < "4.0"
certifi==2024.7.4 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.16.0 ; python_version >= "3.10" and python_version < "4.0" and (platform_python_implementation != "PyPy" or sys_platform == "darwin")
cffi==1.17.0 ; python_version >= "3.10" and python_version < "4.0" and (platform_python_implementation != "PyPy" or sys_platform == "darwin")
charset-normalizer==3.3.2 ; python_version >= "3.10" and python_version < "4.0"
cleo==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
click==8.1.7 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -20,23 +18,22 @@ dash-html-components==2.0.0 ; python_version >= "3.10" and python_version < "4.0
dash-renderer==1.9.1 ; python_version >= "3.10" and python_version < "4.0"
dash-table==5.0.0 ; python_version >= "3.10" and python_version < "4.0"
dash==2.17.1 ; python_version >= "3.10" and python_version < "4.0"
ddsketch==3.0.1 ; python_version >= "3.10" and python_version < "4.0"
ddtrace==2.10.1 ; python_version >= "3.10" and python_version < "4.0"
ddtrace==2.11.1 ; python_version >= "3.10" and python_version < "4.0"
deprecated==1.2.14 ; python_version >= "3.10" and python_version < "4.0"
distlib==0.3.8 ; python_version >= "3.10" and python_version < "4.0"
dulwich==0.21.7 ; python_version >= "3.10" and python_version < "4.0"
envier==0.5.2 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.2.2 ; python_version >= "3.10" and python_version < "3.11"
fastjsonschema==2.20.0 ; python_version >= "3.10" and python_version < "4.0"
filelock==3.15.4 ; python_version >= "3.10" and python_version < "4.0"
flake8==7.1.0 ; python_version >= "3.10" and python_version < "4.0"
flake8==7.1.1 ; python_version >= "3.10" and python_version < "4.0"
flask-assets==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
flask-sqlalchemy==3.1.1 ; python_version >= "3.10" and python_version < "4.0"
flask==3.0.3 ; python_version >= "3.10" and python_version < "4.0"
greenlet==3.0.3 ; python_version < "3.13" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32") and python_version >= "3.10"
gunicorn==22.0.0 ; python_version >= "3.10" and python_version < "4.0"
idna==3.7 ; python_version >= "3.10" and python_version < "4.0"
importlib-metadata==8.2.0 ; python_version >= "3.10" and python_version < "4.0"
gunicorn==23.0.0 ; python_version >= "3.10" and python_version < "4.0"
idna==3.8 ; python_version >= "3.10" and python_version < "4.0"
importlib-metadata==8.4.0 ; python_version >= "3.10" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.10" and python_version < "4.0"
installer==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
isort==5.13.2 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -50,11 +47,11 @@ lesscpy==0.15.1 ; python_version >= "3.10" and python_version < "4.0"
loguru==0.7.2 ; python_version >= "3.10" and python_version < "4.0"
markupsafe==2.1.5 ; python_version >= "3.10" and python_version < "4.0"
mccabe==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
more-itertools==10.3.0 ; python_version >= "3.10" and python_version < "4.0"
more-itertools==10.4.0 ; python_version >= "3.10" and python_version < "4.0"
msgpack==1.0.8 ; python_version >= "3.10" and python_version < "4.0"
mypy-extensions==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
nest-asyncio==1.6.0 ; python_version >= "3.10" and python_version < "4.0"
numpy==2.0.1 ; python_version >= "3.10" and python_version <= "3.11" or python_version >= "3.12" and python_version < "4.0"
numpy==2.1.0 ; python_version >= "3.10" and python_version <= "3.11" or python_version >= "3.12" and python_version < "4.0"
opentelemetry-api==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
packaging==24.1 ; python_version >= "3.10" and python_version < "4.0"
pandas==2.2.2 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -68,9 +65,9 @@ ply==3.11 ; python_version >= "3.10" and python_version < "4.0"
poetry-core==1.9.0 ; python_version >= "3.10" and python_version < "4.0"
poetry-plugin-export==1.8.0 ; python_version >= "3.10" and python_version < "4.0"
poetry==1.8.3 ; python_version >= "3.10" and python_version < "4.0"
protobuf==5.27.2 ; python_version >= "3.10" and python_version < "4.0"
protobuf==5.27.4 ; python_version >= "3.10" and python_version < "4.0"
ptyprocess==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
pycodestyle==2.12.0 ; python_version >= "3.10" and python_version < "4.0"
pycodestyle==2.12.1 ; python_version >= "3.10" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.10" and python_version < "4.0" and (platform_python_implementation != "PyPy" or sys_platform == "darwin")
pyflakes==3.2.0 ; python_version >= "3.10" and python_version < "4.0"
pymysql==1.1.1 ; python_version >= "3.10" and python_version < "4.0"
Expand All @@ -79,30 +76,30 @@ pytest==8.3.2 ; python_version >= "3.10" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.0.1 ; python_version >= "3.10" and python_version < "4.0"
pytz==2024.1 ; python_version >= "3.10" and python_version < "4.0"
pywin32-ctypes==0.2.2 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
rapidfuzz==3.9.5 ; python_version >= "3.10" and python_version < "4.0"
redis==5.0.7 ; python_version >= "3.10" and python_version < "4.0"
pywin32-ctypes==0.2.3 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
rapidfuzz==3.9.6 ; python_version >= "3.10" and python_version < "4.0"
redis==5.0.8 ; python_version >= "3.10" and python_version < "4.0"
requests-toolbelt==1.0.0 ; python_version >= "3.10" and python_version < "4.0"
requests==2.32.3 ; python_version >= "3.10" and python_version < "4.0"
retrying==1.3.4 ; python_version >= "3.10" and python_version < "4.0"
secretstorage==3.3.3 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "linux"
setuptools==72.1.0 ; python_version >= "3.10" and python_version < "4.0"
setuptools==74.0.0 ; python_version >= "3.10" and python_version < "4.0"
shellingham==1.5.4 ; python_version >= "3.10" and python_version < "4.0"
six==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy==2.0.31 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy==2.0.32 ; python_version >= "3.10" and python_version < "4.0"
tenacity==9.0.0 ; python_version >= "3.10" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.10" and python_version < "3.11"
tomlkit==0.13.0 ; python_version >= "3.10" and python_version < "4.0"
tomlkit==0.13.2 ; python_version >= "3.10" and python_version < "4.0"
trove-classifiers==2024.7.2 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.12.2 ; python_version >= "3.10" and python_version < "4.0"
tzdata==2024.1 ; python_version >= "3.10" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.10" and python_version < "4.0"
virtualenv==20.26.3 ; python_version >= "3.10" and python_version < "4.0"
webassets==2.0 ; python_version >= "3.10" and python_version < "4.0"
werkzeug==3.0.3 ; python_version >= "3.10" and python_version < "4.0"
werkzeug==3.0.4 ; python_version >= "3.10" and python_version < "4.0"
win32-setctime==1.1.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
wrapt==1.16.0 ; python_version >= "3.10" and python_version < "4.0"
wtforms==3.1.2 ; python_version >= "3.10" and python_version < "4.0"
xattr==1.1.0 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "darwin"
xmltodict==0.13.0 ; python_version >= "3.10" and python_version < "4.0"
zipp==3.19.2 ; python_version >= "3.10" and python_version < "4.0"
zipp==3.20.1 ; python_version >= "3.10" and python_version < "4.0"

0 comments on commit 66aa85e

Please sign in to comment.