completed

This commit is contained in:
Ske087
2025-01-25 20:03:47 +02:00
parent 014a47594e
commit fda07c701d
9 changed files with 163 additions and 42 deletions

Binary file not shown.

View File

@@ -2,7 +2,7 @@
services: services:
web: web:
image: digi_signage:latest image: digi_serverdocker :latest
ports: ports:
- "7100:5000" - "7100:5000"
environment: environment:

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 410 KiB

View File

@@ -19,11 +19,33 @@
max-width: 100px; max-width: 100px;
max-height: 100px; max-height: 100px;
} }
.popup-message {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 20px;
border-radius: 10px;
display: none;
z-index: 1000;
}
.logo {
max-height: 100px;
margin-right: 20px;
}
</style> </style>
</head> </head>
<body class="{{ 'dark-mode' if theme == 'dark' else '' }}"> <body class="{{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="container py-5"> <div class="container py-5">
<h1 class="text-center mb-4">Admin Panel</h1> <div class="d-flex justify-content-start align-items-center mb-4">
{% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Admin Panel</h1>
</div>
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}"> <div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header"> <div class="card-header">
<h2>Manage Users</h2> <h2>Manage Users</h2>
@@ -125,13 +147,13 @@
</div> </div>
</div> </div>
<!-- Change Theme Section --> <!-- Change Theme Card -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}"> <div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header"> <div class="card-header">
<h2>Change Theme</h2> <h2>Change Theme</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ url_for('change_theme') }}" method="post"> <form action="{{ url_for('change_theme') }}" method="post" onsubmit="showPopupMessage('Theme changed successfully!')">
<div class="mb-3"> <div class="mb-3">
<label for="theme" class="form-label">Select Theme</label> <label for="theme" class="form-label">Select Theme</label>
<select class="form-select" id="theme" name="theme" required> <select class="form-select" id="theme" name="theme" required>
@@ -144,11 +166,35 @@
</div> </div>
</div> </div>
<!-- Clean Script Card -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header">
<h2>Clean Unused Files</h2>
</div>
<div class="card-body">
<form action="{{ url_for('clean_unused_files') }}" method="post" onsubmit="showPopupMessage('Clean script executed successfully!')">
<button type="submit" class="btn btn-danger">Run Clean Script</button>
</form>
</div>
</div>
<div class="mt-4"> <div class="mt-4">
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Back to Dashboard</a> <a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Back to Dashboard</a>
</div> </div>
</div> </div>
<div id="popup-message" class="popup-message"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
<script>
function showPopupMessage(message) {
const popup = document.getElementById('popup-message');
popup.textContent = message;
popup.style.display = 'block';
setTimeout(() => {
popup.style.display = 'none';
}, 5000); // Increased time to 5 seconds
}
</script>
</body> </body>
</html> </html>

View File

@@ -15,36 +15,63 @@
.dark-mode label, .dark-mode th, .dark-mode td { .dark-mode label, .dark-mode th, .dark-mode td {
color: #ffffff; color: #ffffff;
} }
.logo {
max-height: 100px;
margin-right: 20px;
}
</style> </style>
</head> </head>
<body class="{{ 'dark-mode' if theme == 'dark' else '' }}"> <body class="{{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="container py-5"> <div class="container py-5">
<h1 class="text-center mb-4">Integrate Player</h1> <div class="d-flex justify-content-start align-items-center mb-4">
{% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Integrate Player</h1>
</div>
<!-- Players Section --> <!-- Players Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}"> <div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header bg-primary text-white"> <div class="card-header">
<h2>Players</h2> <h2>Players</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="row"> <ul class="list-group">
{% for player in players %} {% for player in players %}
<div class="col-md-4 mb-3"> <li class="list-group-item d-flex justify-content-between align-items-center">
<div class="card {{ 'dark-mode' if theme == 'dark' else '' }}"> <div>
<div class="card-body"> <strong>{{ player.username }}</strong>
<h5 class="card-title">{{ player.username }}</h5>
<p class="card-text">{{ player.ip }}</p>
<div class="input-group">
<input type="text" class="form-control" value="{{ url_for('player_fullscreen', player_id=player.id, _external=True) }}" readonly>
<button class="btn btn-primary" onclick="copyToClipboard(this)">Copy</button>
</div>
<a href="{{ url_for('player_fullscreen', player_id=player.id) }}" class="btn btn-primary mt-2" target="_blank">Fullscreen Link</a>
</div>
</div> </div>
<div>
<a href="{{ url_for('player_page', player_id=player.id) }}" class="btn btn-sm btn-primary">View</a>
<form action="{{ url_for('delete_player', player_id=player.id) }}" method="post" style="display:inline;">
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to delete this player?');">Delete</button>
</form>
</div> </div>
</li>
{% endfor %} {% endfor %}
</ul>
</div> </div>
</div> </div>
<!-- Add Player Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header">
<h2>Add Player</h2>
</div>
<div class="card-body">
<form action="{{ url_for('add_player') }}" method="post">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control {{ 'dark-mode' if theme == 'dark' else '' }}" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control {{ 'dark-mode' if theme == 'dark' else '' }}" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary">Add Player</button>
</form>
</div>
</div> </div>
<!-- Groups Section --> <!-- Groups Section -->

