182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
blob_adminmain.tsx23 matches
234const [isDragging, setIsDragging] = useState(false);
235236const fetchBlobs = useCallback(async () => {
237setLoading(true);
238try {
239const response = await fetch(`/api/blobs?prefix=${encodeKey(searchPrefix)}&limit=${limit}`);
240const data = await response.json();
241setBlobs(data);
242} catch (error) {
243console.error("Error fetching blobs:", error);
244} finally {
245setLoading(false);
248249useEffect(() => {
250fetchBlobs();
251}, [fetchBlobs]);
252253const handleSearch = (e) => {
264setBlobContentLoading(true);
265try {
266const response = await fetch(`/api/blob?key=${encodeKey(clickedBlob.key)}`);
267const content = await response.text();
268setSelectedBlob({ ...clickedBlob, key: decodeKey(clickedBlob.key) });
269setEditContent(content);
270} catch (error) {
271console.error("Error fetching blob content:", error);
272} finally {
273setBlobContentLoading(false);
278const handleSave = async () => {
279try {
280await fetch(`/api/blob?key=${encodeKey(selectedBlob.key)}`, {
281method: "PUT",
282body: editContent,
290const handleDelete = async (key) => {
291try {
292await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
293setBlobs(blobs.filter(b => b.key !== key));
294if (selectedBlob && selectedBlob.key === key) {
307const key = `${searchPrefix}${file.name}`;
308formData.append("key", encodeKey(key));
309await fetch("/api/blob", { method: "POST", body: formData });
310const newBlob = { key, size: file.size, lastModified: new Date().toISOString() };
311setBlobs([newBlob, ...blobs]);
315}
316}
317fetchBlobs();
318};
319329try {
330const fullKey = `${searchPrefix}${key}`;
331await fetch(`/api/blob?key=${encodeKey(fullKey)}`, {
332method: "PUT",
333body: "",
344const handleDownload = async (key) => {
345try {
346const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
347const blob = await response.blob();
348const url = window.URL.createObjectURL(blob);
363if (newKey && newKey !== oldKey) {
364try {
365const response = await fetch(`/api/blob?key=${encodeKey(oldKey)}`);
366const content = await response.blob();
367await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
368method: "PUT",
369body: content,
370});
371await fetch(`/api/blob?key=${encodeKey(oldKey)}`, { method: "DELETE" });
372setBlobs(blobs.map(b => b.key === oldKey ? { ...b, key: newKey } : b));
373if (selectedBlob && selectedBlob.key === oldKey) {
383const newKey = `__public/${key}`;
384try {
385const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
386const content = await response.blob();
387await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
388method: "PUT",
389body: content,
390});
391await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
392setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
393if (selectedBlob && selectedBlob.key === key) {
402const newKey = key.slice(9); // Remove "__public/" prefix
403try {
404const response = await fetch(`/api/blob?key=${encodeKey(key)}`);
405const content = await response.blob();
406await fetch(`/api/blob?key=${encodeKey(newKey)}`, {
407method: "PUT",
408body: content,
409});
410await fetch(`/api/blob?key=${encodeKey(key)}`, { method: "DELETE" });
411setBlobs(blobs.map(b => b.key === key ? { ...b, key: newKey } : b));
412if (selectedBlob && selectedBlob.key === key) {
826});
827828export default lastlogin((request: Request) => app.fetch(request));
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
cerebras_codermain.tsx1 match
182183try {
184const response = await fetch("/", {
185method: "POST",
186body: JSON.stringify({
aigeneratorblogmain.tsx12 matches
3031useEffect(() => {
32fetchUserData();
33fetchAd();
34}, []);
3536const fetchUserData = async () => {
37const response = await fetch("/user");
38const userData = await response.json();
39setUser(userData);
42};
4344const fetchAd = async () => {
45const response = await fetch("/ad");
46const adData = await response.json();
47setAdContent(adData.content);
52setIsLoading(true);
53try {
54const response = await fetch("/generate", {
55method: "POST",
56headers: { "Content-Type": "application/json" },
62} else {
63setGeneratedContent(data.content);
64fetchUserData(); // Refresh user data to update usage
65}
66} catch (error) {
7273const handleUpgrade = async (tier) => {
74const response = await fetch("/upgrade", {
75method: "POST",
76headers: { "Content-Type": "application/json" },
79const data = await response.json();
80if (data.success) {
81fetchUserData();
82} else {
83alert("Upgrade failed. Please try again.");
9899const updateUserSettings = async (settings) => {
100const response = await fetch("/updateSettings", {
101method: "POST",
102headers: { "Content-Type": "application/json" },
105const data = await response.json();
106if (data.success) {
107fetchUserData();
108} else {
109alert("Failed to update settings. Please try again.");
legalAssistantmain.tsx1 match
3132try {
33const serverResponse = await fetch("/query", {
34method: "POST",
35body: JSON.stringify({ query }),
seoKeywordResearchToolmain.tsx12 matches
3031useEffect(() => {
32fetchUserData();
33fetchAd();
34}, []);
3536const fetchUserData = async () => {
37const response = await fetch("/user");
38const userData = await response.json();
39setUser(userData);
42};
4344const fetchAd = async () => {
45const response = await fetch("/ad");
46const adData = await response.json();
47setAdContent(adData.content);
52setIsLoading(true);
53try {
54const response = await fetch("/generate", {
55method: "POST",
56headers: { "Content-Type": "application/json" },
62} else {
63setGeneratedContent(data.content);
64fetchUserData(); // Refresh user data to update usage
65}
66} catch (error) {
7273const handleUpgrade = async (tier) => {
74const response = await fetch("/upgrade", {
75method: "POST",
76headers: { "Content-Type": "application/json" },
79const data = await response.json();
80if (data.success) {
81fetchUserData();
82} else {
83alert("Upgrade failed. Please try again.");
9899const updateUserSettings = async (settings) => {
100const response = await fetch("/updateSettings", {
101method: "POST",
102headers: { "Content-Type": "application/json" },
105const data = await response.json();
106if (data.success) {
107fetchUserData();
108} else {
109alert("Failed to update settings. Please try again.");