From ef2db25b0bb3c0a5a1c37bf6c3833a292ea31713 Mon Sep 17 00:00:00 2001 From: mpabi Date: Mon, 24 Jun 2024 18:37:36 +0000 Subject: [PATCH] vue tab fetch/post v0.01 --- src/app/main.py | 17 +++++++++++- src/static/index.html | 17 ++++-------- src/static/script.js | 3 +-- src/static/style.css | 63 +++++++++++++++---------------------------- 4 files changed, 44 insertions(+), 56 deletions(-) diff --git a/src/app/main.py b/src/app/main.py index 392823c..9735285 100644 --- a/src/app/main.py +++ b/src/app/main.py @@ -4,9 +4,24 @@ from sqlalchemy.orm import Session from app.database import SessionLocal, engine from app import models, schemas -models.Base.metadata.create_all(bind=engine) +from typing import List, Optional +# ddfrom starlette.middleware.base import BaseHTTPMiddleware +# from starlette.responses import Response + +# class CustomMIMEMiddleware(BaseHTTPMiddleware): +# async def dispatch(self, request, call_next): +# response = await call_next(request) +# if request.url.path.endswith('.vue'): +# response.headers['Content-Type'] = 'application/javascript' +# return response + +from fastapi.staticfiles import StaticFiles + app = FastAPI() +app.mount("/static", StaticFiles(directory="static"), name="static") + +models.Base.metadata.create_all(bind=engine) def get_db(): db = SessionLocal() diff --git a/src/static/index.html b/src/static/index.html index 91c424e..2f9b441 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -4,20 +4,13 @@ Passport Form App - + -
+ +
+ + - diff --git a/src/static/script.js b/src/static/script.js index 8dda52a..a3cde9b 100644 --- a/src/static/script.js +++ b/src/static/script.js @@ -1,5 +1,5 @@ import { createApp } from './js/vue.esm-browser.js'; -import PassportForm from './components/PassportForm.js'; +import PassportForm from './components/Tabs.js'; const App = { name: 'App', @@ -14,4 +14,3 @@ const App = { }; createApp(App).mount('#app'); - diff --git a/src/static/style.css b/src/static/style.css index 3883254..948d204 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -1,43 +1,24 @@ -body, html { - margin: 0; - padding: 0; - font-family: Arial, sans-serif; -} - -header, footer { - background-color: #333; - color: #fff; +#app { + font-family: Avenir, Helvetica, Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; text-align: center; - padding: 1rem 0; -} - -.container { - display: flex; - min-height: calc(100vh - 100px); /* Adjust based on header/footer height */ -} - -.sidebar { - width: 30%; - padding: 20px; - background-color: #f4f4f4; -} - -.content { - flex-grow: 1; - padding: 20px; -} - -form > * { - display: block; - margin-bottom: 10px; -} - -button { + color: #2c3e50; + margin-top: 60px; + } + + nav { + margin-bottom: 20px; + } + + button { + padding: 10px 20px; + margin: 5px; cursor: pointer; -} - -ul { - list-style-type: none; - padding-left: 0; -} - + } + + button.active { + background-color: #2c3e50; + color: white; + } + \ No newline at end of file