feat: add cyberpunk theme to Apps Manager with debug logging and UCI config
SecuBox Core (v0.8.0-7): - Added UCI config /etc/config/secubox-appstore with multi-source catalog - Sources: GitHub (priority 1), Local Web, USB, Embedded fallback LuCI Admin Apps Manager (v1.0.0-11): - Cyberpunk UI transformation with debug logging - Neon terminal aesthetic with animated status indicators - Enhanced error handling with empty state messaging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
19eeae6a86
commit
4b8d72b6f6
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=luci-app-secubox-admin
|
PKG_NAME:=luci-app-secubox-admin
|
||||||
PKG_VERSION:=1.0.0
|
PKG_VERSION:=1.0.0
|
||||||
PKG_RELEASE:=10
|
PKG_RELEASE:=11
|
||||||
PKG_LICENSE:=MIT
|
PKG_LICENSE:=MIT
|
||||||
PKG_MAINTAINER:=CyberMind <contact@cybermind.fr>
|
PKG_MAINTAINER:=CyberMind <contact@cybermind.fr>
|
||||||
|
|
||||||
|
|||||||
@ -7,19 +7,34 @@
|
|||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
load: function() {
|
load: function() {
|
||||||
|
console.log('[APPS] Loading data...');
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
L.resolveDefault(API.getApps(), { apps: [] }),
|
L.resolveDefault(API.getApps(), { apps: [] }),
|
||||||
L.resolveDefault(API.getModules(), { modules: {} }),
|
L.resolveDefault(API.getModules(), { modules: {} }),
|
||||||
L.resolveDefault(API.checkUpdates(), {})
|
L.resolveDefault(API.checkUpdates(), { updates: [] })
|
||||||
]);
|
]).then(function(results) {
|
||||||
|
console.log('[APPS] Data loaded:', {
|
||||||
|
apps: results[0],
|
||||||
|
modules: results[1],
|
||||||
|
updates: results[2]
|
||||||
|
});
|
||||||
|
return results;
|
||||||
|
}).catch(function(err) {
|
||||||
|
console.error('[APPS] Load error:', err);
|
||||||
|
return [{ apps: [] }, { modules: {} }, { updates: [] }];
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function(data) {
|
render: function(data) {
|
||||||
|
console.log('[APPS] Rendering with data:', data);
|
||||||
var apps = data[0].apps || [];
|
var apps = data[0].apps || [];
|
||||||
var modules = data[1].modules || {};
|
var modules = data[1].modules || {};
|
||||||
var updateInfo = data[2] || {};
|
var updateInfo = data[2] || {};
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
console.log('[APPS] Apps count:', apps.length);
|
||||||
|
console.log('[APPS] Updates:', updateInfo);
|
||||||
|
|
||||||
// Create updates lookup map
|
// Create updates lookup map
|
||||||
var updatesMap = {};
|
var updatesMap = {};
|
||||||
if (updateInfo.updates) {
|
if (updateInfo.updates) {
|
||||||
@ -28,57 +43,87 @@ return view.extend({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var container = E('div', { 'class': 'secubox-apps-manager' }, [
|
var container = E('div', { 'class': 'cyberpunk-mode secubox-apps-manager' }, [
|
||||||
E('link', { 'rel': 'stylesheet',
|
E('link', { 'rel': 'stylesheet',
|
||||||
'href': L.resource('secubox-admin/common.css') }),
|
'href': L.resource('secubox-admin/common.css') }),
|
||||||
E('link', { 'rel': 'stylesheet',
|
E('link', { 'rel': 'stylesheet',
|
||||||
'href': L.resource('secubox-admin/admin.css') }),
|
'href': L.resource('secubox-admin/admin.css') }),
|
||||||
|
E('link', { 'rel': 'stylesheet',
|
||||||
|
'href': L.resource('secubox-admin/cyberpunk.css') }),
|
||||||
|
|
||||||
E('h2', {}, 'Apps Manager'),
|
// Cyberpunk header
|
||||||
E('p', {}, 'Browse and manage SecuBox applications from the catalog'),
|
E('div', { 'class': 'cyber-header' }, [
|
||||||
|
E('div', { 'class': 'cyber-header-title' }, '📦 APPS MANAGER'),
|
||||||
|
E('div', { 'class': 'cyber-header-subtitle' },
|
||||||
|
'Browse and manage SecuBox applications · ' + apps.length + ' apps available')
|
||||||
|
]),
|
||||||
|
|
||||||
// Filters
|
// Cyber filters panel
|
||||||
E('div', { 'class': 'app-filters' }, [
|
E('div', { 'class': 'cyber-panel' }, [
|
||||||
E('input', {
|
E('div', { 'class': 'cyber-panel-header' }, [
|
||||||
'type': 'text',
|
E('span', { 'class': 'cyber-panel-title' }, 'FILTERS'),
|
||||||
'class': 'search-box',
|
E('span', { 'class': 'cyber-panel-badge' }, apps.length)
|
||||||
'placeholder': 'Search apps...',
|
|
||||||
'keyup': function(ev) {
|
|
||||||
self.filterApps(ev.target.value);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
E('select', {
|
|
||||||
'class': 'category-filter',
|
|
||||||
'change': function(ev) {
|
|
||||||
self.filterByCategory(ev.target.value);
|
|
||||||
}
|
|
||||||
}, [
|
|
||||||
E('option', { 'value': '' }, 'All Categories'),
|
|
||||||
E('option', { 'value': 'security' }, 'Security'),
|
|
||||||
E('option', { 'value': 'network' }, 'Network'),
|
|
||||||
E('option', { 'value': 'hosting' }, 'Hosting'),
|
|
||||||
E('option', { 'value': 'productivity' }, 'Productivity')
|
|
||||||
]),
|
]),
|
||||||
E('select', {
|
E('div', { 'class': 'cyber-panel-body' }, [
|
||||||
'class': 'status-filter',
|
E('input', {
|
||||||
'change': function(ev) {
|
'type': 'text',
|
||||||
self.filterByStatus(ev.target.value);
|
'class': 'cyber-input',
|
||||||
}
|
'placeholder': 'Search apps...',
|
||||||
|
'style': 'width: 100%; margin-bottom: 10px; padding: 8px; background: rgba(0,255,65,0.1); border: 1px solid var(--cyber-border); color: var(--cyber-text); font-family: inherit;',
|
||||||
|
'keyup': function(ev) {
|
||||||
|
console.log('[APPS] Search:', ev.target.value);
|
||||||
|
self.filterApps(ev.target.value);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
E('select', {
|
||||||
|
'class': 'cyber-select',
|
||||||
|
'style': 'width: 100%; margin-bottom: 10px; padding: 8px; background: rgba(0,255,65,0.1); border: 1px solid var(--cyber-border); color: var(--cyber-text); font-family: inherit;',
|
||||||
|
'change': function(ev) {
|
||||||
|
console.log('[APPS] Category filter:', ev.target.value);
|
||||||
|
self.filterByCategory(ev.target.value);
|
||||||
|
}
|
||||||
}, [
|
}, [
|
||||||
E('option', { 'value': '' }, 'All Apps'),
|
E('option', { 'value': '' }, '→ All Categories'),
|
||||||
E('option', { 'value': 'update-available' }, 'Updates Available'),
|
E('option', { 'value': 'security' }, '🔒 Security'),
|
||||||
E('option', { 'value': 'installed' }, 'Installed'),
|
E('option', { 'value': 'network' }, '🌐 Network'),
|
||||||
E('option', { 'value': 'not-installed' }, 'Not Installed')
|
E('option', { 'value': 'hosting' }, '☁️ Hosting'),
|
||||||
|
E('option', { 'value': 'productivity' }, '📊 Productivity'),
|
||||||
|
E('option', { 'value': 'monitoring' }, '📡 Monitoring'),
|
||||||
|
E('option', { 'value': 'storage' }, '💾 Storage')
|
||||||
|
]),
|
||||||
|
E('select', {
|
||||||
|
'class': 'cyber-select',
|
||||||
|
'style': 'width: 100%; padding: 8px; background: rgba(0,255,65,0.1); border: 1px solid var(--cyber-border); color: var(--cyber-text); font-family: inherit;',
|
||||||
|
'change': function(ev) {
|
||||||
|
console.log('[APPS] Status filter:', ev.target.value);
|
||||||
|
self.filterByStatus(ev.target.value);
|
||||||
|
}
|
||||||
|
}, [
|
||||||
|
E('option', { 'value': '' }, '→ All Apps'),
|
||||||
|
E('option', { 'value': 'update-available' }, '⚡ Updates Available'),
|
||||||
|
E('option', { 'value': 'installed' }, '✓ Installed'),
|
||||||
|
E('option', { 'value': 'not-installed' }, '○ Not Installed')
|
||||||
|
])
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
|
|
||||||
// Apps grid
|
// Apps list (cyberpunk style)
|
||||||
E('div', { 'class': 'apps-grid', 'id': 'apps-grid' },
|
E('div', { 'class': 'cyber-list', 'id': 'apps-grid' },
|
||||||
apps.map(function(app) {
|
apps.length > 0 ?
|
||||||
var status = API.getAppStatus(app, modules);
|
apps.map(function(app) {
|
||||||
var updateAvailable = updatesMap[app.id];
|
console.log('[APPS] Rendering app:', app.id, app);
|
||||||
return self.renderAppCard(app, status, updateAvailable);
|
var status = API.getAppStatus(app, modules);
|
||||||
})
|
var updateAvailable = updatesMap[app.id];
|
||||||
|
return self.renderAppCard(app, status, updateAvailable);
|
||||||
|
}) :
|
||||||
|
[E('div', { 'class': 'cyber-panel' }, [
|
||||||
|
E('div', { 'class': 'cyber-panel-body', 'style': 'text-align: center; padding: 40px;' }, [
|
||||||
|
E('div', { 'style': 'font-size: 48px; margin-bottom: 20px;' }, '📦'),
|
||||||
|
E('div', { 'style': 'color: var(--cyber-text-dim);' }, 'NO APPS FOUND'),
|
||||||
|
E('div', { 'style': 'color: var(--cyber-text-dim); font-size: 12px; margin-top: 10px;' },
|
||||||
|
'Check catalog sources or sync catalog')
|
||||||
|
])
|
||||||
|
])]
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -88,62 +133,82 @@ return view.extend({
|
|||||||
renderAppCard: function(app, status, updateInfo) {
|
renderAppCard: function(app, status, updateInfo) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var hasUpdate = updateInfo && updateInfo.update_available;
|
var hasUpdate = updateInfo && updateInfo.update_available;
|
||||||
|
var isInstalled = status && status.installed;
|
||||||
|
|
||||||
var cardClasses = 'app-card';
|
console.log('[APPS] Rendering card for:', app.id, {isInstalled: isInstalled, hasUpdate: hasUpdate});
|
||||||
if (status.installed) cardClasses += ' installed';
|
|
||||||
if (hasUpdate) cardClasses += ' has-update';
|
var itemClass = 'cyber-list-item';
|
||||||
|
if (isInstalled) itemClass += ' active';
|
||||||
|
|
||||||
return E('div', {
|
return E('div', {
|
||||||
'class': cardClasses,
|
'class': itemClass,
|
||||||
'data-category': app.category,
|
'data-category': app.category,
|
||||||
'data-update-status': hasUpdate ? 'update-available' : '',
|
'data-update-status': hasUpdate ? 'update-available' : '',
|
||||||
'data-install-status': status.installed ? 'installed' : 'not-installed'
|
'data-install-status': isInstalled ? 'installed' : 'not-installed'
|
||||||
}, [
|
}, [
|
||||||
E('div', { 'class': 'app-icon' }, app.icon || '📦'),
|
// Icon
|
||||||
E('div', { 'class': 'app-info' }, [
|
E('div', { 'class': 'cyber-list-icon' }, app.icon || '📦'),
|
||||||
E('div', { 'class': 'app-title-row' }, [
|
|
||||||
E('h3', {}, app.name),
|
// Content
|
||||||
hasUpdate ? E('span', { 'class': 'badge badge-warning update-badge' }, 'Update') : null
|
E('div', { 'class': 'cyber-list-content' }, [
|
||||||
|
E('div', { 'class': 'cyber-list-title' }, [
|
||||||
|
app.name,
|
||||||
|
isInstalled ? E('span', { 'class': 'cyber-badge success' }, [
|
||||||
|
E('span', { 'class': 'cyber-status-dot online' }),
|
||||||
|
' INSTALLED'
|
||||||
|
]) : null,
|
||||||
|
hasUpdate ? E('span', { 'class': 'cyber-badge warning' }, [
|
||||||
|
'⚡ UPDATE'
|
||||||
|
]) : null
|
||||||
]),
|
]),
|
||||||
E('p', { 'class': 'app-description' }, app.description),
|
E('div', { 'class': 'cyber-list-meta' }, [
|
||||||
E('div', { 'class': 'app-meta' }, [
|
E('span', { 'class': 'cyber-list-meta-item' }, [
|
||||||
E('span', { 'class': 'app-category' }, app.category),
|
E('span', {}, '📁 '),
|
||||||
E('span', {
|
app.category || 'general'
|
||||||
'class': 'app-version' + (hasUpdate ? ' version-outdated' : ''),
|
]),
|
||||||
'title': hasUpdate ?
|
E('span', { 'class': 'cyber-list-meta-item' }, [
|
||||||
'Installed: ' + updateInfo.installed_version + ' → Available: ' + updateInfo.catalog_version :
|
E('span', {}, '🔖 '),
|
||||||
''
|
'v' + (app.pkg_version || app.version || '1.0')
|
||||||
}, 'v' + (app.pkg_version || app.version || '1.0')),
|
]),
|
||||||
Components.renderStatusBadge(status.status)
|
hasUpdate ? E('span', { 'class': 'cyber-list-meta-item' }, [
|
||||||
|
E('span', {}, '→ '),
|
||||||
|
'v' + updateInfo.catalog_version
|
||||||
|
]) : null
|
||||||
])
|
])
|
||||||
]),
|
]),
|
||||||
E('div', { 'class': 'app-actions' },
|
|
||||||
status.installed ? [
|
// Actions
|
||||||
|
E('div', { 'class': 'cyber-list-actions' },
|
||||||
|
isInstalled ? [
|
||||||
hasUpdate ? E('button', {
|
hasUpdate ? E('button', {
|
||||||
'class': 'btn btn-sm btn-warning',
|
'class': 'cyber-btn warning',
|
||||||
'click': function() { self.updateApp(app, updateInfo); }
|
'click': function() {
|
||||||
}, 'Update') : null,
|
console.log('[APPS] Update app:', app.id);
|
||||||
|
self.updateApp(app, updateInfo);
|
||||||
|
}
|
||||||
|
}, '⚡ UPDATE') : null,
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'btn btn-sm btn-secondary',
|
'class': 'cyber-btn',
|
||||||
'click': function() { self.viewChangelog(app); }
|
'click': function() {
|
||||||
}, 'Changelog'),
|
console.log('[APPS] Configure app:', app.id);
|
||||||
|
self.configureApp(app);
|
||||||
|
}
|
||||||
|
}, '⚙️ CONFIG'),
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'btn btn-sm btn-primary',
|
'class': 'cyber-btn danger',
|
||||||
'click': function() { self.configureApp(app); }
|
'click': function() {
|
||||||
}, 'Configure'),
|
console.log('[APPS] Remove app:', app.id);
|
||||||
E('button', {
|
self.removeApp(app);
|
||||||
'class': 'btn btn-sm btn-danger',
|
}
|
||||||
'click': function() { self.removeApp(app); }
|
}, '🗑️ REMOVE')
|
||||||
}, 'Remove')
|
|
||||||
] : [
|
] : [
|
||||||
E('button', {
|
E('button', {
|
||||||
'class': 'btn btn-sm btn-secondary',
|
'class': 'cyber-btn primary',
|
||||||
'click': function() { self.viewChangelog(app); }
|
'click': function() {
|
||||||
}, 'Changelog'),
|
console.log('[APPS] Install app:', app.id);
|
||||||
E('button', {
|
self.installApp(app);
|
||||||
'class': 'btn btn-sm btn-success',
|
}
|
||||||
'click': function() { self.installApp(app); }
|
}, '⬇️ INSTALL')
|
||||||
}, 'Install')
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=secubox-core
|
PKG_NAME:=secubox-core
|
||||||
PKG_VERSION:=0.8.0
|
PKG_VERSION:=0.8.0
|
||||||
PKG_RELEASE:=6
|
PKG_RELEASE:=7
|
||||||
PKG_ARCH:=all
|
PKG_ARCH:=all
|
||||||
PKG_LICENSE:=GPL-2.0
|
PKG_LICENSE:=GPL-2.0
|
||||||
PKG_MAINTAINER:=SecuBox Team
|
PKG_MAINTAINER:=SecuBox Team
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
config settings 'main'
|
config settings 'main'
|
||||||
option enabled '1'
|
option enabled '1'
|
||||||
option auto_sync '0'
|
option auto_sync '0'
|
||||||
option sync_interval '86400'
|
|
||||||
option force_source ''
|
option force_source ''
|
||||||
option check_updates_on_boot '1'
|
|
||||||
option notify_updates '1'
|
option notify_updates '1'
|
||||||
|
|
||||||
config source 'github'
|
config source 'github'
|
||||||
@ -13,7 +11,6 @@ config source 'github'
|
|||||||
option url 'https://raw.githubusercontent.com/cybermind-studios/secubox-catalog/main/catalog.json'
|
option url 'https://raw.githubusercontent.com/cybermind-studios/secubox-catalog/main/catalog.json'
|
||||||
option priority '1'
|
option priority '1'
|
||||||
option timeout '30'
|
option timeout '30'
|
||||||
option verify_ssl '1'
|
|
||||||
|
|
||||||
config source 'local_web'
|
config source 'local_web'
|
||||||
option enabled '0'
|
option enabled '0'
|
||||||
@ -21,23 +18,15 @@ config source 'local_web'
|
|||||||
option url 'http://192.168.1.100/secubox/catalog.json'
|
option url 'http://192.168.1.100/secubox/catalog.json'
|
||||||
option priority '2'
|
option priority '2'
|
||||||
option timeout '10'
|
option timeout '10'
|
||||||
option verify_ssl '0'
|
|
||||||
|
|
||||||
config source 'usb'
|
config source 'usb'
|
||||||
option enabled '1'
|
option enabled '1'
|
||||||
option type 'local'
|
option type 'local'
|
||||||
option path '/mnt/usb/secubox/catalog.json'
|
option path '/mnt/usb/secubox/catalog.json'
|
||||||
option priority '3'
|
option priority '3'
|
||||||
option auto_mount_check '1'
|
|
||||||
|
|
||||||
config source 'embedded'
|
config source 'embedded'
|
||||||
option enabled '1'
|
option enabled '1'
|
||||||
option type 'embedded'
|
option type 'embedded'
|
||||||
option path '/usr/share/secubox/catalog.json'
|
option path '/usr/share/secubox/catalog.json'
|
||||||
option priority '999'
|
option priority '999'
|
||||||
|
|
||||||
config updates 'check'
|
|
||||||
option enabled '1'
|
|
||||||
option notify_method 'ui'
|
|
||||||
option check_interval '3600'
|
|
||||||
option auto_install '0'
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user