Added discord webhooks, better filtering, and automated ticket creation
This commit is contained in:
@ -139,6 +139,61 @@ body {
|
||||
background: rgba(239, 68, 68, 0.1);
|
||||
}
|
||||
|
||||
.status-dropdown {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.dropdown-header {
|
||||
padding: 8px 15px;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
background: var(--bg-secondary);
|
||||
min-width: 160px;
|
||||
box-shadow: var(--shadow);
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
z-index: 100;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.status-dropdown.active .dropdown-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-content label {
|
||||
display: block;
|
||||
padding: 8px;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.dropdown-content label:hover {
|
||||
background: var(--hover-bg);
|
||||
}
|
||||
|
||||
.dropdown-content .save-filter {
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
padding: 8px;
|
||||
background: #3b82f6;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*UNCHECKED BELOW*/
|
||||
|
||||
body.menu-open {
|
||||
|
||||
@ -291,25 +291,62 @@ function initSearch() {
|
||||
|
||||
// Filter by status
|
||||
function initStatusFilter() {
|
||||
const filter = document.createElement('select');
|
||||
filter.innerHTML = `
|
||||
<option value="">All Status</option>
|
||||
<option value="Open">Open</option>
|
||||
<option value="Closed">Closed</option>
|
||||
`;
|
||||
filter.className = 'status-filter';
|
||||
filter.onchange = (e) => {
|
||||
const status = e.target.value;
|
||||
const rows = document.querySelectorAll('tbody tr');
|
||||
rows.forEach(row => {
|
||||
if (!status || row.querySelector('.status-' + status)) {
|
||||
row.style.display = '';
|
||||
} else {
|
||||
row.style.display = 'none';
|
||||
}
|
||||
});
|
||||
const filterContainer = document.createElement('div');
|
||||
filterContainer.className = 'status-filter-container';
|
||||
|
||||
// Create dropdown container
|
||||
const dropdown = document.createElement('div');
|
||||
dropdown.className = 'status-dropdown';
|
||||
|
||||
// Create dropdown header
|
||||
const dropdownHeader = document.createElement('div');
|
||||
dropdownHeader.className = 'dropdown-header';
|
||||
dropdownHeader.textContent = 'Status Filter';
|
||||
|
||||
// Create dropdown content
|
||||
const dropdownContent = document.createElement('div');
|
||||
dropdownContent.className = 'dropdown-content';
|
||||
|
||||
const statuses = ['Open', 'Closed'];
|
||||
statuses.forEach(status => {
|
||||
const label = document.createElement('label');
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.value = status;
|
||||
checkbox.id = `status-${status.toLowerCase()}`;
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const currentStatuses = urlParams.get('status') ? urlParams.get('status').split(',') : [];
|
||||
checkbox.checked = currentStatuses.includes(status);
|
||||
|
||||
label.appendChild(checkbox);
|
||||
label.appendChild(document.createTextNode(status));
|
||||
dropdownContent.appendChild(label);
|
||||
});
|
||||
|
||||
const saveButton = document.createElement('button');
|
||||
saveButton.className = 'btn save-filter';
|
||||
saveButton.textContent = 'Apply Filter';
|
||||
|
||||
saveButton.onclick = () => {
|
||||
const checkedBoxes = dropdownContent.querySelectorAll('input:checked');
|
||||
const selectedStatuses = Array.from(checkedBoxes).map(cb => cb.value);
|
||||
localStorage.setItem('statusFilter', selectedStatuses.join(','));
|
||||
window.location.href = selectedStatuses.length ? `?status=${selectedStatuses.join(',')}` : '?';
|
||||
dropdown.classList.remove('active');
|
||||
};
|
||||
document.querySelector('.table-controls .table-actions').prepend(filter);
|
||||
|
||||
// Toggle dropdown on header click
|
||||
dropdownHeader.onclick = () => {
|
||||
dropdown.classList.toggle('active');
|
||||
};
|
||||
|
||||
dropdown.appendChild(dropdownHeader);
|
||||
dropdown.appendChild(dropdownContent);
|
||||
dropdownContent.appendChild(saveButton);
|
||||
filterContainer.appendChild(dropdown);
|
||||
|
||||
document.querySelector('.table-controls .table-actions').prepend(filterContainer);
|
||||
}
|
||||
|
||||
function sortTable(table, column) {
|
||||
|
||||
Reference in New Issue
Block a user