mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-08-06 19:28:06 +00:00
chore: second-pass cleanup — dead installer branch, broken script, orphaned JS, misfiled test deps
- first_time_install.sh: removed the pip fallback branch that installed from requirements_web_v2.txt — a file that has not existed since the v2 web interface was removed (the branch always printed its own 'not found; skipping' warning). - scripts/remove_plugin_backups.sh deleted: its PROJECT_ROOT resolved to the repo's PARENT directory, and its verify_submodules() checks for plugin submodules from an era before plugins moved to the store — it could never have worked from its current location. - plugins_manager.js: removed three functions with zero call sites anywhere (addKeyValuePair, formatCommit, togglePasswordVisibility) — verified against all templates, all JS, and the dynamic window[name] dispatch sites, which resolve widget-registry keys only. Also replaced base.html's misleading 'Legacy ... during migration' label: the file is deliberately loaded last and provides the LIVE implementations of seven window.* plugin actions that shadow same-named definitions in app.js/app-shell.js. - pytest/pytest-cov/pytest-mock moved from runtime requirements.txt to requirements-test.txt (CI already installs both files; the installer's line-by-line loop simply installs three fewer packages on devices; no store plugin declares pytest). HOW_TO_RUN_TESTS.md updated. - scripts/add_defaults_to_schemas.py and analyze_plugin_schemas.py scanned the empty legacy plugins/ dir — now scan plugin-repos/. Verified: fresh venv installs all four requirements files with pip check clean and pytest available; bash -n on the installer; node --check on the JS; widget/cache guard tests green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SXb4mKcAkVaxkeTb3YnAdr
This commit is contained in:
@@ -2299,56 +2299,6 @@ function renderArrayObjectItem(fieldId, fullKey, itemProperties, itemValue, inde
|
||||
|
||||
|
||||
// Functions to handle patternProperties key-value pairs
|
||||
window.addKeyValuePair = function(fieldId, fullKey, maxProperties) {
|
||||
const pairsContainer = document.getElementById(fieldId + '_pairs');
|
||||
if (!pairsContainer) return;
|
||||
|
||||
const currentPairs = pairsContainer.querySelectorAll('.key-value-pair');
|
||||
if (currentPairs.length >= maxProperties) {
|
||||
alert(`Maximum ${maxProperties} entries allowed`);
|
||||
return;
|
||||
}
|
||||
|
||||
const newIndex = currentPairs.length;
|
||||
const valueType = 'string'; // Default to string, could be determined from schema
|
||||
|
||||
const pairHtml = `
|
||||
<div class="flex items-center gap-2 key-value-pair" data-index="${newIndex}">
|
||||
<input type="text"
|
||||
name="${fullKey}[key_${newIndex}]"
|
||||
value=""
|
||||
placeholder="Key"
|
||||
class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
||||
data-key-index="${newIndex}"
|
||||
onchange="updateKeyValuePairData('${fieldId}', '${fullKey}')">
|
||||
<input type="text"
|
||||
name="${fullKey}[value_${newIndex}]"
|
||||
value=""
|
||||
placeholder="Value"
|
||||
class="flex-1 px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm"
|
||||
data-value-index="${newIndex}"
|
||||
onchange="updateKeyValuePairData('${fieldId}', '${fullKey}')">
|
||||
<button type="button"
|
||||
onclick="removeKeyValuePair('${fieldId}', ${newIndex})"
|
||||
class="px-3 py-2 text-red-600 hover:text-red-800 hover:bg-red-50 rounded-md transition-colors"
|
||||
title="Remove">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
|
||||
pairsContainer.insertAdjacentHTML('beforeend', pairHtml);
|
||||
updateKeyValuePairData(fieldId, fullKey);
|
||||
|
||||
// Update add button state
|
||||
const addButton = pairsContainer.nextElementSibling;
|
||||
if (addButton && currentPairs.length + 1 >= maxProperties) {
|
||||
addButton.disabled = true;
|
||||
addButton.style.opacity = '0.5';
|
||||
addButton.style.cursor = 'not-allowed';
|
||||
}
|
||||
};
|
||||
|
||||
window.removeKeyValuePair = function(fieldId, index) {
|
||||
const pairsContainer = document.getElementById(fieldId + '_pairs');
|
||||
if (!pairsContainer) return;
|
||||
@@ -4559,23 +4509,6 @@ function formatDate(dateString) {
|
||||
}
|
||||
}
|
||||
|
||||
function formatCommit(commit, branch) {
|
||||
const shortCommit = commit ? String(commit).substring(0, 7) : '';
|
||||
const branchText = branch ? String(branch) : '';
|
||||
|
||||
if (branchText && shortCommit) {
|
||||
return `${branchText} · ${shortCommit}`;
|
||||
}
|
||||
if (branchText) {
|
||||
return branchText;
|
||||
}
|
||||
if (shortCommit) {
|
||||
return shortCommit;
|
||||
}
|
||||
return 'Latest';
|
||||
}
|
||||
|
||||
// Check if plugin is new (updated within last 7 days)
|
||||
function isNewPlugin(lastUpdated) {
|
||||
if (!lastUpdated) return false;
|
||||
|
||||
@@ -4605,26 +4538,6 @@ function debounce(func, wait) {
|
||||
}
|
||||
|
||||
// Toggle password visibility for secret fields
|
||||
function togglePasswordVisibility(fieldId) {
|
||||
const input = document.getElementById(fieldId);
|
||||
const icon = document.getElementById(fieldId + '-icon');
|
||||
|
||||
if (input && icon) {
|
||||
if (input.type === 'password') {
|
||||
input.type = 'text';
|
||||
icon.classList.remove('fa-eye');
|
||||
icon.classList.add('fa-eye-slash');
|
||||
} else {
|
||||
input.type = 'password';
|
||||
icon.classList.remove('fa-eye-slash');
|
||||
icon.classList.add('fa-eye');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// GitHub Token Configuration Functions
|
||||
// Open GitHub Token Settings panel (only opens, doesn't close)
|
||||
// Used when user clicks "Configure Token" link
|
||||
window.openGithubTokenSettings = function() {
|
||||
const settings = document.getElementById('github-token-settings');
|
||||
const warning = document.getElementById('github-auth-warning');
|
||||
|
||||
Reference in New Issue
Block a user