Update the agents page with new UX (#850)

- Use icons/colors for setting the styling of agents
- Update automations page to use the shadcn cards: https://github.com/shadcn-ui/ui
This commit is contained in:
sabaimran
2024-07-15 21:40:55 -07:00
committed by GitHub
parent 1c6ed9bc6d
commit c837f3779e
12 changed files with 395 additions and 284 deletions

View File

@@ -103,6 +103,39 @@ class VoiceModelOption(BaseModel):
class Agent(BaseModel):
class StyleColorTypes(models.TextChoices):
BLUE = "blue"
GREEN = "green"
RED = "red"
YELLOW = "yellow"
ORANGE = "orange"
PURPLE = "purple"
PINK = "pink"
TEAL = "teal"
CYAN = "cyan"
LIME = "lime"
INDIGO = "indigo"
FUSCHIA = "fuschia"
ROSE = "rose"
SKY = "sky"
AMBER = "amber"
EMERALD = "emerald"
class StyleIconTypes(models.TextChoices):
LIGHBULB = "Lightbulb"
HEALTH = "Health"
ROBOT = "Robot"
APERTURE = "Aperture"
GRADUATION_CAP = "GraduationCap"
JEEP = "Jeep"
ISLAND = "Island"
MATH_OPERATIONS = "MathOperations"
ASCLEPIUS = "Asclepius"
COUCH = "Couch"
CODE = "Code"
ATOM = "Atom"
CLOCK_COUNTER_CLOCKWISE = "ClockCounterClockwise"
creator = models.ForeignKey(
KhojUser, on_delete=models.CASCADE, default=None, null=True, blank=True
) # Creator will only be null when the agents are managed by admin
@@ -114,6 +147,8 @@ class Agent(BaseModel):
managed_by_admin = models.BooleanField(default=False)
chat_model = models.ForeignKey(ChatModelOptions, on_delete=models.CASCADE)
slug = models.CharField(max_length=200)
style_color = models.CharField(max_length=200, choices=StyleColorTypes.choices, default=StyleColorTypes.BLUE)
style_icon = models.CharField(max_length=200, choices=StyleIconTypes.choices, default=StyleIconTypes.LIGHBULB)
class ProcessLock(BaseModel):