Revize 1e4fafce
Přidáno uživatelem stepanekp před asi 3 roky(ů)
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/controller/AppController.java | ||
---|---|---|
349 | 349 |
* @throws Exception If image is not in the folder |
350 | 350 |
*/ |
351 | 351 |
@GetMapping("/operationalizations/images/{imageName}") |
352 |
public @ResponseBody byte[] imageTestGet(@PathVariable String imageName) throws Exception {
|
|
352 |
public @ResponseBody byte[] imageGet(@PathVariable String imageName) throws Exception { |
|
353 | 353 |
File f = new File(new FileSystemResource("").getFile().getAbsolutePath() + "\\src\\main\\webapp\\operationalizations\\images\\" + imageName); |
354 | 354 |
return Files.readAllBytes(f.toPath()); |
355 | 355 |
} |
src/main/webapp/WEB-INF/templates/configuration.html | ||
---|---|---|
34 | 34 |
<h1>Configuration</h1> |
35 | 35 |
|
36 | 36 |
<!-- Form for configuration values --> |
37 |
<form action="#" th:action="@{/configuration}" th:object="${antiPatterns}" method="post"> |
|
37 |
<form action="#" th:action="@{/configuration}" th:object="${antiPatterns}" method="post" id="configuration-form">
|
|
38 | 38 |
<div th:each="antiPattern : ${antiPatterns}"> |
39 | 39 |
<h3 th:text="${antiPattern.printName}"></h3> |
40 | 40 |
<div th:each="threshold : ${antiPattern.thresholds}"> |
... | ... | |
88 | 88 |
|
89 | 89 |
<!-- Submit button to save configuration --> |
90 | 90 |
<div class="text-center save-configuration-button-container"> |
91 |
<button type="submit" class="btn btn-primary btn-lg custom-button" id="configuration-save-button" name="configuration-save-button" hidden>Save</button> |
|
91 |
<button type="submit" class="btn btn-primary btn-lg custom-button" id="configuration-save-button" name="configuration-save-button" disabled hidden>Save</button>
|
|
92 | 92 |
<div class="input-group w-25 mx-auto" style="margin: 15px"> |
93 |
<input type="text" class="form-control" placeholder="New configuration name" id="configuration-save-as-input" name="configuration-save-as-input"> |
|
93 |
<input type="text" class="form-control" placeholder="New configuration name" id="configuration-save-as-input" name="configuration-save-as-input" required>
|
|
94 | 94 |
<div class="input-group-append"> |
95 |
<button type="submit" class="btn btn-outline-primary" id="configuration-save-as-button" name="configuration-save-as-button" hidden>Save as</button> |
|
95 |
<button type="submit" class="btn btn-outline-primary" id="configuration-save-as-button" name="configuration-save-as-button" disabled hidden>Save as</button>
|
|
96 | 96 |
</div> |
97 | 97 |
</div> |
98 | 98 |
</div> |
src/main/webapp/WEB-INF/templates/fragments/navbar.html | ||
---|---|---|
7 | 7 |
<div class="collapse navbar-collapse" id="navbarSupportedContent"> |
8 | 8 |
<ul class="navbar-nav mr-auto"> |
9 | 9 |
<li class="nav-item active"> |
10 |
<a class="nav-link" th:href="@{/}">Home</a>
|
|
10 |
<a class="nav-link" th:href="@{/}">Analyze</a>
|
|
11 | 11 |
</li> |
12 | 12 |
<li class="nav-item active"> |
13 | 13 |
<a class="nav-link" th:href="@{/configuration}">Configuration</a> |
... | ... | |
22 | 22 |
</li> |
23 | 23 |
<li class="nav-item active" id="current-configuration-box"> |
24 | 24 |
<form id="configuration-form" th:action="@{/setSelectedConfiguration}" method="post"> |
25 |
<select class="form-control" id="current-configuration-select" name="current-configuration-select" onchange="this.form.submit()"> |
|
25 |
<select class="form-control" id="current-configuration-select" name="current-configuration-select" onchange="this.form.submit()" disabled>
|
|
26 | 26 |
<option th:each="configuration : ${configurationList}" th:value = ${configuration} th:text = ${configuration} th:selected="${#strings.equals(configuration, selectedConfiguration)}"></option> |
27 | 27 |
</select> |
28 | 28 |
</form> |
src/main/webapp/resources/js/config-edit.js | ||
---|---|---|
31 | 31 |
* Show only 'Save as' button |
32 | 32 |
*/ |
33 | 33 |
function showSaveAsButton(){ |
34 |
if(document.getElementById("configuration-save-button") != null) |
|
34 |
if(document.getElementById("configuration-save-button") != null) {
|
|
35 | 35 |
document.getElementById("configuration-save-button").hidden = true; |
36 |
|
|
37 |
if(document.getElementById("configuration-save-button-individual") != null) |
|
36 |
document.getElementById("configuration-save-button").disabled = true; |
|
37 |
} |
|
38 |
if(document.getElementById("configuration-save-button-individual") != null) { |
|
38 | 39 |
document.getElementById("configuration-save-button-individual").hidden = true; |
39 |
|
|
40 |
if(document.getElementById("configuration-save-as-button") != null) |
|
40 |
document.getElementById("configuration-save-button-individual").disabled = true; |
|
41 |
} |
|
42 |
if(document.getElementById("configuration-save-as-button") != null) { |
|
41 | 43 |
document.getElementById("configuration-save-as-button").hidden = false; |
42 |
|
|
43 |
if(document.getElementById("configuration-save-as-input") != null) |
|
44 |
document.getElementById("configuration-save-as-button").disabled = false; |
|
45 |
} |
|
46 |
if(document.getElementById("configuration-save-as-input") != null) { |
|
44 | 47 |
document.getElementById("configuration-save-as-input").hidden = false; |
48 |
document.getElementById("configuration-save-as-input").disabled = false; |
|
49 |
} |
|
45 | 50 |
} |
46 | 51 |
|
47 | 52 |
/** |
48 | 53 |
* Show both save buttons |
49 | 54 |
*/ |
50 | 55 |
function showBothSaveButtons(){ |
51 |
if(document.getElementById("configuration-save-button") != null) |
|
52 |
document.getElementById("configuration-save-button").hidden = false; |
|
53 |
|
|
54 |
if(document.getElementById("configuration-save-button-individual") != null) |
|
56 |
if(document.getElementById("configuration-save-button") != null) { |
|
57 |
document.getElementById("configuration-save-button").hidden = false; |
|
58 |
document.getElementById("configuration-save-button").disabled = false; |
|
59 |
} |
|
60 |
if(document.getElementById("configuration-save-button-individual") != null) { |
|
55 | 61 |
document.getElementById("configuration-save-button-individual").hidden = false; |
56 |
|
|
57 |
if(document.getElementById("configuration-save-as-button") != null) |
|
62 |
document.getElementById("configuration-save-button-individual").disabled = false; |
|
63 |
} |
|
64 |
if(document.getElementById("configuration-save-as-button") != null) { |
|
58 | 65 |
document.getElementById("configuration-save-as-button").hidden = false; |
59 |
|
|
60 |
if(document.getElementById("configuration-save-as-input") != null) |
|
66 |
document.getElementById("configuration-save-as-button").disabled = false; |
|
67 |
} |
|
68 |
if(document.getElementById("configuration-save-as-input") != null) { |
|
61 | 69 |
document.getElementById("configuration-save-as-input").hidden = false; |
70 |
document.getElementById("configuration-save-as-input").disabled = false; |
|
71 |
} |
|
62 | 72 |
} |
63 | 73 |
|
64 | 74 |
/** |
65 | 75 |
* Hide both save buttons |
66 | 76 |
*/ |
67 | 77 |
function hideBothSaveButtons(){ |
68 |
if(document.getElementById("configuration-save-button") != null) |
|
78 |
if(document.getElementById("configuration-save-button") != null) {
|
|
69 | 79 |
document.getElementById("configuration-save-button").hidden = true; |
70 |
|
|
71 |
if(document.getElementById("configuration-save-button-individual") != null) |
|
80 |
document.getElementById("configuration-save-button").disabled = true; |
|
81 |
} |
|
82 |
if(document.getElementById("configuration-save-button-individual") != null) { |
|
72 | 83 |
document.getElementById("configuration-save-button-individual").hidden = true; |
73 |
|
|
74 |
if(document.getElementById("configuration-save-as-button") != null) |
|
84 |
document.getElementById("configuration-save-button-individual").disabled = true; |
|
85 |
} |
|
86 |
if(document.getElementById("configuration-save-as-button") != null) { |
|
75 | 87 |
document.getElementById("configuration-save-as-button").hidden = true; |
76 |
|
|
77 |
if(document.getElementById("configuration-save-as-input") != null) |
|
88 |
document.getElementById("configuration-save-as-button").disabled = true; |
|
89 |
} |
|
90 |
if(document.getElementById("configuration-save-as-input") != null) { |
|
78 | 91 |
document.getElementById("configuration-save-as-input").hidden = true; |
92 |
document.getElementById("configuration-save-as-input").disabled = true; |
|
93 |
} |
|
79 | 94 |
} |
src/main/webapp/resources/js/editor.js | ||
---|---|---|
122 | 122 |
return; |
123 | 123 |
} |
124 | 124 |
else{ |
125 |
alert("Image upload error.");
|
|
125 |
alert("Upload error. Max size of image is 1048576 bytes.");
|
|
126 | 126 |
document.getElementById('imageInput').files[0] = null; |
127 | 127 |
return; |
128 | 128 |
} |
src/main/webapp/resources/js/login.js | ||
---|---|---|
26 | 26 |
function applyUnloggedStyle(){ |
27 | 27 |
document.getElementById("login-button").hidden = false; |
28 | 28 |
document.getElementById("logout-button").hidden = true; |
29 |
document.getElementById("current-configuration-select").disabled = true; |
|
29 | 30 |
} |
30 | 31 |
|
31 | 32 |
/** |
... | ... | |
36 | 37 |
document.getElementById("logout-button").hidden = false; |
37 | 38 |
document.getElementById("user-name-container").innerText = user; |
38 | 39 |
document.getElementById("user-name-container").hidden = false; |
40 |
document.getElementById("current-configuration-select").disabled = false; |
|
39 | 41 |
} |
Také k dispozici: Unified diff
Minor changes