up testing api page
This commit is contained in:
parent
b9abd0883d
commit
74fa59a2e1
5 changed files with 177 additions and 7 deletions
|
@ -95,7 +95,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
border: 3px solid var(--Colors-Principal-100, #96BEE4);
|
outline: 3px solid var(--Colors-Principal-100, #96BEE4);
|
||||||
background: var(--Gradient, linear-gradient(77deg, #073A7C -4.23%, #1767AD 51.8%, #255B8E 87.72%));
|
background: var(--Gradient, linear-gradient(77deg, #073A7C -4.23%, #1767AD 51.8%, #255B8E 87.72%));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
83
sae-csc/deployment/Dockerfile
Normal file
83
sae-csc/deployment/Dockerfile
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
# servir une application angular buildée
|
||||||
|
|
||||||
|
# qui utilise la lib sae Aero
|
||||||
|
|
||||||
|
# - relier la lib my_workspace
|
||||||
|
|
||||||
|
# - build de l'app angular
|
||||||
|
|
||||||
|
# - servir le build
|
||||||
|
|
||||||
|
# Use official Node.js LTS image
|
||||||
|
|
||||||
|
FROM node:24-alpine AS build
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
|
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Create a non-root user
|
||||||
|
|
||||||
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||||
|
|
||||||
|
# Copy package.json and package-lock.json as root and install dependencies
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Copy app source and fix ownership
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN chown -R appuser:appgroup /usr/src/app
|
||||||
|
|
||||||
|
RUN pwd
|
||||||
|
|
||||||
|
RUN cd /usr/src/app/my-workspace/projects/sae-lib
|
||||||
|
|
||||||
|
RUN npm link
|
||||||
|
|
||||||
|
# Switch to non-root user
|
||||||
|
|
||||||
|
USER appuser
|
||||||
|
|
||||||
|
RUN pwd
|
||||||
|
|
||||||
|
RUN cd ../../../../../
|
||||||
|
|
||||||
|
RUN npm link sae-lib
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
RUN echo "building done"
|
||||||
|
|
||||||
|
# Add healthcheck (tries every 30s, times out after 10s, fails after 3 retries)
|
||||||
|
|
||||||
|
# HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
||||||
|
|
||||||
|
# CMD wget -qO- http://localhost:8080/ || exit 1
|
||||||
|
|
||||||
|
# ============================
|
||||||
|
|
||||||
|
# 🚀 Stage 2 — Serve with NGINX
|
||||||
|
|
||||||
|
# ============================
|
||||||
|
|
||||||
|
FROM nginx:1.29-alpine AS serve
|
||||||
|
|
||||||
|
# Remove default NGINX website
|
||||||
|
|
||||||
|
RUN rm -rf /usr/share/nginx/html/*
|
||||||
|
|
||||||
|
# Copy built Angular app from previous stage
|
||||||
|
|
||||||
|
COPY --from=build /app/dist/implem /usr/share/nginx/html
|
||||||
|
|
||||||
|
# Expose port 80
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# Start NGINX
|
||||||
|
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
|
||||||
/app/summarize_questions
|
<!-- /app/summarize_questions
|
||||||
/app/get_keyword_from_email
|
/app/get_keyword_from_email
|
||||||
/app/search_engine
|
/app/search_engine
|
||||||
/app/query_simple
|
/app/query_simple
|
||||||
|
@ -12,7 +12,33 @@
|
||||||
/app/esm_detect
|
/app/esm_detect
|
||||||
/app/hardware_detect
|
/app/hardware_detect
|
||||||
/app/esm_content_analyse
|
/app/esm_content_analyse
|
||||||
/app/ai_filter
|
/app/ai_filter -->
|
||||||
|
|
||||||
|
backend:
|
||||||
|
<input [(ngModel)]="backend" type="text">
|
||||||
|
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='summarize_questions' (click)="summarizeQuestions()">
|
||||||
|
</sae-m-button>
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='get_keyword_from_email' (click)="getKeywordFromEmail()"></sae-m-button>
|
||||||
|
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='search_engine' (click)="searchEngine()">
|
||||||
|
</sae-m-button>
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='query_simple' (click)="querySimple()">
|
||||||
|
|
||||||
|
</sae-m-button>
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='dica_detect' (click)="dicaDetect()">
|
||||||
|
</sae-m-button>
|
||||||
|
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='esm_detect' (click)="esmDetect()">
|
||||||
|
</sae-m-button>
|
||||||
|
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='hardware_detect' (click)="hardwareDetect()">
|
||||||
|
</sae-m-button>
|
||||||
|
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='esm_content_analyse' (click)="esmContentAnalyse()">
|
||||||
|
</sae-m-button>
|
||||||
|
<sae-m-button [kind]="'primary'" class="button" label='ai_filter' (click)="aiFilter()">
|
||||||
|
</sae-m-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,14 +61,14 @@
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
|
|
||||||
<br>
|
|
||||||
<h2>
|
<h2>
|
||||||
Post /api/v1/messages
|
Post /api/v1/messages
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
entrez votre message:
|
entrez votre message:
|
||||||
<input [(ngModel)]="input" type="text">
|
<input [(ngModel)]="input" type="text">
|
||||||
<br>
|
|
||||||
<sae-m-button
|
<sae-m-button
|
||||||
(click)="sendMessage()"
|
(click)="sendMessage()"
|
||||||
[kind]="'primary'"
|
[kind]="'primary'"
|
||||||
|
@ -52,7 +78,7 @@
|
||||||
<sae-bot-talks [message]="message">
|
<sae-bot-talks [message]="message">
|
||||||
</sae-bot-talks>
|
</sae-bot-talks>
|
||||||
</section>
|
</section>
|
||||||
<br>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
@ -78,7 +104,7 @@
|
||||||
<section>
|
<section>
|
||||||
|
|
||||||
<h2>Envoi de fichier</h2>
|
<h2>Envoi de fichier</h2>
|
||||||
<!-- <br>-->
|
<!-- -->
|
||||||
<sae-m-button
|
<sae-m-button
|
||||||
(click)="sendFile()"
|
(click)="sendFile()"
|
||||||
class="button" kind="secondary"
|
class="button" kind="secondary"
|
||||||
|
|
|
@ -25,4 +25,8 @@
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
|
sae-m-button {
|
||||||
|
margin-top: 1rem;
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,4 +115,61 @@ export class TestingApi {
|
||||||
getUserConversations() {
|
getUserConversations() {
|
||||||
console.log('getUserConversations TODO')
|
console.log('getUserConversations TODO')
|
||||||
}
|
}
|
||||||
|
summarizeQuestions() {
|
||||||
|
console.log('summarizeQuestions TODO')
|
||||||
|
fetch(`http://${this.backend}/app/summarize_questions`, {
|
||||||
|
method: "POST",
|
||||||
|
mode: "cors",
|
||||||
|
body: JSON.stringify({
|
||||||
|
question: "What are the main causes of engine failures in Boeing 737?"
|
||||||
|
}),
|
||||||
|
headers: defaultHeaders
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
console.log(data);
|
||||||
|
this.response = JSON.stringify(data);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
}
|
||||||
|
getKeywordFromEmail() {
|
||||||
|
console.log('getKeywordFromEmail TODO')
|
||||||
|
fetch(`http://${this.backend}/app/get_keyword_from_email`, {
|
||||||
|
method: "POST",
|
||||||
|
mode: "cors",
|
||||||
|
body: JSON.stringify({
|
||||||
|
email: "test@test.com"
|
||||||
|
}),
|
||||||
|
headers: defaultHeaders
|
||||||
|
})
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
console.log(data);
|
||||||
|
this.response = JSON.stringify(data);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.catch(error => console.error('Error:', error));
|
||||||
|
}
|
||||||
|
esmDetect() {
|
||||||
|
console.log('esmDetect TODO')
|
||||||
|
}
|
||||||
|
hardwareDetect() {
|
||||||
|
console.log('hardwareDetect TODO')
|
||||||
|
}
|
||||||
|
esmContentAnalyse() {
|
||||||
|
console.log('esmContentAnalyse TODO')
|
||||||
|
}
|
||||||
|
aiFilter() {
|
||||||
|
console.log('aiFilter TODO')
|
||||||
|
}
|
||||||
|
searchEngine() {
|
||||||
|
console.log('searchEngine TODO')
|
||||||
|
}
|
||||||
|
querySimple() {
|
||||||
|
console.log('querySimple TODO')
|
||||||
|
}
|
||||||
|
dicaDetect() {
|
||||||
|
console.log('dicaDetect TODO')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue