Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft : Feature/configurable header title #4084

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.concurrent.atomic.LongAdder;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Slf4j
public class DefaultApplicationRegistrator implements ApplicationRegistrator {

private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationRegistrator.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,11 @@ protected void setRequestHeaders(HttpHeaders headers) {
headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
}

@Override
public String toString() {
return "ReactiveRegistrationClient{" +
"webclient=" + webclient +
", timeout=" + timeout +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.time.Duration;
import java.util.concurrent.ScheduledFuture;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
Expand All @@ -37,6 +38,7 @@
*
* @author Johannes Edmeier
*/
@Slf4j
public class RegistrationApplicationListener implements InitializingBean, DisposableBean {

private static final Logger LOGGER = LoggerFactory.getLogger(RegistrationApplicationListener.class);
Expand Down Expand Up @@ -79,6 +81,18 @@ public void onApplicationReady(ApplicationReadyEvent event) {
}
}

@Override
public String toString() {
return "RegistrationApplicationListener{" +
"registrator=" + registrator +
", taskScheduler=" + taskScheduler +
", autoDeregister=" + autoDeregister +
", autoRegister=" + autoRegister +
", registerPeriod=" + registerPeriod +
", scheduledTask=" + scheduledTask +
'}';
}

@EventListener
@Order(Ordered.LOWEST_PRECEDENCE)
public void onClosedContext(ContextClosedEvent event) {
Expand Down
43 changes: 43 additions & 0 deletions spring-boot-admin-server-ui/src/main/frontend/index.server.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!doctype html>
<html class="h-full">
<head>
<base href="/" th:href="${baseUrl}" />
<meta charset="utf-8" />
<title th:text="${uiSettings.title}">Spring Boot Admin</title>
<link
rel="shortcut icon"
th:href="${uiSettings.favicon}"
type="image/png"
/>
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta content="telephone=no,email=no" name="format-detection" />
<meta
content="#42d3a5"
name="theme-color"
th:content="${uiSettings.theme.color}"
/>

<link href="./index.css" rel="stylesheet" />
<link href="/variables.css" rel="stylesheet" />

<link
as="style"
rel="preload"
th:each="cssExtension : ${cssExtensions}"
th:href="'extensions/' + ${cssExtension.resourcePath}"
/>
<script lang="javascript" src="sba-settings.js"></script>
<link
as="script"
rel="preload"
th:each="jsExtension : ${jsExtensions}"
th:href="'extensions/' + ${jsExtension.resourcePath}"
/>
</head>
<body class="h-full">
<div id="app"></div>

<script src="./index.ts" type="module"></script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;

Expand Down Expand Up @@ -297,4 +298,30 @@ public void set900(String shade900) {

}


@Override
public String toString() {
return "AdminServerUiProperties{" +
"resourceLocations=" + Arrays.toString(resourceLocations) +
", extensionResourceLocations=" + Arrays.toString(extensionResourceLocations) +
", templateLocation='" + templateLocation + '\'' +
", loginIcon='" + loginIcon + '\'' +
", favicon='" + favicon + '\'' +
", faviconDanger='" + faviconDanger + '\'' +
", title='" + title + '\'' +
", brand='" + brand + '\'' +
", publicUrl='" + publicUrl + '\'' +
", cacheTemplates=" + cacheTemplates +
", cache=" + cache +
", externalViews=" + externalViews +
", viewSettings=" + viewSettings +
", rememberMeEnabled=" + rememberMeEnabled +
", availableLanguages=" + availableLanguages +
", pollTimer=" + pollTimer +
", additionalRouteExcludes=" + additionalRouteExcludes +
", enableToasts=" + enableToasts +
", hideInstanceUrl=" + hideInstanceUrl +
", theme=" + theme +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import lombok.Builder;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.expression.MapAccessor;
Expand All @@ -50,6 +51,7 @@

import static java.util.Collections.singletonList;

@Slf4j
public class MicrosoftTeamsNotifier extends AbstractStatusChangeNotifier {

private static final Logger LOGGER = LoggerFactory.getLogger(MicrosoftTeamsNotifier.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,18 @@ public void stop() {
}
}

@Override
public String toString() {
return "IntervalCheck{" +
"name='" + name + '\'' +
", lastChecked=" + lastChecked +
", checkFn=" + checkFn +
", maxBackoff=" + maxBackoff +
", interval=" + interval +
", minRetention=" + minRetention +
", subscription=" + subscription +
", scheduler=" + scheduler +
'}';
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,10 @@ public void verifySerializeWithNestedMapEntryVersion() throws JsonProcessingExce
assertThat(result).isEqualTo("\"1.0.0\"");
}

@Test
public void verifyDeserializer() throws JSONException, JsonProcessingException {
BuildVersion buildVersion = objectMapper.readValue("\"1.0.0\"", BuildVersion.class);
assertThat(buildVersion).isEqualTo(BuildVersion.valueOf("1.0.0"));
}

}
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spring.boot.admin.ui.title=My Custom Admin Title