save changes

This commit is contained in:
sandhiya-hepl
2026-07-20 15:00:01 +05:30
parent fe5c85479e
commit b5f7a38c2a
22 changed files with 62 additions and 29 deletions
+2 -2
View File
@@ -7,8 +7,8 @@
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<title>CITPL Admin</title> <title>CITPL Admin</title>
<script type="module" crossorigin src="/citpl_website/assets/admin-CVv7hj2c.js"></script> <script type="module" crossorigin src="/citpl_website/assets/admin-Dt4w1w-p.js"></script>
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-gyvy4NrT.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/x-CWfp5ET4.js">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/admin-yhMCgkf-.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/admin-yhMCgkf-.css">
</head> </head>
<body> <body>
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
-1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
+1 -1
View File
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
+1 -1
View File
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
+1 -1
View File
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
+1 -1
View File
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
+1 -1
View File
@@ -1 +1 @@
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})})); import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -8,9 +8,9 @@
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<title>Cavin Infotech | One Trusted Technology Partner</title> <title>Cavin Infotech | One Trusted Technology Partner</title>
<script type="module" crossorigin src="/citpl_website/assets/main-CVVqQI0V.js"></script> <script type="module" crossorigin src="/citpl_website/assets/main-RYqL6rGL.js"></script>
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-gyvy4NrT.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/x-CWfp5ET4.js">
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-BAlDiH2W.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/App-Bde043lQ.js">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css">
</head> </head>
<body> <body>
+3 -3
View File
@@ -7,9 +7,9 @@
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<title>CITPL Preview</title> <title>CITPL Preview</title>
<script type="module" crossorigin src="/citpl_website/assets/preview-zh4TDIbq.js"></script> <script type="module" crossorigin src="/citpl_website/assets/preview-BCSYkIPC.js"></script>
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-gyvy4NrT.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/x-CWfp5ET4.js">
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-BAlDiH2W.js"> <link rel="modulepreload" crossorigin href="/citpl_website/assets/App-Bde043lQ.js">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css">
<link rel="stylesheet" crossorigin href="/citpl_website/assets/preview-DknkzKsF.css"> <link rel="stylesheet" crossorigin href="/citpl_website/assets/preview-DknkzKsF.css">
</head> </head>
+29 -5
View File
@@ -70,13 +70,37 @@ export const adminApi = {
return apiFetch('/api/auth/me'); return apiFetch('/api/auth/me');
}, },
getContent: () => apiFetch('/api/content'), getContent: async () => {
try {
return await apiFetch('/api/content');
} catch {
const saved = localStorage.getItem('static_content');
if (saved) return JSON.parse(saved);
const { default: seed } = await import('../../server/seed/default-content.json');
return seed;
}
},
updateSection: (section, data) => updateSection: async (section, data) => {
apiFetch(`/api/content/${section}`, { method: 'PUT', body: JSON.stringify(data) }), try {
return await apiFetch(`/api/content/${section}`, { method: 'PUT', body: JSON.stringify(data) });
} catch {
const saved = localStorage.getItem('static_content');
const { default: seed } = await import('../../server/seed/default-content.json');
const current = saved ? JSON.parse(saved) : seed;
const updated = { ...current, [section]: data, _updatedAt: new Date().toISOString() };
localStorage.setItem('static_content', JSON.stringify(updated));
return { message: `${section} updated (local)`, updatedAt: updated._updatedAt };
}
},
changePassword: (currentPassword, newPassword) => changePassword: async (currentPassword, newPassword) => {
apiFetch('/api/auth/password', { method: 'PUT', body: JSON.stringify({ currentPassword, newPassword }) }), try {
return await apiFetch('/api/auth/password', { method: 'PUT', body: JSON.stringify({ currentPassword, newPassword }) });
} catch {
return { message: 'Password change requires the server to be running.' };
}
},
upload: async (file) => { upload: async (file) => {
// Try Node API first; fall back to local data URL when server is unavailable. // Try Node API first; fall back to local data URL when server is unavailable.
+9
View File
@@ -33,6 +33,15 @@ export function ContentProvider({ children, previewMode = false }) {
}) })
.catch((err) => { .catch((err) => {
console.warn('Using fallback content:', err.message); console.warn('Using fallback content:', err.message);
const saved = localStorage.getItem('static_content');
if (saved) {
try {
const { _updatedAt, ...rest } = JSON.parse(saved);
setContent(prefixAssets(rest));
setUpdatedAt(_updatedAt ?? null);
return;
} catch { /* ignore parse error */ }
}
setError(err.message); setError(err.message);
}) })
.finally(() => setLoading(false)); .finally(() => setLoading(false));