mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 06:45:50 +00:00
Merge branch 'spring-ai' into spring-ai
This commit is contained in:
commit
fe144aedd6
6 changed files with 253 additions and 1 deletions
25
.tanzu/config/httproute.yml
Normal file
25
.tanzu/config/httproute.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||||
|
kind: HTTPRoute
|
||||||
|
metadata:
|
||||||
|
name: petclinic-route
|
||||||
|
annotations:
|
||||||
|
healthcheck.gslb.tanzu.vmware.com/service: spring-petclinic
|
||||||
|
healthcheck.gslb.tanzu.vmware.com/path: /
|
||||||
|
healthcheck.gslb.tanzu.vmware.com/port: "80"
|
||||||
|
spec:
|
||||||
|
parentRefs:
|
||||||
|
- group: gateway.networking.k8s.io
|
||||||
|
kind: Gateway
|
||||||
|
name: default-gateway
|
||||||
|
sectionName: http-petclinic
|
||||||
|
rules:
|
||||||
|
- backendRefs:
|
||||||
|
- group: ""
|
||||||
|
kind: Service
|
||||||
|
name: spring-petclinic
|
||||||
|
port: 8080
|
||||||
|
weight: 1
|
||||||
|
matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
18
.tanzu/config/spring-petclinic.yml
Normal file
18
.tanzu/config/spring-petclinic.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: apps.tanzu.vmware.com/v1
|
||||||
|
kind: ContainerApp
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: spring-petclinic
|
||||||
|
spec:
|
||||||
|
nonSecretEnv:
|
||||||
|
- name: SPRING_PROFILES_ACTIVE
|
||||||
|
value: openai
|
||||||
|
build:
|
||||||
|
buildpacks: {}
|
||||||
|
nonSecretEnv:
|
||||||
|
- name: BP_JVM_VERSION
|
||||||
|
value: "17"
|
||||||
|
path: ../..
|
||||||
|
ports:
|
||||||
|
- name: main
|
||||||
|
port: 8080
|
|
@ -9610,4 +9610,118 @@ strong {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
margin-bottom: 30px; } }
|
margin-bottom: 30px; } }
|
||||||
|
|
||||||
/*# sourceMappingURL=../../../../../../target/petclinic.css.map */
|
/*# sourceMappingURL=../../../../../../target/petclinic.css.map */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Chatbox container */
|
||||||
|
.chatbox {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 10px;
|
||||||
|
right: 10px;
|
||||||
|
width: 300px;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Header styling */
|
||||||
|
.chatbox-header {
|
||||||
|
background-color: #075E54;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
border-top-left-radius: 10px;
|
||||||
|
border-top-right-radius: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chatbox content styling */
|
||||||
|
.chatbox-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 400px; /* Adjust to desired height */
|
||||||
|
overflow: hidden; /* Hide overflow to make it scrollable */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Minimize style */
|
||||||
|
.chatbox.minimized .chatbox-content {
|
||||||
|
height: 40px; /* Height when minimized (header only) */
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox.minimized .chatbox-messages,
|
||||||
|
.chatbox.minimized .chatbox-footer {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox-messages {
|
||||||
|
flex-grow: 1;
|
||||||
|
overflow-y: auto; /* Allows vertical scrolling */
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chat bubbles styling */
|
||||||
|
.chat-bubble {
|
||||||
|
max-width: 80%;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
position: relative;
|
||||||
|
word-wrap: break-word;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure bold and italic styles are handled */
|
||||||
|
.chat-bubble strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-bubble em {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-bubble.user {
|
||||||
|
background-color: #dcf8c6; /* WhatsApp-style light green */
|
||||||
|
margin-left: auto;
|
||||||
|
text-align: right;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-bubble.bot {
|
||||||
|
background-color: #ffffff;
|
||||||
|
margin-right: auto;
|
||||||
|
text-align: left;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
border: 1px solid #e1e1e1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Input field and button */
|
||||||
|
.chatbox-footer {
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox-footer input {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 20px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
margin-right: 10px;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox-footer button {
|
||||||
|
background-color: #075E54;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chatbox-footer button:hover {
|
||||||
|
background-color: #128C7E;
|
||||||
|
}
|
||||||
|
|
88
src/main/scss/chatbot.scss
Normal file
88
src/main/scss/chatbot.scss
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
.chatbox {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
width: 300px;
|
||||||
|
border-radius: 10px 10px 0 0;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&.minimized {
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-header {
|
||||||
|
background-color: $spring-green;
|
||||||
|
color: white;
|
||||||
|
padding: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
height: 400px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: white;
|
||||||
|
transition: height 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-messages {
|
||||||
|
padding: 10px;
|
||||||
|
overflow-y: auto;
|
||||||
|
height: 90%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
|
||||||
|
.chat-bubble {
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 15px;
|
||||||
|
max-width: 70%;
|
||||||
|
word-wrap: break-word;
|
||||||
|
|
||||||
|
&.user {
|
||||||
|
background-color: $spring-brown;
|
||||||
|
color: white;
|
||||||
|
align-self: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.bot {
|
||||||
|
background-color: $spring-grey;
|
||||||
|
color: black;
|
||||||
|
align-self: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-footer {
|
||||||
|
display: flex;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: $spring-light-grey;
|
||||||
|
|
||||||
|
input {
|
||||||
|
flex: 1;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
border: 1px solid $spring-brown;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-left: 10px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
background-color: $spring-green;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: darken($spring-green, 10%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -337,3 +337,4 @@ hr {
|
||||||
@import "typography.scss";
|
@import "typography.scss";
|
||||||
@import "header.scss";
|
@import "header.scss";
|
||||||
@import "responsive.scss";
|
@import "responsive.scss";
|
||||||
|
@import "chatbot.scss";
|
6
tanzu.yml
Normal file
6
tanzu.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
apiVersion: config.tanzu.vmware.com/v1
|
||||||
|
configuration:
|
||||||
|
dev:
|
||||||
|
paths:
|
||||||
|
- .tanzu/config/
|
||||||
|
kind: TanzuConfig
|
Loading…
Reference in a new issue