Skip to content

Commit

Permalink
NOJIRA
Browse files Browse the repository at this point in the history
Fixing the footer version information
  • Loading branch information
chasegawa committed Jul 1, 2022
1 parent 3f08c18 commit 079716e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
8 changes: 5 additions & 3 deletions backend/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spring.liquibase.change-log=db/changelog/changelog.sql
spring.jpa.hibernate.ddl-auto=update
spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
spring.jpa.show-sql=false
spring.jpa.properties.hibernate.format_sql=false
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.hibernate.check_nullability=true
spring.jpa.hibernate.use-new-id-generator-mappings=true

Expand Down Expand Up @@ -118,5 +118,7 @@ springdoc.swagger-ui.tagsSorter: alpha
springdoc.writer-with-order-by-keys: true
springdoc.pathsToMatch=/entities, /api/**
# This property enables the openapi and swagger-ui endpoints to be exposed beneath the actuator base path.
management.endpoints.web.exposure.include=openapi, swagger-ui
management.server.port=9090
management.endpoints.web.exposure.include=openapi, swagger-ui, info
management.server.port=9090
management.endpoints.web.cors.allowed-origins=*
management.endpoints.web.cors.allowed-headers=*
10 changes: 10 additions & 0 deletions ui/src/app/App.constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ export const getBasePath = () => {
//replace(/^\/|\/$/g, '')
};

export const getActuatorPath = () => {
const url = new URL(document.getElementsByTagName('base')[0].href);

var foo = document.createElement("a");
foo.href = url.pathname?.replace(/^\/+/g, '');
foo.port = "9090"
return foo.href;
}

export const BASE_PATH = getBasePath();
export const API_BASE_PATH = `${BASE_PATH}api`;
export const ACTUATOR_PATH = getActuatorPath();

export const FILTER_PLUGIN_TYPES = ['RequiredValidUntil', 'SignatureValidation', 'EntityRoleWhiteList'];

Expand Down
14 changes: 9 additions & 5 deletions ui/src/app/core/components/VersionInfo.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import useFetch from 'use-http';
import { BASE_PATH } from '../../App.constant';
import { ACTUATOR_PATH } from '../../App.constant';

import Translate from '../../i18n/components/translate';

Expand All @@ -11,11 +11,15 @@ const year = new Date().getFullYear();
const params = { year };

export function VersionInfo () {

const { data = {} } = useFetch(`${BASE_PATH}actuator/info`, {}, []);
var opts = {
headers: {
'mode':'no-cors'
}
}
const { data = {} } = useFetch(`${ACTUATOR_PATH}actuator/info`, opts, []);

const [ versionData, setVersionData ] = React.useState('');

React.useEffect(() => {
setVersionData(formatter(data));
}, [data]);
Expand All @@ -29,4 +33,4 @@ export function VersionInfo () {
);
}

export default VersionInfo;
export default VersionInfo;

0 comments on commit 079716e

Please sign in to comment.