Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
awesomelands
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vuk Lazovic
awesomelands
Commits
a55534d8
Commit
a55534d8
authored
Sep 19, 2022
by
Vuk Lazovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UPLOAD sada radi
parent
dedf10eb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
18 deletions
+53
-18
.idea/workspace.xml
+5
-12
src/main/java/app/config/Bezbednost.java
+3
-1
src/main/java/app/usluga/web/MainKontroler.java
+19
-3
src/main/resources/static/images/uploads/viber_image_2022-05-26_11-52-21-814.jpg
+0
-0
src/main/resources/templates/dodaj.html
+26
-2
No files found.
.idea/workspace.xml
View file @
a55534d8
...
...
@@ -5,21 +5,13 @@
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"6e82c7f1-3949-40e2-bc26-7eb50b36f993"
name=
"Default Changelist"
comment=
"login/logout/anonymous user..."
>
<change
afterPath=
"$PROJECT_DIR$/src/main/resources/static/images/bgg_1.jpg
"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/resources/templates/maintance.ht
ml"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/src/main/resources/templates/upload.ht
ml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_18_9_2022__18_26__Default_Changelist_.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_18_9_2022__18_26__Default_Changelist_.xml
"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_18_9_2022__20_08__Default_Changelist_.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_18_9_2022__20_08__Default_Changelist_.x
ml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_19_9_2022__15_07__Default_Changelist_.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_19_9_2022__15_07__Default_Changelist_.x
ml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/java/app/config/Bezbednost.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/java/app/config/Bezbednost.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/java/app/usluga/web/MainKontroler.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/java/app/usluga/web/MainKontroler.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/about.html"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/agents.html"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/blog-single.html"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/blog.html"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/contact.html"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/dodaj.html"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/resources/templates/dodaj.html"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/images/bg_1.jpg"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/index.html"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/resources/templates/index.html"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/property-single.html"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/resources/templates/property-single.html"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/main/resources/templates/property.html"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/main/resources/templates/property.html"
afterDir=
"false"
/>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
...
@@ -207,6 +199,7 @@
<workItem
from=
"1663587883995"
duration=
"11000"
/>
<workItem
from=
"1663589644471"
duration=
"4472000"
/>
<workItem
from=
"1663594548080"
duration=
"456000"
/>
<workItem
from=
"1663598082766"
duration=
"1582000"
/>
</task>
<task
id=
"LOCAL-00001"
summary=
"dodata ulogovana verzija"
>
<created>
1663501497955
</created>
...
...
src/main/java/app/config/Bezbednost.java
View file @
a55534d8
...
...
@@ -72,7 +72,9 @@ public class Bezbednost extends WebSecurityConfigurerAdapter {
.
clearAuthentication
(
true
)
.
logoutRequestMatcher
(
new
AntPathRequestMatcher
(
"/logout"
))
.
logoutSuccessUrl
(
"/"
)
.
permitAll
();
.
permitAll
()
.
and
()
.
csrf
().
disable
();
}
}
src/main/java/app/usluga/web/MainKontroler.java
View file @
a55534d8
package
app
.
usluga
.
web
;
import
org.springframework.http.HttpStatus
;
import
app.model.Oglas
;
import
app.usluga.OglasUsluga
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
java
x.persistence.EntityManager
;
import
java
x.persistence.EntityManagerFactory
;
import
java
.io.File
;
import
java
.io.IOException
;
import
java.util.List
;
@Controller
public
class
MainKontroler
{
@PostMapping
(
"/upload"
)
public
ResponseEntity
<?>
handleFileUpload
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
String
fileName
=
file
.
getOriginalFilename
();
try
{
file
.
transferTo
(
new
File
(
"C:\\Users\\vuk\\Desktop\\awesomelands\\src\\main\\resources\\static\\images\\uploads\\"
+
fileName
));
}
catch
(
IOException
e
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
build
();
}
return
ResponseEntity
.
ok
(
"file uploaded successfully"
);
}
@GetMapping
(
"/login"
)
public
String
prikaziLogin
()
{
return
"login"
;
...
...
src/main/resources/static/images/uploads/viber_image_2022-05-26_11-52-21-814.jpg
0 → 100644
View file @
a55534d8
224 KB
src/main/resources/templates/dodaj.html
View file @
a55534d8
<
!DOCTYPE html
>
<html>
<
html
xmlns:th=
"https://www.thymeleaf.org"
>
<html
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Dodaj stan
</title>
...
...
@@ -2150,6 +2150,30 @@ template {
</nav>
<!-- END nav -->
<input
id=
"fileupload"
type=
"file"
/>
<button
id=
"upload_button"
onclick=
"uploadFile()"
>
UPLOAD
</button>
<script>
async
function
uploadFile
()
{
let
formData
=
new
FormData
();
formData
.
append
(
"file"
,
fileupload
.
files
[
0
]);
let
response
=
await
fetch
(
'/upload'
,{
method
:
'POST'
,
body
:
formData
});
if
(
response
.
status
==
200
)
{
alert
(
"DOBRO JE"
);
}
else
{
alert
(
"NIJE DOBRO"
);
}
}
</script>
<section
class=
"home-slider owl-carousel"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment