Skip to content

Commit

Permalink
Update Manage Jenkins icons (#6273)
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik authored Feb 15, 2022
1 parent 595547e commit 958db3c
Show file tree
Hide file tree
Showing 81 changed files with 241 additions and 374 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/AboutJenkins.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class AboutJenkins extends ManagementLink {
@Override
public String getIconFileName() {
return "symbol-help-circle";
return "symbol-jenkins";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/diagnosis/OldDataMonitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public Category getCategory() {

@Override
public String getIconFileName() {
return "document.svg";
return "symbol-cube";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private WindowsInstallerLink(File jenkinsWar) {

@Override
public String getIconFileName() {
return "installer.svg";
return "symbol-windows";
}

@Override
Expand Down
12 changes: 6 additions & 6 deletions core/src/main/java/hudson/model/Computer.java
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,10 @@ public void setTemporarilyOffline(boolean temporarilyOffline, OfflineCause cause
@Exported
public String getIcon() {
// The machine was taken offline by someone
if (isTemporarilyOffline() && getOfflineCause() instanceof OfflineCause.UserCause) return "computer-user-offline.svg";
if (isTemporarilyOffline() && getOfflineCause() instanceof OfflineCause.UserCause) return "symbol-computer-disconnected";
// There is a "technical" reason the computer will not accept new builds
if (isOffline() || !isAcceptingTasks()) return "computer-x.svg";
return "computer.svg";
if (isOffline() || !isAcceptingTasks()) return "symbol-computer-offline";
return "symbol-computer";
}

/**
Expand All @@ -747,10 +747,10 @@ public String getIcon() {
@Exported
public String getIconClassName() {
// The machine was taken offline by someone
if (isTemporarilyOffline() && getOfflineCause() instanceof OfflineCause.UserCause) return "icon-computer-user-offline";
if (isTemporarilyOffline() && getOfflineCause() instanceof OfflineCause.UserCause) return "symbol-computer-disconnected";
// There is a "technical" reason the computer will not accept new builds
if (isOffline() || !isAcceptingTasks()) return "icon-computer-x";
return "icon-computer";
if (isOffline() || !isAcceptingTasks()) return "symbol-computer-offline";
return "symbol-computer";
}

public String getIconAltText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public String getDescription() {

@Override
public String getIconFileName() {
return "secure.svg";
return "symbol-lock-closed";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ public static final class ManageUserLinks extends ManagementLink {
@Override
public String getIconFileName() {
if (Jenkins.get().getSecurityRealm() instanceof HudsonPrivateSecurityRealm)
return "user.svg";
return "symbol-people";
else
return null; // not applicable now
}
Expand Down
5 changes: 1 addition & 4 deletions core/src/main/java/hudson/tasks/UserAvatarResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
import hudson.Extension;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.Functions;
import hudson.model.User;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import jenkins.model.Jenkins;

/**
* Infers avatar image URLs for users
Expand Down Expand Up @@ -87,8 +85,7 @@ public abstract class UserAvatarResolver implements ExtensionPoint {
*/
public static String resolve(User u, String avatarSize) {
String avatar = resolveOrNull(u, avatarSize);
return avatar != null ? avatar : Jenkins.get().getRootUrl() + Functions.getResourcePath() +
"/images/svgs/person.svg";
return avatar != null ? avatar : "symbol-person-circle";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/CliLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class CliLink extends ManagementLink {

@Override
public String getIconFileName() {
return "terminal.svg";
return "symbol-terminal";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/ConsoleLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ConsoleLink extends ManagementLink {

@Override
public String getIconFileName() {
return "notepad.svg";
return "symbol-code-working";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/NodesLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class NodesLink extends ManagementLink {

@Override
public String getIconFileName() {
return "network.svg";
return "symbol-cloud";
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/jenkins/management/PluginsLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public Category getCategory() {
}

@Restricted(NoExternalUse.class)
public boolean hasUpdates() {
public int getUpdateCount() {
final UpdateCenter updateCenter = Jenkins.get().getUpdateCenter();
if (!updateCenter.isSiteDataReady()) {
// Do not display message during this page load, but possibly later.
return false;
return 0;
}
return !updateCenter.getUpdates().isEmpty();
return updateCenter.getUpdates().size();
}
}
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/ReloadLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ReloadLink extends ManagementLink {

@Override
public String getIconFileName() {
return "refresh.svg";
return "symbol-reload";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/ShutdownLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class ShutdownLink extends ManagementLink {

@Override
public String getIconFileName() {
return "system-log-out.svg";
return "symbol-power";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/StatisticsLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class StatisticsLink extends ManagementLink {

@Override
public String getIconFileName() {
return "monitor.svg";
return "symbol-analytics";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/SystemInfoLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SystemInfoLink extends ManagementLink {

@Override
public String getIconFileName() {
return "computer.svg";
return "symbol-server";
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/management/SystemLogLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class SystemLogLink extends ManagementLink {

@Override
public String getIconFileName() {
return "clipboard.svg";
return "symbol-file-tray";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class GlobalToolConfiguration extends ManagementLink {

@Override
public String getIconFileName() {
return "setting.svg";
return "symbol-hammer";
}

@Override
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/jenkins/ui/icon/IconSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ public static String tryTranslateTangoIconToSymbol(String tangoIcon) {
translations.put("icon-gear", "symbol-settings");
translations.put("icon-gear2", "symbol-settings");
translations.put("icon-plugin", "symbol-plugins");
translations.put("icon-up", "symbol-arrow-up");

return translations.getOrDefault(tangoIcon, null);
}
Expand Down
4 changes: 3 additions & 1 deletion core/src/main/resources/hudson/model/Computer/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ THE SOFTWARE.
</div>

<h1>
<l:icon class="${it.iconClassName} icon-xlg" />
<span class="icon-lg">
<l:icon src="${it.iconClassName}" />
</span>
${it.caption}
<j:if test="${!empty(it.node.nodeDescription)}">
<span style="font-size:smaller">(${it.node.nodeDescription})</span>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/hudson/model/ComputerSet/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ THE SOFTWARE.

<j:forEach var="c" items="${it._all}">
<tr id="node_${c.name}">
<td data="${c.icon}" class="jenkins-table__cell--tight">
<td data="${c.icon}" class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<l:icon class="${c.iconClassName} icon-lg" alt="${c.iconAltText}"/>
<l:icon src="${c.iconClassName}" alt="${c.iconAltText}"/>
</div>
</td>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ THE SOFTWARE.
<l:tasks>
<l:task href="${rootURL}/" icon="icon-up icon-md" title="${%Back to Dashboard}"/>
<l:task href="${rootURL}/manage" icon="symbol-settings" permissions="${app.MANAGE_AND_SYSTEM_READ}" title="${%Manage Jenkins}"/>
<l:task href="new" icon="icon-new-computer icon-md" permission="${createPermission}" title="${%New Node}"/>
<l:task href="${rootURL}/configureClouds" icon="icon-health-40to59 icon-md" permission="${app.SYSTEM_READ}"
<l:task href="new" icon="symbol-add" permission="${createPermission}" title="${%New Node}"/>
<l:task href="${rootURL}/configureClouds" icon="symbol-cloud" permission="${app.SYSTEM_READ}"
title="${app.hasPermission(app.ADMINISTER) ? '%Configure Clouds' : '%View Clouds'}"/>
<l:task href="configure" icon="symbol-settings" permissions="${app.MANAGE_AND_SYSTEM_READ}" title="${%Node Monitoring}"/>
</l:tasks>
Expand Down
1 change: 0 additions & 1 deletion core/src/main/resources/hudson/model/User/builds.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ THE SOFTWARE.
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>
<img src="${h.getUserAvatar(it,'48x48')}" alt="" height="48" width="48" />
${%title(it)}
</h1>

Expand Down
4 changes: 3 additions & 1 deletion core/src/main/resources/hudson/model/User/index.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ THE SOFTWARE.
<st:include page="sidepanel.jelly" />
<l:main-panel>
<h1>
<img src="${h.getUserAvatar(it,'48x48')}" alt="" height="48" width="48" />
<span class="icon-lg">
<l:icon src="${h.getUserAvatar(user,'48x48')}" />
</span>
${it.fullName}
</h1>
<t:editableDescription permission="${app.ADMINISTER}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
input {
.form-content input {
/* match width with captcha image */
width:200px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ THE SOFTWARE.
<tr>
<td class="jenkins-table__cell--tight jenkins-table__icon">
<div class="jenkins-table__cell__button-wrapper">
<img src="${h.getUserAvatar(user,'32x32')}" alt="" height="32" width="32"/>
<l:icon src="${h.getUserAvatar(user,'32x32')}" />
</div>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ THE SOFTWARE.
<l:tasks>
<l:task href="${rootURL}/" icon="icon-up icon-md" title="${%Back to Dashboard}" />
<l:task href="${rootURL}/manage" icon="symbol-settings" permission="${app.MANAGE}" title="${%Manage Jenkins}" />
<l:task href="." icon="icon-new-user icon-md" permission="${app.ADMINISTER}" title="${%Users}" />
<l:task href="addUser" icon="icon-new-user icon-md" permission="${app.ADMINISTER}" title="${%Create User}" />
<l:task href="." icon="symbol-people" permission="${app.ADMINISTER}" title="${%Users}" />
<l:task href="addUser" icon="symbol-add" permission="${app.ADMINISTER}" title="${%Create User}" />
</l:tasks>
</l:side-panel>
</j:jelly>
30 changes: 0 additions & 30 deletions core/src/main/resources/jenkins/management/PluginsLink/info.jelly

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 958db3c

Please sign in to comment.