Skip to content

Commit 61f2908

Browse files
committed
updated log
1 parent a7b533c commit 61f2908

File tree

8 files changed

+84
-13
lines changed

8 files changed

+84
-13
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2929
let should_compile = !Path::new(proto_out_dir).exists()
3030
|| std::fs::read_dir(proto_out_dir)?.count() < proto_files.len();
3131

32-
if should_compile || true {
32+
if should_compile {
3333
println!("cargo:warning=Compiling protobuf files...");
3434
tonic_prost_build::configure()
3535
.out_dir(proto_out_dir)

src/api/cms_api.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::api::proto::cms::{
33
GetCmsContentRequest, GetCmsContentResponse, SentContactFormRequest, SentContactFormResponse,
44
};
55
use crate::avored_state::AvoRedState;
6+
use std::net::SocketAddr;
67
use std::sync::Arc;
78
use tonic::{async_trait, Request, Response, Status};
89

@@ -32,6 +33,16 @@ impl Cms for CmsApi {
3233
// return Err(status);
3334
// }
3435

36+
// let headers = request.g
37+
let remote_addr: Option<SocketAddr> = request.remote_addr();
38+
39+
// Log or use the remote address as needed
40+
if let Some(addr) = remote_addr {
41+
println!("Request from: {}", addr);
42+
} else {
43+
println!("Could not determine remote address.");
44+
}
45+
3546
let req = request.into_inner();
3647

3748
match self

src/services/cms_service.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ impl CmsService {
7676
request: GetCmsContentRequest,
7777
(datastore, database_session): &DB,
7878
) -> Result<GetCmsContentResponse> {
79+
//@todo create a visitor record
80+
println!("request: {:?}", request);
7981
let content_model = self
8082
.content_repository
8183
.find_by_identifier(

ts-grpc-vite-admin/vite.config.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
import { defineConfig } from 'vite';
1+
import { defineConfig, loadEnv } from 'vite';
22
import react from '@vitejs/plugin-react';
33
import tailwindcss from '@tailwindcss/vite';
44
import { viteRequire } from 'vite-require';
55
import svgLoader from 'vite-svg-loader';
6-
// https://vite.dev/config/
7-
export default defineConfig({
8-
plugins: [
6+
7+
8+
export default defineConfig(({ mode }) => {
9+
const env = loadEnv(mode, process.cwd(), 'VITE_'); // Load env variables with VITE_ prefix
10+
11+
return {
12+
plugins: [
913
react(),
1014
tailwindcss(),
1115
viteRequire(),
1216
svgLoader()
13-
],
14-
resolve: {
15-
preserveSymlinks: true,
16-
}
17-
});
17+
],
18+
resolve: {
19+
preserveSymlinks: true,
20+
},
21+
server: {
22+
port: parseInt(env.VITE_PORT) || 5173, // Use the VITE_PORT or default to 5173
23+
},
24+
};
25+
});

ts-grpc-vite-front/package-lock.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ts-grpc-vite-front/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
},
2929
"devDependencies": {
3030
"@eslint/js": "^9.33.0",
31-
"@types/react": "^19.1.10",
31+
"@tailwindcss/typography": "^0.5.18",
3232
"@types/lodash": "^4.17.20",
33+
"@types/react": "^19.1.10",
3334
"@types/react-dom": "^19.1.7",
3435
"@vitejs/plugin-react": "^5.0.0",
3536
"eslint": "^9.33.0",

ts-grpc-vite-front/src/index.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import "tailwindcss";
2+
@plugin "@tailwindcss/typography";
23

34
@theme {
45
--color-primary-50: oklch(0.977 0.017 320.058);

ts-grpc-vite-front/src/pages/docs/DocsPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ export const DocsPage = (() => {
2020

2121
return(
2222
<>
23-
<div className="flex w-full">
23+
<div className="flex mt-5 w-full">
2424
<div className="p-5 bg-gray-200 rounded-lg w-48">
2525
<Link to={`/docs`}>
2626
Installation
2727
</Link>
2828
</div>
29-
<div className="p-5 flex-1 markdown-body">
29+
<div className="p-5 flex-1 markdown-body prose prose-slate">
3030
<Markdown>{GetElementValue(content_content_field_list, 'docs-page-content')}</Markdown>
3131
</div>
3232
<div className="p-5 w-64">

0 commit comments

Comments
 (0)