last add topic pages and content
parent
5efa3d3270
commit
7258809230
|
@ -1,3 +1,4 @@
|
|||
public/robots.txt
|
||||
# build output
|
||||
dist/
|
||||
# generated types
|
||||
|
|
|
@ -3,13 +3,20 @@ import { defineConfig } from 'astro/config';
|
|||
import tailwind from '@astrojs/tailwind';
|
||||
import react from '@astrojs/react';
|
||||
|
||||
// https://astro.build/config
|
||||
export default defineConfig({
|
||||
site: 'https://siliconpin.com',
|
||||
site: 'https://siliconpin.cs1.hz.siliconpin.com',
|
||||
vite: {
|
||||
server: {
|
||||
allowedHosts: ['siliconpin.cs1.hz.siliconpin.com'],
|
||||
},
|
||||
preview: {
|
||||
allowedHosts: ['siliconpin.cs1.hz.siliconpin.com'],
|
||||
},
|
||||
},
|
||||
integrations: [tailwind(), react()],
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
port: 3000
|
||||
port: 4000
|
||||
},
|
||||
output: 'static',
|
||||
});
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"pocketbase": "^0.25.2",
|
||||
"postcss": "^8.5.3",
|
||||
"react-qr-code": "^2.0.15",
|
||||
"react-router-dom": "^7.4.1",
|
||||
"react-router-dom": "^7.5.0",
|
||||
"react-to-print": "^3.0.5",
|
||||
"tailwind-merge": "^3.0.2",
|
||||
"tailwindcss": "^3.4.17",
|
||||
|
@ -6174,9 +6174,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/react-router": {
|
||||
"version": "7.4.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.4.1.tgz",
|
||||
"integrity": "sha512-Vmizn9ZNzxfh3cumddqv3kLOKvc7AskUT0dC1prTabhiEi0U4A33LmkDOJ79tXaeSqCqMBXBU/ySX88W85+EUg==",
|
||||
"version": "7.5.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.5.0.tgz",
|
||||
"integrity": "sha512-estOHrRlDMKdlQa6Mj32gIks4J+AxNsYoE0DbTTxiMy2mPzZuWSDU+N85/r1IlNR7kGfznF3VCUlvc5IUO+B9g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/cookie": "^0.6.0",
|
||||
|
@ -6198,12 +6198,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/react-router-dom": {
|
||||
"version": "7.4.1",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.4.1.tgz",
|
||||
"integrity": "sha512-L3/4tig0Lvs6m6THK0HRV4eHUdpx0dlJasgCxXKnavwhh4tKYgpuZk75HRYNoRKDyDWi9QgzGXsQ1oQSBlWpAA==",
|
||||
"version": "7.5.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.5.0.tgz",
|
||||
"integrity": "sha512-fFhGFCULy4vIseTtH5PNcY/VvDJK5gvOWcwJVHQp8JQcWVr85ENhJ3UpuF/zP1tQOIFYNRJHzXtyhU1Bdgw0RA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"react-router": "7.4.1"
|
||||
"react-router": "7.5.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"dev": "astro dev --port 4000 --host",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"preview": "astro preview --port 4000",
|
||||
"astro": "astro",
|
||||
"push-s33": "rsync -rv --exclude .hta_config/conf.php dist/ dev2@siliconpin.s33.siliconpin.com:/home/dev2/domains/siliconpin.s33.siliconpin.com/public_html/"
|
||||
},
|
||||
|
@ -28,7 +28,7 @@
|
|||
"pocketbase": "^0.25.2",
|
||||
"postcss": "^8.5.3",
|
||||
"react-qr-code": "^2.0.15",
|
||||
"react-router-dom": "^7.4.1",
|
||||
"react-router-dom": "^7.5.0",
|
||||
"react-to-print": "^3.0.5",
|
||||
"tailwind-merge": "^3.0.2",
|
||||
"tailwindcss": "^3.4.17",
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
User-agent: *
|
||||
Disallow: /secret-location/
|
||||
Disallow: /*
|
||||
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
Sitemap: https://siliconpin.com/sitemap.xml
|
|
@ -34,9 +34,9 @@ export const DomainSetupForm = ({ defaultSubdomain }) => {
|
|||
const [userEmail, setUserEmail] = useState('');
|
||||
|
||||
const [panelType, setPanelType] = useState('');
|
||||
const API_URL = 'http://192.168.1.197:2058/v1/users/index.php';
|
||||
const SERVICES_API_URL = 'http://192.168.1.197:2058/v1/services/index.php';
|
||||
// const BILLING_API_URL = 'http://192.168.1.197:2058/v1/users/index.php';
|
||||
const API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/';
|
||||
const SERVICES_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/services/';
|
||||
// const BILLING_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/index.php';
|
||||
|
||||
const [selectedTenure, setSelectedTenure] = useState('');
|
||||
const [selectedPrice, setSelectedPrice] = useState(0);
|
||||
|
|
|
@ -118,7 +118,7 @@ const LoginPage = () => {
|
|||
|
||||
const syncSessionWithBackend = async (authData: AuthResponse, avatarUrl: string) => {
|
||||
try {
|
||||
const response = await fetch('http://192.168.1.197:2058/v1/users/?query=login', {
|
||||
const response = await fetch('https://host-api.cs1.hz.siliconpin.com/v1/users/?query=login', {
|
||||
method: 'POST',
|
||||
credentials: 'include', // Important for cookies
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
|
|
@ -5,8 +5,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle} from "./ui/dialog";
|
|||
import { Toast } from './Toast';
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "./ui/card";
|
||||
|
||||
const API_URL = 'http://192.168.1.197:2058/v1/users/index.php';
|
||||
|
||||
const API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/index.php';
|
||||
export default function MakePayment(){
|
||||
const [initialOrderData, setInitialOrderData] = useState(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
|
@ -96,10 +95,11 @@ export default function MakePayment(){
|
|||
|
||||
Object.entries(initialOrderData.payment_data).forEach(([key, value]) => {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.type = 'text';
|
||||
input.name = key;
|
||||
input.value = value;
|
||||
form.appendChild(input);
|
||||
console.log(`Adding field: ${key}=${value}`);
|
||||
});
|
||||
|
||||
document.body.appendChild(form);
|
||||
|
@ -151,7 +151,7 @@ export default function MakePayment(){
|
|||
<Button variant="outline" className="" onClick={handleQRPaymentClick} >UPI QR</Button>
|
||||
<span className="text-gray-500 text-center font-semibold my-2">OR</span>
|
||||
<Button className="" onClick={redirectToPayU} >Payment Gateway</Button>
|
||||
<span className="text-center mt-2 text-gray-400 text-xs">Applicabel 2% Transaction Charge if using Payment Gateway</span>
|
||||
<span className="text-center mt-2 text-gray-400 text-xs">Applicable 2% Transaction Charge if using Payment Gateway</span>
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
import React, { useState } from 'react';
|
||||
|
||||
export default function HestiaCredentialsFetcher() {
|
||||
const [creds, setCreds] = useState(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState('');
|
||||
|
||||
const fetchCredentials = async () => {
|
||||
setLoading(true);
|
||||
setError('');
|
||||
try {
|
||||
const response = await fetch('https://host-api.cs1.hz.siliconpin.com/v1/services/index.php?query=get-hestia-cred', {
|
||||
method: 'GET', // Changed to GET to match backend
|
||||
credentials: 'include'
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
if (!response.ok || data.error) {
|
||||
throw new Error(data.error || data.details || 'Failed to fetch credentials');
|
||||
}
|
||||
|
||||
setCreds(data);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setError(err.message);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="p-4 bg-gray-100 rounded shadow max-w-md mx-auto mt-10">
|
||||
<h2 className="text-xl font-bold mb-4">Get Hestia Credentials</h2>
|
||||
<button
|
||||
onClick={fetchCredentials}
|
||||
className="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700"
|
||||
disabled={loading}
|
||||
>
|
||||
{loading ? 'Fetching...' : 'Get Credentials'}
|
||||
</button>
|
||||
|
||||
{creds && (
|
||||
<div className="mt-4 bg-white p-4 rounded border">
|
||||
<p><strong>Username:</strong> {creds.username}</p>
|
||||
<p><strong>Password:</strong> {creds.password}</p>
|
||||
<p><strong>Output:</strong> <pre className="whitespace-pre-wrap">{creds.output}</pre></p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{error && <p className="text-red-600 mt-2">{error}</p>}
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -27,7 +27,7 @@ interface Message {
|
|||
user_type: string;
|
||||
}
|
||||
|
||||
const API_URL = 'http://192.168.1.197:2058/v1/ticket/index.php';
|
||||
const API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/ticket/index.php';
|
||||
|
||||
function Ticketing() {
|
||||
const [tickets, setTickets] = useState<Ticket[]>([]);
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
import React, {useEffect, useState} from "react";
|
||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./ui/card";
|
||||
|
||||
export default function TopicCreation(){
|
||||
const API_URL = 'http://192.168.1.197:2058/v1/users/index.php';
|
||||
// useEffect(() => {
|
||||
// fetch(`${API_URL}?query=get-topic`)
|
||||
// .then(response => response.json())
|
||||
// .then{(data: any) => {
|
||||
// console.log(data);
|
||||
// }}
|
||||
// })
|
||||
return(
|
||||
<>
|
||||
<section className="container mx-auto px-4">
|
||||
<div className="grid grid-cols md:grid-cols-2 lg:grid-cols-3">
|
||||
<Card>
|
||||
<CardContent>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo, excepturi ipsum et animi debitis doloremque quam aliquid quaerat. Totam officiis iste laudantium amet corrupti, doloribus sunt minima dolor odit. Ipsum.
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
import React from "react";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card";
|
||||
|
||||
export default function TopicDetail(props) {
|
||||
console.log('All topic Form allTopic', props.allTopic)
|
||||
if (!props.topic) {
|
||||
return <div>Topic not found</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="container mx-auto px-4 py-12">
|
||||
<article className="max-w-4xl mx-auto">
|
||||
<img src={props.topic.img} alt={props.topic.title} className="w-full h-96 object-cover rounded-lg mb-8" />
|
||||
<h1 className="text-4xl font-bold text-[#6d9e37] mb-4">{props.topic.title}</h1>
|
||||
<p className="font-light mb-8 text-justify" dangerouslySetInnerHTML={{__html: props.topic.content}}></p>
|
||||
</article>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
import React from "react";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card";
|
||||
|
||||
export default function TopicItems(props) {
|
||||
return (
|
||||
<section className="container mx-auto px-4">
|
||||
<div className="py-8 text-center">
|
||||
<h2 className="text-3xl sm:text-4xl font-bold text-[#6d9e37] mb-3 sm:mb-4">
|
||||
{props.title}
|
||||
</h2>
|
||||
<p className="text-lg sm:text-xl max-w-3xl mx-auto text-neutral-300">
|
||||
{props.description}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
||||
{props.topics.map((topic) => (
|
||||
<a href={`/topic/${topic.slug}`} key={topic.id} className="hover:scale-[1.02] transition-transform duration-200">
|
||||
<Card className="h-full flex flex-col">
|
||||
<img src={topic.img} alt={topic.title} className="aspect-video object-cover rounded-t-lg" loading="lazy" />
|
||||
<CardContent className="flex-1 p-6">
|
||||
<CardTitle className="mb-2">{topic.title}</CardTitle>
|
||||
<CardDescription className="line-clamp-3">
|
||||
{topic.description}
|
||||
</CardDescription>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
import React, {useEffect, useState} from "react";
|
||||
import TopicItems from "./TopicItem";
|
||||
let topicPageDesc = 'Cutting-edge discussions on tech, digital services, news, and digital freedom. Stay informed on AI, cybersecurity, privacy, and the future of innovation.';
|
||||
export default function TopicCreation(props){
|
||||
return(
|
||||
<>
|
||||
<TopicItems topics={props.topics} title="SoliconPin Topics" description={topicPageDesc} />
|
||||
</>
|
||||
)
|
||||
}
|
|
@ -25,8 +25,8 @@ export default function ProfilePage() {
|
|||
const [userData, setUserData] = useState<UserData | null>(null);
|
||||
const [invoiceList, setInvoiceList] = useState<any[]>([]);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const USER_API_URL = 'http://192.168.1.197:2058/v1/users/index.php';
|
||||
const INVOICE_API_URL = 'http://192.168.1.197:2058/v1/invoice/';
|
||||
const USER_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/index.php';
|
||||
const INVOICE_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/invoice/';
|
||||
useEffect(() => {
|
||||
const fetchSessionData = async () => {
|
||||
try {
|
||||
|
|
|
@ -96,6 +96,7 @@ const organizationSchema = {
|
|||
<nav class="hidden md:flex items-center gap-6" aria-label="Main Navigation">
|
||||
<a href="/" class="hover:text-[#6d9e37] transition-colors">Home</a>
|
||||
<a href="/services" class="hover:text-[#6d9e37] transition-colors">Services</a>
|
||||
<a href="/topic" class="hover:text-[#6d9e37] transition-colors">Topic</a>
|
||||
<a href="/contact" class="hover:text-[#6d9e37] transition-colors">Contact</a>
|
||||
<a
|
||||
href="/get-started"
|
||||
|
@ -114,6 +115,7 @@ const organizationSchema = {
|
|||
<div id="mobileMenu" class="absolute right-0 mt-2 w-48 bg-neutral-800 rounded-md shadow-lg py-1 z-50 hidden border border-neutral-700">
|
||||
<a href="/" class="block px-4 py-2 text-sm text-white hover:bg-neutral-700">Home</a>
|
||||
<a href="/services" class="block px-4 py-2 text-sm text-white hover:bg-neutral-700">Services</a>
|
||||
<a href="/topic" class="block px-4 py-2 text-sm text-white hover:bg-neutral-700">Topic</a>
|
||||
<a href="/contact" class="block px-4 py-2 text-sm text-white hover:bg-neutral-700">Contact</a>
|
||||
<a href="/about-us" class="block px-4 py-2 text-sm text-white hover:bg-neutral-700">About Us</a>
|
||||
<a href="/get-started" class="block px-4 py-2 text-sm text-white hover:bg-neutral-700 font-medium text-[#6d9e37]">Get Started</a>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import PaymentSucces from "../components/PaymentSuccessfully";
|
||||
---
|
||||
|
||||
<Layout title="">
|
||||
<PaymentSucces client:load />
|
||||
</Layout>
|
|
@ -1,7 +0,0 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import TopicList from "../components/Topic";
|
||||
---
|
||||
<Layout title="">
|
||||
<TopicList client:load />
|
||||
</Layout>
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
import TopicDetail from "../../components/TopicDetail";
|
||||
|
||||
const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/';
|
||||
const { id } = Astro.params;
|
||||
|
||||
let topic = null;
|
||||
|
||||
try {
|
||||
const response = await fetch(`${TOPIC_API_URL}?query=get-single-topic&slug=${id}`, {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch topic. Status: ${response.status}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
topic = data.data[0]; // Assuming single result
|
||||
console.log('Single Topic:', topic);
|
||||
} catch (error) {
|
||||
console.error('Error fetching single topic:', error);
|
||||
}
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/';
|
||||
|
||||
try {
|
||||
const response = await fetch(`${TOPIC_API_URL}?query=get-all-topics`, {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
const data = await response.json();
|
||||
const paths = data.data.map((topic: { slug: string }) => ({
|
||||
params: { id: topic.slug },
|
||||
}));
|
||||
|
||||
console.log('Generated Static Paths:', paths);
|
||||
return paths;
|
||||
} catch (error) {
|
||||
console.error('Error generating static paths:', error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
---
|
||||
|
||||
<Layout title={topic?.title ?? 'Topic'}>
|
||||
<TopicDetail client:load topic={topic} />
|
||||
</Layout>
|
||||
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
import TopicsList from "../../components/Topics";
|
||||
|
||||
const TOPIC_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/topics/';
|
||||
let topics = [];
|
||||
|
||||
try {
|
||||
const response = await fetch(`${TOPIC_API_URL}?query=get-all-topics`, {
|
||||
method: 'GET',
|
||||
credentials: 'include',
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
topics = data.data || [];
|
||||
console.log('Topic Data', data);
|
||||
} catch (error) {
|
||||
console.error('An error occurred', error);
|
||||
}
|
||||
---
|
||||
|
||||
<Layout title="Topics">
|
||||
<TopicsList client:load topics={topics} />
|
||||
</Layout>
|
18
yarn.lock
18
yarn.lock
|
@ -2883,17 +2883,17 @@ react-remove-scroll@^2.6.3:
|
|||
use-callback-ref "^1.3.3"
|
||||
use-sidecar "^1.1.3"
|
||||
|
||||
react-router-dom@^7.4.1:
|
||||
version "7.4.1"
|
||||
resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.4.1.tgz"
|
||||
integrity sha512-L3/4tig0Lvs6m6THK0HRV4eHUdpx0dlJasgCxXKnavwhh4tKYgpuZk75HRYNoRKDyDWi9QgzGXsQ1oQSBlWpAA==
|
||||
react-router-dom@^7.5.0:
|
||||
version "7.5.0"
|
||||
resolved "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.5.0.tgz"
|
||||
integrity sha512-fFhGFCULy4vIseTtH5PNcY/VvDJK5gvOWcwJVHQp8JQcWVr85ENhJ3UpuF/zP1tQOIFYNRJHzXtyhU1Bdgw0RA==
|
||||
dependencies:
|
||||
react-router "7.4.1"
|
||||
react-router "7.5.0"
|
||||
|
||||
react-router@7.4.1:
|
||||
version "7.4.1"
|
||||
resolved "https://registry.npmjs.org/react-router/-/react-router-7.4.1.tgz"
|
||||
integrity sha512-Vmizn9ZNzxfh3cumddqv3kLOKvc7AskUT0dC1prTabhiEi0U4A33LmkDOJ79tXaeSqCqMBXBU/ySX88W85+EUg==
|
||||
react-router@7.5.0:
|
||||
version "7.5.0"
|
||||
resolved "https://registry.npmjs.org/react-router/-/react-router-7.5.0.tgz"
|
||||
integrity sha512-estOHrRlDMKdlQa6Mj32gIks4J+AxNsYoE0DbTTxiMy2mPzZuWSDU+N85/r1IlNR7kGfznF3VCUlvc5IUO+B9g==
|
||||
dependencies:
|
||||
"@types/cookie" "^0.6.0"
|
||||
cookie "^1.0.1"
|
||||
|
|
Loading…
Reference in New Issue