mirror of
https://github.com/theonedev/onedev.git
synced 2025-12-08 18:26:30 +00:00
wip: i18n support
This commit is contained in:
parent
5db24341af
commit
b34b2d130b
@ -23,7 +23,7 @@ public class RegistryLogin implements Serializable {
|
||||
|
||||
private String passwordSecret;
|
||||
|
||||
@Editable(order=100, placeholder="Docker hub", displayPlaceholderAsValue =true, description="Specify registry url. Leave empty for official registry")
|
||||
@Editable(order=100, placeholder="Docker Hub", displayPlaceholderAsValue =true, description="Specify registry url. Leave empty for official registry")
|
||||
@Interpolative(variableSuggester = "suggestVariables")
|
||||
public String getRegistryUrl() {
|
||||
return registryUrl;
|
||||
|
||||
@ -31,6 +31,7 @@ import io.onedev.commons.utils.StringUtils;
|
||||
import io.onedev.server.annotation.Editable;
|
||||
import io.onedev.server.persistence.HibernateConfig;
|
||||
import io.onedev.server.security.SecurityUtils;
|
||||
import io.onedev.server.util.MetricIndicator;
|
||||
import io.onedev.server.web.editable.EditableUtils;
|
||||
import io.onedev.server.web.translation.Translation;
|
||||
import io.onedev.server.web.util.TextUtils;
|
||||
@ -125,21 +126,21 @@ public class ExtractTranslationKeys extends CommandHandler {
|
||||
}
|
||||
}
|
||||
for (var method : clazz.getDeclaredMethods()) {
|
||||
var annotation = method.getAnnotation(Editable.class);
|
||||
if (annotation != null) {
|
||||
editable = method.getAnnotation(Editable.class);
|
||||
if (editable != null) {
|
||||
extractedTranslationKeys.add(EditableUtils.getDisplayName(method));
|
||||
var group = EditableUtils.getGroup(method);
|
||||
if (group != null)
|
||||
extractedTranslationKeys.add(group);
|
||||
var description = annotation.description();
|
||||
var description = editable.description();
|
||||
if (description.length() != 0) {
|
||||
extractedTranslationKeys.add(description);
|
||||
}
|
||||
var placeholder = annotation.placeholder();
|
||||
var placeholder = editable.placeholder();
|
||||
if (placeholder.length() != 0) {
|
||||
extractedTranslationKeys.add(placeholder);
|
||||
}
|
||||
var rootPlaceholder = annotation.rootPlaceholder();
|
||||
var rootPlaceholder = editable.rootPlaceholder();
|
||||
if (rootPlaceholder.length() != 0) {
|
||||
extractedTranslationKeys.add(rootPlaceholder);
|
||||
}
|
||||
@ -156,6 +157,13 @@ public class ExtractTranslationKeys extends CommandHandler {
|
||||
if (size != null && size.message().length() != 0) {
|
||||
extractedTranslationKeys.add(size.message());
|
||||
}
|
||||
var metricIndicator = method.getAnnotation(MetricIndicator.class);
|
||||
if (metricIndicator != null) {
|
||||
if (metricIndicator.name().length() != 0)
|
||||
extractedTranslationKeys.add(metricIndicator.name());
|
||||
if (metricIndicator.group().length() != 0)
|
||||
extractedTranslationKeys.add(metricIndicator.group());
|
||||
}
|
||||
}
|
||||
if (clazz.isEnum()) {
|
||||
for (var constant : clazz.getEnumConstants()) {
|
||||
|
||||
@ -61,7 +61,7 @@ public class LinkSpec extends AbstractEntity {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Editable(order=150, name="Multiple", description="Whether or not multiple issues can be linked")
|
||||
@Editable(order=150, name="link:Multiple", description="Whether or not multiple issues can be linked")
|
||||
public boolean isMultiple() {
|
||||
return multiple;
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ public class RegistryLogin implements Serializable {
|
||||
|
||||
private String password;
|
||||
|
||||
@Editable(order=100, placeholder="Docker hub", description="Specify registry url. Leave empty for official registry")
|
||||
@Editable(order=100, placeholder="Docker Hub", description="Specify registry url. Leave empty for official registry")
|
||||
@Interpolative(variableSuggester = "suggestRegistryUrlVariables")
|
||||
public String getRegistryUrl() {
|
||||
return registryUrl;
|
||||
|
||||
@ -1,14 +1,17 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.onedev.commons.codeassist.InputSuggestion;
|
||||
import io.onedev.server.model.Project;
|
||||
import io.onedev.server.search.entity.issue.IssueQueryLexer;
|
||||
import io.onedev.server.annotation.Editable;
|
||||
import io.onedev.server.annotation.IssueQuery;
|
||||
import io.onedev.server.annotation.Patterns;
|
||||
import io.onedev.server.model.Project;
|
||||
import io.onedev.server.search.entity.issue.IssueQueryLexer;
|
||||
import io.onedev.server.web.util.SuggestionUtils;
|
||||
|
||||
@Editable(order=500, name="Code is committed")
|
||||
@ -59,9 +62,9 @@ public class BranchUpdatedSpec extends AutoSpec {
|
||||
@Override
|
||||
public String getTriggerDescription() {
|
||||
if (branches != null)
|
||||
return "code is committed to branches '" + branches + "'";
|
||||
return MessageFormat.format(_T("code is committed to branches \"{0}\""), branches);
|
||||
else
|
||||
return "code is committed to any branch";
|
||||
return _T("code is committed to any branch");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,16 +1,19 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.onedev.commons.codeassist.InputSuggestion;
|
||||
import io.onedev.server.annotation.Editable;
|
||||
import io.onedev.server.annotation.IssueQuery;
|
||||
import io.onedev.server.annotation.Patterns;
|
||||
import io.onedev.server.model.Project;
|
||||
import io.onedev.server.search.entity.issue.IssueQueryLexer;
|
||||
import io.onedev.server.util.patternset.PatternSet;
|
||||
import io.onedev.server.util.usage.Usage;
|
||||
import io.onedev.server.annotation.Editable;
|
||||
import io.onedev.server.annotation.IssueQuery;
|
||||
import io.onedev.server.annotation.Patterns;
|
||||
import io.onedev.server.web.util.SuggestionUtils;
|
||||
|
||||
@Editable(order=400, name="Build is successful")
|
||||
@ -94,14 +97,14 @@ public class BuildSuccessfulSpec extends AutoSpec {
|
||||
public String getTriggerDescription() {
|
||||
if (jobNames != null) {
|
||||
if (branches != null)
|
||||
return "build is successful for jobs '" + jobNames + "' on branches '" + branches + "'";
|
||||
return MessageFormat.format(_T("build is successful for jobs \"{0}\" on branches \"{1}\""), jobNames, branches);
|
||||
else
|
||||
return "build is successful for jobs '" + jobNames + "' on any branch";
|
||||
return MessageFormat.format(_T("build is successful for jobs \"{0}\" on any branch"), jobNames);
|
||||
} else {
|
||||
if (branches != null)
|
||||
return "build is successful for any job on branches '" + branches + "'";
|
||||
return MessageFormat.format(_T("build is successful for any job on branches \"{0}\""), branches);
|
||||
else
|
||||
return "build is successful for any job and branch";
|
||||
return _T("build is successful for any job and branch");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -43,7 +46,7 @@ public class IssueStateTransitedSpec extends AutoSpec {
|
||||
|
||||
@Override
|
||||
public String getTriggerDescription() {
|
||||
return "state of other issue is transited to " + states;
|
||||
return MessageFormat.format(_T("state of other issue is transited to \"{0}\""), states);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
@ -260,9 +263,9 @@ public class ManualSpec extends TransitionSpec {
|
||||
@Override
|
||||
public String getTriggerDescription() {
|
||||
if (authorizedRoles.isEmpty())
|
||||
return "transit manually by any user";
|
||||
return _T("transit manually by any user");
|
||||
else
|
||||
return "transit manually by any user of roles " + authorizedRoles;
|
||||
return MessageFormat.format(_T("transit manually by any user of roles \"{0}\""), authorizedRoles);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
|
||||
import io.onedev.server.annotation.Editable;
|
||||
@ -23,7 +27,7 @@ public class NoActivitySpec extends AutoSpec {
|
||||
|
||||
@Override
|
||||
public String getTriggerDescription() {
|
||||
return "no activity for " + days + " days";
|
||||
return MessageFormat.format(_T("no activity for {0} days"), days);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import io.onedev.server.annotation.Editable;
|
||||
|
||||
@Editable(order=300, name="Pull request is discarded")
|
||||
@ -10,9 +14,9 @@ public class PullRequestDiscardedSpec extends PullRequestSpec {
|
||||
@Override
|
||||
public String getTriggerDescription() {
|
||||
if (getBranches() != null)
|
||||
return "pull request to branches '" + getBranches() + "' is discarded";
|
||||
return MessageFormat.format(_T("pull request to branches \"{0}\" is discarded"), getBranches());
|
||||
else
|
||||
return "pull request to any branch is discarded";
|
||||
return _T("pull request to any branch is discarded");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import io.onedev.server.annotation.Editable;
|
||||
|
||||
@Editable(order=250, name="Pull request is merged")
|
||||
@ -10,9 +14,9 @@ public class PullRequestMergedSpec extends PullRequestSpec {
|
||||
@Override
|
||||
public String getTriggerDescription() {
|
||||
if (getBranches() != null)
|
||||
return "pull request to branches '" + getBranches() + "' is merged";
|
||||
return MessageFormat.format(_T("pull request to branches \"{0}\" is merged"), getBranches());
|
||||
else
|
||||
return "pull request to any branch is merged";
|
||||
return _T("pull request to any branch is merged");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
package io.onedev.server.model.support.issue.transitionspec;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import io.onedev.server.annotation.Editable;
|
||||
|
||||
@Editable(order=200, name="Pull request is opened")
|
||||
@ -10,9 +14,9 @@ public class PullRequestOpenedSpec extends PullRequestSpec {
|
||||
@Override
|
||||
public String getTriggerDescription() {
|
||||
if (getBranches() != null)
|
||||
return "pull request to branches '" + getBranches() + "' is opened";
|
||||
return MessageFormat.format(_T("pull request to branches \"{0}\" is opened"), getBranches());
|
||||
else
|
||||
return "pull request to any branch is opened";
|
||||
return _T("pull request to any branch is opened");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ public class Widget implements Serializable {
|
||||
|
||||
private int bottom;
|
||||
|
||||
@Editable(order=100, name="Tabs")
|
||||
@Editable(order=100, name="widget:Tabs")
|
||||
@Size(min=1, message = "At least one tab should be added")
|
||||
public List<WidgetTab<TabState>> getTabs() {
|
||||
return tabs;
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package io.onedev.server.util;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
@ -18,6 +21,7 @@ import com.google.common.collect.Lists;
|
||||
import com.joestelmach.natty.DateGroup;
|
||||
import com.joestelmach.natty.Parser;
|
||||
|
||||
import io.onedev.commons.utils.StringUtils;
|
||||
import io.onedev.k8shelper.KubernetesHelper;
|
||||
import io.onedev.server.web.WebSession;
|
||||
|
||||
@ -114,7 +118,10 @@ public class DateUtils {
|
||||
}
|
||||
|
||||
public static String formatDuration(long durationMillis) {
|
||||
return KubernetesHelper.formatDuration(durationMillis);
|
||||
var duration = KubernetesHelper.formatDuration(durationMillis);
|
||||
var number = StringUtils.substringBefore(duration, " ");
|
||||
var unit = StringUtils.substringAfter(duration, " ");
|
||||
return MessageFormat.format(_T("{0} " + unit), number);
|
||||
}
|
||||
|
||||
public static Date parseISO8601Date(String dateString) {
|
||||
|
||||
@ -31,7 +31,7 @@ onedev.server.codeProblem = {
|
||||
return "badge-secondary";
|
||||
}
|
||||
},
|
||||
renderProblems: function(problems) {
|
||||
renderProblems: function(problems, translations) {
|
||||
var $container = $("<div></div>");
|
||||
for (var i in problems) {
|
||||
var problem = problems[i];
|
||||
@ -40,8 +40,8 @@ onedev.server.codeProblem = {
|
||||
$container.append($content);
|
||||
$content.html(problem.message);
|
||||
|
||||
$content.prepend(`<span class='badge badge-sm mr-2 ${severityInfo}'>${problem.severity}</span>`);
|
||||
$content.append("<a title='Add comment' class='add-comment ml-2'><svg class='icon icon-sm mr-2'><use xlink:href='" + onedev.server.icons + "#comment'/></svg></a>");
|
||||
$content.prepend(`<span class='badge badge-sm mr-2 ${severityInfo}'>${translations[problem.severity]}</span>`);
|
||||
$content.append(`<a data-tippy-content='${translations["add-problem-comment"]}' class='add-comment ml-2'><svg class='icon icon-sm mr-2'><use xlink:href='${onedev.server.icons}#comment'/></svg></a>`);
|
||||
}
|
||||
return $container.html();
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import org.apache.wicket.behavior.AttributeAppender;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.model.IModel;
|
||||
@ -20,12 +22,12 @@ public class AgentStatusBadge extends Label {
|
||||
protected String load() {
|
||||
String status;
|
||||
if (getAgent().isOnline())
|
||||
status = "Online";
|
||||
status = _T("Online");
|
||||
else
|
||||
status = "Offline";
|
||||
status = _T("Offline");
|
||||
|
||||
if (getAgent().isPaused())
|
||||
status += "/Paused";
|
||||
status += " / " + _T("Paused");
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.blob;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
@ -71,7 +73,7 @@ public abstract class BlobPicker extends DropdownLink {
|
||||
|
||||
};
|
||||
} else {
|
||||
return new Label(id, "Project or revision not specified yet").add(AttributeAppender.append("class", "m-3 text-danger font-italic"));
|
||||
return new Label(id, _T("Project or revision not specified yet")).add(AttributeAppender.append("class", "m-3 text-danger font-italic"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,10 +94,10 @@ public abstract class BlobPicker extends DropdownLink {
|
||||
+ " <svg class='icon rotate-90'><use xlink:href='%s'/></svg>"
|
||||
+ "</span>",
|
||||
"<svg class='icon'><use xlink:href='" + SpriteImage.getVersionedHref(IconScope.class, "file") + "'/></svg>",
|
||||
blobPath!=null?HtmlEscape.escapeHtml5(blobPath):"Choose file",
|
||||
blobPath!=null?HtmlEscape.escapeHtml5(blobPath):_T("Choose file"),
|
||||
SpriteImage.getVersionedHref(IconScope.class, "arrow")));
|
||||
} else {
|
||||
return Model.of("<i>Select project and revision first</i>");
|
||||
return Model.of("<i>" + _T("Select project and revision first") + "</i>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.branch.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -21,9 +23,9 @@ public class BranchMultiChoice extends Select2MultiChoice<String> {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose branches...");
|
||||
getSettings().setPlaceholder(_T("Choose branches..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.branchChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.branchChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.branchChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.branch.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -22,9 +24,9 @@ public class BranchSingleChoice extends Select2Choice<String> {
|
||||
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose branch...");
|
||||
getSettings().setPlaceholder(_T("Choose branch..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.branchChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.branchChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.branchChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.build.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
|
||||
import org.apache.wicket.model.IModel;
|
||||
@ -19,9 +21,9 @@ public class BuildSingleChoice extends Select2Choice<Build> {
|
||||
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose build...");
|
||||
getSettings().setPlaceholder(_T("Choose build..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.buildChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.buildChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.buildChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -7,6 +7,8 @@ public class PieSlice implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final String name;
|
||||
|
||||
private final String displayName;
|
||||
|
||||
private final int value;
|
||||
|
||||
@ -14,13 +16,18 @@ public class PieSlice implements Serializable {
|
||||
|
||||
private final boolean selected;
|
||||
|
||||
public PieSlice(String name, int value, String color, boolean selected) {
|
||||
public PieSlice(String name, String displayName, int value, String color, boolean selected) {
|
||||
this.name = name;
|
||||
this.displayName = displayName;
|
||||
this.value = value;
|
||||
this.color = color;
|
||||
this.selected = selected;
|
||||
}
|
||||
|
||||
public PieSlice(String name, int value, String color, boolean selected) {
|
||||
this(name, name, value, color, selected);
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
@ -29,6 +36,10 @@ public class PieSlice implements Serializable {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -11,7 +11,8 @@ onedev.server.pieChart = {
|
||||
for (var i in pieSlices) {
|
||||
chartColors.push(pieSlices[i].color);
|
||||
chartData.push({
|
||||
name: pieSlices[i].name,
|
||||
name: pieSlices[i].name,
|
||||
displayName: pieSlices[i].displayName,
|
||||
value: pieSlices[i].value
|
||||
})
|
||||
pieSelections[pieSlices[i].name] = pieSlices[i].selected;
|
||||
@ -20,7 +21,9 @@ onedev.server.pieChart = {
|
||||
chart.setOption({
|
||||
color: chartColors,
|
||||
tooltip: {
|
||||
formatter: "{b}",
|
||||
formatter: function(params) {
|
||||
return params.data.displayName;
|
||||
},
|
||||
textStyle: {
|
||||
color: darkMode? 'white': '#535370'
|
||||
},
|
||||
@ -33,11 +36,15 @@ onedev.server.pieChart = {
|
||||
x: "center",
|
||||
formatter: function(name) {
|
||||
var value = 0;
|
||||
var displayName = "";
|
||||
for (var i = 0; i < chartData.length; i++) {
|
||||
if (chartData[i].name == name)
|
||||
if (chartData[i].name == name) {
|
||||
value = chartData[i].value;
|
||||
displayName = chartData[i].displayName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return `${name} ${value}`;
|
||||
return `${displayName} ${value}`;
|
||||
},
|
||||
textStyle: {
|
||||
color: darkMode?'#cdcdde':'#3F4254'
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<wicket:panel>
|
||||
<div wicket:id="term" class="form-group">
|
||||
<label class="control-label">File Name <span class="text-danger">*</span></label>
|
||||
<label class="control-label"><wicket:t>File Name</wicket:t> <span class="text-danger">*</span></label>
|
||||
<input wicket:id="term" name="searchFor" class="form-control" type="text">
|
||||
<p class="form-text text-muted">(* = any string, ? = any character)</p>
|
||||
<p class="form-text text-muted"><wicket:t>(* = any string, ? = any character)</wicket:t></p>
|
||||
<div wicket:id="feedback" class="mt-2"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="checkbox"><input wicket:id="caseSensitive" type="checkbox"> Case Sensitive</label>
|
||||
<label class="checkbox"><input wicket:id="caseSensitive" type="checkbox"> <wicket:t>Case Sensitive</wicket:t></label>
|
||||
</div>
|
||||
</wicket:panel>
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
<wicket:panel>
|
||||
<div wicket:id="term" class="form-group">
|
||||
<label class="control-label">Symbol Name <span class="text-danger">*</span></label>
|
||||
<label class="control-label"><wicket:t>Symbol Name</wicket:t> <span class="text-danger">*</span></label>
|
||||
<input wicket:id="term" name="searchFor" class="form-control" type="text">
|
||||
<p class="form-text text-muted">(* = any string, ? = any character)</p>
|
||||
<p class="form-text text-muted"><wicket:t>(* = any string, ? = any character)</wicket:t></p>
|
||||
<div wicket:id="feedback" class="mt-2"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="checkbox"><input wicket:id="caseSensitive" type="checkbox"> Case Sensitive</label>
|
||||
<label class="checkbox"><input wicket:id="caseSensitive" type="checkbox"> <wicket:t>Case Sensitive</wicket:t></label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">File Name Patterns (separated by comma)</label>
|
||||
<label class="control-label"><wicket:t>File Name Patterns (separated by comma)</wicket:t></label>
|
||||
<input wicket:id="fileNames" class="form-control" type="text" t:placeholder="File name patterns such as *.java, *.c">
|
||||
</div>
|
||||
</wicket:panel>
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
<wicket:panel>
|
||||
<div wicket:id="term" class="form-group">
|
||||
<label class="control-label">Search For <span class="text-danger">*</span></label>
|
||||
<label class="control-label"><wicket:t>Search For</wicket:t> <span class="text-danger">*</span></label>
|
||||
<input wicket:id="term" name="searchFor" class="form-control" type="text">
|
||||
<div wicket:id="feedback" class="mt-2"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="checkbox-inline">
|
||||
<label class="checkbox"><input wicket:id="regex" type="checkbox"> Regular Expression</label>
|
||||
<label class="checkbox"><input wicket:id="wholeWord" type="checkbox"> Whole Word</label>
|
||||
<label class="checkbox"><input wicket:id="caseSensitive" type="checkbox"> Case Sensitive</label>
|
||||
<label class="checkbox"><input wicket:id="regex" type="checkbox"> <wicket:t>Regular Expression</wicket:t></label>
|
||||
<label class="checkbox"><input wicket:id="wholeWord" type="checkbox"> <wicket:t>Whole Word</wicket:t></label>
|
||||
<label class="checkbox"><input wicket:id="caseSensitive" type="checkbox"> <wicket:t>Case Sensitive</wicket:t></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">File Name Patterns (separated by comma)</label>
|
||||
<label class="control-label"><wicket:t>File Name Patterns (separated by comma)</wicket:t></label>
|
||||
<input wicket:id="fileNames" class="form-control" type="text" t:placeholder="File name patterns such as *.java, *.c">
|
||||
</div>
|
||||
</wicket:panel>
|
||||
|
||||
@ -414,7 +414,7 @@ public class BlobTextDiffPanel extends Panel {
|
||||
translations.put("unable-to-comment", _T("Unable to comment"));
|
||||
translations.put("perma-link", _T("Permanent link of this selection"));
|
||||
translations.put("copy-to-clipboard", _T("Copy selected text to clipboard"));
|
||||
translations.put("add-comment", _T("Add comment on this selection"));
|
||||
translations.put("add-selection-comment", _T("Add comment on this selection"));
|
||||
translations.put("login-to-comment", _T("Login to comment on selection"));
|
||||
translations.put("covered-by-tests", _T("Covered by tests"));
|
||||
translations.put("not-covered-by-any-test", _T("Not covered by any test"));
|
||||
@ -423,6 +423,9 @@ public class BlobTextDiffPanel extends Panel {
|
||||
translations.put("show-comment", _T("Click to show comment of marked text"));
|
||||
translations.put("loading", _T("Loading..."));
|
||||
translations.put("invalid-selection", _T("Invalid selection, click for details"));
|
||||
for (var severity: CodeProblem.Severity.values())
|
||||
translations.put(severity.name(), _T("severity:" + severity.name()));
|
||||
translations.put("add-problem-comment", _T("Add comment"));
|
||||
|
||||
String script = String.format("onedev.server.blobTextDiff.onDomReady('%s', '%s', '%s', '%s', '%s', '%s', %s, %s, %s, %s, %s, %s, %s);",
|
||||
getMarkupId(), symbolTooltip.getMarkupId(),
|
||||
|
||||
@ -786,7 +786,7 @@ onedev.server.blobTextDiff = {
|
||||
$(".selection-popover").remove();
|
||||
});
|
||||
if (loggedIn) {
|
||||
$content.append(`<a class='comment'><svg class='icon mr-1'><use xlink:href='${onedev.server.icons}#comment'/></svg> ${onedev.server.blobTextDiff.translations["add-comment"]}</a>`);
|
||||
$content.append(`<a class='comment'><svg class='icon mr-1'><use xlink:href='${onedev.server.icons}#comment'/></svg> ${onedev.server.blobTextDiff.translations["add-selection-comment"]}</a>`);
|
||||
$content.children("a.comment").click(function() {
|
||||
if (onedev.server.blobTextDiff.confirmUnsavedChanges($container)) {
|
||||
$container.data("callback")("addComment", markRange.leftSide,
|
||||
@ -1097,7 +1097,7 @@ onedev.server.blobTextDiff = {
|
||||
sanitize: false,
|
||||
placement: "top",
|
||||
container: $container,
|
||||
content: onedev.server.codeProblem.renderProblems(problems),
|
||||
content: onedev.server.codeProblem.renderProblems(problems, onedev.server.blobTextDiff.translations),
|
||||
template: `<div data-line='${line}' class='${oldOrNew} popover problem-popover'><div class='arrow'></div><div class='popover-body'></div></div>`
|
||||
}).on("shown.bs.popover", function() {
|
||||
var $currentPopover = $(`.problem-popover.${oldOrNew}[data-line='${line}']`);
|
||||
@ -1117,6 +1117,10 @@ onedev.server.blobTextDiff = {
|
||||
}
|
||||
});
|
||||
});
|
||||
tippy($currentPopover[0].querySelectorAll('[data-tippy-content]'), {
|
||||
delay: [500, 0],
|
||||
placement: 'auto'
|
||||
});
|
||||
}).data("popoverInited", true);
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.groupchoice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -19,9 +21,9 @@ public class GroupMultiChoice extends Select2MultiChoice<Group> {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose groups...");
|
||||
getSettings().setPlaceholder(_T("Choose groups..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.groupChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.groupChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.groupChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.groupchoice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -21,9 +23,9 @@ public class GroupSingleChoice extends Select2Choice<Group> {
|
||||
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose group...");
|
||||
getSettings().setPlaceholder(_T("Choose group..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.groupChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.groupChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.groupChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.iteration.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -21,9 +23,9 @@ public class IterationSingleChoice extends Select2Choice<Iteration> {
|
||||
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose iteration...");
|
||||
getSettings().setPlaceholder(_T("Choose iteration..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.iterationChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.iterationChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.iterationChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.project.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -22,9 +24,9 @@ public class ProjectMultiChoice extends Select2MultiChoice<Project> {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose projects...");
|
||||
getSettings().setPlaceholder(_T("Choose projects..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.projectChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.projectChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.projectChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.project.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -20,9 +22,9 @@ public class ProjectSingleChoice extends Select2Choice<Project> {
|
||||
super.onInitialize();
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose a project...");
|
||||
getSettings().setPlaceholder(_T("Choose a project..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.projectChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.projectChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.projectChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,17 +1,13 @@
|
||||
package io.onedev.server.web.component.pullrequest.assignment;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import io.onedev.server.OneDev;
|
||||
import io.onedev.server.entitymanager.PullRequestAssignmentManager;
|
||||
import io.onedev.server.model.PullRequest;
|
||||
import io.onedev.server.model.PullRequestAssignment;
|
||||
import io.onedev.server.model.User;
|
||||
import io.onedev.server.security.SecurityUtils;
|
||||
import io.onedev.server.web.ajaxlistener.ConfirmClickListener;
|
||||
import io.onedev.server.web.behavior.ChangeObserver;
|
||||
import io.onedev.server.web.component.user.ident.Mode;
|
||||
import io.onedev.server.web.component.user.ident.UserIdentPanel;
|
||||
import io.onedev.server.web.page.base.BasePage;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
|
||||
import org.apache.wicket.ajax.markup.html.AjaxLink;
|
||||
@ -23,7 +19,19 @@ import org.apache.wicket.markup.html.panel.Panel;
|
||||
import org.apache.wicket.model.IModel;
|
||||
import org.apache.wicket.model.LoadableDetachableModel;
|
||||
|
||||
import java.util.*;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import io.onedev.server.OneDev;
|
||||
import io.onedev.server.entitymanager.PullRequestAssignmentManager;
|
||||
import io.onedev.server.model.PullRequest;
|
||||
import io.onedev.server.model.PullRequestAssignment;
|
||||
import io.onedev.server.model.User;
|
||||
import io.onedev.server.security.SecurityUtils;
|
||||
import io.onedev.server.web.ajaxlistener.ConfirmClickListener;
|
||||
import io.onedev.server.web.behavior.ChangeObserver;
|
||||
import io.onedev.server.web.component.user.ident.Mode;
|
||||
import io.onedev.server.web.component.user.ident.UserIdentPanel;
|
||||
import io.onedev.server.web.page.base.BasePage;
|
||||
|
||||
public abstract class AssignmentListPanel extends Panel {
|
||||
|
||||
@ -87,8 +95,9 @@ public abstract class AssignmentListPanel extends Panel {
|
||||
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
|
||||
super.updateAjaxAttributes(attributes);
|
||||
if (!getPullRequest().isNew()) {
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener("Do you really want to "
|
||||
+ "remove assignee '" + item.getModelObject().getUser().getDisplayName() + "'?"));
|
||||
var message = MessageFormat.format(_T("Do you really want to remove assignee \"{0}\"?"),
|
||||
item.getModelObject().getUser().getDisplayName());
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener(message));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.pullrequest.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
|
||||
import org.apache.wicket.model.IModel;
|
||||
@ -18,9 +20,9 @@ public class PullRequestSingleChoice extends Select2Choice<PullRequest> {
|
||||
super.onInitialize();
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose pull request...");
|
||||
getSettings().setPlaceholder(_T("Choose pull request..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.pullRequestChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.pullRequestChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.pullRequestChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -120,7 +120,7 @@ public abstract class RevisionPicker extends DropdownLink {
|
||||
label,
|
||||
SpriteImage.getVersionedHref(IconScope.class, "arrow")));
|
||||
} else {
|
||||
return Model.of("<i>Select project first</i>");
|
||||
return Model.of("<i>" + _T("Select project first") + "</i>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.rolechoice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -19,9 +21,9 @@ public class RoleMultiChoice extends Select2MultiChoice<Role> {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose roles...");
|
||||
getSettings().setPlaceholder(_T("Choose roles..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.roleChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.roleChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.roleChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.rolechoice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -21,9 +23,9 @@ public class RoleSingleChoice extends Select2Choice<Role> {
|
||||
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose role...");
|
||||
getSettings().setPlaceholder(_T("Choose role..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.roleChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.roleChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.roleChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
*/
|
||||
package io.onedev.server.web.component.select2;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
@ -52,7 +54,7 @@ public class Select2Choice<T> extends AbstractSelect2Choice<T, T> {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Select below...");
|
||||
getSettings().setPlaceholder(_T("Select below..."));
|
||||
else
|
||||
getSettings().setPlaceholder("");
|
||||
}
|
||||
|
||||
@ -1,5 +1,36 @@
|
||||
package io.onedev.server.web.component.taskbutton;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.UnauthorizedException;
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
|
||||
import org.apache.wicket.ajax.attributes.IAjaxCallListener;
|
||||
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
import org.apache.wicket.request.cycle.RequestCycle;
|
||||
import org.joda.time.DateTime;
|
||||
import org.quartz.ScheduleBuilder;
|
||||
import org.quartz.SimpleScheduleBuilder;
|
||||
|
||||
import io.onedev.commons.utils.ExceptionUtils;
|
||||
import io.onedev.commons.utils.ExplicitException;
|
||||
import io.onedev.commons.utils.TaskLogger;
|
||||
@ -15,26 +46,6 @@ import io.onedev.server.taskschedule.SchedulableTask;
|
||||
import io.onedev.server.taskschedule.TaskScheduler;
|
||||
import io.onedev.server.web.component.modal.ModalPanel;
|
||||
import io.onedev.server.web.component.taskbutton.TaskResult.PlainMessage;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.UnauthorizedException;
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
|
||||
import org.apache.wicket.ajax.attributes.IAjaxCallListener;
|
||||
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
import org.apache.wicket.request.cycle.RequestCycle;
|
||||
import org.joda.time.DateTime;
|
||||
import org.quartz.ScheduleBuilder;
|
||||
import org.quartz.SimpleScheduleBuilder;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
public abstract class TaskButton extends AjaxButton {
|
||||
|
||||
@ -58,7 +69,7 @@ public abstract class TaskButton extends AjaxButton {
|
||||
}
|
||||
|
||||
protected String getTitle() {
|
||||
return WordUtils.uncamel(getId());
|
||||
return _T(StringUtils.capitalize(WordUtils.uncamel(getId()).toLowerCase()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -126,7 +137,6 @@ public abstract class TaskButton extends AjaxButton {
|
||||
|
||||
protected void submitTask(AjaxRequestTarget target) {
|
||||
String path = getPath();
|
||||
String title = getTitle().toLowerCase();
|
||||
|
||||
ExecutorService executorService = OneDev.getInstance(ExecutorService.class);
|
||||
List<JobLogEntryEx> messages = new ArrayList<>();
|
||||
@ -200,7 +210,7 @@ public abstract class TaskButton extends AjaxButton {
|
||||
|
||||
@Override
|
||||
protected Component newContent(String id) {
|
||||
return new TaskFeedbackPanel(id, _T(StringUtils.capitalize(title))) {
|
||||
return new TaskFeedbackPanel(id, getTitle()) {
|
||||
|
||||
@Override
|
||||
protected void onClose(AjaxRequestTarget target) {
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.user.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@ -23,9 +25,9 @@ public class UserMultiChoice extends Select2MultiChoice<User> {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose users...");
|
||||
getSettings().setPlaceholder(_T("Choose users..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.userChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.userChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.userChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.component.user.choice;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -20,9 +22,9 @@ public class UserSingleChoice extends Select2Choice<User> {
|
||||
super.onInitialize();
|
||||
getSettings().setAllowClear(!isRequired());
|
||||
if (isRequired())
|
||||
getSettings().setPlaceholder("Choose a user...");
|
||||
getSettings().setPlaceholder(_T("Choose a user..."));
|
||||
else
|
||||
getSettings().setPlaceholder("Not specified");
|
||||
getSettings().setPlaceholder(_T("Not specified"));
|
||||
getSettings().setFormatResult("onedev.server.userChoiceFormatter.formatResult");
|
||||
getSettings().setFormatSelection("onedev.server.userChoiceFormatter.formatSelection");
|
||||
getSettings().setEscapeMarkup("onedev.server.userChoiceFormatter.escapeMarkup");
|
||||
|
||||
@ -92,7 +92,7 @@ public class GroupChoiceEditSupport implements EditSupport {
|
||||
|
||||
};
|
||||
} else {
|
||||
throw new RuntimeException("Annotation 'TeamChoice' should be applied to property with type String or Collection<String>");
|
||||
throw new RuntimeException("Annotation 'GroupChoice' should be applied to property with type String or Collection<String>");
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
|
||||
@ -4,6 +4,9 @@ import io.onedev.server.OneDev;
|
||||
import io.onedev.server.entitymanager.SettingManager;
|
||||
import io.onedev.server.web.editable.BeanContext;
|
||||
import io.onedev.server.web.page.admin.AdministrationPage;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
@ -27,7 +30,7 @@ public class AlertSettingPage extends AdministrationPage {
|
||||
protected void onSubmit() {
|
||||
super.onSubmit();
|
||||
OneDev.getInstance(SettingManager.class).saveAlertSetting(alertSetting);
|
||||
getSession().success("Alert settings have been updated");
|
||||
getSession().success(_T("Alert settings have been updated"));
|
||||
|
||||
setResponsePage(AlertSettingPage.class);
|
||||
}
|
||||
@ -40,7 +43,7 @@ public class AlertSettingPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Alert Settings");
|
||||
return new Label(componentId, _T("Alert Settings"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="card-body">
|
||||
<form wicket:id="authenticator" class="authenticator leave-confirm">
|
||||
<div wicket:id="editor" class="mb-5"></div>
|
||||
<button wicket:id="save" class="btn btn-primary dirty-aware mr-3">Save Settings</button>
|
||||
<button wicket:id="save" class="btn btn-primary dirty-aware mr-3"><wicket:t>Save Settings</wicket:t></button>
|
||||
<input wicket:id="test" type="submit" class="btn btn-light-primary" t:value="Test Settings">
|
||||
</form>
|
||||
</div>
|
||||
@ -11,15 +11,15 @@
|
||||
<wicket:fragment wicket:id="testFrag">
|
||||
<form wicket:id="form" class="authenticator-test">
|
||||
<div class="modal-header">
|
||||
<h5 id="modal-title" class="modal-title">Authentication Test</h5>
|
||||
<h5 id="modal-title" class="modal-title"><wicket:t>Authentication Test</wicket:t></h5>
|
||||
<button wicket:id="close" type="button" class="close"><wicket:svg href="times" class="icon"/></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div wicket:id="editor"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button wicket:id="ok" class="btn btn-primary">Ok</button>
|
||||
<button wicket:id="cancel" class="btn btn-secondary">Cancel</button>
|
||||
<button wicket:id="ok" class="btn btn-primary"><wicket:t>Ok</wicket:t></button>
|
||||
<button wicket:id="cancel" class="btn btn-secondary"><wicket:t>Cancel</wicket:t></button>
|
||||
</div>
|
||||
</form>
|
||||
</wicket:fragment>
|
||||
|
||||
@ -26,6 +26,8 @@ import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
import org.apache.wicket.util.visit.IVisit;
|
||||
import org.apache.wicket.util.visit.IVisitor;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class AuthenticatorPage extends AdministrationPage {
|
||||
@ -52,10 +54,16 @@ public class AuthenticatorPage extends AdministrationPage {
|
||||
super.onSubmit();
|
||||
|
||||
OneDev.getInstance(SettingManager.class).saveAuthenticator(bean.getAuthenticator());
|
||||
getSession().success("External authenticator settings saved");
|
||||
getSession().success(_T("External authenticator settings saved"));
|
||||
}
|
||||
|
||||
};
|
||||
var fullNameLabel = _T("Full Name");
|
||||
var emailLabel = _T("Email");
|
||||
var groupsLabel = _T("Groups");
|
||||
var sshKeysLabel = _T("Number of SSH Keys");
|
||||
var testSuccessfulLabel = _T("Test successful: authentication passed");
|
||||
var testSuccessfulWithInfoLabel = _T("Test successful: authentication passed with below information retrieved:");
|
||||
TaskButton testButton = new TaskButton("test") {
|
||||
|
||||
@Override
|
||||
@ -136,31 +144,29 @@ public class AuthenticatorPage extends AdministrationPage {
|
||||
new UsernamePasswordToken(token.getUserName(), token.getPassword()));
|
||||
StringBuilder retrievedInfoBuilder = new StringBuilder();
|
||||
if (authenticated.getFullName() != null) {
|
||||
retrievedInfoBuilder.append("Full Name: ")
|
||||
retrievedInfoBuilder.append(fullNameLabel + ": ")
|
||||
.append(authenticated.getFullName())
|
||||
.append("<br>");
|
||||
}
|
||||
if (authenticated.getEmail() != null) {
|
||||
retrievedInfoBuilder.append("Email: ")
|
||||
retrievedInfoBuilder.append(emailLabel + ": ")
|
||||
.append(authenticated.getEmail())
|
||||
.append("<br>");
|
||||
}
|
||||
if (authenticated.getGroupNames() != null) {
|
||||
retrievedInfoBuilder.append("Groups: ")
|
||||
retrievedInfoBuilder.append(groupsLabel + ": ")
|
||||
.append(Joiner.on(", ").join(authenticated.getGroupNames()))
|
||||
.append("<br>");
|
||||
}
|
||||
if (authenticated.getSshKeys() != null) {
|
||||
retrievedInfoBuilder.append("Number of SSH Keys: ").append(authenticated.getSshKeys().size())
|
||||
retrievedInfoBuilder.append(sshKeysLabel + ": ").append(authenticated.getSshKeys().size())
|
||||
.append("<br>");
|
||||
}
|
||||
StringBuilder messageBuilder =
|
||||
new StringBuilder("Test successful: authentication passed");
|
||||
if (retrievedInfoBuilder.length() != 0) {
|
||||
messageBuilder.append(" with below information retrieved:<br>")
|
||||
.append(retrievedInfoBuilder);
|
||||
}
|
||||
return new TaskResult(true, new HtmlMessgae(messageBuilder.toString()));
|
||||
|
||||
if (retrievedInfoBuilder.length() != 0)
|
||||
return new TaskResult(true, new HtmlMessgae(testSuccessfulWithInfoLabel + "<br>" + retrievedInfoBuilder));
|
||||
else
|
||||
return new TaskResult(true, new HtmlMessgae(testSuccessfulLabel));
|
||||
}
|
||||
|
||||
};
|
||||
@ -189,7 +195,7 @@ public class AuthenticatorPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "External Authenticator");
|
||||
return new Label(componentId, _T("External Authenticator"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,7 +4,7 @@
|
||||
<form wicket:id="settings" class="leave-confirm mb-5">
|
||||
<div wicket:id="editor" class="mb-4"></div>
|
||||
<input type="submit" class="btn btn-primary dirty-aware mr-2" t:value="Update">
|
||||
<a wicket:id="useDefault" class="btn btn-secondary">Use Default</a>
|
||||
<a wicket:id="useDefault" class="btn btn-secondary"><wicket:t>Use Default</wicket:t></a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.brandingsetting;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@ -94,7 +96,7 @@ public class BrandingSettingPage extends AdministrationPage {
|
||||
var bytes = getLogoBytes(bean.getDarkLogoData());
|
||||
getClusterManager().runOnAllServers(new UpdateLogoTask(bytes, true));
|
||||
}
|
||||
Session.get().success("Branding settings updated");
|
||||
Session.get().success(_T("Branding settings updated"));
|
||||
}
|
||||
};
|
||||
add(form);
|
||||
@ -109,7 +111,7 @@ public class BrandingSettingPage extends AdministrationPage {
|
||||
getClusterManager().runOnAllServers(new UpdateLogoTask(null, false));
|
||||
getClusterManager().runOnAllServers(new UpdateLogoTask(null, true));
|
||||
setResponsePage(BrandingSettingPage.class);
|
||||
Session.get().success("Default branding settings restored");
|
||||
Session.get().success(_T("Default branding settings restored"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -124,7 +126,7 @@ public class BrandingSettingPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Branding");
|
||||
return new Label(componentId, _T("Branding"));
|
||||
}
|
||||
|
||||
private SettingManager getSettingManager() {
|
||||
|
||||
@ -1,60 +1,60 @@
|
||||
<wicket:panel>
|
||||
<div class="p-5 add-agent">
|
||||
<h6 class="text-center mb-4">Connect New Agent</h6>
|
||||
<h6 class="text-center mb-4"><wicket:t>Connect New Agent</wicket:t></h6>
|
||||
<ul wicket:id="tabs" class="nav nav-tabs nav-tabs-line nav-bold mb-4"></ul>
|
||||
<div wicket:id="instructions"></div>
|
||||
</div>
|
||||
<wicket:fragment wicket:id="dockerInstructionsFrag">
|
||||
<a wicket:id="showCommand" class="btn btn-light-primary">Show Command</a>
|
||||
<div class="text-muted font-size-sm mt-2 mb-3">(a new agent token will be generated each time this button is pressed)</div>
|
||||
<a wicket:id="showCommand" class="btn btn-light-primary"><wicket:t>Show Command</wicket:t></a>
|
||||
<div class="text-muted font-size-sm mt-2 mb-3">(<wicket:t>a new agent token will be generated each time this button is pressed</wicket:t>)</div>
|
||||
<div wicket:id="command"></div>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="bareMetalInstructionsFrag">
|
||||
<div class="alert alert-light p-0 py-4">
|
||||
<div class="px-3 mb-2">Follow below steps to install agent on remote machine (supports Linux/Windows/Mac OS X/FreeBSD):</div>
|
||||
<div class="px-3 mb-2"><wicket:t>Follow below steps to install agent on remote machine (supports Linux/Windows/Mac OS X/FreeBSD):</wicket:t></div>
|
||||
<ol class="mb-0">
|
||||
<li>Make sure <a href="https://openjdk.java.net" target="_blank">Java 11 or higher</a> is installed</li>
|
||||
<li>Make sure docker engine is installed and docker command line is available in system path</li>
|
||||
<li>Make sure current user has permission to run docker containers</li>
|
||||
<li>Make sure git version 2.11.1 or higher is installed and available in system path</li>
|
||||
<li>Make sure git-lfs is installed and available in system path if you want to retrieve LFS files</li>
|
||||
<li>Download <a wicket:id="agentZip" class="link-primary">agent.zip</a> or <a wicket:id="agentTgz" class="link-primary">agent.tar.gz</a>. A new agent token will be included in the package</li>
|
||||
<li>Extract the package into a folder. <b class="text-danger">Warning:</b> On Mac OS X, do not extract to Mac managed
|
||||
<li><wicket:t>Make sure <a href="https://openjdk.java.net" target="_blank">Java 11 or higher</a> is installed</wicket:t></li>
|
||||
<li><wicket:t>Make sure docker engine is installed and docker command line is available in system path</wicket:t></li>
|
||||
<li><wicket:t>Make sure current user has permission to run docker containers</wicket:t></li>
|
||||
<li><wicket:t>Make sure git version 2.11.1 or higher is installed and available in system path</wicket:t></li>
|
||||
<li><wicket:t>Make sure git-lfs is installed and available in system path if you want to retrieve LFS files</wicket:t></li>
|
||||
<li><wicket:t>Download <a wicket:id="agentZip" class="link-primary">agent.zip</a> or <a wicket:id="agentTgz" class="link-primary">agent.tar.gz</a>. A new agent token will be included in the package</wicket:t></li>
|
||||
<li><wicket:t>Extract the package into a folder. <b class="text-danger">Warning:</b> On Mac OS X, do not extract to Mac managed
|
||||
folders such as Downloads, Desktop, Documents; otherwise you may encounter permission issues
|
||||
starting agent</li>
|
||||
starting agent</wicket:t></li>
|
||||
<li>
|
||||
Change property <code>serverUrl</code> in file <code>conf/agent.properties</code> if necessary. The default value is
|
||||
taken from OneDev server url specified in <i>Administration / System Setting</i>
|
||||
<wicket:t>Change property <code>serverUrl</code> in file <code>conf/agent.properties</code> if necessary. The default value is
|
||||
taken from OneDev server url specified in <i>Administration / System Setting</i></wicket:t>
|
||||
</li>
|
||||
<li>From extracted folder, run <code>bin\agent.bat console</code> as administrator on Windows or <code>bin/agent.sh console</code> on other OS </li>
|
||||
<li><wicket:t>From extracted folder, run <code>bin\agent.bat console</code> as administrator on Windows or <code>bin/agent.sh console</code> on other OS</wicket:t></li>
|
||||
</ol>
|
||||
</div>
|
||||
<ul class="text-muted font-size-sm mb-0">
|
||||
<li>
|
||||
Agent is designed to be maintenance free. Once connected to server, it will be updated automatically
|
||||
upon server upgrade
|
||||
<wicket:t>Agent is designed to be maintenance free. Once connected to server, it will be updated automatically
|
||||
upon server upgrade</wicket:t>
|
||||
</li>
|
||||
<li>
|
||||
Check <a href="https://docs.onedev.io/administration-guide/agent-management" target="_blank">agent management</a> for details, including instructions on how to run agent as service
|
||||
<wicket:t>Check <a href="https://docs.onedev.io/administration-guide/agent-management" target="_blank">agent management</a> for details, including instructions on how to run agent as service</wicket:t>
|
||||
</li>
|
||||
</ul>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="dockerCommandFrag">
|
||||
Start agent on remote Linux machine by running below command:
|
||||
<wicket:t>Start agent on remote Linux machine by running below command:</wicket:t>
|
||||
<div class="text-monospace font-size-sm mt-3 alert alert-light">
|
||||
<span wicket:id="command"></span> <a wicket:id="copy"><wicket:svg href="copy" class="icon"></wicket:svg></a>
|
||||
</div>
|
||||
<ul class="text-muted font-size-sm mb-0">
|
||||
<li>
|
||||
Environment variable <code>serverUrl</code> in above command is taken from OneDev server url
|
||||
specified in <i>Administration / System Setting</i>. Change it if necessary
|
||||
<wicket:t>Environment variable <code>serverUrl</code> in above command is taken from OneDev server url
|
||||
specified in <i>Administration / System Setting</i>. Change it if necessary</wicket:t>
|
||||
</li>
|
||||
<li>
|
||||
Agent is designed to be maintenance free. Once connected to server, it will be updated automatically
|
||||
upon server upgrade
|
||||
<wicket:t>Agent is designed to be maintenance free. Once connected to server, it will be updated automatically
|
||||
upon server upgrade</wicket:t>
|
||||
</li>
|
||||
<li>
|
||||
Check <a href="https://docs.onedev.io/administration-guide/agent-management" target="_blank">agent management</a> for details, including list of supported environment variables
|
||||
<wicket:t>Check <a href="https://docs.onedev.io/administration-guide/agent-management" target="_blank">agent management</a> for details, including list of supported environment variables</wicket:t>
|
||||
</li>
|
||||
</ul>
|
||||
</wicket:fragment>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.buildsetting.agent;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -34,7 +36,7 @@ class AddAgentPanel extends Panel {
|
||||
|
||||
List<Tab> tabs = new ArrayList<>();
|
||||
|
||||
tabs.add(new AjaxActionTab(Model.of("Run via Docker Container")) {
|
||||
tabs.add(new AjaxActionTab(Model.of(_T("Run via Docker Container"))) {
|
||||
|
||||
@Override
|
||||
protected void onSelect(AjaxRequestTarget target, Component tabLink) {
|
||||
@ -44,7 +46,7 @@ class AddAgentPanel extends Panel {
|
||||
}
|
||||
|
||||
});
|
||||
tabs.add(new AjaxActionTab(Model.of("Run on Bare Metal/Virtual Machine")) {
|
||||
tabs.add(new AjaxActionTab(Model.of(_T("Run on Bare Metal/Virtual Machine"))) {
|
||||
|
||||
@Override
|
||||
protected void onSelect(AjaxRequestTarget target, Component tabLink) {
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
package io.onedev.server.web.page.admin.buildsetting.agent;
|
||||
|
||||
import io.onedev.commons.utils.ExplicitException;
|
||||
import io.onedev.server.OneDev;
|
||||
import io.onedev.server.entitymanager.AgentManager;
|
||||
import io.onedev.server.model.Agent;
|
||||
import io.onedev.server.web.component.tabbable.PageTab;
|
||||
import io.onedev.server.web.component.tabbable.Tab;
|
||||
import io.onedev.server.web.component.tabbable.Tabbable;
|
||||
import io.onedev.server.web.page.admin.AdministrationPage;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.head.CssHeaderItem;
|
||||
import org.apache.wicket.markup.head.IHeaderResponse;
|
||||
@ -17,8 +15,14 @@ import org.apache.wicket.model.LoadableDetachableModel;
|
||||
import org.apache.wicket.model.Model;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import io.onedev.commons.utils.ExplicitException;
|
||||
import io.onedev.server.OneDev;
|
||||
import io.onedev.server.entitymanager.AgentManager;
|
||||
import io.onedev.server.model.Agent;
|
||||
import io.onedev.server.web.component.tabbable.PageTab;
|
||||
import io.onedev.server.web.component.tabbable.Tab;
|
||||
import io.onedev.server.web.component.tabbable.Tabbable;
|
||||
import io.onedev.server.web.page.admin.AdministrationPage;
|
||||
|
||||
public abstract class AgentDetailPage extends AdministrationPage {
|
||||
|
||||
@ -34,7 +38,7 @@ public abstract class AgentDetailPage extends AdministrationPage {
|
||||
Agent agent = OneDev.getInstance(AgentManager.class).findByName(agentName);
|
||||
|
||||
if (agent == null)
|
||||
throw new ExplicitException("Unable to find agent " + agentName);
|
||||
throw new ExplicitException(MessageFormat.format(_T("Unable to find agent {0}"), agentName));
|
||||
|
||||
Long agentId = agent.getId();
|
||||
|
||||
@ -57,9 +61,9 @@ public abstract class AgentDetailPage extends AdministrationPage {
|
||||
|
||||
List<Tab> tabs = new ArrayList<>();
|
||||
|
||||
tabs.add(new PageTab(Model.of("Overview"), AgentOverviewPage.class, AgentOverviewPage.paramsOf(getAgent())));
|
||||
tabs.add(new PageTab(Model.of("Builds"), AgentBuildsPage.class, AgentBuildsPage.paramsOf(getAgent())));
|
||||
tabs.add(new PageTab(Model.of("Log"), AgentLogPage.class, AgentLogPage.paramsOf(getAgent())));
|
||||
tabs.add(new PageTab(Model.of(_T("Overview")), AgentOverviewPage.class, AgentOverviewPage.paramsOf(getAgent())));
|
||||
tabs.add(new PageTab(Model.of(_T("Builds")), AgentBuildsPage.class, AgentBuildsPage.paramsOf(getAgent())));
|
||||
tabs.add(new PageTab(Model.of(_T("Log")), AgentLogPage.class, AgentLogPage.paramsOf(getAgent())));
|
||||
|
||||
add(new Tabbable("agentTabs", tabs).setOutputMarkupId(true));
|
||||
}
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
<wicket:extend>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Status</label>
|
||||
<label class="control-label"><wicket:t>Status</wicket:t></label>
|
||||
<input wicket:id="status" type="hidden" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">OS</label>
|
||||
<label class="control-label"><wicket:t>OS</wicket:t></label>
|
||||
<input wicket:id="os" type="hidden" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">OS Arch</label>
|
||||
<label class="control-label"><wicket:t>OS Arch</wicket:t></label>
|
||||
<input wicket:id="osArch" type="hidden" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Paused</label>
|
||||
<label class="control-label"><wicket:t>Paused</wicket:t></label>
|
||||
<span class="switch switch-sm switch-primary">
|
||||
<label>
|
||||
<input wicket:id="paused" type="checkbox">
|
||||
@ -20,7 +20,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Has Running Builds</label>
|
||||
<label class="control-label"><wicket:t>Has Running Builds</wicket:t></label>
|
||||
<span class="switch switch-sm switch-primary">
|
||||
<label>
|
||||
<input wicket:id="hasRunningBuilds" type="checkbox">
|
||||
@ -28,13 +28,13 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Ever Used Since</label>
|
||||
<label class="control-label"><wicket:t>Ever Used Since</wicket:t></label>
|
||||
<div class="clearable-wrapper">
|
||||
<input wicket:id="everUsedSince" type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label">Not Used Since</label>
|
||||
<label class="control-label"><wicket:t>Not Used Since</wicket:t></label>
|
||||
<div class="clearable-wrapper">
|
||||
<input wicket:id="notUsedSince" type="text" class="form-control">
|
||||
</div>
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package io.onedev.server.web.page.admin.buildsetting.agent;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.ajax.AjaxRequestTarget;
|
||||
@ -13,8 +15,7 @@ import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
|
||||
import org.apache.wicket.markup.html.form.CheckBox;
|
||||
import org.apache.wicket.model.IModel;
|
||||
import org.apache.wicket.model.LoadableDetachableModel;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.wicket.model.Model;
|
||||
|
||||
import io.onedev.server.OneDev;
|
||||
import io.onedev.server.entitymanager.AgentManager;
|
||||
@ -47,6 +48,10 @@ class AgentFilterPanel extends FilterEditPanel<Agent> {
|
||||
protected void onInitialize() {
|
||||
super.onInitialize();
|
||||
|
||||
var statusChoices = new LinkedHashMap<String, String>();
|
||||
statusChoices.put("Online", _T("Online"));
|
||||
statusChoices.put("Offline", _T("Offline"));
|
||||
|
||||
var statusChoice = new StringSingleChoice("status", new IModel<String>() {
|
||||
|
||||
@Override
|
||||
@ -76,13 +81,8 @@ class AgentFilterPanel extends FilterEditPanel<Agent> {
|
||||
getModel().setObject(query);
|
||||
}
|
||||
|
||||
}, new LoadableDetachableModel<List<String>>() {
|
||||
}, Model.ofList(new ArrayList<>(statusChoices.keySet())), Model.ofMap(statusChoices), false);
|
||||
|
||||
@Override
|
||||
protected List<String> load() {
|
||||
return Lists.newArrayList("Online", "Offline");
|
||||
}
|
||||
}, false);
|
||||
statusChoice.add(new AjaxFormComponentUpdatingBehavior("change") {
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<wicket:extend>
|
||||
<div class="alert alert-info mb-5">
|
||||
<wicket:svg href="bulb" class="icon"></wicket:svg>
|
||||
Agents can be used to execute jobs on remote machines. Once started it will update itself
|
||||
from server automatically when necessary
|
||||
<wicket:t>Agents can be used to execute jobs on remote machines. Once started it will update itself
|
||||
from server automatically when necessary</wicket:t>
|
||||
</div>
|
||||
<div class="side-main side-main-wrap">
|
||||
<div wicket:id="savedQueries" class="side"></div>
|
||||
|
||||
@ -27,6 +27,9 @@ import org.apache.wicket.request.cycle.RequestCycle;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@ -217,7 +220,7 @@ public class AgentListPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Agents");
|
||||
return new Label(componentId, _T("Agents"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -14,22 +14,22 @@
|
||||
</div>
|
||||
<div class="operations mb-4">
|
||||
<a wicket:id="showSavedQueries" class="show-saved-queries text-gray mr-4 d-inline-block mb-2 text-nowrap">
|
||||
<wicket:svg href="eye" class="icon"></wicket:svg> Show Saved Queries
|
||||
<wicket:svg href="eye" class="icon"></wicket:svg> <wicket:t>Show Saved Queries</wicket:t>
|
||||
</a>
|
||||
<a wicket:id="saveQuery" class="save-query text-gray mr-4 d-inline-block mb-2 text-nowrap">
|
||||
<wicket:svg href="save" class="icon"></wicket:svg> Save Query
|
||||
<wicket:svg href="save" class="icon"></wicket:svg> <wicket:t>Save Query</wicket:t>
|
||||
</a>
|
||||
<a wicket:id="filter" class="filter text-gray mr-4 mb-2 d-inline-block text-nowrap">
|
||||
<wicket:svg href="filter" class="icon"></wicket:svg> Filter
|
||||
<wicket:svg href="filter" class="icon"></wicket:svg> <wicket:t>Filter</wicket:t>
|
||||
</a>
|
||||
<a wicket:id="orderBy" class="order-by text-gray mr-4 d-inline-block mb-2 text-nowrap">
|
||||
<wicket:svg href="sort" class="icon"></wicket:svg> Order By
|
||||
<wicket:svg href="sort" class="icon"></wicket:svg> <wicket:t>Order By</wicket:t>
|
||||
</a>
|
||||
<a wicket:id="operations" class="text-gray mr-4 d-inline-block mb-2 text-nowrap">
|
||||
<wicket:svg href="ellipsis-circle" class="icon rotate-180"></wicket:svg> Operations
|
||||
<wicket:svg href="ellipsis-circle" class="icon rotate-180"></wicket:svg> <wicket:t>Operations</wicket:t>
|
||||
</a>
|
||||
<a wicket:id="tokens" class="text-gray mr-4 d-inline-block mb-2 text-nowrap">
|
||||
<wicket:svg href="token" class="icon"></wicket:svg> Tokens
|
||||
<wicket:svg href="token" class="icon"></wicket:svg> <wicket:t>Tokens</wicket:t>
|
||||
</a>
|
||||
<span wicket:id="count" class="float-right text-gray"></span>
|
||||
</div>
|
||||
@ -40,10 +40,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<wicket:fragment wicket:id="cpuHeaderFrag">
|
||||
<span class="mr-1">CPU</span> <a t:data-tippy-content="CPU capability in millis. This is normally (CPU cores)*1000"><wicket:svg href="question-circle-o" class="icon icon-sm"/></a>
|
||||
<span class="mr-1"><wicket:t>CPU</wicket:t></span> <a t:data-tippy-content="CPU capability in millis. This is normally (CPU cores)*1000"><wicket:svg href="question-circle-o" class="icon icon-sm"/></a>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="memoryHeaderFrag">
|
||||
<span class="mr-1">Memory</span> <a t:data-tippy-content="Physical memory in mega bytes"><wicket:svg href="question-circle-o" class="icon icon-sm"/></a>
|
||||
<span class="mr-1"><wicket:t>Memory</wicket:t></span> <a t:data-tippy-content="Physical memory in mega bytes"><wicket:svg href="question-circle-o" class="icon icon-sm"/></a>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="agentLinkFrag">
|
||||
<a wicket:id="link" class="d-flex align-items-center"><svg wicket:id="icon" class="icon icon-lg mr-1"></svg> <span wicket:id="label"></span></a>
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package io.onedev.server.web.page.admin.buildsetting.agent;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
@ -82,7 +85,7 @@ class AgentListPanel extends Panel {
|
||||
error(e.getMessage());
|
||||
return null;
|
||||
} else {
|
||||
info("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and online");
|
||||
info(_T("Performing fuzzy query. Enclosing search text with '~' to add more conditions, for instance: ~text to search~ and online"));
|
||||
return new AgentQuery(new FuzzyCriteria(queryString));
|
||||
}
|
||||
}
|
||||
@ -185,9 +188,9 @@ class AgentListPanel extends Panel {
|
||||
if (!isEnabled())
|
||||
tag.append("class", "disabled", " ");
|
||||
if (!querySubmitted)
|
||||
tag.put("title", "Query not submitted");
|
||||
tag.put("data-tippy-content", _T("Query not submitted"));
|
||||
else if (queryModel.getObject() == null)
|
||||
tag.put("title", "Can not save malformed query");
|
||||
tag.put("data-tippy-content", _T("Can not save malformed query"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -278,7 +281,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Pause Selected Agents";
|
||||
return _T("Pause Selected Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -293,7 +296,7 @@ class AgentListPanel extends Panel {
|
||||
target.add(countLabel);
|
||||
target.add(body);
|
||||
selectionColumn.getSelections().clear();
|
||||
Session.get().success("Paused selected agents");
|
||||
Session.get().success(_T("Paused selected agents"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -308,7 +311,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "Please select agents to pause");
|
||||
tag.put("data-tippy-content", _T("Please select agents to pause"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -321,7 +324,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Resume Selected Agents";
|
||||
return _T("Resume Selected Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -336,7 +339,7 @@ class AgentListPanel extends Panel {
|
||||
target.add(countLabel);
|
||||
target.add(body);
|
||||
selectionColumn.getSelections().clear();
|
||||
Session.get().success("Resumed selected agents");
|
||||
Session.get().success(_T("Resumed selected agents"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -351,7 +354,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "Please select agents to resume");
|
||||
tag.put("data-tippy-content", _T("Please select agents to resume"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -364,7 +367,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Restart Selected Agents";
|
||||
return _T("Restart Selected Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -384,12 +387,12 @@ class AgentListPanel extends Panel {
|
||||
target.add(countLabel);
|
||||
target.add(body);
|
||||
selectionColumn.getSelections().clear();
|
||||
Session.get().success("Restart command issued to selected agents");
|
||||
Session.get().success(_T("Restart command issued to selected agents"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getConfirmMessage() {
|
||||
return "Type <code>yes</code> below to restart selected agents";
|
||||
return _T("Type <code>yes</code> below to restart selected agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -412,7 +415,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "Please select agents to restart");
|
||||
tag.put("data-tippy-content", _T("Please select agents to restart"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -425,7 +428,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Remove Selected Agents";
|
||||
return _T("Remove Selected Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -449,7 +452,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
protected String getConfirmMessage() {
|
||||
return "Removed selected agents. Type <code>yes</code> below to confirm";
|
||||
return _T("Removed selected agents. Type <code>yes</code> below to confirm");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -473,7 +476,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "Please select agents to remove");
|
||||
tag.put("data-tippy-content", _T("Please select agents to remove"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -486,7 +489,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Pause All Queried Agents";
|
||||
return _T("Pause All Queried Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -508,12 +511,12 @@ class AgentListPanel extends Panel {
|
||||
dataProvider.detach();
|
||||
target.add(countLabel);
|
||||
target.add(body);
|
||||
Session.get().success("Paused all queried agents");
|
||||
Session.get().success(_T("Paused all queried agents"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getConfirmMessage() {
|
||||
return "Type <code>yes</code> below to pause all queried agents";
|
||||
return _T("Type <code>yes</code> below to pause all queried agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -537,7 +540,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "No agents to pause");
|
||||
tag.put("data-tippy-content", _T("No agents to pause"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -550,7 +553,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Resume All Queried Agents";
|
||||
return _T("Resume All Queried Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -572,12 +575,12 @@ class AgentListPanel extends Panel {
|
||||
target.add(countLabel);
|
||||
target.add(body);
|
||||
selectionColumn.getSelections().clear();
|
||||
Session.get().success("Resumed all queried agents");
|
||||
Session.get().success(_T("Resumed all queried agents"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getConfirmMessage() {
|
||||
return "Type <code>yes</code> below to resume all queried agents";
|
||||
return _T("Type <code>yes</code> below to resume all queried agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -601,7 +604,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "No agents to resume");
|
||||
tag.put("data-tippy-content", _T("No agents to resume"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -614,7 +617,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Restart All Queried Agents";
|
||||
return _T("Restart All Queried Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -636,12 +639,12 @@ class AgentListPanel extends Panel {
|
||||
target.add(countLabel);
|
||||
target.add(body);
|
||||
selectionColumn.getSelections().clear();
|
||||
Session.get().success("Restart command issued to all queried agents");
|
||||
Session.get().success(_T("Restart command issued to all queried agents"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getConfirmMessage() {
|
||||
return "Type <code>yes</code> below to restart all queried agents";
|
||||
return _T("Type <code>yes</code> below to restart all queried agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -665,7 +668,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "No agents to restart");
|
||||
tag.put("data-tippy-content", _T("No agents to restart"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -678,7 +681,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Remove All Queried Agents";
|
||||
return _T("Remove All Queried Agents");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -704,7 +707,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
@Override
|
||||
protected String getConfirmMessage() {
|
||||
return "Removed all queried agents. Type <code>yes</code> below to confirm";
|
||||
return _T("Removed all queried agents. Type <code>yes</code> below to confirm");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -728,7 +731,7 @@ class AgentListPanel extends Panel {
|
||||
configure();
|
||||
if (!isEnabled()) {
|
||||
tag.put("disabled", "disabled");
|
||||
tag.put("title", "No agents to remove");
|
||||
tag.put("data-tippy-content", _T("No agents to remove"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -791,9 +794,9 @@ class AgentListPanel extends Panel {
|
||||
@Override
|
||||
public String getObject() {
|
||||
if (dataProvider.size() > 1)
|
||||
return "found " + dataProvider.size() + " agents";
|
||||
return MessageFormat.format(_T("found {0} agents"), dataProvider.size());
|
||||
else
|
||||
return "found 1 agent";
|
||||
return _T("found 1 agent");
|
||||
}
|
||||
}) {
|
||||
@Override
|
||||
@ -853,7 +856,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
columns.add(selectionColumn = new SelectionColumn<Agent, Void>());
|
||||
|
||||
columns.add(new AbstractColumn<>(Model.of("Name")) {
|
||||
columns.add(new AbstractColumn<>(Model.of(_T("Name"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<Agent>> cellItem, String componentId, IModel<Agent> rowModel) {
|
||||
@ -869,7 +872,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<>(Model.of("IP Address")) {
|
||||
columns.add(new AbstractColumn<>(Model.of(_T("IP Address"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<Agent>> cellItem, String componentId, IModel<Agent> rowModel) {
|
||||
@ -884,7 +887,7 @@ class AgentListPanel extends Panel {
|
||||
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<>(Model.of("Status")) {
|
||||
columns.add(new AbstractColumn<>(Model.of(_T("Status"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<Agent>> cellItem, String componentId, IModel<Agent> rowModel) {
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
<wicket:fragment wicket:id="onlineFrag">
|
||||
<div class="card server-log">
|
||||
<div class="card-body">
|
||||
<a wicket:id="download" class="btn btn-light btn-hover-primary btn-block mb-4" t:data-tippy-content="Download log"><wicket:svg href="download" class="icon mr-2"/> Download</a>
|
||||
<a wicket:id="download" class="btn btn-light btn-hover-primary btn-block mb-4" t:data-tippy-content="Download log"><wicket:svg href="download" class="icon mr-2"/> <wicket:t>Download</wicket:t></a>
|
||||
<div wicket:id="warning" class="alert alert-notice alert-light-warning mb-4"></div>
|
||||
<pre class="font-size-sm" wicket:id="logContent"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="offlineFrag">
|
||||
<div class="alert alert-notice alert-light-warning">Log not available for offline agent</div>
|
||||
<div class="alert alert-notice alert-light-warning"><wicket:t>Log not available for offline agent</wicket:t></div>
|
||||
</wicket:fragment>
|
||||
</wicket:extend>
|
||||
@ -2,7 +2,9 @@ package io.onedev.server.web.page.admin.buildsetting.agent;
|
||||
|
||||
import static io.onedev.agent.job.LogRequest.toZoneId;
|
||||
import static io.onedev.server.util.DateUtils.getZoneId;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.wicket.markup.html.WebMarkupContainer;
|
||||
@ -39,7 +41,7 @@ public class AgentLogPage extends AgentDetailPage {
|
||||
List<String> lines = OneDev.getInstance(AgentManager.class).getAgentLog(getAgent());
|
||||
String content;
|
||||
if (lines.size() > MAX_DISPLAY_LINES) {
|
||||
fragment.add(new Label("warning", "Too many log entries, displaying recent " + MAX_DISPLAY_LINES));
|
||||
fragment.add(new Label("warning", MessageFormat.format(_T("Too many log entries, displaying recent {0}"), MAX_DISPLAY_LINES)));
|
||||
content = Joiner.on("\n").join(toZoneId(lines.subList(lines.size()-MAX_DISPLAY_LINES, lines.size()), getZoneId()));
|
||||
} else {
|
||||
fragment.add(new WebMarkupContainer("warning").setVisible(false));
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<wicket:extend xmlns:wicket="http://www.w3.org/1999/html">
|
||||
<div class="mb-5">
|
||||
<a wicket:id="pauseOrResume" class="btn btn-light-primary mr-2"><span wicket:id="label"></span></a>
|
||||
<a wicket:id="restart" class="btn btn-light-primary mr-2">Restart</a>
|
||||
<a wicket:id="remove" class="btn btn-light-danger mr-2">Remove</a>
|
||||
<a wicket:id="restart" class="btn btn-light-primary mr-2"><wicket:t>Restart</wicket:t></a>
|
||||
<a wicket:id="remove" class="btn btn-light-danger mr-2"><wicket:t>Remove</wicket:t></a>
|
||||
</div>
|
||||
<table class="table mb-5">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th class="d-none d-xl-table-cell">IP Address</th>
|
||||
<th class="d-none d-xl-table-cell">OS Version</th>
|
||||
<th class="d-none d-xl-table-cell">OS Arch</th>
|
||||
<th>Status</th>
|
||||
<th><wicket:t>Name</wicket:t></th>
|
||||
<th class="d-none d-xl-table-cell"><wicket:t>IP Address</wicket:t></th>
|
||||
<th class="d-none d-xl-table-cell"><wicket:t>OS Version</wicket:t></th>
|
||||
<th class="d-none d-xl-table-cell"><wicket:t>OS Arch</wicket:t></th>
|
||||
<th><wicket:t>Status</wicket:t></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
@ -36,7 +36,7 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="mb-4">
|
||||
<span class="font-weight-bold">Access Token: </span>
|
||||
<span class="font-weight-bold"><wicket:t>Access Token</wicket:t>: </span>
|
||||
<span wicket:id="accessToken" class="text-monospace font-size-sm mr-2"></span>
|
||||
<a wicket:id="copyAccessToken" t:data-tippy-content="copy"><wicket:svg href="copy" class="icon mr-1"/></a>
|
||||
<a wicket:id="regenerateAccessToken" t:data-tippy-content="Regenerate"><wicket:svg href="refresh2" class="icon"/></a>
|
||||
@ -49,12 +49,12 @@
|
||||
</form>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="offlineHasAttributesFrag">
|
||||
<div class="mb-3 font-weight-bold">Attributes (can only be edited when agent is online)</div>
|
||||
<div class="mb-3 font-weight-bold"><wicket:t>Attributes (can only be edited when agent is online)</wicket:t></div>
|
||||
<div class="border rounded">
|
||||
<table class="table mb-0">
|
||||
<thead>
|
||||
<th>Name</th>
|
||||
<th>Value</th>
|
||||
<th><wicket:t>Name</wicket:t></th>
|
||||
<th><wicket:t>Value</wicket:t></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr wicket:id="attributes">
|
||||
@ -66,6 +66,6 @@
|
||||
</div>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="offlineNoAttributesFrag">
|
||||
<div class="alert alert-notice alert-light-warning">No attributes defined (can only be edited when agent is online)</div>
|
||||
<div class="alert alert-notice alert-light-warning"><wicket:t>No attributes defined (can only be edited when agent is online)</wicket:t></div>
|
||||
</wicket:fragment>
|
||||
</wicket:extend>
|
||||
@ -20,6 +20,8 @@ import org.apache.wicket.model.AbstractReadOnlyModel;
|
||||
import org.apache.wicket.model.LoadableDetachableModel;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class AgentOverviewPage extends AgentDetailPage {
|
||||
@ -42,10 +44,10 @@ public class AgentOverviewPage extends AgentDetailPage {
|
||||
public void onClick() {
|
||||
getAgentManager().restart(getAgent());
|
||||
setResponsePage(AgentOverviewPage.class, AgentOverviewPage.paramsOf(getAgent()));
|
||||
Session.get().success("Restart command issued");
|
||||
Session.get().success(_T("Restart command issued"));
|
||||
}
|
||||
|
||||
}.add(new ConfirmClickModifier("Do you really want to restart this agent?")));
|
||||
}.add(new ConfirmClickModifier(_T("Do you really want to restart this agent?"))));
|
||||
|
||||
add(new Link<Void>("remove") {
|
||||
|
||||
@ -53,10 +55,10 @@ public class AgentOverviewPage extends AgentDetailPage {
|
||||
public void onClick() {
|
||||
getAgentManager().delete(getAgent());
|
||||
setResponsePage(AgentListPage.class);
|
||||
Session.get().success("Agent removed");
|
||||
Session.get().success(_T("Agent removed"));
|
||||
}
|
||||
|
||||
}.add(new ConfirmClickModifier("Do you really want to remove this agent?")));
|
||||
}.add(new ConfirmClickModifier(_T("Do you really want to remove this agent?"))));
|
||||
|
||||
add(new Link<Void>("pauseOrResume") {
|
||||
|
||||
@ -67,7 +69,7 @@ public class AgentOverviewPage extends AgentDetailPage {
|
||||
|
||||
@Override
|
||||
public String getObject() {
|
||||
return getAgent().isPaused()?"Resume":"Pause";
|
||||
return getAgent().isPaused()?_T("Resume"):_T("Pause");
|
||||
}
|
||||
|
||||
}));
|
||||
@ -112,7 +114,7 @@ public class AgentOverviewPage extends AgentDetailPage {
|
||||
token.setValue(UUID.randomUUID().toString());
|
||||
OneDev.getInstance(AgentTokenManager.class).createOrUpdate(token);
|
||||
OneDev.getInstance(AgentManager.class).disconnect(getAgent().getId());
|
||||
Session.get().success("Access token regenerated, make sure to update the token at agent side");
|
||||
Session.get().success(_T("Access token regenerated, make sure to update the token at agent side"));
|
||||
setResponsePage(AgentOverviewPage.class, paramsOf(getAgent()));
|
||||
}
|
||||
});
|
||||
@ -133,7 +135,7 @@ public class AgentOverviewPage extends AgentDetailPage {
|
||||
attributeMap.put(attribute.getName(), attribute.getValue());
|
||||
OneDev.getInstance(AgentAttributeManager.class).syncAttributes(getAgent(), attributeMap);
|
||||
getAgentManager().attributesUpdated(getAgent());
|
||||
Session.get().success("Attributes saved");
|
||||
Session.get().success(_T("Attributes saved"));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
<wicket:panel>
|
||||
<div class="p-5 token-list">
|
||||
<h6 class="text-center mb-4">Available Agent Tokens</h6>
|
||||
<h6 class="text-center mb-4"><wicket:t>Available Agent Tokens</wicket:t></h6>
|
||||
<div class="alert alert-light alert-notice mb-5">
|
||||
Agent tokens are used to authorize agents. It should be configured via environment variable
|
||||
<wicket:t>Agent tokens are used to authorize agents. It should be configured via environment variable
|
||||
<tt>agentToken</tt> if agent runs as docker container, or property <tt>agentToken</tt> in
|
||||
file <tt><agent dir>/conf/agent.properties</tt> if agent runs on bare metal/virtual machine.
|
||||
A token will be in-use and removed from this list if agent using it connects to server
|
||||
A token will be in-use and removed from this list if agent using it connects to server</wicket:t>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<a wicket:id="addNew" class="btn btn-primary mr-2">Generate New</a>
|
||||
<a wicket:id="deleteAll" class="btn btn-danger">Delete All</a>
|
||||
<a wicket:id="addNew" class="btn btn-primary mr-2"><wicket:t>Generate New</wicket:t></a>
|
||||
<a wicket:id="deleteAll" class="btn btn-danger"><wicket:t>Delete All</wicket:t></a>
|
||||
</div>
|
||||
<table wicket:id="tokens" class="table"></table>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.buildsetting.agent;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -70,7 +72,7 @@ public class TokenListPanel extends GenericPanel<List<AgentToken>> {
|
||||
@Override
|
||||
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
|
||||
super.updateAjaxAttributes(attributes);
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener("Do you really want to delete unused tokens?"));
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to delete unused tokens?")));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -90,7 +92,7 @@ public class TokenListPanel extends GenericPanel<List<AgentToken>> {
|
||||
|
||||
List<IColumn<AgentToken, Void>> columns = new ArrayList<>();
|
||||
|
||||
columns.add(new AbstractColumn<AgentToken, Void>(Model.of("Value")) {
|
||||
columns.add(new AbstractColumn<AgentToken, Void>(Model.of(_T("Value"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<AgentToken>> cellItem, String componentId,
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
<form wicket:id="form" class="leave-confirm">
|
||||
<div wicket:id="feedback"></div>
|
||||
<div wicket:id="editor" class="mb-4"></div>
|
||||
<button wicket:id="save" type="submit" class="btn btn-primary dirty-aware mr-1">Save</button>
|
||||
<button wicket:id="testingExecutor" type="submit" class="btn btn-light-primary mr-1">Test</button>
|
||||
<button wicket:id="cancel" class="btn btn-secondary">Cancel</button>
|
||||
<button wicket:id="save" type="submit" class="btn btn-primary dirty-aware mr-1"><wicket:t>Save</wicket:t></button>
|
||||
<button wicket:id="testingExecutor" type="submit" class="btn btn-light-primary mr-1"><wicket:t>Test</wicket:t></button>
|
||||
<button wicket:id="cancel" class="btn btn-secondary"><wicket:t>Cancel</wicket:t></button>
|
||||
</form>
|
||||
</wicket:panel>
|
||||
@ -26,6 +26,9 @@ import org.apache.wicket.util.visit.IVisit;
|
||||
import org.apache.wicket.util.visit.IVisitor;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
@ -94,11 +97,11 @@ abstract class JobExecutorEditPanel extends Panel {
|
||||
JobExecutor oldExecutor = executors.get(executorIndex);
|
||||
if (!executor.getName().equals(oldExecutor.getName()) && getExecutor(executor.getName()) != null) {
|
||||
editor.error(new Path(new PathNode.Named("executor"), new PathNode.Named("name")),
|
||||
"This name has already been used by another job executor");
|
||||
_T("This name has already been used by another job executor"));
|
||||
}
|
||||
} else if (getExecutor(executor.getName()) != null) {
|
||||
editor.error(new Path(new PathNode.Named("executor"), new PathNode.Named("name")),
|
||||
"This name has already been used by another job executor");
|
||||
_T("This name has already been used by another job executor"));
|
||||
}
|
||||
|
||||
if (editor.isValid()) {
|
||||
@ -202,7 +205,7 @@ abstract class JobExecutorEditPanel extends Panel {
|
||||
@Override
|
||||
protected TaskResult runTask(TaskLogger logger) {
|
||||
((Testable)bean.getExecutor()).test(testData, logger);
|
||||
return new TaskResult(true, new PlainMessage("Job executor tested successfully"));
|
||||
return new TaskResult(true, new PlainMessage(_T("Job executor tested successfully")));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<a wicket:id="delete" t:data-tippy-content="Delete this executor" class="btn btn-light btn-xs btn-icon btn-hover-danger text-muted mr-4">
|
||||
<wicket:svg href="trash" class="icon"/>
|
||||
</a>
|
||||
<span wicket:id="disabled" class="badge badge-light-warning">Disabled</span>
|
||||
<span wicket:id="disabled" class="badge badge-light-warning"><wicket:t>Disabled</wicket:t></span>
|
||||
</div>
|
||||
<div class="card-toolbar">
|
||||
<span class="switch switch-sm switch-primary mb-n2">
|
||||
|
||||
@ -14,6 +14,8 @@ import org.apache.wicket.markup.html.panel.Panel;
|
||||
import org.apache.wicket.model.LoadableDetachableModel;
|
||||
import org.apache.wicket.model.Model;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
abstract class JobExecutorPanel extends Panel {
|
||||
@ -63,7 +65,7 @@ abstract class JobExecutorPanel extends Panel {
|
||||
@Override
|
||||
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
|
||||
super.updateAjaxAttributes(attributes);
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener("Do you really want to delete this executor?"));
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to delete this executor?")));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<li wicket:id="executors" class="executor mb-5"><div wicket:id="executor"></div></li>
|
||||
</ul>
|
||||
<div wicket:id="noExecutors" class="alert alert-info mb-5">
|
||||
No executors defined. Jobs will use auto-discovered executor with default settings
|
||||
<wicket:t>No executors defined. Jobs will use auto-discovered executor with default settings</wicket:t>
|
||||
</div>
|
||||
<div wicket:id="newExecutor"></div>
|
||||
</div>
|
||||
@ -15,7 +15,7 @@
|
||||
<wicket:fragment wicket:id="editNewFrag">
|
||||
<div class="executor card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">Edit Executor</div>
|
||||
<div class="card-title"><wicket:t>Edit Executor</wicket:t></div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div wicket:id="editor"></div>
|
||||
@ -26,7 +26,7 @@
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="card-title">
|
||||
<a wicket:id="link" class="add-new d-flex align-items-center"><wicket:svg href="plus-circle-o" class="icon mr-2"></wicket:svg> <span>Add Executor</span></a>
|
||||
<a wicket:id="link" class="add-new d-flex align-items-center"><wicket:svg href="plus-circle-o" class="icon mr-2"></wicket:svg> <span><wicket:t>Add Executor</wicket:t></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -18,6 +18,8 @@ import org.apache.wicket.markup.html.panel.Fragment;
|
||||
import org.apache.wicket.model.AbstractReadOnlyModel;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class JobExecutorsPage extends AdministrationPage {
|
||||
@ -137,7 +139,7 @@ public class JobExecutorsPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Job Executors");
|
||||
return new Label(componentId, _T("Job Executors"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,12 +2,12 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<wicket:enclosure child="leadServer">
|
||||
<div class="alert alert-light-warning mb-5">If enabled, scheduled backup will run on lead server which is <span wicket:id="leadServer"></span> currently</div>
|
||||
<div class="alert alert-light-warning mb-5"><wicket:t>If enabled, scheduled backup will run on lead server which is <span wicket:id="leadServer"></span> currently</wicket:t></div>
|
||||
</wicket:enclosure>
|
||||
<form wicket:id="backupSetting" class="leave-confirm">
|
||||
<div wicket:id="editor" class="mb-4"></div>
|
||||
<input type="submit" class="btn btn-primary dirty-aware mr-1" t:value="Save Settings">
|
||||
<a wicket:id="backupNow" class="btn btn-light-primary">Backup Now</a>
|
||||
<a wicket:id="backupNow" class="btn btn-light-primary"><wicket:t>Backup Now</wicket:t></a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -17,6 +17,8 @@ import org.apache.wicket.model.LoadableDetachableModel;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
import org.apache.wicket.request.resource.AbstractResource;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -54,7 +56,7 @@ public class DatabaseBackupPage extends AdministrationPage {
|
||||
protected void onSubmit() {
|
||||
super.onSubmit();
|
||||
OneDev.getInstance(SettingManager.class).saveBackupSetting(backupSettingHolder.getBackupSetting());
|
||||
getSession().success("Backup settings updated");
|
||||
getSession().success(_T("Backup settings updated"));
|
||||
|
||||
setResponsePage(DatabaseBackupPage.class);
|
||||
}
|
||||
@ -95,7 +97,7 @@ public class DatabaseBackupPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Database Backup");
|
||||
return new Label(componentId, _T("Database Backup"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
@ -21,13 +23,13 @@ public abstract class AbstractNotificationTemplatePage extends AbstractTemplateP
|
||||
@Override
|
||||
protected String getTemplateHelp(String helpText, Map<String, String> variableHelp) {
|
||||
var currentVaribaleHelp = CollectionUtils.newLinkedHashMap(
|
||||
"event", "<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/event/Event.java' target='_blank'>event object</a> triggering the notification",
|
||||
"eventSummary", "a string representing summary of the event",
|
||||
"eventBody", "a string representing body of the event. May be <code>null</code>",
|
||||
"eventUrl", "a string representing event detail url",
|
||||
"replyable", "a boolean indiciating whether or not topic comment can be created directly by replying the email",
|
||||
"unsubscribable", "an <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/notification/Unsubscribable.java' target='_blank'>object</a> holding unsubscribe information. "
|
||||
+ " A <code>null</code> value means that the notification can not be unsubscribed"
|
||||
"event", _T("<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/event/Event.java' target='_blank'>event object</a> triggering the notification"),
|
||||
"eventSummary", _T("a string representing summary of the event"),
|
||||
"eventBody", _T("a string representing body of the event. May be <code>null</code>"),
|
||||
"eventUrl", _T("a string representing event detail url"),
|
||||
"replyable", _T("a boolean indiciating whether or not topic comment can be created directly by replying the email"),
|
||||
"unsubscribable", _T("an <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/notification/Unsubscribable.java' target='_blank'>object</a> holding unsubscribe information. "
|
||||
+ " A <code>null</code> value means that the notification can not be unsubscribed")
|
||||
);
|
||||
currentVaribaleHelp.putAll(variableHelp);
|
||||
|
||||
|
||||
@ -4,6 +4,8 @@ import io.onedev.server.model.support.administration.emailtemplates.EmailTemplat
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class AbstractSimpleNotificationTemplatePage extends AbstractTemplatePage {
|
||||
@ -20,10 +22,10 @@ public abstract class AbstractSimpleNotificationTemplatePage extends AbstractTem
|
||||
@Override
|
||||
protected String getTemplateHelp(String helpText, Map<String, String> variableHelp) {
|
||||
var currentVaribaleHelp = CollectionUtils.newLinkedHashMap(
|
||||
"event", "<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/event/Event.java' target='_blank'>event object</a> triggering the notification",
|
||||
"eventSummary", "a string representing summary of the event",
|
||||
"eventBody", "a string representing body of the event. May be <code>null</code>",
|
||||
"eventUrl", "a string representing event detail url"
|
||||
"event", _T("<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/event/Event.java' target='_blank'>event object</a> triggering the notification"),
|
||||
"eventSummary", _T("a string representing summary of the event"),
|
||||
"eventBody", _T("a string representing body of the event. May be <code>null</code>"),
|
||||
"eventUrl", _T("a string representing event detail url")
|
||||
);
|
||||
currentVaribaleHelp.putAll(variableHelp);
|
||||
|
||||
|
||||
@ -18,12 +18,14 @@ import org.apache.wicket.markup.html.form.Button;
|
||||
import org.apache.wicket.markup.html.form.Form;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class AbstractTemplatePage extends AdministrationPage {
|
||||
|
||||
protected final String GROOVY_TEMPLATE_LINK = "<a href='https://docs.groovy-lang.org/latest/html/api/groovy/text/SimpleTemplateEngine.html' target='_blank'>Groovy simple template</a>";
|
||||
protected static final String GROOVY_TEMPLATE_LINK = "<a href='https://docs.groovy-lang.org/latest/html/api/groovy/text/SimpleTemplateEngine.html' target='_blank'>Groovy simple template</a>";
|
||||
|
||||
public AbstractTemplatePage(PageParameters params) {
|
||||
super(params);
|
||||
@ -50,7 +52,7 @@ public abstract class AbstractTemplatePage extends AdministrationPage {
|
||||
super.onSubmit();
|
||||
|
||||
getSettingManager().saveEmailTemplates(templates);
|
||||
getSession().success("Template saved");
|
||||
getSession().success(_T("Template saved"));
|
||||
}
|
||||
|
||||
};
|
||||
@ -61,7 +63,7 @@ public abstract class AbstractTemplatePage extends AdministrationPage {
|
||||
@Override
|
||||
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
|
||||
super.updateAjaxAttributes(attributes);
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener("Do you really want to use default template?"));
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to use default template?")));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -107,10 +109,10 @@ public abstract class AbstractTemplatePage extends AdministrationPage {
|
||||
StringBuilder builder = new StringBuilder(helpText);
|
||||
if (!builder.toString().endsWith("."))
|
||||
builder.append(".");
|
||||
builder.append(" When evaluating this template, below variables will be available:<ul class='mb-0'>");
|
||||
builder.append(" " + _T("When evaluating this template, below variables will be available:") + "<ul class='mb-0'>");
|
||||
|
||||
var currentVariableHelp = new LinkedHashMap<String, String>();
|
||||
currentVariableHelp.put("htmlVersion", "true for html version, false for text version");
|
||||
currentVariableHelp.put("htmlVersion", _T("true for html version, false for text version"));
|
||||
currentVariableHelp.putAll(variableHelp);
|
||||
|
||||
for (Map.Entry<String, String> entry: currentVariableHelp.entrySet())
|
||||
|
||||
@ -5,9 +5,11 @@ import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.*;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
public class AlertTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@ -27,19 +29,19 @@ public class AlertTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of system alert email";
|
||||
return MessageFormat.format(_T("A {0} used as body of system alert email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap(
|
||||
"alert", "<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Alert.java'>alert</a> to display",
|
||||
"serverUrl", "root url of OneDev server");
|
||||
"alert", _T("<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Alert.java'>alert</a> to display"),
|
||||
"serverUrl", _T("root url of OneDev server"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "System Alert Template");
|
||||
return new Label(componentId, _T("System Alert Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,16 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_BUILD_NOTIFICATION;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_BUILD_NOTIFICATION;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class BuildNotificationTemplatePage extends AbstractSimpleNotificationTemplatePage {
|
||||
|
||||
@ -22,18 +25,18 @@ public class BuildNotificationTemplatePage extends AbstractSimpleNotificationTem
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of build notification email";
|
||||
return MessageFormat.format(_T("A {0} used as body of build notification email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("build",
|
||||
"represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Build.java' target='_blank'>build</a> object to be notified");
|
||||
_T("represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Build.java' target='_blank'>build</a> object to be notified"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Build Notification Template");
|
||||
return new Label(componentId, _T("Build Notification Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,16 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_COMMIT_NOTIFICATION;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_COMMIT_NOTIFICATION;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class CommitNotificationTemplatePage extends AbstractSimpleNotificationTemplatePage {
|
||||
|
||||
@ -22,18 +25,18 @@ public class CommitNotificationTemplatePage extends AbstractSimpleNotificationTe
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of commit notification email";
|
||||
return MessageFormat.format(_T("A {0} used as body of commit notification email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("commit",
|
||||
"represents the <a href='https://javadoc.io/static/org.eclipse.jgit/org.eclipse.jgit/5.13.0.202109080827-r/org/eclipse/jgit/revwalk/RevCommit.html' target='_blank'>commit</a> object to be notified");
|
||||
_T("represents the <a href='https://javadoc.io/static/org.eclipse.jgit/org.eclipse.jgit/5.13.0.202109080827-r/org/eclipse/jgit/revwalk/RevCommit.html' target='_blank'>commit</a> object to be notified"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Commit Notification Template");
|
||||
return new Label(componentId, _T("Commit Notification Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,17 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_EMAIL_VERIFICATION;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_EMAIL_VERIFICATION;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.*;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class EmailVerificationTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@ -27,21 +31,21 @@ public class EmailVerificationTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of address verification email";
|
||||
return MessageFormat.format(_T("A {0} used as body of address verification email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap(
|
||||
"user", "<a href=\"https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/User.java\">user</a> to verify email for",
|
||||
"emailAddress", "Email address to verify",
|
||||
"serverUrl", "root url of OneDev server",
|
||||
"verificationUrl", "url following which to verify email address");
|
||||
"user", _T("<a href=\"https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/User.java\">user</a> to verify email for"),
|
||||
"emailAddress", _T("Email address to verify"),
|
||||
"serverUrl", _T("root url of OneDev server"),
|
||||
"verificationUrl", _T("url following which to verify email address"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Email Verification Template");
|
||||
return new Label(componentId, _T("Email Verification Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,16 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_ISSUE_NOTIFICATION;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_ISSUE_NOTIFICATION;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class IssueNotificationTemplatePage extends AbstractNotificationTemplatePage {
|
||||
|
||||
@ -22,18 +25,18 @@ public class IssueNotificationTemplatePage extends AbstractNotificationTemplateP
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of various issue notification emails";
|
||||
return MessageFormat.format(_T("A {0} used as body of various issue notification emails"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("issue",
|
||||
"represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Issue.java' target='_blank'>issue</a> object to be notified");
|
||||
_T("represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Issue.java' target='_blank'>issue</a> object to be notified"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Issue Notification Template");
|
||||
return new Label(componentId, _T("Issue Notification Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,7 +2,9 @@ package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_ISSUE_NOTIFICATION_UNSUBSCRIBED;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_ISSUE_NOTIFICATION_UNSUBSCRIBED;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
@ -29,19 +31,18 @@ public class IssueNotificationUnsubscribedTemplatePage extends AbstractTemplateP
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of feedback email when unsubscribed " +
|
||||
"from issue notification";
|
||||
return MessageFormat.format(_T("A {0} used as body of feedback email when unsubscribed from issue notification"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("issue",
|
||||
"represents the unsubscribed <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Issue.java' target='_blank'>issue</a>");
|
||||
_T("represents the unsubscribed <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Issue.java' target='_blank'>issue</a>"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Issue Notification Unsubscribed Template");
|
||||
return new Label(componentId, _T("Issue Notification Unsubscribed Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,16 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_PACK_NOTIFICATION;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_PACK_NOTIFICATION;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class PackNotificationTemplatePage extends AbstractSimpleNotificationTemplatePage {
|
||||
|
||||
@ -22,18 +25,18 @@ public class PackNotificationTemplatePage extends AbstractSimpleNotificationTemp
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of package notification email";
|
||||
return MessageFormat.format(_T("A {0} used as body of package notification email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("pack",
|
||||
"represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Pack.java' target='_blank'>package</a> object to be notified");
|
||||
_T("represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Pack.java' target='_blank'>package</a> object to be notified"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Package Notification Template");
|
||||
return new Label(componentId, _T("Package Notification Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,17 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_PASSWORD_RESET;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_PASSWORD_RESET;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.*;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class PasswordResetTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@ -27,19 +31,19 @@ public class PasswordResetTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of password reset email";
|
||||
return MessageFormat.format(_T("A {0} used as body of password reset email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap(
|
||||
"user", "<a href=\"https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/User.java\">user</a> to reset password for",
|
||||
"passwordResetUrl", "url to reset password");
|
||||
"user", _T("<a href=\"https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/User.java\">user</a> to reset password for"),
|
||||
"passwordResetUrl", _T("url to reset password"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Password Reset Template");
|
||||
return new Label(componentId, _T("Password Reset Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,16 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_PULL_REQUEST_NOTIFICATION;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_PULL_REQUEST_NOTIFICATION;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class PullRequestNotificationTemplatePage extends AbstractNotificationTemplatePage {
|
||||
|
||||
@ -22,18 +25,18 @@ public class PullRequestNotificationTemplatePage extends AbstractNotificationTem
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of various pull request notification emails";
|
||||
return MessageFormat.format(_T("A {0} used as body of various pull request notification emails"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("pullRequest",
|
||||
"represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/PullRequest.java' target='_blank'>pull request</a> object to be notified");
|
||||
_T("represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/PullRequest.java' target='_blank'>pull request</a> object to be notified"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Pull Request Notification Template");
|
||||
return new Label(componentId, _T("Pull Request Notification Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,7 +2,9 @@ package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_PULL_REQUEST_NOTIFICATION_UNSUBSCRIBED;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_PULL_REQUEST_NOTIFICATION_UNSUBSCRIBED;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
@ -29,19 +31,18 @@ public class PullRequestNotificationUnsubscribedTemplatePage extends AbstractTem
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of feedback email when unsubscribed " +
|
||||
"from pull request notification";
|
||||
return MessageFormat.format(_T("A {0} used as body of feedback email when unsubscribed from pull request notification"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("pullRequest",
|
||||
"represents the unsubscribed <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/PullRequest.java' target='_blank'>pull request</a>");
|
||||
_T("represents the unsubscribed <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/PullRequest.java' target='_blank'>pull request</a>"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Pull Request Notification Unsubscribed Template");
|
||||
return new Label(componentId, _T("Pull Request Notification Unsubscribed Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,7 +2,9 @@ package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_SERVICE_DESK_ISSUE_OPEN_FAILED;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_SERVICE_DESK_ISSUE_OPEN_FAILED;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
@ -29,19 +31,18 @@ public class ServiceDeskIssueOpenFailedTemplatePage extends AbstractTemplatePage
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of feedback email when failed to open issue " +
|
||||
"via service desk";
|
||||
return MessageFormat.format(_T("A {0} used as body of feedback email when failed to open issue via service desk"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("exception",
|
||||
"represents the exception encountered when open issue via service desk");
|
||||
_T("represents the exception encountered when open issue via service desk"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Service Desk Issue Open Failed Template");
|
||||
return new Label(componentId, _T("Service Desk Issue Open Failed Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,7 +2,9 @@ package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_SERVICE_DESK_ISSUE_OPENED;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_SERVICE_DESK_ISSUE_OPENED;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
@ -29,19 +31,18 @@ public class ServiceDeskIssueOpenedTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of feedback email when issue is opened " +
|
||||
"via service desk";
|
||||
return MessageFormat.format(_T("A {0} used as body of feedback email when issue is opened via service desk"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("issue",
|
||||
"represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Issue.java' target='_blank'>issue</a> being opened via service desk");
|
||||
_T("represents the <a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Issue.java' target='_blank'>issue</a> being opened via service desk"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Service Desk Issue Opened Template");
|
||||
return new Label(componentId, _T("Service Desk Issue Opened Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,17 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_STOPWATCH_OVERDUE;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_STOPWATCH_OVERDUE;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.*;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class StopwatchOverdueTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@ -27,18 +31,18 @@ public class StopwatchOverdueTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of issue stopwatch overdue notification email";
|
||||
return MessageFormat.format(_T("A {0} used as body of issue stopwatch overdue notification email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap(
|
||||
"stopwatch", "<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Stopwatch.java'>Stopwatch</a> overdue");
|
||||
"stopwatch", _T("<a href='https://code.onedev.io/onedev/server/~files/main/server-core/src/main/java/io/onedev/server/model/Stopwatch.java'>Stopwatch</a> overdue"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Issue Stopwatch Overdue Notification Template");
|
||||
return new Label(componentId, _T("Issue Stopwatch Overdue Notification Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,17 @@
|
||||
package io.onedev.server.web.page.admin.emailtemplates;
|
||||
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.DEFAULT_USER_INVITATION;
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.PROP_USER_INVITATION;
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.markup.html.basic.Label;
|
||||
import org.apache.wicket.request.mapper.parameter.PageParameters;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static io.onedev.server.model.support.administration.emailtemplates.EmailTemplates.*;
|
||||
import io.onedev.server.util.CollectionUtils;
|
||||
|
||||
public class UserInvitationTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@ -27,17 +31,17 @@ public class UserInvitationTemplatePage extends AbstractTemplatePage {
|
||||
|
||||
@Override
|
||||
protected String getHelpText() {
|
||||
return "A " + GROOVY_TEMPLATE_LINK + " used as body of user invitation email";
|
||||
return MessageFormat.format(_T("A {0} used as body of user invitation email"), GROOVY_TEMPLATE_LINK);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getVariableHelp() {
|
||||
return CollectionUtils.newLinkedHashMap("setupAccountUrl", "the url to set up user account");
|
||||
return CollectionUtils.newLinkedHashMap("setupAccountUrl", _T("the url to set up user account"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "User Invitation Template");
|
||||
return new Label(componentId, _T("User Invitation Template"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,26 +2,27 @@
|
||||
<div class="card gpg-signing-key">
|
||||
<div class="card-body">
|
||||
<div class="alert alert-light alert-notice mb-4">
|
||||
GPG signing key will be used to sign commits generated by OneDev, including
|
||||
<wicket:t>GPG signing key will be used to sign commits generated by OneDev, including
|
||||
pull request merge commits, user commits created via web UI or RESTful api.
|
||||
</wicket:t>
|
||||
</div>
|
||||
<div wicket:id="content"></div>
|
||||
</div>
|
||||
</div>
|
||||
<wicket:fragment wicket:id="undefinedFrag">
|
||||
<a wicket:id="generate" class="btn btn-primary">Generate</a>
|
||||
<a wicket:id="generate" class="btn btn-primary"><wicket:t>Generate</wicket:t></a>
|
||||
</wicket:fragment>
|
||||
<wicket:fragment wicket:id="definedFrag">
|
||||
<dl>
|
||||
<dt>Email Address</dt>
|
||||
<dt><wicket:t>Email Address</wicket:t></dt>
|
||||
<dd wicket:id="emailAddress"></dd>
|
||||
<dt>Key ID</dt>
|
||||
<dt><wicket:t>Key ID</wicket:t></dt>
|
||||
<dd wicket:id="keyID"></dd>
|
||||
<dt class="mb-2">Public Key <a wicket:id="copyPublicKey" t:data-tippy-content="Copy public key"><wicket:svg href="copy" class="icon"/></a></dt>
|
||||
<dt class="mb-2"><wicket:t>Public Key</wicket:t> <a wicket:id="copyPublicKey" t:data-tippy-content="Copy public key"><wicket:svg href="copy" class="icon"/></a></dt>
|
||||
<dd>
|
||||
<pre wicket:id="publicKey" class="font-size-sm bg-light p-3 rounded"></pre>
|
||||
</dd>
|
||||
</dl>
|
||||
<a wicket:id="delete" class="btn btn-light-danger">Delete</a>
|
||||
<a wicket:id="delete" class="btn btn-light-danger"><wicket:t>Delete</wicket:t></a>
|
||||
</wicket:fragment>
|
||||
</wicket:extend>
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.gpgsigningkey;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
@ -69,8 +71,8 @@ public class GpgSigningKeyPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected String getConfirmMessage() {
|
||||
return "Commits generated by OneDev previously will be shown as unverified if this key is deleted. "
|
||||
+ "Type <code>yes</code> below if you want to continue.";
|
||||
return _T("Commits generated by OneDev previously will be shown as unverified if this key is deleted. "
|
||||
+ "Type <code>yes</code> below if you want to continue.");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -119,7 +121,7 @@ public class GpgSigningKeyPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "GPG Signing Key");
|
||||
return new Label(componentId, _T("GPG Signing Key"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="card gpg-trusted-keys">
|
||||
<div class="card-body">
|
||||
<div class="alert alert-light alert-notice mb-4">
|
||||
Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.
|
||||
<wicket:t>Add GPG public keys to be trusted here. Commits signed with trusted keys will be shown as verified.</wicket:t>
|
||||
</div>
|
||||
<a wicket:id="newKey" class="btn btn-primary btn-icon mb-4" t:data-tippy-content="Add GPG key"><wicket:svg href="plus" class="icon"></wicket:svg></a>
|
||||
<table wicket:id="keys" class="table table-hover"></table>
|
||||
@ -14,7 +14,7 @@
|
||||
<wicket:fragment wicket:id="addKeyFrag">
|
||||
<div class="add-gpg-trusted-key">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Add a GPG Public Key</h5>
|
||||
<h5 class="modal-title"><wicket:t>Add a GPG Public Key</wicket:t></h5>
|
||||
<button wicket:id="close" type="button" class="close"><wicket:svg href="times" class="icon"/></button>
|
||||
</div>
|
||||
<form wicket:id="form">
|
||||
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<input wicket:id="add" type="submit" class="btn btn-primary dirty-aware" t:value="Add">
|
||||
<button wicket:id="cancel" type="button" class="btn btn-secondary">Cancel</button>
|
||||
<button wicket:id="cancel" type="button" class="btn btn-secondary"><wicket:t>Cancel</wicket:t></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.gpgtrustedkeys;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -89,7 +91,7 @@ public class GpgTrustedKeysPage extends AdministrationPage {
|
||||
if (bean.getKeyIds().stream().anyMatch(it-> setting.getTrustedSignatureVerificationKey(it) != null)) {
|
||||
editor.error(
|
||||
new Path(new PathNode.Named(BaseGpgKey.PROP_CONTENT)),
|
||||
"This key or one of its sub key is already added");
|
||||
_T("This key or one of its sub key is already added"));
|
||||
target.add(form);
|
||||
} else {
|
||||
setting.getEncodedTrustedKeys().put(bean.getKeyIds().get(0), bean.getContent());
|
||||
@ -126,7 +128,7 @@ public class GpgTrustedKeysPage extends AdministrationPage {
|
||||
|
||||
List<IColumn<Long, Void>> columns = new ArrayList<>();
|
||||
|
||||
columns.add(new AbstractColumn<Long, Void>(Model.of("Key ID")) {
|
||||
columns.add(new AbstractColumn<Long, Void>(Model.of(_T("Key ID"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<Long>> cellItem, String componentId,
|
||||
@ -137,7 +139,7 @@ public class GpgTrustedKeysPage extends AdministrationPage {
|
||||
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<Long, Void>(Model.of("Email Addresses")) {
|
||||
columns.add(new AbstractColumn<Long, Void>(Model.of(_T("Email Addresses"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<Long>> cellItem, String componentId,
|
||||
@ -149,7 +151,7 @@ public class GpgTrustedKeysPage extends AdministrationPage {
|
||||
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<Long, Void>(Model.of("Sub Keys")) {
|
||||
columns.add(new AbstractColumn<Long, Void>(Model.of(_T("Sub Keys"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<Long>> cellItem, String componentId,
|
||||
@ -164,7 +166,7 @@ public class GpgTrustedKeysPage extends AdministrationPage {
|
||||
if (subKeyIds.length() != 0)
|
||||
cellItem.add(new MultilineLabel(componentId, subKeyIds));
|
||||
else
|
||||
cellItem.add(new Label(componentId, "<i>None</i>").setEscapeModelStrings(false));
|
||||
cellItem.add(new Label(componentId, "<i>" + _T("None") + "</i>").setEscapeModelStrings(false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -189,14 +191,14 @@ public class GpgTrustedKeysPage extends AdministrationPage {
|
||||
setting.getEncodedTrustedKeys().remove(rowModel.getObject());
|
||||
setting.encodedTrustedKeysUpdated();
|
||||
getSettingManager().saveGpgSetting(setting);
|
||||
Session.get().success("GPG key deleted");
|
||||
Session.get().success(_T("GPG key deleted"));
|
||||
target.add(trustedKeysTable);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
|
||||
super.updateAjaxAttributes(attributes);
|
||||
String message = "Do you really want to delete this GPG key?";
|
||||
String message = _T("Do you really want to delete this GPG key?");
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener(message));
|
||||
}
|
||||
|
||||
@ -250,7 +252,7 @@ public class GpgTrustedKeysPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "GPG Trusted Keys");
|
||||
return new Label(componentId, _T("GPG Trusted Keys"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<wicket:panel>
|
||||
<form wicket:id="form" class="groovy-script-edit leave-confirm">
|
||||
<div class="modal-header">
|
||||
<h5 id="modal-title" class="modal-title">Groovy Script</h5>
|
||||
<h5 id="modal-title" class="modal-title"><wicket:t>Groovy Script</wicket:t></h5>
|
||||
<button wicket:id="close" type="button" class="close"><wicket:svg href="times" class="icon"/></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -9,7 +9,7 @@
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<input wicket:id="save" type="submit" class="dirty-aware btn btn-primary" t:value="Save">
|
||||
<a wicket:id="cancel" class="btn btn-secondary">Cancel</a>
|
||||
<a wicket:id="cancel" class="btn btn-secondary"><wicket:t>Cancel</wicket:t></a>
|
||||
</div>
|
||||
</form>
|
||||
</wicket:panel>
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.groovyscript;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -79,11 +81,11 @@ abstract class GroovyScriptEditPanel extends Panel {
|
||||
GroovyScript oldScript = getScripts().get(scriptIndex);
|
||||
if (!script.getName().equals(oldScript.getName()) && getScript(script.getName()) != null) {
|
||||
editor.error(new Path(new PathNode.Named("name")),
|
||||
"This name has already been used by another script");
|
||||
_T("This name has already been used by another script"));
|
||||
}
|
||||
} else if (getScript(script.getName()) != null) {
|
||||
editor.error(new Path(new PathNode.Named("name")),
|
||||
"This name has already been used by another script");
|
||||
_T("This name has already been used by another script"));
|
||||
}
|
||||
|
||||
if (editor.isValid()) {
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.groovyscript;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -105,21 +107,21 @@ public class GroovyScriptListPage extends AdministrationPage {
|
||||
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<>(Model.of("Name")) {
|
||||
columns.add(new AbstractColumn<>(Model.of(_T("Name"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<GroovyScript>> cellItem, String componentId, IModel<GroovyScript> rowModel) {
|
||||
cellItem.add(new Label(componentId, rowModel.getObject().getName()));
|
||||
}
|
||||
});
|
||||
columns.add(new AbstractColumn<>(Model.of("Can Be Used By Jobs")) {
|
||||
columns.add(new AbstractColumn<>(Model.of(_T("Can Be Used By Jobs"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<GroovyScript>> cellItem, String componentId, IModel<GroovyScript> rowModel) {
|
||||
cellItem.add(new Label(componentId, TextUtils.getDisplayValue(rowModel.getObject().isCanBeUsedByBuildJobs())));
|
||||
cellItem.add(new Label(componentId, _T(TextUtils.getDisplayValue(rowModel.getObject().isCanBeUsedByBuildJobs()))));
|
||||
}
|
||||
});
|
||||
columns.add(new AbstractColumn<>(Model.of("Job Authorization")) {
|
||||
columns.add(new AbstractColumn<>(Model.of(_T("Job Authorization"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<GroovyScript>> cellItem, String componentId, IModel<GroovyScript> rowModel) {
|
||||
@ -128,9 +130,9 @@ public class GroovyScriptListPage extends AdministrationPage {
|
||||
if (script.getAuthorization() != null)
|
||||
cellItem.add(new Label(componentId, script.getAuthorization()));
|
||||
else
|
||||
cellItem.add(new Label(componentId, "<i>Any job</i>").setEscapeModelStrings(false));
|
||||
cellItem.add(new Label(componentId, "<i>" + _T("Any job") + "</i>").setEscapeModelStrings(false));
|
||||
} else {
|
||||
cellItem.add(new Label(componentId, "<i>N/A</i>").setEscapeModelStrings(false));
|
||||
cellItem.add(new Label(componentId, "<i>" + _T("N/A") + "</i>").setEscapeModelStrings(false));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -173,7 +175,7 @@ public class GroovyScriptListPage extends AdministrationPage {
|
||||
@Override
|
||||
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
|
||||
super.updateAjaxAttributes(attributes);
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener("Do you really want to delete this script?"));
|
||||
attributes.getAjaxCallListeners().add(new ConfirmClickListener(_T("Do you really want to delete this script?")));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -224,7 +226,7 @@ public class GroovyScriptListPage extends AdministrationPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "Groovy Scripts");
|
||||
return new Label(componentId, _T("Groovy Scripts"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<wicket:extend>
|
||||
<div class="text-muted mb-4">
|
||||
<wicket:svg href="bulb" class="icon"/>Commit message can be used to fix issues
|
||||
<wicket:svg href="bulb" class="icon"/> <wicket:t>Commit message can be used to fix issues
|
||||
by prefixing and suffixing issue number with specified pattern. Each line of
|
||||
the commit message will be matched against each entry defined here to find
|
||||
issues to be fixed
|
||||
issues to be fixed</wicket:t>
|
||||
</div>
|
||||
<form wicket:id="form">
|
||||
<div wicket:id="feedback"></div>
|
||||
|
||||
@ -5,6 +5,9 @@ import io.onedev.server.entitymanager.SettingManager;
|
||||
import io.onedev.server.model.support.issue.CommitMessageFixPatterns;
|
||||
import io.onedev.server.web.editable.BeanContext;
|
||||
import io.onedev.server.web.page.admin.issuesetting.IssueSettingPage;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.Session;
|
||||
import org.apache.wicket.feedback.FencedFeedbackPanel;
|
||||
@ -29,7 +32,7 @@ public class CommitMessageFixPatternsPage extends IssueSettingPage {
|
||||
super.onSubmit();
|
||||
getSetting().setCommitMessageFixPatterns(patterns);
|
||||
getSettingManager().saveIssueSetting(getSetting());
|
||||
Session.get().success("Setting updated");
|
||||
Session.get().success(_T("Settings updated"));
|
||||
}
|
||||
};
|
||||
form.add(new FencedFeedbackPanel("feedback", form));
|
||||
@ -43,7 +46,7 @@ public class CommitMessageFixPatternsPage extends IssueSettingPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "<span class='text-truncate'>Commit Message Fix Patterns</span>").setEscapeModelStrings(false);
|
||||
return new Label(componentId, "<span class='text-truncate'>" + _T("Commit Message Fix Patterns") + "</span>").setEscapeModelStrings(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class DefaultBoardListPage extends IssueSettingPage {
|
||||
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<BoardSpec, Void>(Model.of("Name")) {
|
||||
columns.add(new AbstractColumn<BoardSpec, Void>(Model.of(_T("Name"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<BoardSpec>> cellItem, String componentId, IModel<BoardSpec> rowModel) {
|
||||
@ -104,7 +104,7 @@ public class DefaultBoardListPage extends IssueSettingPage {
|
||||
}
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<BoardSpec, Void>(Model.of("Columns")) {
|
||||
columns.add(new AbstractColumn<BoardSpec, Void>(Model.of(_T("Columns"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<BoardSpec>> cellItem, String componentId, IModel<BoardSpec> rowModel) {
|
||||
@ -114,7 +114,7 @@ public class DefaultBoardListPage extends IssueSettingPage {
|
||||
|
||||
});
|
||||
|
||||
columns.add(new AbstractColumn<BoardSpec, Void>(Model.of("Identify Field")) {
|
||||
columns.add(new AbstractColumn<BoardSpec, Void>(Model.of(_T("Identify Field"))) {
|
||||
|
||||
@Override
|
||||
public void populateItem(Item<ICellPopulator<BoardSpec>> cellItem, String componentId, IModel<BoardSpec> rowModel) {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<wicket:extend>
|
||||
<div class="text-muted mb-4">
|
||||
<wicket:svg href="bulb" class="icon"/>
|
||||
In case you are using external issue tracker, you can define transformers
|
||||
<wicket:t>In case you are using external issue tracker, you can define transformers
|
||||
to transform external issue references into external issue links in various
|
||||
places, such as commit messages and pull request descriptions
|
||||
places, such as commit messages and pull request descriptions</wicket:t>
|
||||
</div>
|
||||
<form wicket:id="form">
|
||||
<div wicket:id="feedback"></div>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package io.onedev.server.web.page.admin.issuesetting.externalissuepattern;
|
||||
|
||||
import static io.onedev.server.web.translation.Translation._T;
|
||||
|
||||
import org.apache.wicket.Component;
|
||||
import org.apache.wicket.Session;
|
||||
import org.apache.wicket.feedback.FencedFeedbackPanel;
|
||||
@ -32,7 +34,7 @@ public class ExternalIssueTransformersPage extends IssueSettingPage {
|
||||
super.onSubmit();
|
||||
getSetting().setExternalIssueTransformers(transformers);
|
||||
getSettingManager().saveIssueSetting(getSetting());
|
||||
Session.get().success("Setting updated");
|
||||
Session.get().success(_T("Settings updated"));
|
||||
}
|
||||
};
|
||||
form.add(new FencedFeedbackPanel("feedback", form));
|
||||
@ -46,7 +48,7 @@ public class ExternalIssueTransformersPage extends IssueSettingPage {
|
||||
|
||||
@Override
|
||||
protected Component newTopbarTitle(String componentId) {
|
||||
return new Label(componentId, "External Issue Transformers");
|
||||
return new Label(componentId, _T("External Issue Transformers"));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
<wicket:extend>
|
||||
<div class="alert alert-notice alert-light">
|
||||
In rare cases, your issues might be out of sync with workflow settings (undefined state/field etc.).
|
||||
Run integrity check below to find problems and get them fixed.
|
||||
<wicket:t>In rare cases, your issues might be out of sync with workflow settings (undefined state/field etc.).
|
||||
Run integrity check below to find problems and get them fixed.</wicket:t>
|
||||
</div>
|
||||
<a wicket:id="run" class="btn btn-primary mt-2">Run Integrity Check</a>
|
||||
<a wicket:id="run" class="btn btn-primary mt-2"><wicket:t>Run Integrity Check</wicket:t></a>
|
||||
</wicket:extend>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user