This commit is contained in:
Michael Wain 2024-07-13 21:24:58 +03:00
parent 3c5522b475
commit b90f85a924
3 changed files with 16 additions and 7 deletions

View File

@ -38,6 +38,14 @@ public class FileServerController {
"attachment; filename=\"" + file.getFilename() + "\"").body(file);
}
@GetMapping("/static/cube/{filename:.+}")
@ResponseBody
public ResponseEntity<Resource> serveCube(@PathVariable String filename) {
Resource file = storageService.loadAsResource("static/cube/" + filename);
return ResponseEntity.ok().contentType(MediaType.IMAGE_JPEG).header(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=\"" + file.getFilename() + "\"").body(file);
}
@ExceptionHandler(StorageFileNotFoundException.class)
public ResponseEntity<?> handleStorageFileNotFound(StorageFileNotFoundException exc) {
return ResponseEntity.notFound().build();

View File

@ -468,32 +468,32 @@ h2 {
}
.dice_front {
background-image: url("monopoly/cube/1.jpg");
background-image: url("/cube/1.jpg");
background-size: 200px;
transform:rotateY(0deg) translateZ(100px);
}
.dice_right {
background-image: url("monopoly/cube/2.jpg");
background-image: url("/cube/2.jpg");
background-size: 200px;
transform:rotateY(90deg) translateZ(100px);
}
.dice_back {
background-image: url("monopoly/cube/3.jpg");
background-image: url("/cube/3.jpg");
background-size: 200px;
transform:rotateY(180deg) translateZ(100px);
}
.dice_left {
background-image: url("monopoly/cube/4.jpg");
background-image: url("/cube/4.jpg");
background-size: 200px;
transform:rotateY(-90deg) translateZ(100px);
}
.dice_top {
background-image: url("monopoly/cube/5.jpg");
background-image: url("/cube/5.jpg");
background-size: 200px;
transform:rotateX(90deg) translateZ(100px);
}
.dice_bottom {
background-image: url("monopoly/cube/6.jpg");
background-image: url("/cube/6.jpg");
background-size: 200px;
transform:rotateX(-90deg) translateZ(100px);
}

View File

@ -112,7 +112,6 @@ $(document).ready(function() {
};
socket.onmessage = function(e) {
//console.log('message', e.data);
showMessage(jsonParseFixer(JSON.parse(e.data)));
};
@ -172,6 +171,8 @@ function actionButtonClicked(action) {
function showDialog(body) {
let title = body.dialogTitle;
let descr = body.dialogDescription;
$("#dialog_desc").html(descr);
$("#dialog_title").html(title);
if( body.actionDialogType == "Buttons" ) {
let btns = body.actionDialogBody.value;
let html_btns = '';