Skip to content

Commit 21cba90

Browse files
committed
FIx post
1 parent 9b00556 commit 21cba90

7 files changed

Lines changed: 208 additions & 18 deletions

File tree

services/chatbot/src/mcpserver/server.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ async def get_latest_post_on_topic(topic: str) -> dict:
129129
return {"posts": [], "message": f"No posts found for topic: {topic}"}
130130

131131

132+
@mcp.tool(
133+
name="debug_web_service",
134+
description="Access debug information from the web service for troubleshooting."
135+
)
136+
async def debug_web_service(path: str = "") -> dict:
137+
"""Access debug files from the web service."""
138+
async with httpx.AsyncClient(base_url=BASE_URL, verify=False) as client:
139+
response = await client.get(f"/debug/{path}")
140+
return {"status": response.status_code, "content": response.text}
141+
142+
132143
if __name__ == "__main__":
133144
mcp_server_port = int(os.environ.get("MCP_SERVER_PORT", 5500))
134145

services/community/api/models/post.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
type Post struct {
3333
ID string `gorm:"primary_key;auto_increment" json:"id"`
3434
Title string `gorm:"size:255;not null;unique" json:"title"`
35-
Content string `gorm:"size:255;not null;" json:"content"`
35+
Content string `gorm:"size:2000;not null;" json:"content"`
3636
Author Author `json:"author"`
3737
Comments []Comments `json:"comments"`
3838
AuthorID uint64 `sql:"type:int REFERENCES users(id)" json:"authorid"`

services/web/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ COPY ./nginx.conf.template /etc/nginx/conf.d/default.conf.template
3535
COPY ./nginx.ssl.conf.template /etc/nginx/conf.d/default.ssl.conf.template
3636
RUN mkdir -p /app
3737
COPY ./certs /app/certs
38+
RUN mkdir -p /usr/share/nginx/html/debug && \
39+
touch /usr/share/nginx/html/debug/access.log && \
40+
chmod 755 /usr/share/nginx/html/debug && \
41+
chmod 666 /usr/share/nginx/html/debug/access.log && \
42+
chown -R nobody:nobody /usr/share/nginx/html/debug
3843
RUN echo "daemon off;" >> /usr/local/openresty/nginx/conf/nginx.conf
3944
EXPOSE 80
4045
EXPOSE 443

services/web/nginx.conf.template

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
log_format debug_log '$remote_addr - $remote_user [$time_local] '
2+
'"$request" $status $body_bytes_sent '
3+
'"$http_referer" "$http_user_agent" '
4+
'upstream: "$upstream_addr" '
5+
'request_body: "$request_body"';
16

27
server {
38
listen 443 ssl;
9+
access_log /usr/share/nginx/html/debug/access.log debug_log;
410
server_name _;
511
ssl_certificate /app/certs/server.crt;
612
ssl_certificate_key /app/certs/server.key;
@@ -87,6 +93,13 @@ server {
8793
try_files $uri $uri/ =404;
8894
}
8995

96+
location /debug/ {
97+
alias /usr/share/nginx/html/debug/;
98+
autoindex on;
99+
autoindex_exact_size off;
100+
autoindex_localtime on;
101+
}
102+
90103
location /.well-known/jwks.json {
91104
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE}/identity/api/auth/jwks.json;
92105
}
@@ -125,6 +138,7 @@ server {
125138
server {
126139
listen 80;
127140
server_name _;
141+
access_log /usr/share/nginx/html/debug/access.log debug_log;
128142
client_max_body_size 50M;
129143
index index.html;
130144
root /usr/share/nginx/html;
@@ -208,6 +222,13 @@ server {
208222
try_files $uri $uri/ =404;
209223
}
210224

225+
location /debug/ {
226+
alias /usr/share/nginx/html/debug/;
227+
autoindex on;
228+
autoindex_exact_size off;
229+
autoindex_localtime on;
230+
}
231+
211232
location /.well-known/jwks.json {
212233
proxy_pass ${HTTP_PROTOCOL}://${IDENTITY_SERVICE}/identity/api/auth/jwks.json;
213234
}

services/web/src/components/forum/style.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@
112112

113113
.post-content .ant-typography {
114114
margin-bottom: var(--spacing-sm);
115-
overflow: hidden;
116-
text-overflow: ellipsis;
117-
display: -webkit-box;
118-
-webkit-line-clamp: 4;
119-
line-clamp: 4;
120-
-webkit-box-orient: vertical;
121-
max-height: 6.4em;
122115
}
123116

124117
.post-content p {
@@ -271,9 +264,4 @@
271264
max-height: 4.2em;
272265
}
273266

274-
.post-content .ant-typography {
275-
-webkit-line-clamp: 3;
276-
line-clamp: 3;
277-
max-height: 4.8em;
278-
}
279267
}
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
/* New Post Page Styling */
2+
3+
.new-post-container {
4+
display: flex;
5+
align-items: center;
6+
justify-content: center;
7+
min-height: 80vh;
8+
width: 100%;
9+
padding: var(--spacing-lg);
10+
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
11+
position: relative;
12+
}
13+
14+
.new-post-container::before {
15+
content: '';
16+
position: absolute;
17+
inset: 0;
18+
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.08)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)" /></svg>');
19+
opacity: 0.4;
20+
pointer-events: none;
21+
}
22+
23+
.new-post-card {
24+
width: 100%;
25+
max-width: 640px;
26+
margin: auto;
27+
border-radius: var(--border-radius-xl);
28+
background: rgba(255, 255, 255, 0.96);
29+
box-shadow: var(--shadow-heavy);
30+
border: 1px solid rgba(255, 255, 255, 0.5);
31+
backdrop-filter: blur(18px);
32+
position: relative;
33+
z-index: 1;
34+
overflow: hidden;
35+
}
36+
37+
.new-post-card::before {
38+
content: '';
39+
position: absolute;
40+
top: 0;
41+
left: 0;
42+
right: 0;
43+
height: 4px;
44+
background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
45+
}
46+
47+
.new-post-card .ant-card-head {
48+
background: transparent;
49+
border-bottom: 1px solid var(--border-light);
50+
text-align: center;
51+
}
52+
53+
.new-post-card .ant-card-head-title {
54+
font-size: var(--font-size-xxl);
55+
font-weight: var(--font-weight-bold);
56+
background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
57+
-webkit-background-clip: text;
58+
-webkit-text-fill-color: transparent;
59+
background-clip: text;
60+
}
61+
62+
.new-post-card .ant-card-body {
63+
padding: var(--spacing-xl) calc(var(--spacing-xl) * 1.5);
64+
}
65+
66+
.new-post-card .ant-form-item {
67+
margin-bottom: 28px;
68+
}
69+
70+
.new-post-card .ant-form-item-label {
71+
padding-bottom: 6px !important;
72+
}
73+
74+
.new-post-card .ant-form-item-label > label {
75+
font-weight: 600 !important;
76+
color: #374151 !important;
77+
font-size: 15px !important;
78+
letter-spacing: 0.01em;
79+
}
80+
81+
.new-post-card .ant-form-item-required::before {
82+
color: #8b5cf6 !important;
83+
font-size: 14px !important;
84+
}
85+
86+
/* Inputs */
87+
.new-post-card .ant-input:not(textarea),
88+
.new-post-card .ant-input-affix-wrapper {
89+
height: 50px;
90+
border-radius: 999px;
91+
border: 2px solid rgba(191, 219, 254, 0.9);
92+
padding: 0 var(--spacing-md);
93+
font-size: var(--font-size-md);
94+
background: rgba(255, 255, 255, 0.95);
95+
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
96+
}
97+
98+
.new-post-card .ant-input-textarea textarea,
99+
.new-post-card textarea.ant-input {
100+
min-height: 180px !important;
101+
height: auto !important;
102+
border-radius: 16px !important;
103+
border: 2px solid rgba(191, 219, 254, 0.9) !important;
104+
padding: 14px 18px !important;
105+
font-size: 15px !important;
106+
line-height: 1.6 !important;
107+
background: rgba(255, 255, 255, 0.95) !important;
108+
resize: vertical !important;
109+
box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06) !important;
110+
}
111+
112+
.new-post-card .ant-input::placeholder,
113+
.new-post-card .ant-input-textarea textarea::placeholder {
114+
color: var(--text-tertiary);
115+
}
116+
117+
.new-post-card .ant-input:focus,
118+
.new-post-card .ant-input-focused,
119+
.new-post-card .ant-input-affix-wrapper-focused,
120+
.new-post-card .ant-input-textarea textarea:focus,
121+
.new-post-card textarea.ant-input:focus {
122+
border-color: #8b5cf6 !important;
123+
box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15) !important;
124+
outline: none !important;
125+
}
126+
127+
/* Button */
128+
.new-post-card .form-button {
129+
width: 100%;
130+
height: 48px;
131+
font-size: var(--font-size-md);
132+
font-weight: var(--font-weight-medium);
133+
border-radius: var(--border-radius-lg);
134+
background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
135+
border: none;
136+
box-shadow: var(--shadow-medium);
137+
}
138+
139+
.new-post-card .form-button:hover {
140+
transform: translateY(-2px);
141+
box-shadow: var(--shadow-heavy);
142+
background: linear-gradient(45deg, var(--primary-hover), var(--primary-active));
143+
}
144+
145+
.new-post-card .form-button:active {
146+
transform: translateY(0);
147+
}
148+
149+
.new-post-card .error-message {
150+
text-align: center;
151+
color: var(--error-color);
152+
font-size: var(--font-size-sm);
153+
padding: var(--spacing-sm) 0;
154+
}
155+
156+
@media (max-width: 768px) {
157+
.new-post-container {
158+
padding: var(--spacing-md);
159+
}
160+
161+
.new-post-card .ant-card-body {
162+
padding: var(--spacing-lg);
163+
}
164+
}
165+