View File

@@ -15,24 +15,33 @@
.dark-mode label, .dark-mode th, .dark-mode td { .dark-mode label, .dark-mode th, .dark-mode td {
color: #ffffff; color: #ffffff;
} }
.logo {
max-height: 100px;
margin-right: 20px;
}
</style> </style>
</head> </head>
<body class="{{ 'dark-mode' if theme == 'dark' else '' }}"> <body class="{{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="container py-5"> <div class="container py-5">
<h1 class="text-center mb-4">Manage Group: {{ group.name }}</h1> <div class="d-flex justify-content-start align-items-center mb-4">
{% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Manage Group: {{ group.name }}</h1>
</div>
<!-- Add Players to Group Section --> <!-- Add Players to Group Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}"> <div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header bg-primary text-white"> <div class="card-header">
<h2>Add Players to Group</h2> <h2>Add Players to Group</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ url_for('add_player_to_group', group_id=group.id) }}" method="post"> <form action="{{ url_for('add_player_to_group', group_id=group.id) }}" method="post">
<div class="mb-3"> <div class="mb-3">
<label for="player_id" class="form-label">Select Player</label> <label for="player_id" class="form-label">Select Player</label>
<select class="form-select" id="player_id" name="player_id" required> <select class="form-select {{ 'dark-mode' if theme == 'dark' else '' }}" id="player_id" name="player_id" required>
{% for player in available_players %} {% for player in available_players %}
<option value="{{ player.id }}">{{ player.username }} ({{ player.ip }})</option> <option value="{{ player.id }}">{{ player.username }}</option>
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
@@ -41,32 +50,29 @@
</div> </div>
</div> </div>
<!-- Players in Group Section --> <!-- Group Players Section -->
<div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}"> <div class="card mb-4 {{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="card-header bg-secondary text-white"> <div class="card-header">
<h2>Players in Group</h2> <h2>Group Players</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<ul class="list-group"> <ul class="list-group">
{% for player in group.players %} {% for player in group.players %}
<li class="list-group-item {{ 'dark-mode' if theme == 'dark' else '' }}"> <li class="list-group-item d-flex justify-content-between align-items-center">
{{ player.username }} ({{ player.ip }}) <div>
<form action="{{ url_for('remove_player_from_group', group_id=group.id, player_id=player.id) }}" method="post" class="d-inline"> <strong>{{ player.username }}</strong>
<button type="submit" class="btn btn-danger btn-sm float-end">Remove</button> </div>
<div>
<form action="{{ url_for('remove_player_from_group', group_id=group.id, player_id=player.id) }}" method="post" style="display:inline;">
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Are you sure you want to remove this player from the group?');">Remove</button>
</form> </form>
</div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
</div> </div>
<!-- Replace Upload Content Card with Button -->
{% if current_user.role == 'admin' %}
<div class="text-center mb-4">
<a href="{{ url_for('upload_content', target_type='group', target_id=group.id, return_url=request.url) }}" class="btn btn-primary">Upload Content</a>
</div>
{% endif %}
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Back to Dashboard</a> <a href="{{ url_for('dashboard') }}" class="btn btn-secondary">Back to Dashboard</a>
</div> </div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>

View File

@@ -11,9 +11,11 @@
align-items: center; align-items: center;
background-color: black; background-color: black;
} }
img, video { img, video, embed, object {
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 100%;
width: 100%;
height: 100%;
display: none; display: none;
} }
.active { .active {
@@ -29,6 +31,10 @@
<source src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="video/mp4"> <source src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="video/mp4">
Your browser does not support the video tag. Your browser does not support the video tag.
</video> </video>
{% elif item.file_name.endswith('.pdf') %}
<object data="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="application/pdf" class="content-item" data-duration="{{ item.duration }}">
<embed src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" type="application/pdf" class="content-item" data-duration="{{ item.duration }}">
</object>
{% else %} {% else %}
<img src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" alt="Content Image" class="content-item" data-duration="{{ item.duration }}"> <img src="{{ url_for('static', filename='uploads/' ~ item.file_name) }}" alt="Content Image" class="content-item" data-duration="{{ item.duration }}">
{% endif %} {% endif %}

View File

@@ -15,12 +15,33 @@
.dark-mode label, .dark-mode th, .dark-mode td { .dark-mode label, .dark-mode th, .dark-mode td {
color: #ffffff; color: #ffffff;
} }
.popup-message {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.8);
color: white;
padding: 20px;
border-radius: 10px;
display: none;
z-index: 1000;
}
.logo {
max-height: 100px;
margin-right: 20px;
}
</style> </style>
</head> </head>
<body class="{{ 'dark-mode' if theme == 'dark' else '' }}"> <body class="{{ 'dark-mode' if theme == 'dark' else '' }}">
<div class="container py-5"> <div class="container py-5">
<h1 class="text-center mb-4">Upload Content</h1> <div class="d-flex justify-content-start align-items-center mb-4">
<form method="POST" enctype="multipart/form-data"> {% if logo_exists %}
<img src="{{ url_for('static', filename='uploads/logo.png') }}" alt="Logo" class="logo">
{% endif %}
<h1 class="mb-0">Upload Content</h1>
</div>
<form id="upload-form" action="{{ url_for('upload_content') }}" method="post" enctype="multipart/form-data" onsubmit="showPopupMessage('Content uploaded successfully!')">
<input type="hidden" name="return_url" value="{{ return_url }}"> <input type="hidden" name="return_url" value="{{ return_url }}">
<div class="mb-3"> <div class="mb-3">
<label for="target_type" class="form-label">Target Type:</label> <label for="target_type" class="form-label">Target Type:</label>
@@ -55,6 +76,8 @@
<select name="media_type" id="media_type" class="form-select" required> <select name="media_type" id="media_type" class="form-select" required>
<option value="image">Image</option> <option value="image">Image</option>
<option value="video">Video</option> <option value="video">Video</option>
<option value="pdf">PDF</option>
<option value="ppt">PPT/PPTX</option>
</select> </select>
</div> </div>
<div class="mb-3"> <div class="mb-3">
@@ -70,6 +93,9 @@
<a href="{{ return_url }}" class="btn btn-secondary mt-3">Back</a> <a href="{{ return_url }}" class="btn btn-secondary mt-3">Back</a>
<a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-3">Back to Dashboard</a> <a href="{{ url_for('dashboard') }}" class="btn btn-secondary mt-3">Back to Dashboard</a>
</div> </div>
<div id="popup-message" class="popup-message"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
<script> <script>
document.getElementById('files').addEventListener('change', function(event) { document.getElementById('files').addEventListener('change', function(event) {
@@ -87,6 +113,16 @@
videoElement.src = URL.createObjectURL(videoFile); videoElement.src = URL.createObjectURL(videoFile);
} }
}); });
function showPopupMessage(message) {
const popup = document.getElementById('popup-message');
popup.textContent = message;
popup.style.display = 'block';
setTimeout(() => {
popup.style.display = 'none';
document.getElementById('upload-form').submit();
}, 5000); // Display time set to 5 seconds
}
</script> </script>
</body> </body>
</html> </html>