diff --git a/src/main/resources/META-INF/resources/static/js/shots.js b/src/main/resources/META-INF/resources/static/js/shots.js index 8528985..01a9470 100644 --- a/src/main/resources/META-INF/resources/static/js/shots.js +++ b/src/main/resources/META-INF/resources/static/js/shots.js @@ -1,9 +1,6 @@ window.shots = { generateUid() { - if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') { - return crypto.randomUUID(); - } - return Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 10); + return window.uid(); }, WEIGHTS: { Soulshot: { D: 3, C: 3, B: 2, A: 2, S: 2 }, @@ -84,7 +81,7 @@ window.shots = { const grado = m[2].toUpperCase(); const cantidad = parseInt(m[3].replace(/[.,]/g, ''), 10); if (!this.WEIGHTS[tipo]?.[grado]) continue; - parsed.push({ uid: this.generateUid(), tipo, grado, cantidad }); + parsed.push({ uid: window.uid(), tipo, grado, cantidad }); } return parsed; }, diff --git a/src/main/resources/META-INF/resources/static/js/uid.js b/src/main/resources/META-INF/resources/static/js/uid.js new file mode 100644 index 0000000..a496ec5 --- /dev/null +++ b/src/main/resources/META-INF/resources/static/js/uid.js @@ -0,0 +1,6 @@ +window.uid = function () { + if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') { + return crypto.randomUUID(); + } + return Date.now().toString(36) + '-' + Math.random().toString(36).slice(2, 10); +}; diff --git a/src/main/resources/templates/PageResource/personajes.html b/src/main/resources/templates/PageResource/personajes.html index a248b67..b2bc5dc 100644 --- a/src/main/resources/templates/PageResource/personajes.html +++ b/src/main/resources/templates/PageResource/personajes.html @@ -205,6 +205,7 @@ + diff --git a/src/main/resources/templates/PageResource/ventas.html b/src/main/resources/templates/PageResource/ventas.html index a1501c5..a97d628 100644 --- a/src/main/resources/templates/PageResource/ventas.html +++ b/src/main/resources/templates/PageResource/ventas.html @@ -227,11 +227,12 @@

- - - - - + + + + + +