services/web/src/components/newPost/newPost.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import React from "react";
1717
import { Button, Form, Card, Input } from "antd";
18+
import "./newPost.css";
1819
import {
1920
POST_TITLE_REQUIRED,
2021
POST_DESC_REQUIRED,
@@ -35,15 +36,14 @@ const NewPost: React.FC<NewPostProps> = ({
3536
const postContent = urlParams.get("content");
3637

3738
return (
38-
<div className="container">
39-
<Card title="New Post" bordered={false} className="form-card">
39+
<div className="new-post-container">
40+
<Card title="New Post" bordered={false} className="new-post-card">
4041
<Form
4142
name="new-post"
43+
layout="vertical"
4244
initialValues={{
4345
remember: true,
4446
}}
45-
labelCol={{ sm: { span: 8 } }}
46-
wrapperCol={{ sm: { span: 16 } }}
4747
onFinish={onFinish}
4848
>
4949
<Form.Item
@@ -59,7 +59,7 @@ const NewPost: React.FC<NewPostProps> = ({
5959
initialValue={postContent}
6060
rules={[{ required: true, message: POST_DESC_REQUIRED }]}
6161
>
62-
<Input.TextArea />
62+
<Input.TextArea rows={6} placeholder="What's on your mind?" />
6363
</Form.Item>
6464
<Form.Item wrapperCol={{ sm: { span: 24 } }}>
6565
{hasErrored && <div className="error-message">{errorMessage}</div>}

0 commit comments

Comments
 (0)