5 final
This commit is contained in:
parent
f77269cc24
commit
346679055d
3
5/README.md
Normal file
3
5/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
### SaaS 5.2 i 5.3
|
||||
|
||||
[link](http://dxh2j7qvjtcxi.cloudfront.net/)
|
1
5/api.py
1
5/api.py
@ -15,6 +15,7 @@ def daj_dane(plik):
|
||||
sprzedawca = dane[dane.index('Sprzedawca:') : dane.index('Nabywca:')]
|
||||
sprzedawca_nazwa = sprzedawca[1]
|
||||
nip = sprzedawca[-1].replace('NIP: ', '')
|
||||
|
||||
return {
|
||||
'vat_id' : nip,
|
||||
'salesman' : sprzedawca_nazwa,
|
||||
|
22
5/index.html
Normal file
22
5/index.html
Normal file
@ -0,0 +1,22 @@
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
async function parse(){
|
||||
document.getElementById("result").innerHTML = "Ładowanie"
|
||||
var data = new FormData()
|
||||
data.append('file', document.getElementById("docpicker").files[0])
|
||||
document.getElementById("result").innerHTML = "Przechwytywanie"
|
||||
resp = await fetch('http://54.224.24.43:80/invoice', {method: "POST", body: data})
|
||||
document.getElementById("result").innerHTML = "Przechwycono"
|
||||
data = await resp.json()
|
||||
var result = JSON.stringify(data)
|
||||
document.getElementById("result").innerHTML = result
|
||||
}
|
||||
</script>
|
||||
<title>Chmura</title>
|
||||
</head>
|
||||
<body>
|
||||
<input type="file" id="docpicker" accept=".pdf" onchange="parse()" />
|
||||
<p id="result"></p>
|
||||
</body>
|
||||
</html>
|
@ -57,6 +57,3 @@ if __name__ == '__main__':
|
||||
UserData=user_data,
|
||||
SecurityGroups=[security_group.group_name],
|
||||
)
|
||||
|
||||
|
||||
|
13
5/policy.json
Normal file
13
5/policy.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Id": "MyPolicy",
|
||||
"Statement": [
|
||||
{
|
||||
"Sid": "PublicReadForGetBucketObjects",
|
||||
"Effect": "Allow",
|
||||
"Principal": "*",
|
||||
"Action": "s3:GetObject",
|
||||
"Resource": "arn:aws:s3:::s444455buckettest/*"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user