Add docs link

This commit is contained in:
2026-01-23 17:03:47 +01:00
parent 6ee91c8b0c
commit 8c8cd0f42d
6 changed files with 23 additions and 1 deletions

View File

@@ -36,6 +36,7 @@ public class ViewController {
private final SystemAdministratorService systemAdministratorService;
private final long uploadLimitBytes;
private final boolean isStaging;
private final String docsUrl;
public ViewController(
ChannelDirectoryService channelDirectoryService,
@@ -47,7 +48,8 @@ public class ViewController {
GithubReleaseService githubReleaseService,
SystemAdministratorService systemAdministratorService,
long uploadLimitBytes,
@Value("${IMGFLOAT_IS_STAGING:0}") String isStagingFlag
@Value("${IMGFLOAT_IS_STAGING:0}") String isStagingFlag,
@Value("${IMGFLOAT_DOCS_URL:https://docs.imgflo.at}") String docsUrl
) {
this.channelDirectoryService = channelDirectoryService;
this.versionService = versionService;
@@ -59,6 +61,7 @@ public class ViewController {
this.systemAdministratorService = systemAdministratorService;
this.uploadLimitBytes = uploadLimitBytes;
this.isStaging = "1".equals(isStagingFlag);
this.docsUrl = docsUrl;
}
@org.springframework.web.bind.annotation.GetMapping("/")
@@ -127,6 +130,7 @@ public class ViewController {
}
model.addAttribute("initialSysadmin", systemAdministratorService.getInitialSysadmin());
addStagingAttribute(model);
addDocsAttribute(model);
return "settings";
}
@@ -156,6 +160,7 @@ public class ViewController {
throw new ResponseStatusException(INTERNAL_SERVER_ERROR, "Failed to serialize settings");
}
addStagingAttribute(model);
addDocsAttribute(model);
return "admin";
}
@@ -196,9 +201,14 @@ public class ViewController {
model.addAttribute("showCommitChip", gitInfoService.shouldShowCommitChip());
model.addAttribute("buildCommitShort", gitInfoService.getShortCommitSha());
model.addAttribute("buildCommitUrl", gitInfoService.getCommitUrl());
addDocsAttribute(model);
}
private void addStagingAttribute(Model model) {
model.addAttribute("isStaging", isStaging);
}
private void addDocsAttribute(Model model) {
model.addAttribute("docsUrl", docsUrl);
}
}

View File

@@ -44,6 +44,7 @@
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
<span class="sr-only">Back to dashboard</span>
</a>
<a class="button ghost" th:href="${docsUrl}" target="_blank" rel="noreferrer">Docs</a>
<a
class="button ghost"
th:if="${#strings.equalsIgnoreCase(username, broadcaster)}"

View File

@@ -31,6 +31,7 @@
<span class="eyebrow subtle">Signed in as</span>
<span class="user-display" th:text="${username}">user</span>
</div>
<a class="ghost" th:href="${docsUrl}" target="_blank" rel="noreferrer">Docs</a>
<form class="user-logout" th:action="@{/logout}" method="post">
<button class="ghost" type="submit">Logout</button>
</form>

View File

@@ -45,6 +45,13 @@
<a class="version-badge version-link" href="/terms">Terms</a>
<a class="version-badge version-link" href="/privacy">Privacy</a>
<a class="version-badge version-link" href="/cookies">Cookies</a>
<a
class="version-badge version-link"
th:href="${docsUrl}"
rel="noreferrer"
target="_blank"
>Docs</a
>
</div>
<div class="build-chip">
<span class="muted">License</span>