theme.pyā¢2.71 kB
"""
Theme configuration for Proxmox MCP output styling.
"""
class ProxmoxTheme:
"""Theme configuration for Proxmox MCP output."""
# Feature flags
USE_EMOJI = True
USE_COLORS = True
# Status indicators with emojis
STATUS = {
'online': 'š¢',
'offline': 'š“',
'running': 'ā¶ļø',
'stopped': 'ā¹ļø',
'unknown': 'ā',
'pending': 'ā³',
'error': 'ā',
'warning': 'ā ļø',
}
# Resource type indicators
RESOURCES = {
'node': 'š„ļø',
'vm': 'šļø',
'container': 'š¦',
'storage': 'š¾',
'cpu': 'ā”',
'memory': 'š§ ',
'network': 'š',
'disk': 'šæ',
'backup': 'š¼',
'snapshot': 'šø',
'template': 'š',
'pool': 'š',
}
# Action and operation indicators
ACTIONS = {
'success': 'ā
',
'error': 'ā',
'warning': 'ā ļø',
'info': 'ā¹ļø',
'command': 'š§',
'start': 'ā¶ļø',
'stop': 'ā¹ļø',
'restart': 'š',
'delete': 'šļø',
'edit': 'āļø',
'create': 'ā',
'migrate': 'ā”ļø',
'clone': 'š',
'lock': 'š',
'unlock': 'š',
}
# Section and grouping indicators
SECTIONS = {
'header': 'š',
'details': 'š',
'statistics': 'š',
'configuration': 'āļø',
'logs': 'š',
'tasks': 'š',
'users': 'š„',
'permissions': 'š',
}
# Measurement and metric indicators
METRICS = {
'percentage': '%',
'temperature': 'š”ļø',
'uptime': 'ā³',
'bandwidth': 'š¶',
'latency': 'ā”',
}
@classmethod
def get_status_emoji(cls, status: str) -> str:
"""Get emoji for a status value with fallback."""
status = status.lower()
return cls.STATUS.get(status, cls.STATUS['unknown'])
@classmethod
def get_resource_emoji(cls, resource: str) -> str:
"""Get emoji for a resource type with fallback."""
resource = resource.lower()
return cls.RESOURCES.get(resource, 'š¦')
@classmethod
def get_action_emoji(cls, action: str) -> str:
"""Get emoji for an action with fallback."""
action = action.lower()
return cls.ACTIONS.get(action, cls.ACTIONS['info'])
@classmethod
def get_section_emoji(cls, section: str) -> str:
"""Get emoji for a section type with fallback."""
section = section.lower()
return cls.SECTIONS.get(section, cls.SECTIONS['details'])