summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/framework/src/views
diff options
context:
space:
mode:
authorAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-08-27 09:01:53 +0200
committerAijana Schumann <aijana.schumann@highstreet-technologies.com>2020-08-27 11:52:38 +0200
commit4bd84bebdaa0c2d82050fbedd1fa8260eb62146d (patch)
tree3f26dfc6c7da0f176f31bcde112971b0b8c552ce /sdnr/wt/odlux/framework/src/views
parent958de10b4c433eb6110b93007f281b07515ed6fe (diff)
Add link calculation app
Add link calculation app to odlux Issue-ID: CCSDK-2562 Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com> Change-Id: Ifc0a5b2a8bb974dfd85d70a9f05990b1f11925a3 Signed-off-by: Aijana Schumann <aijana.schumann@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/framework/src/views')
-rw-r--r--sdnr/wt/odlux/framework/src/views/about.tsx16
-rw-r--r--sdnr/wt/odlux/framework/src/views/login.tsx1
2 files changed, 15 insertions, 2 deletions
diff --git a/sdnr/wt/odlux/framework/src/views/about.tsx b/sdnr/wt/odlux/framework/src/views/about.tsx
index c4a5488e0..f97d6ffb3 100644
--- a/sdnr/wt/odlux/framework/src/views/about.tsx
+++ b/sdnr/wt/odlux/framework/src/views/about.tsx
@@ -40,11 +40,23 @@ class AboutComponent extends React.Component<any, AboutState> {
this.textarea = React.createRef();
this.loadAboutContent();
}
+ private getMarkOdluxVersionMarkdownTable(data:{version:string,build:string}|null|undefined):string{
+ if(!data) {
+ return "";
+ }
+ return `| | |\n| --- | --- |\n| Version | ${data.version} |\n| Build timestamp | ${data.build}|`
+ }
private loadAboutContent(): void {
- requestRestExt<string>('/about').then((response) => {
+ const baseUri = window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1);
+ const p1 = requestRestExt<string>('/about');
+ const p2 = requestRestExt<{version:string,build:string}>(`${baseUri}version.json`);
+ Promise.all([p1,p2]).then((responses) => {
+ const response = responses[0];
+ const response2 = responses[1];
const content = response.status == 200 ? response.data : `${response.status} ${response.message}` || "Server error";
+ const content2 = `\n## ODLUX Version Info\n`+(response2.status == 200 ? this.getMarkOdluxVersionMarkdownTable(response2.data) : `${response2.status} ${response2.message}` || "ODLUX Server error");
const loadedSucessfully = response.status == 200 ? true : false;
- this.setState({ content: content || null, isContentLoadedSucessfully: loadedSucessfully });
+ this.setState({ content: (content + content2) || null, isContentLoadedSucessfully: loadedSucessfully });
}).catch((error) => {
this.setState({ content: error })
})
diff --git a/sdnr/wt/odlux/framework/src/views/login.tsx b/sdnr/wt/odlux/framework/src/views/login.tsx
index 30b9c85a2..b06cf7631 100644
--- a/sdnr/wt/odlux/framework/src/views/login.tsx
+++ b/sdnr/wt/odlux/framework/src/views/login.tsx
@@ -142,6 +142,7 @@ class LoginComponent extends React.Component<LoginProps, ILoginState> {
label="Remember me"
/>
<Button
+ aria-label="login-button"
type="submit"
fullWidth
variant="contained"