AI
This commit is contained in:
1 parent
c557ca01e7
commit
e1c88ac774
8 files changed
+223
-14
No files matched your search
@@ -1,6 +1,4 @@
|
|||||||
def main():
|
import uvicorn
|
||||||
print("Hello from qrcode-from-onetab!")
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
uvicorn.run("uhhhhup:app", host="0.0.0.0", port=2222, reload=True)
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
:root {
|
||||||
|
--bg-color: #121212;
|
||||||
|
--text-color: #e0e0e0;
|
||||||
|
--primary-color: #bb86fc;
|
||||||
|
--secondary-color: #03dac6;
|
||||||
|
--error-color: #cf6679;
|
||||||
|
--surface-color: #1e1e1e;
|
||||||
|
--border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: var(--bg-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
margin: 0;
|
||||||
|
padding: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: var(--primary-color);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
button,
|
||||||
|
input[type="submit"],
|
||||||
|
.btn {
|
||||||
|
background-color: var(--surface-color);
|
||||||
|
color: var(--primary-color);
|
||||||
|
border: 1px solid var(--primary-color);
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1rem;
|
||||||
|
transition: background-color 0.2s, color 0.2s;
|
||||||
|
margin: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover,
|
||||||
|
input[type="submit"]:hover,
|
||||||
|
.btn:hover {
|
||||||
|
background-color: var(--primary-color);
|
||||||
|
color: var(--bg-color);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
background-color: var(--surface-color);
|
||||||
|
color: var(--text-color);
|
||||||
|
border: 1px solid #333;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
padding: 10px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 800px;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 800px;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 800px;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
background-color: var(--surface-color);
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
li a {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qrcode {
|
||||||
|
margin-top: 10px;
|
||||||
|
background-color: white;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Specifics for reader */
|
||||||
|
#b {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
padding: 20px 40px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Specifics for index */
|
||||||
|
.hero {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 20px;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1000px;
|
||||||
|
margin-bottom: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background-color: var(--surface-color);
|
||||||
|
padding: 30px;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
flex: 1;
|
||||||
|
min-width: 300px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card h2 {
|
||||||
|
color: var(--secondary-color);
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card p {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card .actions {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.route-list {
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.route-item {
|
||||||
|
background-color: var(--surface-color);
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: var(--border-radius);
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
+39
-8
@@ -4,15 +4,46 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Document</title>
|
<title>Document</title>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="{{ url_for('static', path='style.css') }}"
|
||||||
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% macro this(route) %}
|
<h1>Queue Manager</h1>
|
||||||
<p>
|
|
||||||
<a href="{{ url_for(route.name) }}"
|
<div class="hero">
|
||||||
>{{ route.name }}: {{ route.path }}</a
|
<div class="card">
|
||||||
>
|
<h2>Input (PC)</h2>
|
||||||
</p>
|
<p>
|
||||||
{% endmacro %} {% for route in routes if "GET" in route.methods %} {{
|
Paste your OneTab export or list of links here to add them
|
||||||
this(route) }} {% endfor %}
|
to the queue.
|
||||||
|
</p>
|
||||||
|
<div class="actions">
|
||||||
|
<a href="/queuein" class="btn">Add Links</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<h2>Output (Mobile)</h2>
|
||||||
|
<p>Open these on your phone to consume the queue.</p>
|
||||||
|
<div class="actions">
|
||||||
|
<a href="/q" class="btn">Reader (QR)</a>
|
||||||
|
<a href="/t" class="btn">Trail (Focus)</a>
|
||||||
|
<a href="/r" class="btn">Next Link</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>System Routes</h3>
|
||||||
|
<div class="route-list">
|
||||||
|
{% macro this(route) %}
|
||||||
|
<div class="route-item">
|
||||||
|
<a href="{{ route.path }}">{{ route.name }}</a>
|
||||||
|
<span>{{ route.path }}</span>
|
||||||
|
</div>
|
||||||
|
{% endmacro %} {% for route in routes %} {{ this(route) }} {% endfor
|
||||||
|
%}
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -4,6 +4,10 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Queue Input</title>
|
<title>Queue Input</title>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="{{ url_for('static', path='style.css') }}"
|
||||||
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<form method="POST" action="/queuein">
|
<form method="POST" action="/queuein">
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Queue Reader</title>
|
<title>Queue Reader</title>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% from 'macros.html' import magic_link %} {% if current_link %}
|
{% from 'macros.html' import magic_link %} {% if current_link %}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Trail</title>
|
<title>Trail</title>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', path='style.css') }}">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% if queue_length > 0 %}
|
{% if queue_length > 0 %}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
"why outdated"
|
||||||
|
|
||||||
from collections import deque
|
from collections import deque
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
|
|||||||
+6
-2
@@ -6,11 +6,13 @@ from itertools import islice
|
|||||||
import uvicorn
|
import uvicorn
|
||||||
from fastapi import FastAPI, Form, Request
|
from fastapi import FastAPI, Form, Request
|
||||||
from fastapi.responses import HTMLResponse, RedirectResponse
|
from fastapi.responses import HTMLResponse, RedirectResponse
|
||||||
|
from fastapi.staticfiles import StaticFiles
|
||||||
from fastapi.templating import Jinja2Templates
|
from fastapi.templating import Jinja2Templates
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI()
|
||||||
|
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||||
templates = Jinja2Templates(directory="templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
queue: deque[str] = deque() # lifo ahh
|
queue: deque[str] = deque() # fifo ahh
|
||||||
|
|
||||||
|
|
||||||
def link_extract_from_onetab(line):
|
def link_extract_from_onetab(line):
|
||||||
@@ -57,7 +59,9 @@ async def redir(request: Request):
|
|||||||
|
|
||||||
@app.get("/m", response_class=HTMLResponse)
|
@app.get("/m", response_class=HTMLResponse)
|
||||||
async def mlti(request: Request):
|
async def mlti(request: Request):
|
||||||
"request first new style"
|
"""request first new style.
|
||||||
|
js still breaking (on mobile. they dont like mass popups) im so sad
|
||||||
|
"""
|
||||||
return templates.TemplateResponse(request, "multi.html")
|
return templates.TemplateResponse(request, "multi.html")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user