Commit 1b8a02bd authored by aray's avatar aray

initial commit

parent 8ae6c736
Pipeline #2891 failed
package com.altimetrik.playground.candidate.assessment.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/")
@CrossOrigin
public class AdminDbConsoleController {
@Value("${k8s.db.env}")
private String deploymentEnv;
@GetMapping(value = "/", produces = {"text/html"}, consumes = MediaType.ALL_VALUE)
public ResponseEntity<String> getUserDetailByGitlabEmailId() {
String data = "Welcome to Playground Engineering Environment";
if (deploymentEnv != null && !deploymentEnv.isEmpty()) {
data = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + "<title>Playground Engineering Environment</title>\n"
+ "<style>\n" + "body {\n" + " background-color: white;\n" + " text-align: center;\n"
+ " color: black;\n" + "}\n" + "table {\n" + " align: center;\n"
+ " border-collapse: collapse;\n" + " width: 65%;\n" + "}\n" + "td, th {\n"
+ " border: 1px solid #dddddd;\n" + " padding: 8px;\n" + "}\n" + "tr:nth-child(even) {\n"
+ " background-color: #dddddd;\n" + "}\n" + "</style>\n" + "</head>\n" + "<body>\n"
+ "<img src='https://playground.altimetrik.com/assets/img/playground-logo2.svg' alt='Avatar' style='width:200px'>\n"
+ "<h2>Welcome to Playground Engineering Environment</h2>\n" + "<h3>Database access details</h3>\n"
+ "<table align=center>\n" + " <tr>\n" + " <th>DB Admin Console</th>\n" + " <th>JDBC URL</th>\n"
+ " <th>User Name</th>\n" + " <th>Password</th>\n" + " </tr>\n" + " <tr>\n"
+ " <td><a target='_blank' href='https://pgsandbox.altimetrik.com/project1457/project1457/'>https://pgsandbox.altimetrik.com/project1457/project1457/</a></td>\n"
+ " <td>jdbc:h2:file:./src/main/resources/project1457</td>\n" + " <td>playground</td>\n"
+ " <td>password</td>\n" + " </tr>\n" + "</table>\n" + "</body>\n" + "</html>\n";
}
return new ResponseEntity<>(data, HttpStatus.OK);
}
}
spring.h2.console.enabled=true
spring.h2.console.settings.web-allow-others=true
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=playground
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
# temporary data storage
spring.datasource.url = jdbc:h2:file:./src/main/resources/test
k8s.db.env=
server.servlet.contextPath=/
server.port=1099
\ No newline at end of file
# Spring properties
spring:
application:
name: PlaygroundAssessmentDemo
freemarker:
enabled: false
# HTTP Server
server:
port: 1099 # HTTP (Tomcat) port
servlet.contextPath: /
undertow:
accesslog:
enabled: true
# Logging configurations
logging:
level:
root: INFO
com.memorynotfound: DEBUG
org.springframework.web: INFO
org.springframework.security: INFO
org.hibernate.SQL: WARN
jasypt:
encryptor:
password: playground
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment