Erweiterungen
This commit is contained in:
@@ -17,7 +17,7 @@ import java.net.URL;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class LlmConfig {
|
public class LlmConfig {
|
||||||
|
|
||||||
@Value("${spring.ai.openai.base-url:http://192.168.180.10:1234}")
|
@Value("${spring.ai.openai.base-url:http://192.168.180.3:1234}")
|
||||||
private String baseUrl;
|
private String baseUrl;
|
||||||
|
|
||||||
@Value("${spring.ai.openai.chat.options.model:local-model}")
|
@Value("${spring.ai.openai.chat.options.model:local-model}")
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class LlmRestClient {
|
|||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
private final String model;
|
private final String model;
|
||||||
|
|
||||||
public LlmRestClient(@Value("${spring.ai.openai.base-url:http://192.168.180.10:1234}") String baseUrl,
|
public LlmRestClient(@Value("${spring.ai.openai.base-url:http://192.168.180.3:1234}") String baseUrl,
|
||||||
@Value("${spring.ai.openai.chat.options.model:local-model}") String model, ObjectMapper objectMapper) {
|
@Value("${spring.ai.openai.chat.options.model:local-model}") String model, ObjectMapper objectMapper) {
|
||||||
|
|
||||||
this.webClient = WebClient.builder().baseUrl(baseUrl + "/v1/chat/completions").build();
|
this.webClient = WebClient.builder().baseUrl(baseUrl + "/v1/chat/completions").build();
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ import de.assecutor.votianlt.security.SecurityService;
|
|||||||
import jakarta.annotation.security.RolesAllowed;
|
import jakarta.annotation.security.RolesAllowed;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import de.assecutor.votianlt.model.CargoItem;
|
import de.assecutor.votianlt.model.CargoItem;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -371,6 +372,7 @@ public class AddJobView extends Main {
|
|||||||
// Date picker fields for appointments
|
// Date picker fields for appointments
|
||||||
pickupDate = new DatePicker("Datum");
|
pickupDate = new DatePicker("Datum");
|
||||||
pickupDate.setRequiredIndicatorVisible(true);
|
pickupDate.setRequiredIndicatorVisible(true);
|
||||||
|
pickupDate.setMin(LocalDate.now());
|
||||||
pickupDate.setLocale(java.util.Locale.GERMANY); // Monday as first day of week
|
pickupDate.setLocale(java.util.Locale.GERMANY); // Monday as first day of week
|
||||||
pickupDate.setI18n(new DatePicker.DatePickerI18n().setFirstDayOfWeek(1) // 1 = Monday
|
pickupDate.setI18n(new DatePicker.DatePickerI18n().setFirstDayOfWeek(1) // 1 = Monday
|
||||||
.setMonthNames(java.util.Arrays.asList("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli",
|
.setMonthNames(java.util.Arrays.asList("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli",
|
||||||
@@ -381,6 +383,7 @@ public class AddJobView extends Main {
|
|||||||
|
|
||||||
deliveryDate = new DatePicker("Datum");
|
deliveryDate = new DatePicker("Datum");
|
||||||
deliveryDate.setRequiredIndicatorVisible(true);
|
deliveryDate.setRequiredIndicatorVisible(true);
|
||||||
|
deliveryDate.setMin(LocalDate.now());
|
||||||
deliveryDate.setLocale(java.util.Locale.GERMANY); // Monday as first day of week
|
deliveryDate.setLocale(java.util.Locale.GERMANY); // Monday as first day of week
|
||||||
deliveryDate.setI18n(new DatePicker.DatePickerI18n().setFirstDayOfWeek(1) // 1 = Monday
|
deliveryDate.setI18n(new DatePicker.DatePickerI18n().setFirstDayOfWeek(1) // 1 = Monday
|
||||||
.setMonthNames(java.util.Arrays.asList("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli",
|
.setMonthNames(java.util.Arrays.asList("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli",
|
||||||
@@ -843,9 +846,15 @@ public class AddJobView extends Main {
|
|||||||
.bind(Job::getPrice, Job::setPrice);
|
.bind(Job::getPrice, Job::setPrice);
|
||||||
|
|
||||||
// Bind date picker fields with validation
|
// Bind date picker fields with validation
|
||||||
binder.forField(pickupDate).asRequired("").bind(Job::getPickupDate, Job::setPickupDate);
|
binder.forField(pickupDate).asRequired("")
|
||||||
|
.withValidator(date -> date == null || !date.isBefore(LocalDate.now()),
|
||||||
|
"Das Abholdatum darf nicht in der Vergangenheit liegen")
|
||||||
|
.bind(Job::getPickupDate, Job::setPickupDate);
|
||||||
|
|
||||||
binder.forField(deliveryDate).asRequired("").bind(Job::getDeliveryDate, Job::setDeliveryDate);
|
binder.forField(deliveryDate).asRequired("")
|
||||||
|
.withValidator(date -> date == null || !date.isBefore(LocalDate.now()),
|
||||||
|
"Das Lieferdatum darf nicht in der Vergangenheit liegen")
|
||||||
|
.bind(Job::getDeliveryDate, Job::setDeliveryDate);
|
||||||
|
|
||||||
// Bind time picker fields (optional)
|
// Bind time picker fields (optional)
|
||||||
binder.bind(pickupTime, Job::getPickupTime, Job::setPickupTime);
|
binder.bind(pickupTime, Job::getPickupTime, Job::setPickupTime);
|
||||||
@@ -1064,7 +1073,9 @@ public class AddJobView extends Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasAppointmentValidationErrors() {
|
private boolean hasAppointmentValidationErrors() {
|
||||||
return pickupDate.getValue() == null || deliveryDate.getValue() == null;
|
LocalDate today = LocalDate.now();
|
||||||
|
return pickupDate.getValue() == null || deliveryDate.getValue() == null
|
||||||
|
|| pickupDate.getValue().isBefore(today) || deliveryDate.getValue().isBefore(today);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasCargoValidationErrors() {
|
private boolean hasCargoValidationErrors() {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ app.google.maps.api-key=AIzaSyDnbitL06iLp3elmj-WtPudCykX9xvXcVE
|
|||||||
# ===========================================
|
# ===========================================
|
||||||
# LLM Configuration (LM Studio)
|
# LLM Configuration (LM Studio)
|
||||||
# ===========================================
|
# ===========================================
|
||||||
spring.ai.openai.base-url=http://192.168.180.10:1234
|
spring.ai.openai.base-url=http://192.168.180.3:1234
|
||||||
spring.ai.openai.api-key=not-used
|
spring.ai.openai.api-key=not-used
|
||||||
spring.ai.openai.chat.options.model=local-model
|
spring.ai.openai.chat.options.model=local-model
|
||||||
spring.ai.openai.chat.options.temperature=0.7
|
spring.ai.openai.chat.options.temperature=0.7
|
||||||
|
|||||||
Reference in New Issue
Block a user