Spaces:
Running
Running
Download webui/components/projects/project-list.html from Leon4gr45/openoperator: direct link, hf CLI and curl.
- Browser
- Download file 9.02 kB
-
https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/webui/components/projects/project-list.html
- Command line
-
hf download hf://spaces/Leon4gr45/openoperator/webui/components/projects/project-list.html
-
curl -L -o project-list.html https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/webui/components/projects/project-list.html
9.02 kB
| <html> | |
| <head> | |
| <title>Projects</title> | |
| <script type="module"> | |
| import { store as projectsStore } from "/components/projects/projects-store.js"; | |
| import { store as chatsStore } from "/components/sidebar/chats/chats-store.js"; | |
| </script> | |
| </head> | |
| <body> | |
| <div x-data> | |
| <template x-if="$store.projects && $store.chats"> | |
| <div> | |
| <p class="projects-intro">Projects in Agent Zero are used to separate different use cases with custom | |
| instructions and files. | |
| You can create projects for your tasks and switch between them easily.</p> | |
| <div class="projects-list-header"> | |
| <div x-show="$store.chats.selectedContext && $store.chats.selectedContext?.project" class="active-project-display"> | |
| <span style="display: inline-flex; align-items: center; gap: 0.5em;"> | |
| <span>Active:</span> | |
| <span class="project-color-ball" :style="$store.chats.selectedContext?.project?.color ? { backgroundColor: $store.chats.selectedContext?.project?.color } : { border: '1px solid var(--color-border)' }"></span> | |
| <strong x-text="$store.chats.selectedContext?.project?.name"></strong> | |
| </span> | |
| <button type="button" class="button cancel icon-button" title="Deactivate" @click="$store.projects.deactivateProject()"> | |
| <x-icon class="icon" name="close"></x-icon> | |
| </button> | |
| <button type="button" class="button icon-button" title="Edit" @click="$store.projects.openEditModal($store.chats.selectedContext?.project?.name)"> | |
| <x-icon class="icon" name="edit"></x-icon> | |
| </button> | |
| </div> | |
| <button @click="$store.projects.openCreateModal()" type="button" | |
| class="button projects-create-btn-top"> | |
| <x-icon class="icon" name="add"></x-icon> Create project | |
| </button> | |
| </div> | |
| <template :key="project.name" x-for="project in $store.projects.projectList"> | |
| <div class="projects-project-card" :class="{ 'projects-active': project.name === $store.chats.selectedContext?.project?.name }"> | |
| <div class="projects-project-card-header"> | |
| <div class="projects-project-card-info"> | |
| <div class="projects-project-card-title"> | |
| <span class="project-color-ball" :style="project.color ? { backgroundColor: project.color } : { border: '1px solid var(--color-border)' }"></span> | |
| <span class="projects-project-card-title-text" x-text="project.title"></span> | |
| </div> | |
| <div class="projects-project-card-name">/<span x-text="project.name"></span></div> | |
| </div> | |
| <div class="projects-project-card-actions"> | |
| <template x-if="$store.chats.selectedContext && project.name === $store.chats.selectedContext?.project?.name"> | |
| <button type="button" class="button cancel projects-project-card-state-action" title="Deactivate" @click="$store.projects.deactivateProject()"> | |
| <x-icon class="icon" name="close"></x-icon> | |
| <span class="projects-project-card-action-text">Deactivate</span> | |
| </button> | |
| </template> | |
| <template x-if="$store.chats.selectedContext && project.name !== $store.chats.selectedContext?.project?.name"> | |
| <button type="button" class="button confirm projects-project-card-state-action" title="Activate" @click="$store.projects.activateProject(project.name)"> | |
| <x-icon class="icon" name="play_arrow"></x-icon> | |
| <span class="projects-project-card-action-text">Activate</span> | |
| </button> | |
| </template> | |
| <button type="button" class="button icon-button" title="Edit" @click="$store.projects.openEditModal(project.name)"> | |
| <x-icon class="icon" name="edit"></x-icon> | |
| </button> | |
| <button type="button" class="button cancel icon-button" title="Delete" @click="$confirmClick($event, () => $store.projects.deleteProject(project.name))"> | |
| <x-icon class="icon" name="delete"></x-icon> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- <div class="projects-project-card-description"><span x-text="project.description"></span></div> --> | |
| </div> | |
| </template> | |
| <template x-if="$store.projects.projectList.length === 0"> | |
| <div class="projects-no-projects"> | |
| <div class="projects-project-card-title">There are no projects yet</div> | |
| <div class="projects-no-projects-actions"> | |
| <button @click="$store.projects.openCreateModal()" type="button" | |
| class="button"><x-icon class="icon" name="add"></x-icon>Create project</button> | |
| </div> | |
| </div> | |
| </template> | |
| </div> | |
| </template> | |
| </div> | |
| </body> | |
| <style> | |
| .projects-project-card { | |
| border: 1px solid var(--color-border); | |
| border-radius: 0.5em; | |
| padding: 1em; | |
| margin-top: 1em; | |
| } | |
| .projects-project-card.projects-active { | |
| border-color: var(--color-highlight); | |
| } | |
| .projects-project-card-header { | |
| display: flex; | |
| align-items: flex-start; | |
| justify-content: space-between; | |
| gap: 1em; | |
| } | |
| .projects-project-card-info { | |
| min-width: 0; | |
| flex: 1 1 auto; | |
| } | |
| .projects-project-card-title { | |
| font-weight: bold; | |
| font-size: 1.2em; | |
| display: flex; | |
| align-items: center; | |
| min-width: 0; | |
| line-height: 1.25; | |
| } | |
| .projects-project-card-title-text { | |
| min-width: 0; | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| white-space: nowrap; | |
| } | |
| .projects-project-card-name { | |
| margin-top: var(--spacing-xs); | |
| min-width: 0; | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| white-space: nowrap; | |
| } | |
| .projects-project-card-actions { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5em; | |
| flex: 0 0 auto; | |
| } | |
| .projects-project-card-state-action { | |
| gap: 0.35em; | |
| min-width: 9em; | |
| } | |
| .project-color-ball { | |
| width: 0.6em; | |
| height: 0.6em; | |
| border-radius: 50%; | |
| display: inline-block; | |
| margin-right: 0.5em; | |
| flex-shrink: 0; | |
| box-sizing: border-box; | |
| } | |
| .projects-project-card-description { | |
| font-size: 0.9em; | |
| color: var(--color-text); | |
| } | |
| .projects-no-projects { | |
| border: 1px dashed var(--color-border); | |
| border-radius: 0.5em; | |
| padding: 2em; | |
| margin: 1em; | |
| text-align: center; | |
| background: var(--color-panel); | |
| } | |
| .projects-no-projects-actions { | |
| margin-top: 1em; | |
| display: flex; | |
| justify-content: center; | |
| } | |
| .projects-create-btn-top { | |
| float: right; | |
| margin: var(--spacing-xs) var(--spacing-md); | |
| } | |
| .projects-list-header { | |
| width: 100%; | |
| display: flex; | |
| justify-content: flex-end; | |
| align-items: center; | |
| margin-bottom: 0.5em; | |
| } | |
| .active-project-display { | |
| display: flex; | |
| align-items: center; | |
| gap: 0.5em; | |
| border: 1px solid var(--color-highlight); | |
| padding: 0.5em; | |
| border-radius: 0.5em; | |
| margin-right: auto; | |
| } | |
| @media (max-width: 600px) { | |
| .projects-list-header { | |
| flex-wrap: wrap; | |
| gap: 1em; | |
| } | |
| .projects-project-card-header { | |
| flex-direction: row; | |
| gap: 0.75em; | |
| } | |
| .projects-project-card-title { | |
| font-size: 1.1em; | |
| } | |
| .projects-project-card-actions { | |
| gap: 0.4em; | |
| padding-top: 0.08em; | |
| } | |
| .projects-project-card-state-action { | |
| min-width: 2.75rem; | |
| padding-left: 0.75rem; | |
| padding-right: 0.75rem; | |
| } | |
| .projects-project-card-action-text { | |
| display: none; | |
| } | |
| .active-project-display { | |
| width: 100%; | |
| justify-content: space-between; | |
| } | |
| } | |
| </style> | |
| </html> | |