File size: 9,624 Bytes
4343907
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<template>
  <div class="min-h-screen bg-gray-50">
    <!-- Header -->
    <header class="bg-white border-b border-gray-200 px-6 py-4">
      <div class="max-w-7xl mx-auto flex justify-between items-center">
        <div>
          <h1 class="text-2xl font-bold text-gray-900">SAAP Dashboard</h1>
          <p class="text-sm text-gray-600">Multi-Agent Platform</p>
        </div>
        <div class="flex items-center space-x-4">
          <div class="flex items-center space-x-2">
            <div class="w-2 h-2 bg-green-400 rounded-full"></div>
            <span class="text-sm text-gray-700">Connected</span>
          </div>
          <div class="text-center">
            <div class="text-xl font-bold text-blue-600">{{ activeAgents }}</div>
            <div class="text-xs text-gray-500 uppercase">Active Agents</div>
          </div>
        </div>
      </div>
    </header>

    <!-- Content -->
    <main class="max-w-7xl mx-auto px-6 py-6">
      
      <!-- Action Buttons -->
      <div class="flex space-x-3 mb-6">
        <button 
          @click="refresh"
          class="flex items-center px-4 py-2 bg-white border border-gray-300 rounded-lg text-sm font-medium hover:bg-gray-50"
        >
          <ArrowPathIcon class="w-4 h-4 mr-2" />
          Refresh
        </button>
        <button 
          @click="showForm = !showForm"
          class="flex items-center px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium hover:bg-blue-700"
        >
          <PlusIcon class="w-4 h-4 mr-2" />
          Add Agent
        </button>
      </div>

      <!-- Stats Grid -->
      <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-8">
        <div class="bg-white p-6 rounded-xl border border-gray-200">
          <div class="flex items-center space-x-4">
            <div class="w-12 h-12 bg-blue-100 rounded-lg flex items-center justify-center">
              <UserGroupIcon class="w-6 h-6 text-blue-600" />
            </div>
            <div>
              <div class="text-xl font-bold text-gray-900">{{ totalAgents }}</div>
              <div class="text-sm text-gray-600">Total Agents</div>
            </div>
          </div>
        </div>

        <div class="bg-white p-6 rounded-xl border border-gray-200">
          <div class="flex items-center space-x-4">
            <div class="w-12 h-12 bg-green-100 rounded-lg flex items-center justify-center">
              <ChartBarIcon class="w-6 h-6 text-green-600" />
            </div>
            <div>
              <div class="text-xl font-bold text-gray-900">{{ activeAgents }}</div>
              <div class="text-sm text-gray-600">Active</div>
            </div>
          </div>
        </div>

        <div class="bg-white p-6 rounded-xl border border-gray-200">
          <div class="flex items-center space-x-4">
            <div class="w-12 h-12 bg-orange-100 rounded-lg flex items-center justify-center">
              <ChatBubbleLeftIcon class="w-6 h-6 text-orange-600" />
            </div>
            <div>
              <div class="text-xl font-bold text-gray-900">{{ messages }}</div>
              <div class="text-sm text-gray-600">Messages</div>
            </div>
          </div>
        </div>

        <div class="bg-white p-6 rounded-xl border border-gray-200">
          <div class="flex items-center space-x-4">
            <div class="w-12 h-12 bg-purple-100 rounded-lg flex items-center justify-center">
              <ClockIcon class="w-6 h-6 text-purple-600" />
            </div>
            <div>
              <div class="text-xl font-bold text-gray-900">1.8s</div>
              <div class="text-sm text-gray-600">Response Time</div>
            </div>
          </div>
        </div>
      </div>

      <!-- Add Agent Form (Toggle) -->
      <div v-if="showForm" class="bg-white p-6 rounded-xl border border-gray-200 mb-6">
        <h3 class="text-lg font-semibold mb-4">Add New Agent</h3>
        <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
          <input 
            v-model="newAgent.name"
            type="text" 
            placeholder="Agent Name"
            class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
          >
          <select 
            v-model="newAgent.type"
            class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
          >
            <option>Coordinator</option>
            <option>Developer</option>
            <option>Analyst</option>
          </select>
        </div>
        <div class="mt-4">
          <button 
            @click="addAgent"
            class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700"
          >
            Create Agent
          </button>
        </div>
      </div>

      <!-- Agents Grid -->
      <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
        <div
          v-for="agent in agents"
          :key="agent.id"
          class="bg-white p-6 rounded-xl border border-gray-200 hover:shadow-md transition-shadow"
        >
          <div class="flex items-start justify-between mb-4">
            <div class="flex items-center space-x-3">
              <div 
                class="w-10 h-10 rounded-full flex items-center justify-center text-white font-medium"
                :style="{ backgroundColor: agent.color }"
              >
                {{ agent.name.charAt(0) }}
              </div>
              <div>
                <h4 class="font-semibold text-gray-900">{{ agent.name }}</h4>
                <p class="text-sm text-gray-600">{{ agent.type }}</p>
              </div>
            </div>
            <span 
              class="px-2 py-1 text-xs font-medium rounded-full"
              :class="agent.status === 'active' ? 'bg-green-100 text-green-800' : 'bg-gray-100 text-gray-800'"
            >
              {{ agent.status }}
            </span>
          </div>

          <div class="flex space-x-2">
            <button 
              v-if="agent.status !== 'active'"
              @click="toggleAgent(agent, 'active')"
              class="flex items-center px-3 py-1.5 bg-green-50 text-green-700 rounded-lg text-sm hover:bg-green-100"
            >
              <PlayIcon class="w-4 h-4 mr-1" />
              Start
            </button>
            <button 
              v-if="agent.status === 'active'"
              @click="toggleAgent(agent, 'inactive')"
              class="flex items-center px-3 py-1.5 bg-red-50 text-red-700 rounded-lg text-sm hover:bg-red-100"
            >
              <StopIcon class="w-4 h-4 mr-1" />
              Stop
            </button>
            <button class="flex items-center px-3 py-1.5 bg-blue-50 text-blue-700 rounded-lg text-sm hover:bg-blue-100">
              <ChatBubbleLeftIcon class="w-4 h-4 mr-1" />
              Chat
            </button>
          </div>
        </div>

        <!-- Empty State -->
        <div v-if="agents.length === 0" class="col-span-full text-center py-12">
          <CpuChipIcon class="w-16 h-16 mx-auto text-gray-400 mb-4" />
          <h3 class="text-lg font-medium text-gray-900 mb-2">No Agents Yet</h3>
          <p class="text-gray-600 mb-6">Create your first AI agent to get started.</p>
          <button 
            @click="showForm = true"
            class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700"
          >
            <PlusIcon class="w-4 h-4 mr-2 inline" />
            Add First Agent
          </button>
        </div>
      </div>
    </main>
  </div>
