blob_adminapp.tsx19 matches
70const menuRef = useRef(null);
71const isPublic = blob.key.startsWith("__public/");
72const publicUrl = isPublic ? `${window.location.origin}/api/public/${encodeURIComponent(blob.key.slice(9))}` : null;
7374useEffect(() => {
234setLoading(true);
235try {
236const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
237const data = await response.json();
238setBlobs(data);
261setBlobContentLoading(true);
262try {
263const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
264const content = await response.text();
265setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
275const handleSave = async () => {
276try {
277await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
278method: "PUT",
279body: editContent,
287const handleDelete = async (key) => {
288try {
289await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
290setBlobs(blobs.filter(b => b.key !== key));
291if (selectedBlob && selectedBlob.key === key) {
304const key = `${searchPrefix}${file.name}`;
305formData.append("key", encodeKey(key));
306await fetch("/api/blob", { method: "POST", body: formData });
307const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
308setBlobs([newBlob, ...blobs]);
326try {
327const fullKey = `${searchPrefix}${key}`;
328await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
329method: "PUT",
330body: "",
341const handleDownload = async (key) => {
342try {
343const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
344const blob = await response.blob();
345const url = window.URL.createObjectURL(blob);
360if (newKey && newKey !== oldKey) {
361try {
362const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
363const content = await response.blob();
364await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
365method: "PUT",
366body: content,
367});
368await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
369setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
370if (selectedBlob && selectedBlob.key === oldKey) {
380const newKey = `__public/${key}`;
381try {
382const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
383const content = await response.blob();
384await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
385method: "PUT",
386body: content,
387});
388await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
389setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
390if (selectedBlob && selectedBlob.key === key) {
399const newKey = key.slice(9); // Remove "__public/" prefix
400try {
401const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
402const content = await response.blob();
403await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
404method: "PUT",
405body: content,
406});
407await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
408setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
409if (selectedBlob && selectedBlob.key === key) {
554onClick={() =>
555copyToClipboard(
556`${window.location.origin}/api/public/${encodeURIComponent(selectedBlob.key.slice(9))}`,
557)}
558className="text-blue-400 hover:text-blue-300 text-sm"
577>
578<img
579src={`/api/blob?key=${encodeKey(selectedBlob.key)}`}
580alt="Blob content"
581className="max-w-full h-auto"
survivor-plan.mcp.json1 match
4"command": "/root/Code/valTownProject/valTownMCPServer/build/valtown-mcp-linux",
5"env": {
6"VAL_TOWN_API_TOKEN": "vtwn_vXeoezF4CAugwkQ7RxxEXiHrNv9",
7"VAL_TOWN_PREFER_CLI": "true"
8}
29
30try {
31const response = await fetch('/api/quick-guidance', {
32method: 'POST',
33headers: {
survivor-planWeeklyReview.js6 matches
31// Fetch tracks, tasks, and weekly review in parallel
32const [tracksResponse, tasksResponse, weeklyReviewResponse] = await Promise.all([
33fetch('/api/tracks'),
34fetch('/api/tasks'),
35fetch(`/api/weekly-reviews/${weekNumber}`)
36]);
37
227
228try {
229const response = await fetch('/api/weekly-reviews', {
230method: 'POST',
231headers: {
250// Send weekly email
251try {
252await fetch('/api/send-weekly-email', {
253method: 'POST'
254});
271
272try {
273const response = await fetch('/api/weekly-review-feedback', {
274method: 'POST',
275headers: {
survivor-planSetupWizard.js1 match
81
82try {
83const response = await fetch('/api/user-status', {
84method: 'POST',
85headers: {
survivor-planDailyStandup.js4 matches
34const fetchExistingLog = async () => {
35try {
36const response = await fetch(`/api/daily-logs/${date}`);
37
38if (response.ok) {
111
112try {
113const response = await fetch('/api/daily-logs', {
114method: 'POST',
115headers: {
131// Trigger email
132try {
133await fetch('/api/send-daily-email', {
134method: 'POST'
135});
156
157try {
158const response = await fetch('/api/daily-standup', {
159method: 'POST'
160});
survivor-planApp.js3 matches
30try {
31// Try to get user status
32const response = await fetch('/api/user-status');
33
34if (response.status === 404) {
56try {
57setIsLoading(true);
58const response = await fetch('/api/migrate', {
59method: 'POST',
60headers: {
79async function fetchInfo() {
80try {
81const response = await fetch('/api/info');
82if (response.ok) {
83const data = await response.json();
survivor-planTrackDetails.js8 matches
26// Fetch track and tasks in parallel
27const [trackResponse, tasksResponse] = await Promise.all([
28fetch(`/api/tracks`),
29fetch(`/api/tracks/${trackId}/tasks`)
30]);
31
55const fetchTrackPrompt = async () => {
56try {
57const response = await fetch(`/api/tracks/${trackId}/prompt`);
58
59if (response.ok) {
72
73try {
74const response = await fetch(`/api/tracks/${trackId}/guidance`, {
75method: 'POST'
76});
93const handleTaskStatusChange = async (taskId, newStatus) => {
94try {
95const response = await fetch(`/api/tasks/${taskId}/status`, {
96method: 'PUT',
97headers: {
119const handleTaskNotesChange = async (taskId, notes) => {
120try {
121const response = await fetch(`/api/tasks/${taskId}/notes`, {
122method: 'PUT',
123headers: {
145const handleUpdateTrackStatus = async (newStatus) => {
146try {
147const response = await fetch(`/api/tracks/${trackId}`, {
148method: 'PUT',
149headers: {
170const handlePromptUpdate = async () => {
171try {
172const response = await fetch(`/api/tracks/${trackId}/prompt`, {
173method: 'PUT',
174headers: {
survivor-planREADME.md12 matches
3334- ValTown SQLite for data storage
35- Hono framework for API endpoints
36- Vercel AI SDK for AI interactions using Gemini models
37- Val Town email service for notifications
524. Perform weekly reviews every Sunday
5354## API Endpoints
5556- `/api/migrate` - Run database migrations
57- `/api/tracks` - Get and update tracks
58- `/api/tasks` - Manage tasks
59- `/api/daily-logs` - Daily progress tracking
60- `/api/weekly-reviews` - Weekly strategic reviews
61- `/api/user-status` - Personal situation management
62- `/api/track-prompts` - Customizable AI prompts
63- `/api/quick-guidance` - Get immediate AI guidance
64- `/api/send-daily-email` - Trigger daily email notifications
65- `/api/send-weekly-email` - Trigger weekly email notifications
6667## AI Guidance Features
survivor-planSettings.js2 matches
80
81try {
82const response = await fetch('/api/user-status', {
83method: 'POST',
84headers: {
111const handleSendEmail = async (type) => {
112try {
113const endpoint = type === 'daily' ? '/api/send-daily-email' : '/api/send-weekly-email';
114const response = await fetch(endpoint, {
115method: 'POST'