generated from recursivezero/template
-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] UI changes #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ravindrayadav04
wants to merge
8
commits into
feature/RTY-260025
Choose a base branch
from
bugfix/RTY-260028
base: feature/RTY-260025
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP] UI changes #30
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
20cfa79
fix the bug related to visit count and change the ui also
Ravindrayadav04 f2bb9f5
[RTY-260028]: fiexed the whole ui header and footer align
Ravindrayadav04 7219026
[RTY-260028]: UI Enhancement
Ravindrayadav04 6eb1057
[RTY-260028]: Merge branch 'feature/RTY-260025' of https://github.com…
Ravindrayadav04 5a38278
[RTY-260028]: fix qr outside the app and add 404 page for non-defined…
Ravindrayadav04 96acea6
[RTY-260028]:
Ravindrayadav04 88ca329
[RTY-260028]: Merge branch 'feature/RTY-260025' into bugfix/RTY-260028
Ravindrayadav04 b10c2f0
[RTY-260028]: name change tiny to RZRO
Ravindrayadav04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,3 +59,6 @@ poetry.lock | |
| *.tmp | ||
| *.temp | ||
| *.bak | ||
|
|
||
|
|
||
| assets/images/qr/* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| from fastapi.templating import Jinja2Templates | ||
| from pydantic import BaseModel, Field | ||
|
|
||
|
|
||
| from app import __version__ | ||
| from app.utils import db | ||
| from app.utils.cache import ( | ||
|
|
@@ -67,10 +68,11 @@ async def index(request: Request): | |
| if qr_enabled and new_short_url and short_code: | ||
| qr_data = new_short_url | ||
| qr_filename = f"{short_code}.png" | ||
| qr_dir = BASE_DIR / "static" / "qr" | ||
| PROJECT_ROOT = BASE_DIR.parent # go from app/ → project root | ||
| qr_dir = PROJECT_ROOT / "assets" / "images" / "qr" | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. create QR_DIR constant and use |
||
| qr_dir.mkdir(parents=True, exist_ok=True) | ||
| generate_qr_with_logo(qr_data, str(qr_dir / qr_filename)) | ||
| qr_image = f"/static/qr/{qr_filename}" | ||
| qr_image = f"/qr/{qr_filename}" | ||
|
|
||
| recent_urls = db.get_recent_urls(MAX_RECENT_URLS) or get_recent_from_cache( | ||
| MAX_RECENT_URLS | ||
|
|
@@ -138,6 +140,7 @@ async def create_short_url( | |
|
|
||
|
|
||
| @ui_router.get("/recent", response_class=HTMLResponse) | ||
| @ui_router.get("/history", response_class=HTMLResponse) | ||
| async def recent_urls(request: Request): | ||
| recent_urls_list = db.get_recent_urls(MAX_RECENT_URLS) or get_recent_from_cache( | ||
| MAX_RECENT_URLS | ||
|
|
@@ -222,7 +225,8 @@ def redirect_short_ui(short_code: str, background_tasks: BackgroundTasks): | |
| set_cache_pair(short_code, original_url) | ||
| return RedirectResponse(original_url) | ||
|
|
||
| return PlainTextResponse("Invalid short URL", status_code=404) | ||
| # return PlainTextResponse("Invalid short URL", status_code=404) | ||
| raise HTTPException(status_code=404, detail="Page not found") | ||
|
|
||
|
|
||
| @ui_router.delete("/recent/{short_code}") | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reason to comment these code?