public static final String I18_BUNDLE_LOCATION = "language/messages";
@Bean
public ResourceBundleMessageSource resourceBundleMessageSource() {
final var source = new ResourceBundleMessageSource();
{
source.setBasename(I18_BUNDLE_LOCATION);
source.setDefaultEncoding(StandardCharsets.UTF_8.name());
}
return source;
}
@Slf4j
@Service
@RequiredArgsConstructor
public class LocaleI18Service implements LocaleService {
private final ResourceBundleMessageSource messageSource;
@Override
public String getI18Message(final String i18Code) {
return getMessage(i18Code, Map.of());
}
public String getI18Message(final String i18Code, final Map<String, String> args) {
return getMessage(i18Code, args);
}
private String getMessage(final String i18Code, final Map<String, String> args) {
if (Objects.isNull(i18Code)) {
return null;
}
final var currentLocale = LocaleContextHolder.getLocale();
final String template = messageSource.getMessage(i18Code, null, currentLocale);
if (Objects.isNull(args) || args.isEmpty()) {
return template;
}
return StringSubstitutor.replace(template, args, "{", "}");
}
}
public interface SystemException {
/**
* Get args for code
*
* @return args message
*/
Map<String, String> getArgs();
/**
* Exception code
*
* @return i18 code
*/
String getI18Code();
}
location /ws {
proxy_pass $BACKEND_URL;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location / {
root /home/html/admin/;
try_files $uri /index.html;
}
location /interview {
root /home/html/;
try_files $uri $uri/index.html;
}
<div>
<img src="// добавь путь полученный с сервера после загрузки">
</div>
var elementFirst = document.querySelector('div img:first-child');
divGallery.insertBefore(newElemnt, elementFirst);
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
send_timeout 300;
proxy_read_timeout 300;
proxy_connect_timeout 300;
gzip on;
gzip_vary on;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/json;
server {
listen 80;
if ($scheme = https) {
return 301 http://$host$request_uri;
}
}
server {
listen 80;
server_name localhost ************ 127.0.0.1;
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
location / {
root /usr/share/nginx/html/;
index index.html;
}
location /api {
proxy_pass http://rest:8080/api;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-for $remote_addr;
proxy_redirect off;
}
}
}
interface Navigate {
currentItem: number;
items: number[]
}
export class NavigateToFirst implements Action {
readonly type = NavigateActions.CHANGE_Navigate;
public payload: Navigate;
constructor(navigate: Navigate) {
// change
this.payload = navigate;
}
}