</template>

<script>
import { ref, computed } from 'vue'
import {
  ArrowPathIcon,
  PlusIcon,
  UserGroupIcon,
  ChartBarIcon,
  ChatBubbleLeftIcon,
  ClockIcon,
  PlayIcon,
  StopIcon,
  CpuChipIcon
} from '@heroicons/vue/24/outline'

export default {
  name: 'DashboardSimple',
  components: {
    ArrowPathIcon,
    PlusIcon,
    UserGroupIcon,
    ChartBarIcon,
    ChatBubbleLeftIcon,
    ClockIcon,
    PlayIcon,
    StopIcon,
    CpuChipIcon
  },
  setup() {
    const showForm = ref(false)
    const newAgent = ref({
      name: '',
      type: 'Coordinator'
    })

    const agents = ref([
      {
        id: '1',
        name: 'Jane Alesi',
        type: 'Lead Coordinator',
        status: 'active',
        color: '#8B5CF6'
      },
      {
        id: '2', 
        name: 'John Alesi',
        type: 'Developer',
        status: 'inactive',
        color: '#14B8A6'
      },
      {
        id: '3',
        name: 'Lara Alesi', 
        type: 'Medical Expert',
        status: 'active',
        color: '#EC4899'
      }
    ])

    const totalAgents = computed(() => agents.value.length)
    const activeAgents = computed(() => 
      agents.value.filter(a => a.status === 'active').length
    )
    const messages = computed(() => totalAgents.value * 15)

    const refresh = () => {
      console.log('🔄 Refreshing data...')
    }

    const addAgent = () => {
      if (newAgent.value.name.trim()) {
        agents.value.push({
          id: Date.now().toString(),
          name: newAgent.value.name,
          type: newAgent.value.type,
          status: 'inactive',
          color: '#6B7280'
        })
        newAgent.value = { name: '', type: 'Coordinator' }
        showForm.value = false
      }
    }

    const toggleAgent = (agent, newStatus) => {
      agent.status = newStatus
      console.log(`${agent.name} is now ${newStatus}`)
    }

    return {
      showForm,
      newAgent,
      agents,
      totalAgents,
      activeAgents,
      messages,
      refresh,
      addAgent,
      toggleAgent
    }
  }
}
</script>