Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'hudson-core/src/main')
-rw-r--r--hudson-core/src/main/java/hudson/model/Hudson.java25
-rw-r--r--hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly3
-rw-r--r--hudson-core/src/main/resources/lib/layout/layout.jelly13
-rw-r--r--hudson-core/src/main/resources/lib/layout/layout.properties1
4 files changed, 38 insertions, 4 deletions
diff --git a/hudson-core/src/main/java/hudson/model/Hudson.java b/hudson-core/src/main/java/hudson/model/Hudson.java
index 2e6db68d..e4b2b48e 100644
--- a/hudson-core/src/main/java/hudson/model/Hudson.java
+++ b/hudson-core/src/main/java/hudson/model/Hudson.java
@@ -262,7 +262,13 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
* CopyRight, Confidentiality information and so forth
* Introduced Hudson 3.0.1
*/
- private String privacyMessage;
+ private String privacyMessage;
+
+ /**
+ * Optional identifier for the instance to be printed on each page
+ * Introduced Hudson 3.0.1
+ */
+ private String instanceTag;
private static transient final String HUDSON_WORKSPACES_PROPERTY_KEY = "HUDSON_WORKSPACES";
/**
@@ -1090,6 +1096,21 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
this.privacyMessage = message;
save();
}
+
+ /**
+ * Get the Instance identifier
+ */
+ public String getInstanceTag() {
+ return instanceTag;
+ }
+
+ /**
+ * Sets the Instance Identifier.
+ */
+ public void setInstanceTag(String name) throws IOException {
+ this.instanceTag = name;
+ save();
+ }
public FederatedLoginService getFederatedLoginService(String name) {
for (FederatedLoginService fls : FederatedLoginService.all()) {
@@ -2508,6 +2529,8 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
quietPeriod = json.getInt("quiet_period");
scmCheckoutRetryCount = json.getInt("retry_count");
+
+ instanceTag = json.optString("instance_tag","");
systemMessage = Util.nullify(req.getParameter("system_message"));
diff --git a/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly b/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly
index 96fb8beb..c40b6793 100644
--- a/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly
+++ b/hudson-core/src/main/resources/hudson/model/Hudson/configure.jelly
@@ -37,6 +37,9 @@
<f:entry title="${%Home directory}" help="/help/system-config/homeDirectory.html">
${it.rootDir}
</f:entry>
+ <f:entry title="${%Instance Tag}" help="/help/system-config/instanceTag.html">
+ <f:textbox name="instance_tag" value="${it.instanceTag}" />
+ </f:entry>
<f:entry title="${%System Message}" help="/help/system-config/systemMessage.html">
<f:textarea name="system_message" value="${it.systemMessage}" />
</f:entry>
diff --git a/hudson-core/src/main/resources/lib/layout/layout.jelly b/hudson-core/src/main/resources/lib/layout/layout.jelly
index 687a585a..c02a0f30 100644
--- a/hudson-core/src/main/resources/lib/layout/layout.jelly
+++ b/hudson-core/src/main/resources/lib/layout/layout.jelly
@@ -66,8 +66,13 @@
<html>
<head>
${h.checkPermission(it,permission)}
+
+ <j:set var="titleSuffix" value=" [Hudson]"/>
+ <j:if test="${!empty(app.instanceTag)}">
+ <j:set var="titleSuffix" value=" [Hudson - ${app.instanceTag}]"/>
+ </j:if>
- <title>${h.appendIfNotNull(title, ' [Hudson]', 'Hudson')}</title>
+ <title>${h.appendIfNotNull(title, titleSuffix, 'Hudson')}</title>
<link rel="shortcut icon" href="${resURL}/favicon.ico" type="image/vnd.microsoft.icon" />
@@ -179,7 +184,7 @@
<table cellpadding="2" cellspacing="3" width="100%" border="0">
<tr>
<td class="instanceTagHeader">
- <!-- For future use -->
+ ${app.instanceTag}
</td>
<td style="vertical-align: middle; text-align: right; padding-right: 1em;">
<!-- search box -->
@@ -305,7 +310,9 @@
</tr>
<tr>
<td d="footer-left-panel" class="footer">
- <!-- For future use -->
+ <j:if test="${!empty(app.instanceTag)}">
+ ${%instance}: <em>${app.instanceTag}</em>
+ </j:if>
</td>
<td id="footer-center-panel" class="footer">
<j:out value="${app.privacyMessage}"/>
diff --git a/hudson-core/src/main/resources/lib/layout/layout.properties b/hudson-core/src/main/resources/lib/layout/layout.properties
index 6a26091e..52c3c0bb 100644
--- a/hudson-core/src/main/resources/lib/layout/layout.properties
+++ b/hudson-core/src/main/resources/lib/layout/layout.properties
@@ -17,3 +17,4 @@
searchBox.url=http://wiki.hudson-ci.org/display/HUDSON/Search+Box
logout=log out
poweredBy=Powered by Hudson Open Source Continuous Integration Server from the Eclipse Foundation
+instance=Instance

Back to the top