Initial commit: Clean DSS implementation
Migrated from design-system-swarm with fresh git history.
Old project history preserved in /home/overbits/apps/design-system-swarm
Core components:
- MCP Server (Python FastAPI with mcp 1.23.1)
- Claude Plugin (agents, commands, skills, strategies, hooks, core)
- DSS Backend (dss-mvp1 - token translation, Figma sync)
- Admin UI (Node.js/React)
- Server (Node.js/Express)
- Storybook integration (dss-mvp1/.storybook)
Self-contained configuration:
- All paths relative or use DSS_BASE_PATH=/home/overbits/dss
- PYTHONPATH configured for dss-mvp1 and dss-claude-plugin
- .env file with all configuration
- Claude plugin uses ${CLAUDE_PLUGIN_ROOT} for portability
Migration completed: $(date)
🤖 Clean migration with full functionality preserved
This commit is contained in:
133
admin-ui/js/workdesks/admin-workdesk.js
Normal file
133
admin-ui/js/workdesks/admin-workdesk.js
Normal file
@@ -0,0 +1,133 @@
|
||||
/**
|
||||
* admin-workdesk.js
|
||||
* Admin Team workdesk - System settings and project management
|
||||
*/
|
||||
|
||||
import BaseWorkdesk from './base-workdesk.js';
|
||||
import '../components/admin/ds-admin-settings.js';
|
||||
import '../components/admin/ds-project-list.js';
|
||||
|
||||
export default class AdminWorkdesk extends BaseWorkdesk {
|
||||
constructor(shell) {
|
||||
super(shell);
|
||||
this.teamId = 'admin';
|
||||
this.teamName = 'Admin';
|
||||
this.tools = [
|
||||
{
|
||||
id: 'settings',
|
||||
name: 'System Settings',
|
||||
description: 'Configure DSS hostname, port, and setup type',
|
||||
component: 'ds-admin-settings'
|
||||
},
|
||||
{
|
||||
id: 'projects',
|
||||
name: 'Projects',
|
||||
description: 'Create and manage design system projects',
|
||||
component: 'ds-project-list'
|
||||
}
|
||||
];
|
||||
this.currentTab = 'settings';
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin sidebar shows tab navigation for Settings and Projects
|
||||
*/
|
||||
renderSidebar() {
|
||||
const sidebar = this.shell.sidebarContent;
|
||||
if (!sidebar) return;
|
||||
|
||||
sidebar.innerHTML = `
|
||||
<div style="padding: 12px; display: flex; flex-direction: column; gap: 8px;">
|
||||
${this.tools.map(tool => `
|
||||
<button class="tab-btn" data-tab="${tool.id}" style="
|
||||
padding: 8px 12px;
|
||||
border: 1px solid ${this.currentTab === tool.id ? 'var(--vscode-focusBorder)' : 'var(--vscode-border)'};
|
||||
background: ${this.currentTab === tool.id ? 'var(--vscode-selection)' : 'var(--vscode-sidebar)'};
|
||||
color: var(--vscode-foreground);
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-weight: ${this.currentTab === tool.id ? '600' : '500'};
|
||||
text-align: left;
|
||||
transition: all 0.2s;
|
||||
" title="${tool.description}">
|
||||
${tool.name}
|
||||
</button>
|
||||
`).join('')}
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Setup tab click handlers
|
||||
sidebar.querySelectorAll('.tab-btn').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const tabId = btn.dataset.tab;
|
||||
this.switchTab(tabId);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin stage shows tab content - either Settings or Projects
|
||||
*/
|
||||
renderStage() {
|
||||
const stage = this.shell.stageContent;
|
||||
if (!stage) return;
|
||||
|
||||
stage.innerHTML = `
|
||||
<div style="height: 100%; overflow-y: auto;">
|
||||
${this.renderTabContent()}
|
||||
</div>
|
||||
`;
|
||||
|
||||
// Trigger connectedCallback on custom elements
|
||||
this.hydrateComponents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Render content based on current tab
|
||||
*/
|
||||
renderTabContent() {
|
||||
switch (this.currentTab) {
|
||||
case 'settings':
|
||||
return '<ds-admin-settings></ds-admin-settings>';
|
||||
case 'projects':
|
||||
return '<ds-project-list></ds-project-list>';
|
||||
default:
|
||||
return '<ds-admin-settings></ds-admin-settings>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch to a different tab and re-render
|
||||
*/
|
||||
switchTab(tabId) {
|
||||
this.currentTab = tabId;
|
||||
this.renderSidebar();
|
||||
this.renderStage();
|
||||
}
|
||||
|
||||
/**
|
||||
* Hydrate custom elements after rendering
|
||||
*/
|
||||
hydrateComponents() {
|
||||
const stage = this.shell.stageContent;
|
||||
if (!stage) return;
|
||||
|
||||
// Find and trigger connectedCallback on custom elements
|
||||
stage.querySelectorAll('ds-admin-settings, ds-project-list').forEach(el => {
|
||||
// Web components auto-trigger connectedCallback when inserted into DOM
|
||||
// No manual trigger needed
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Admin panel shows minimal system log
|
||||
*/
|
||||
renderPanel() {
|
||||
const panel = this.shell.querySelector('ds-panel');
|
||||
if (panel) {
|
||||
// Configure panel with admin config
|
||||
panel.configure('admin', false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user