Spaces:
Runtime error
Runtime error
CaesarCloudSync commited on
Commit ·
3bc47cc
0
Parent(s):
RevisionBankCardLink First commit
Browse files- Dockerfile +11 -0
- README.md +8 -0
- __pycache__/main.cpython-310.pyc +0 -0
- main.py +21 -0
- requirements.txt +5 -0
- static/hello.js +19 -0
- static/test.jpg +0 -0
- static/test.js +64 -0
- templates/hello.html +100 -0
Dockerfile
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
+
|
| 3 |
+
WORKDIR /code
|
| 4 |
+
|
| 5 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
+
|
| 7 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 8 |
+
|
| 9 |
+
COPY . .
|
| 10 |
+
|
| 11 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: RevisionBankCardLink
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
__pycache__/main.cpython-310.pyc
ADDED
|
Binary file (1.05 kB). View file
|
|
|
main.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastapi import FastAPI, Request
|
| 2 |
+
from fastapi.responses import HTMLResponse
|
| 3 |
+
from fastapi.templating import Jinja2Templates
|
| 4 |
+
from fastapi.staticfiles import StaticFiles
|
| 5 |
+
import uvicorn
|
| 6 |
+
import asyncio
|
| 7 |
+
app = FastAPI()
|
| 8 |
+
templates = Jinja2Templates(directory="templates")
|
| 9 |
+
app.mount("/static", StaticFiles(directory="static"), name="static")
|
| 10 |
+
@app.get("/hello/{name}", response_class=HTMLResponse)
|
| 11 |
+
async def hello(request: Request, name:str):
|
| 12 |
+
return templates.TemplateResponse("hello.html", {"request": request, "name":name})
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
async def main():
|
| 16 |
+
config = uvicorn.Config("main:app", port=7860, log_level="info",host="0.0.0.0",reload=True)
|
| 17 |
+
server = uvicorn.Server(config)
|
| 18 |
+
await server.serve()
|
| 19 |
+
|
| 20 |
+
if __name__ == "__main__":
|
| 21 |
+
asyncio.run(main())
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi
|
| 2 |
+
pydantic
|
| 3 |
+
uvicorn
|
| 4 |
+
jinja2
|
| 5 |
+
aiofiles
|
static/hello.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
function myFunction() {
|
| 2 |
+
var today = new Date();
|
| 3 |
+
var h = today.getHours();
|
| 4 |
+
var m = today.getMinutes();
|
| 5 |
+
var s = today.getSeconds();
|
| 6 |
+
var msg="";
|
| 7 |
+
if (h<12) {
|
| 8 |
+
msg="Good Morning, ";
|
| 9 |
+
}
|
| 10 |
+
if (h>=12 && h<18) {
|
| 11 |
+
msg="Good Afternoon, ";
|
| 12 |
+
}
|
| 13 |
+
if (h>=18) {
|
| 14 |
+
msg="Good Evening, ";
|
| 15 |
+
}
|
| 16 |
+
var x=document.getElementById('ttl').innerHTML;
|
| 17 |
+
document.getElementById('ttl').innerHTML = msg+x;
|
| 18 |
+
document.getElementById('time').innerHTML = h + ":" + m + ":" + s;
|
| 19 |
+
}
|
static/test.jpg
ADDED
|
static/test.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict'
|
| 2 |
+
const e = React.createElement;
|
| 3 |
+
class Comp1 extends React.Component {
|
| 4 |
+
constructor(props) {
|
| 5 |
+
super(props);
|
| 6 |
+
//this.getallmagneuris = this.getallmagneuris.bind(this);
|
| 7 |
+
this.state = {quotas:[]}
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
componentDidMount() {
|
| 11 |
+
//window.addEventListener('load', this.handleLoad);
|
| 12 |
+
//this.getallmagneuris();
|
| 13 |
+
alert("Hi")
|
| 14 |
+
}
|
| 15 |
+
/*
|
| 16 |
+
async getallmagneuris(){
|
| 17 |
+
const companyname = "Google"
|
| 18 |
+
const company_password = "kya63amari"
|
| 19 |
+
const contributorsignup= await axios.post("https://caesarcoinbackend.onrender.com/quotapostersignin",{"company":companyname,"email":"amari.lawal05@gmail.com","password":company_password})
|
| 20 |
+
|
| 21 |
+
//console.log(contributorsignup)
|
| 22 |
+
if (contributorsignup.data.access_token == "Wrong password"){
|
| 23 |
+
let walletbalance= document.getElementById("walletbalance")
|
| 24 |
+
walletbalance.style = "position:absolute;left:20%;top:10%;"
|
| 25 |
+
walletbalance.innerHTML = `${companyname} incorrect password or username.`
|
| 26 |
+
}
|
| 27 |
+
else{
|
| 28 |
+
const config = {
|
| 29 |
+
headers: { Authorization: `Bearer ${contributorsignup.data.access_token}` }
|
| 30 |
+
};
|
| 31 |
+
const getlastblockchainresp = await axios.get("https://caesarcoinbackend.onrender.com/getallmagneturi",config)
|
| 32 |
+
//console.log(getlastblockchainresp.data.quotamagneturis)
|
| 33 |
+
this.setState( state => ({
|
| 34 |
+
quotas: state.quotas.concat(getlastblockchainresp.data.quotamagneturis)
|
| 35 |
+
}));
|
| 36 |
+
|
| 37 |
+
}
|
| 38 |
+
}*/
|
| 39 |
+
render () {
|
| 40 |
+
//console.log(this.state)
|
| 41 |
+
//const quotas = this.state //.quotas
|
| 42 |
+
console.log("hi")
|
| 43 |
+
return (
|
| 44 |
+
<div>
|
| 45 |
+
<h1>Quota files Contributed</h1>
|
| 46 |
+
|
| 47 |
+
</div>
|
| 48 |
+
)
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
// Find all DOM containers, and render our component into them.
|
| 54 |
+
var containers = document.querySelectorAll('.root-react')
|
| 55 |
+
console.log("test")
|
| 56 |
+
containers.forEach(domContainer => {
|
| 57 |
+
// Read the user ID from a data-* attribute.
|
| 58 |
+
const userid = domContainer.dataset.userid
|
| 59 |
+
// render the component into the DOM
|
| 60 |
+
ReactDOM.render(
|
| 61 |
+
e(Comp1, { userid: userid}),
|
| 62 |
+
domContainer
|
| 63 |
+
)
|
| 64 |
+
});
|
templates/hello.html
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<html>
|
| 2 |
+
<head>
|
| 3 |
+
<title>My Website</title>
|
| 4 |
+
<script src="{{ url_for('static', path='hello.js') }}"></script>
|
| 5 |
+
|
| 6 |
+
<title>Google</title>
|
| 7 |
+
<meta name="title" content="Google"></meta>
|
| 8 |
+
<meta name="description" content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.">
|
| 9 |
+
</meta>
|
| 10 |
+
<meta property="og:type" content="website">
|
| 11 |
+
</meta>
|
| 12 |
+
<meta property="og:url" content="https://www.google.com/">
|
| 13 |
+
</meta>
|
| 14 |
+
<meta property="og:title" content="Google">
|
| 15 |
+
</meta>
|
| 16 |
+
<meta property="og:description" content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.">
|
| 17 |
+
</meta>
|
| 18 |
+
<meta property="og:image" content="https://www.businessinsider.in/thumb/msid-76111673,width-700,height-525,imgsize-308344/YouTube-is-15-years-old-Heres-a-timeline-of-how-YouTube-was-founded-its-rise-to-video-behemoth-and-its-biggest-controversies-along-way.jpg">
|
| 19 |
+
</meta>
|
| 20 |
+
|
| 21 |
+
<meta property="twitter:card" content="summary_large_image">
|
| 22 |
+
</meta>
|
| 23 |
+
<meta property="twitter:url" content="https://www.google.com/">
|
| 24 |
+
</meta>
|
| 25 |
+
<meta property="twitter:title" content="Google">
|
| 26 |
+
</meta>
|
| 27 |
+
<meta property="twitter:description" content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.">
|
| 28 |
+
</meta>
|
| 29 |
+
<meta property="twitter:image" content="https://www.businessinsider.in/thumb/msid-76111673,width-700,height-525,imgsize-308344/YouTube-is-15-years-old-Heres-a-timeline-of-how-YouTube-was-founded-its-rise-to-video-behemoth-and-its-biggest-controversies-along-way.jpg">
|
| 30 |
+
</meta>
|
| 31 |
+
<style>
|
| 32 |
+
a,p,h1{
|
| 33 |
+
font-family: "Arial"
|
| 34 |
+
}
|
| 35 |
+
</style>
|
| 36 |
+
</head>
|
| 37 |
+
<body style="background-color: #141212;" onload="myFunction()">
|
| 38 |
+
<div id="time" style="text-align:right;" width="100%">
|
| 39 |
+
<div>
|
| 40 |
+
<div style="display:flex;flex-direction:column;align-items:center;width:100%;margin-top:50px">
|
| 41 |
+
<div>
|
| 42 |
+
<h1 style="color:white;margin-bottom:20px">Revision Cards</h1>
|
| 43 |
+
</div>
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
<div style="position:relative;border:3px white solid;border-radius:10px;background-color:white;width: 100vh">
|
| 47 |
+
|
| 48 |
+
<div style="position:relative;left:10%;top:10%;width:80%;border:1px grey solid;border-radius:5px">
|
| 49 |
+
<div style="margin:20px">
|
| 50 |
+
<div style="display:flex;gap:7%;border-bottom:1px grey solid;flex-direction:row">
|
| 51 |
+
<p style="color:grey">Email to send to:</p>
|
| 52 |
+
<p >amari.lawal05@gmail.com</p>
|
| 53 |
+
</div>
|
| 54 |
+
|
| 55 |
+
<div style="display:flex;gap:10%;border-bottom:1px grey solid;margin-top:50px;flex-direction:row">
|
| 56 |
+
<p style="color:grey">Revision Interval</p>
|
| 57 |
+
<p>60 minutes</p>
|
| 58 |
+
|
| 59 |
+
</div>
|
| 60 |
+
<div style="display:flex;gap:10%;border-bottom:1px grey solid;margin-top:50px;flex-direction:row">
|
| 61 |
+
<p style="color:grey">Manage Revision Cards:</p>
|
| 62 |
+
</div>
|
| 63 |
+
|
| 64 |
+
<div>
|
| 65 |
+
<div key={1} style="display:flex;margin-top:50px;flex-direction:row;justify-content: space-between">
|
| 66 |
+
<p >A Level Physics</p>
|
| 67 |
+
<p style="margin-right:40px">Photons and Electrons</p>
|
| 68 |
+
</div>
|
| 69 |
+
<textarea defaultValue="Hello world" name="revisioncard" className="form-control" style="height:200px;width:95%;margin-top:10px">
|
| 70 |
+
</textarea>
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
<table>
|
| 74 |
+
<tbody >
|
| 75 |
+
<tr>
|
| 76 |
+
image.png
|
| 77 |
+
</tr>
|
| 78 |
+
<tr>
|
| 79 |
+
<td ><img key={1} style="width:55%;height:55%" src="{{ url_for('static', path='test.jpg') }}"></img></td>
|
| 80 |
+
|
| 81 |
+
</tr>
|
| 82 |
+
</tbody>
|
| 83 |
+
</table>
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
</div>
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
</div>
|
| 95 |
+
|
| 96 |
+
</div>
|
| 97 |
+
|
| 98 |
+
</body>
|
| 99 |
+
|
| 100 |
+
</html>
|