diff --git a/app/core/models.py b/app/core/models.py index 62c6c72..e3ae047 100644 --- a/app/core/models.py +++ b/app/core/models.py @@ -92,6 +92,7 @@ class App(db.Model): name = db.Column(db.String(64), nullable=False) server_id = db.Column(db.Integer, db.ForeignKey("servers.id"), nullable=False) documentation = db.Column(db.Text) + url = db.Column(db.String(255), nullable=True) created_at = db.Column(db.DateTime, default=datetime.utcnow) updated_at = db.Column( db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow diff --git a/app/routes/dashboard.py b/app/routes/dashboard.py index f1defda..aef023e 100644 --- a/app/routes/dashboard.py +++ b/app/routes/dashboard.py @@ -229,6 +229,7 @@ def app_new(server_id=None): name = request.form.get("name") server_id = request.form.get("server_id") documentation = request.form.get("documentation", "") + url = request.form.get("url", "") # Get the URL if not name or not server_id: flash("Name and server are required", "danger") @@ -240,8 +241,8 @@ def app_new(server_id=None): selected_server_id=server_id, ) - # Create the app - app = App(name=name, server_id=server_id, documentation=documentation) + # Create the app with the URL + app = App(name=name, server_id=server_id, documentation=documentation, url=url) try: db.session.add(app) @@ -309,6 +310,7 @@ def app_edit(app_id): name = request.form.get("name", "").strip() server_id = request.form.get("server_id") documentation = request.form.get("documentation", "") + url = request.form.get("url", "") # Get the URL # Process port data from form port_data = [] @@ -326,6 +328,12 @@ def app_edit(app_id): valid, error = validate_app_data(name, server_id, existing_app_id=app_id) if valid: + # Update application with URL + app.name = name + app.server_id = server_id + app.documentation = documentation + app.url = url + # Update application from app.utils.app_utils import save_app diff --git a/app/static/css/custom.css b/app/static/css/custom.css index b7b12ff..a561ff9 100644 --- a/app/static/css/custom.css +++ b/app/static/css/custom.css @@ -52,4 +52,125 @@ .accordion-body .btn-outline-danger:hover { background-color: #d63939; color: white; +} + +/* Markdown content styling */ +.markdown-content.theme-styled { + color: var(--tblr-body-color); + background-color: var(--tblr-card-bg); + border-radius: 0.375rem; + overflow: hidden; +} + +[data-bs-theme="dark"] .markdown-content.theme-styled { + color: #e1e3e6; +} + +.markdown-content.theme-styled h1, +.markdown-content.theme-styled h2, +.markdown-content.theme-styled h3, +.markdown-content.theme-styled h4, +.markdown-content.theme-styled h5, +.markdown-content.theme-styled h6 { + margin-top: 1.5rem; + margin-bottom: 0.75rem; + color: var(--tblr-primary); + font-weight: 600; +} + +.markdown-content.theme-styled h1:first-child, +.markdown-content.theme-styled h2:first-child, +.markdown-content.theme-styled h3:first-child { + margin-top: 0; +} + +.markdown-content.theme-styled p { + margin-bottom: 1rem; + line-height: 1.6; +} + +.markdown-content.theme-styled a { + color: var(--tblr-primary); + text-decoration: none; + border-bottom: 1px dotted var(--tblr-primary); +} + +.markdown-content.theme-styled a:hover { + border-bottom: 1px solid var(--tblr-primary); +} + +.markdown-content.theme-styled ul, +.markdown-content.theme-styled ol { + margin-bottom: 1rem; + padding-left: 2rem; +} + +.markdown-content.theme-styled code { + padding: 0.2em 0.4em; + background-color: rgba(var(--tblr-primary-rgb), 0.08); + border-radius: 3px; + font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; + font-size: 0.9em; +} + +.markdown-content.theme-styled pre { + margin-bottom: 1rem; + padding: 1rem; + background-color: var(--tblr-dark); + border-radius: 0.375rem; + overflow-x: auto; +} + +[data-bs-theme="dark"] .markdown-content.theme-styled pre { + background-color: rgba(0, 0, 0, 0.2); +} + +.markdown-content.theme-styled pre code { + padding: 0; + background-color: transparent; + color: #e1e3e6; + font-size: 0.85rem; + line-height: 1.5; +} + +.markdown-content.theme-styled blockquote { + margin-left: 0; + padding: 0.5rem 1rem; + border-left: 4px solid var(--tblr-primary); + background-color: rgba(var(--tblr-primary-rgb), 0.05); + color: var(--tblr-secondary); +} + +.markdown-content.theme-styled table { + width: 100%; + margin-bottom: 1rem; + border-collapse: collapse; +} + +.markdown-content.theme-styled table th, +.markdown-content.theme-styled table td { + padding: 0.5rem; + border: 1px solid var(--tblr-border-color); +} + +.markdown-content.theme-styled table th { + background-color: rgba(var(--tblr-primary-rgb), 0.1); +} + +.app-link { + display: inline-flex; + align-items: center; + transition: color 0.2s; +} + +.app-link:hover { + color: var(--tblr-primary-active) !important; +} + +.documentation-wrapper { + border-top: 1px solid rgba(255, 255, 255, 0.1); +} + +[data-bs-theme="light"] .documentation-wrapper { + border-top: 1px solid rgba(0, 0, 0, 0.1); } \ No newline at end of file diff --git a/app/templates/dashboard/app_form.html b/app/templates/dashboard/app_form.html index 7d136eb..9fe1666 100644 --- a/app/templates/dashboard/app_form.html +++ b/app/templates/dashboard/app_form.html @@ -53,6 +53,20 @@ Choose a unique name for this application +
+ +
+ + + + +
+ + If provided, the application name will be clickable and link to this URL. + +
+