mirror of
https://github.com/house-of-vanity/OutFleet.git
synced 2025-07-07 09:24:07 +00:00
Django UI
This commit is contained in:
21
static/admin/js/generate_uuid.js
Normal file
21
static/admin/js/generate_uuid.js
Normal file
@ -0,0 +1,21 @@
|
||||
// static/admin/js/generate_uuid.js
|
||||
|
||||
function generateUUID() {
|
||||
let uuid = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const length = 10;
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
||||
uuid += characters[randomIndex];
|
||||
}
|
||||
|
||||
const hashField = document.getElementById('id_hash');
|
||||
if (hashField) {
|
||||
hashField.value = uuid;
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
generateUUID();
|
||||
});
|
Reference in New Issue
Block a user