java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml | 55 ++ java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHistoryAction.java | 67 +++ java/code/src/com/redhat/rhn/frontend/dto/SystemEventDto.java | 222 ++++++++++ java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 69 +++ java/code/src/com/redhat/rhn/manager/system/SystemManager.java | 26 + java/code/webapp/WEB-INF/includes/legends/system-history-legend.jsp | 21 java/code/webapp/WEB-INF/nav/system_detail.xml | 2 java/code/webapp/WEB-INF/pages/ssm/view-log-details.jsp | 2 java/code/webapp/WEB-INF/pages/systems/sdc/history.jsp | 82 +++ java/code/webapp/WEB-INF/struts-config.xml | 8 web/html/network/systems/details/history/event.pxt | 2 web/html/network/systems/details/history/history.pxt | 79 --- web/html/network/systems/details/history/package_event_results.pxt | 2 web/include/nav/system_detail.xml | 2 web/modules/rhn/RHN/DB/Server.pm | 23 - web/modules/sniglets/Sniglets/Servers.pm | 23 - 16 files changed, 555 insertions(+), 130 deletions(-)
New commits: commit 3c0c4b1985c8edd5a3837f319a33d42f5d9b4eb3 Author: Tomas Kasparek tkasparek@redhat.com Date: Thu Dec 19 15:52:37 2013 +0100
removing some perl
diff --git a/web/html/network/systems/details/history/history.pxt b/web/html/network/systems/details/history/history.pxt deleted file mode 100644 index 67e134f..0000000 --- a/web/html/network/systems/details/history/history.pxt +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<pxt-passthrough> - <pxt-use class="Grail::Frame" /> - <pxt-use class="Sniglets::Servers" /> - <pxt-use class="Sniglets::Lists" /> - <pxt-use class="Sniglets::Navi" /> - <pxt-use class="Sniglets::Users" /> - - <pxt-use class="Sniglets::HTML" /> - - <grail-canvas-replacement mode="legend_canvas"> - <rhn-list-legend type="actions" file="/network/components/legends/event-type.pxi" /> - <rhn-list-legend type="actions" file="/network/components/legends/event-status.pxi" /> - </grail-canvas-replacement> - - - <grail-canvas-template base="/templates/c.pxt" mode="main_canvas"> -<pxt-formvar> - - <pxt-include-late file="/network/components/systems/system_details_toolbar.pxi" /> - -</pxt-formvar> - - <rhn-navi-nav prefix="system_details" depth="0" file="/nav/system_detail.xml" style="contentnav" /> - - - <h2> - <rhn-icon type="header-event-history" title="event"/> - System History - </h2> - - <div class="page-summary"> - <p> - The following history events have been noted for this system. - </p> - - <p> - Please note that this system has <rhn-system-pending-actions-count />. - - <pxt-formvar> - <rhn-require acl="system_locked()"> - <p> - However, because this system is currently <strong>locked</strong>, no system-changing - events will be executed until the system is <a - href="/rhn/systems/details/Overview.do?sid={formvar:sid}">unlocked</a>. - </p> - </rhn-require> - </pxt-formvar> - - </p> - </div> - -<pxt-formvar> - -<rhn-listview class="Sniglets::ListView::ActionList" mode="system_events_history"> - <formvars> - <var name="sid" /> - </formvars> - - <column name="Type" label="history_type" width="1%" align="center" /> - - <column name="Status" label="history_status" width="5%" align="center" /> - - <column name="Summary" label="summary" width="55%"> - <url>/network/systems/details/history/event.pxt?sid={formvar:sid}&hid={column:event_id}</url> - </column> - - <column name="Time" label="time" width="29%" align="center" is_date="1"/> - - - <empty_list_message>No history events</empty_list_message> -</rhn-listview> - -</pxt-formvar> - - </grail-canvas-template> -</pxt-passthrough> - - diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm index 8d08737..7cbed1e 100644 --- a/web/modules/rhn/RHN/DB/Server.pm +++ b/web/modules/rhn/RHN/DB/Server.pm @@ -457,29 +457,6 @@ EOS return $ret; }
-sub system_pending_actions_count { - my $class = shift; - my $server_id = shift; - - my $query = <<EOQ; -SELECT COUNT(action_id) - FROM rhnServerAction - WHERE server_id = :server_id - AND status = 0 -EOQ - - my $dbh = RHN::DB->connect(); - my $sth = $dbh->prepare($query); - $sth->execute_h(server_id => $server_id); - - my ($count) = $sth->fetchrow; - $sth->finish; - - return $count; -} - - - sub server_event_simple_action { my $class = shift; my $sid = shift; diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm index 16259fd..4dd4186 100644 --- a/web/modules/sniglets/Sniglets/Servers.pm +++ b/web/modules/sniglets/Sniglets/Servers.pm @@ -62,7 +62,6 @@ sub register_tags {
$pxt->register_tag('rhn-proxy-entitlement-form' => &proxy_entitlement_form);
- $pxt->register_tag('rhn-system-pending-actions-count' => &system_pending_actions_count); $pxt->register_tag('rhn-system-activation-key-form' => &system_activation_key_form);
$pxt->register_tag('rhn-remote-command-form' => &remote_command_form); @@ -84,28 +83,6 @@ sub register_callbacks { $pxt->register_callback('rhn:package-action-command-cb' => &package_action_command_cb); }
-sub system_pending_actions_count { - my $pxt = shift; - my %params = @_; - - my $block = $params{__block__}; - my $sid = $pxt->param('sid'); - die 'no server id' unless $sid; - - my $count = RHN::Server->system_pending_actions_count($sid); - my $plural; - - if ($count > 1) { - $plural = 1; - } - elsif ($count eq 0) { - return "no pending events"; - } - - return PXT::HTML->link("/network/systems/details/history/pending.pxt?sid=$sid", - "$count pending event" . ($plural ? 's' : '')); -} - # like rhn-require, only shows block if a server's version of up2date is >= required version sub up2date_at_least { my $pxt = shift;
commit 425ea3a54adf68516f2f30f22708a15e3ce1860b Author: Tomas Kasparek tkasparek@redhat.com Date: Wed Dec 18 14:41:04 2013 +0100
rewrite system event history page to java
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml index dd1417b..c374448 100644 --- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml +++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml @@ -2057,4 +2057,59 @@ select s.id as id, <elaborator name="is_virtual_host" /> </mode>
+<mode name="system_events_history" + class="com.redhat.rhn.frontend.dto.SystemEventDto"> + <query params="sid"> +select event_id as id, + to_char(created, 'YYYY-MM-DD HH24:MI:SS') created, + to_char(picked_up, 'YYYY-MM-DD HH24:MI:SS') picked_up, + to_char(completed, 'YYYY-MM-DD HH24:MI:SS') completed, + summary, + history_type, + history_type_name, + history_status + from (select SH.id event_id, + SH.summary summary, + to_timestamp(NULL, NULL) as created, + to_timestamp(NULL, NULL) as picked_up, + SH.created as completed, -- view this as the "completed" date for sorting reasons + NULL as history_status, + NULL as history_type, + NULL as history_type_name + from rhnServerHistory SH + where SH.server_id = :sid + union + select SA.action_id event_id, + AType.name || ' scheduled by ' || NVL(U.login, '(none)') as summary, + SA.created, + SA.pickup_time as picked_up, + SA.completion_time as completed, + AStat.name as history_status, + AType.label as history_type, + AType.name as history_type_name + from rhnActionType AType, + rhnActionStatus AStat, + rhnAction A + left join web_contact U + on U.id = A.scheduler, + rhnServerAction SA + where SA.server_id = :sid + and SA.action_id = A.id + and ATYPE.id = A.action_type + and AStat.id = SA.status + and AStat.id IN (1, 2, 3) + ) X +order by completed desc, picked_up desc, created desc, event_id desc + </query> +</mode> + +<mode name="system_events_history_count_pending"> + <query params="sid"> +select count(action_id) + from rhnServerAction + where server_id = :sid + and status = 0 + </query> +</mode> + </datasource_modes> diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHistoryAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHistoryAction.java new file mode 100644 index 0000000..ba16653 --- /dev/null +++ b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHistoryAction.java @@ -0,0 +1,67 @@ +/** + * Copyright (c) 2012 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.frontend.action.systems.sdc; + +import java.util.List; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import com.redhat.rhn.domain.server.Server; +import com.redhat.rhn.frontend.struts.RequestContext; +import com.redhat.rhn.frontend.struts.RhnAction; +import com.redhat.rhn.frontend.struts.StrutsDelegate; +import com.redhat.rhn.frontend.taglibs.list.helper.ListHelper; +import com.redhat.rhn.frontend.taglibs.list.helper.Listable; +import com.redhat.rhn.manager.system.SystemManager; + +/** + * SystemHistoryAction + * @version $Rev$ + */ +public class SystemHistoryAction extends RhnAction implements Listable { + + /** + * {@inheritDoc} + */ + public ActionForward execute(ActionMapping mapping, ActionForm formIn, + HttpServletRequest request, + HttpServletResponse response) { + RequestContext context = new RequestContext(request); + Long sid = context.getRequiredParam("sid"); + Server server = context.lookupAndBindServer(); + + ListHelper helper = new ListHelper(this, request); + helper.execute(); + Map params = makeParamMap(request); + params.put(RequestContext.SID, sid); + params.put("pendingActions", SystemManager.countPendingActions(sid)); + params.put("isLocked", server.getLock() == null ? false : true); + + return StrutsDelegate.getInstance().forwardParams( + mapping.findForward("default"), params); + } + + /** {@inheritDoc} */ + public List getResult(RequestContext context) { + Long sid = context.getRequiredParam("sid"); + return SystemManager.systemEventHistory(sid, null); + } +} diff --git a/java/code/src/com/redhat/rhn/frontend/dto/SystemEventDto.java b/java/code/src/com/redhat/rhn/frontend/dto/SystemEventDto.java new file mode 100644 index 0000000..f13d6a2 --- /dev/null +++ b/java/code/src/com/redhat/rhn/frontend/dto/SystemEventDto.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) 2009--2012 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.frontend.dto; + +import java.io.Serializable; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.lang.StringUtils; + +import com.redhat.rhn.common.localization.LocalizationService; + +/** + * DTO for a com.redhat.rhn.frontend.action..systems.sdc.SystemHistoryAction + * @version $Rev$ + */ +public class SystemEventDto extends BaseDto implements Serializable { + + private static final long serialVersionUID = -3582329112428837249L; + + private long id; + private Date created; + private Date pickedUp; + private Date completed; + private String summary; + private String historyType; + private String historyTypeName; + private String historyStatus; + private static Map<String, String> actionTypes; + + static { + actionTypes = new HashMap<String, String>(); + actionTypes.put("packages.refresh_list", "event-type-package"); + actionTypes.put("packages.delta", "event-type-package"); + actionTypes.put("packages.update", "event-type-package"); + actionTypes.put("packages.remove", "event-type-package"); + actionTypes.put("packages.verify", "event-type-package"); + actionTypes.put("packages.runTransaction", "event-type-package"); + actionTypes.put("rollback.listTransactions", "event-type-package"); + actionTypes.put("up2date_config.get", "event-type-preferences"); + actionTypes.put("up2date_config.update", "event-type-preferences"); + actionTypes.put("rollback.config", "event-type-preferences"); + actionTypes.put("errata.update", "event-type-errata"); + actionTypes.put("hardware.refresh_list", "event-type-system"); + actionTypes.put("reboot.reboot", "event-type-system"); + actionTypes.put("configfiles.upload", "event-type-system"); + actionTypes.put("configfiles.deploy", "event-type-system"); + actionTypes.put("configfiles.verify", "event-type-system"); + actionTypes.put("configfiles.diff", "event-type-system"); + } + + /** + * @return Returns the id. + */ + @Override + public Long getId() { + return id; + } + + /** + * @param idIn The id to set. + */ + public void setId(Long idIn) { + this.id = idIn; + } + + /** + * @return Returns date of creation + */ + public Date getCreated() { + return created; + } + + /** + * @param createdIn Date of creation to set + */ + public void setCreated(String createdIn) { + if (createdIn == null) { + this.created = null; + } + else { + try { + this.created = new SimpleDateFormat( + LocalizationService.RHN_DB_DATEFORMAT).parse(createdIn); + } + catch (ParseException e) { + throw new IllegalArgumentException("lastCheckin must be of the: [" + + LocalizationService.RHN_DB_DATEFORMAT + "] it was: " + + createdIn); + } + } + } + + /** + * @return Returns date of picking up of the event + */ + public Date getPickedUp() { + return pickedUp; + } + + /** + * @param pickedUpIn Date of pick up of event to set + */ + public void setPickedUp(String pickedUpIn) { + if (pickedUpIn == null) { + this.pickedUp = null; + } + else { + try { + this.pickedUp = new SimpleDateFormat( + LocalizationService.RHN_DB_DATEFORMAT).parse(pickedUpIn); + } + catch (ParseException e) { + throw new IllegalArgumentException("lastCheckin must be of the: [" + + LocalizationService.RHN_DB_DATEFORMAT + "] it was: " + + pickedUpIn); + } + } + } + + /** + * @return Date of completion of the event + */ + public Date getCompleted() { + return completed; + } + + /** + * @param completedIn Date of completion to set + */ + public void setCompleted(String completedIn) { + if (completedIn == null) { + this.completed = null; + } + else { + try { + this.completed = new SimpleDateFormat( + LocalizationService.RHN_DB_DATEFORMAT).parse(completedIn); + } + catch (ParseException e) { + throw new IllegalArgumentException("lastCheckin must be of the: [" + + LocalizationService.RHN_DB_DATEFORMAT + "] it was: " + + completedIn); + } + } + } + + /** + * @return Returns event summary + */ + public String getSummary() { + return summary; + } + + /** + * @param summaryIn Summary of event + */ + public void setSummary(String summaryIn) { + this.summary = summaryIn; + } + + /** + * @return Returns type of history event + */ + public String getHistoryType() { + if (actionTypes.containsKey(historyType)) { + return actionTypes.get(historyType); + } + return historyType; + } + + /** + * @param historyTypeIn Type of history event + */ + public void setHistoryType(String historyTypeIn) { + this.historyType = historyTypeIn; + } + + /** + * @return History type event description + */ + public String getHistoryTypeName() { + return historyTypeName; + } + + /** + * @param historyTypeNameIn History event description to set + */ + public void setHistoryTypeName(String historyTypeNameIn) { + this.historyTypeName = historyTypeNameIn; + } + + /** + * @return Returns history event status + */ + public String getHistoryStatus() { + return StringUtils.isEmpty(historyStatus) ? "(n/a)" : historyStatus; + } + + /** + * @param historyStatusIn History status to set + */ + public void setHistoryStatus(String historyStatusIn) { + this.historyStatus = historyStatusIn; + } + +} diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml index bf92d4e..f3334cf 100644 --- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml +++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml @@ -11552,6 +11552,75 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro <source>scheduled action</source> </trans-unit> </group> + <!-- System event hisotry --> + <group> + <context-group name="ctx"> + <context context-type="sourcefile">System Eevents Pages</context> + </context-group> + <trans-unit id="system.event.history.header"> + <source>System History</source> + </trans-unit> + <trans-unit id="system.event.history.headerSummary"> + <source>The following history events have been noted for this system.</source> + </trans-unit> + <trans-unit id="system.event.history.headerNoPending"> + <source>Please note that this system has no pending events.</source> + </trans-unit> + <trans-unit id="system.event.history.headerPending"> + <source>Please note that this system has <a href="{0}">{1} pending event(s)</a>.</source> + </trans-unit> + <trans-unit id="system.event.history.noevent"> + <source>No event history for this system.</source> + </trans-unit> + <trans-unit id="system.event.history.locked"> + <source>However, because this system is currently <strong>locked</strong>, no system-changing events will be executed until the system is <a href="{0}">unlocked</a>.</source> + </trans-unit> + <trans-unit id="system.event.history.type"> + <source>Type</source> + </trans-unit> + <trans-unit id="system.event.history.status"> + <source>Status</source> + </trans-unit> + <trans-unit id="system.event.history.summary"> + <source>Summary</source> + </trans-unit> + <trans-unit id="system.event.history.time"> + <source>Time</source> + </trans-unit> + </group> + <!-- System event history legend --> + <group> + <context-group name="ctx"> + <context context-type="sourcefile">System Eevents Pages Legend</context> + </context-group> + <trans-unit id="system-history-legend.jsp.type.title"> + <source>Event Type Legend</source> + </trans-unit> + <trans-unit id="system-history-legend.jsp.type.package"> + <source>Package Event</source> + </trans-unit> + <trans-unit id="system-history-legend.jsp.type.errata"> + <source>Errata Event</source> + </trans-unit> + <trans-unit id="system-history-legend.jsp.type.preferences"> + <source>Preferences Event</source> + </trans-unit> + <trans-unit id="system-history-legend.jsp.type.system"> + <source>System Event</source> + </trans-unit> + <trans-unit id="system-hisotry-legend.jsp.status.title"> + <source>Event Status Legend</source> + </trans-unit> + <trans-unit id="system-history-legend.status.jsp.ok"> + <source>Complete</source> + </trans-unit> + <trans-unit id="system-history-legend.jsp.status.failed"> + <source>Failure</source> + </trans-unit> + <trans-unit id="system-history-legend.jsp.status.running"> + <source>Activity Occuring</source> + </trans-unit> + </group> <!-- Configuration Common --> <group> <context-group name="ctx"> diff --git a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java index 362cd16..11f5bc2 100644 --- a/java/code/src/com/redhat/rhn/manager/system/SystemManager.java +++ b/java/code/src/com/redhat/rhn/manager/system/SystemManager.java @@ -2933,4 +2933,30 @@ public class SystemManager extends BaseManager { return m.execute(inParams); }
+ /** + * @param sid server id + * @param pc pageContext + * @return Returns history events for a system + */ + public static DataResult systemEventHistory(Long sid, PageControl pc) { + SelectMode m = ModeFactory.getMode("System_queries", "system_events_history"); + Map params = new HashMap(); + params.put("sid", sid); + Map elabParams = new HashMap(); + return makeDataResult(params, elabParams, pc, m); + } + + /** + * @param sid server id + * @return Count of pending actions on system + */ + public static Long countPendingActions(Long sid) { + SelectMode m = ModeFactory.getMode("System_queries", + "system_events_history_count_pending"); + Map params = new HashMap(); + params.put("sid", sid); + DataResult toReturn = m.execute(params); + return (Long) ((HashMap)toReturn.get(0)).get("count"); + } + } diff --git a/java/code/webapp/WEB-INF/includes/legends/system-history-legend.jsp b/java/code/webapp/WEB-INF/includes/legends/system-history-legend.jsp new file mode 100644 index 0000000..c0576cd --- /dev/null +++ b/java/code/webapp/WEB-INF/includes/legends/system-history-legend.jsp @@ -0,0 +1,21 @@ +<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> +<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %> + +<div class="sideleg"> + <h4><bean:message key="system-history-legend.jsp.type.title"/></h4> + <ul> + <li><rhn:icon type="event-type-package" /><bean:message key="system-history-legend.jsp.type.package" /></li> + <li><rhn:icon type="event-type-errata" /><bean:message key="system-history-legend.jsp.type.errata" /></li> + <li><rhn:icon type="event-type-preferences" /><bean:message key="system-history-legend.jsp.type.preferences" /></li> + <li><rhn:icon type="event-type-system" /><bean:message key="system-history-legend.jsp.type.system" /></li> + </ul> +</div> + +<div class="sideleg"> + <h4><bean:message key="system-hisotry-legend.jsp.status.title" /></h4> + <ul> + <li><rhn:icon type="action-ok" /><bean:message key="system-history-legend.status.jsp.ok" /></li> + <li><rhn:icon type="action-failed" /><bean:message key="system-history-legend.jsp.status.failed" /></li> + <li><rhn:icon type="action-running" /><bean:message key="system-history-legend.jsp.status.running" /></li> + </ul> +</div> diff --git a/java/code/webapp/WEB-INF/nav/system_detail.xml b/java/code/webapp/WEB-INF/nav/system_detail.xml index 0f72dd2..6c20453 100644 --- a/java/code/webapp/WEB-INF/nav/system_detail.xml +++ b/java/code/webapp/WEB-INF/nav/system_detail.xml @@ -216,7 +216,7 @@ <rhn-tab-url>/network/systems/details/history/pending.pxt</rhn-tab-url> </rhn-tab> <rhn-tab name="History"> - <rhn-tab-url>/network/systems/details/history/history.pxt</rhn-tab-url> + <rhn-tab-url>/rhn/systems/details/history/History.do</rhn-tab-url> </rhn-tab> </rhn-tab> </rhn-navi-tree> diff --git a/java/code/webapp/WEB-INF/pages/ssm/view-log-details.jsp b/java/code/webapp/WEB-INF/pages/ssm/view-log-details.jsp index ab8713a..46188cc 100644 --- a/java/code/webapp/WEB-INF/pages/ssm/view-log-details.jsp +++ b/java/code/webapp/WEB-INF/pages/ssm/view-log-details.jsp @@ -58,7 +58,7 @@ <rl:decorator name="PageSizeDecorator"/>
<rl:column headerkey="ssm.operations.viewlog.servers" bound="false"> - <a href="/network/systems/details/history/history.pxt?sid=${current.id}"><c:out + <a href="/rhn/systems/details/history/History.do?sid=${current.id}"><c:out value="${current.name}"/></a> </rl:column>
diff --git a/java/code/webapp/WEB-INF/pages/systems/sdc/history.jsp b/java/code/webapp/WEB-INF/pages/systems/sdc/history.jsp new file mode 100644 index 0000000..9965202 --- /dev/null +++ b/java/code/webapp/WEB-INF/pages/systems/sdc/history.jsp @@ -0,0 +1,82 @@ +<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> +<%@ taglib uri="http://rhn.redhat.com/tags/list" prefix="rl" %> +<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + +<html> + +<body> + +<%@ include file="/WEB-INF/pages/common/fragments/systems/system-header.jspf" %> + +<rhn:toolbar base="h2" icon="header-event-history"> + <bean:message key="system.event.history.header" /> +</rhn:toolbar> + +<div class="page-summary"> + <bean:message key="system.event.history.headerSummary" /> + <br/> + <c:choose> + <c:when test="${param.pendingActions != 0}"> + <bean:message key="system.event.history.headerPending" arg0="/network/systems/details/history/pending.pxt?sid=${param.sid}" arg1="${param.pendingActions}" /> + <c:if test="${param.isLocked == true}"> + <br/> + <bean:message key="system.event.history.locked" arg0="/rhn/systems/details/Overview.do?sid=${param.sid}" /> + </c:if> + </c:when> + <c:otherwise> + <bean:message key="system.event.history.headerNoPending" /> + </c:otherwise> + </c:choose> +</div> + +<rl:listset name="eventSet" legend="system-history"> + <rhn:csrf /> + <input type="hidden" name="sid" value="${param.sid}" /> + <rl:list emptykey="system.event.history.noevent"> + <rl:decorator name="PageSizeDecorator" /> + <rl:decorator name="ElaborationDecorator" /> + <rl:column headerkey="system.event.history.type"> + <c:choose> + <c:when test="${current.historyType == 'event-type-package'}"> + <rhn:icon type="event-type-package" /> + </c:when> + <c:when test="${current.historyType == 'event-type-preferences'}"> + <rhn:icon type="event-type-errata" /> + </c:when> + <c:when test="${current.historyType == 'event-type-errata'}"> + <rhn:icon type="event-type-errata" /> + </c:when> + <c:otherwise> + <rhn:icon type="event-type-system" /> + </c:otherwise> + </c:choose> + </rl:column> + <rl:column headerkey="system.event.history.status"> + <c:choose> + <c:when test="${current.historyStatus == 'Completed'}"> + <rhn:icon type="action-ok" /> + </c:when> + <c:when test="${current.historyStatus == 'Failed'}"> + <rhn:icon type="action-failed" /> + </c:when> + <c:when test="${current.historyStatus == 'Picked Up'}"> + <rhn:icon type="action-running" /> + </c:when> + <c:otherwise> + ${current.historyStatus} + </c:otherwise> + </c:choose> + </rl:column> + <rl:column headerkey="system.event.history.summary"> + <a href="/network/systems/details/history/event.pxt?sid=${param.sid}&hid=${current.id}">${current.summary}</a> + </rl:column> + <rl:column headerkey="system.event.history.time"> + ${current.completed} + </rl:column> + </rl:list> +</rl:listset> + +</body> +</html> diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml index 3a0a043..80d0023 100644 --- a/java/code/webapp/WEB-INF/struts-config.xml +++ b/java/code/webapp/WEB-INF/struts-config.xml @@ -3542,6 +3542,14 @@ path="/systems/Overview.do" redirect="true"/> </action>
+ <action path="/systems/details/history/History" + scope="request" + type="com.redhat.rhn.frontend.action.systems.sdc.SystemHistoryAction" + className="com.redhat.rhn.frontend.struts.RhnActionMapping"> + <forward name="default" + path="/WEB-INF/pages/systems/sdc/history.jsp"/> + </action> + <!--System Details SSM Configuration --> <action path="/systems/ssm/DeleteConfirm" scope="request" diff --git a/web/html/network/systems/details/history/event.pxt b/web/html/network/systems/details/history/event.pxt index 760eb2c..8b57a59 100644 --- a/web/html/network/systems/details/history/event.pxt +++ b/web/html/network/systems/details/history/event.pxt @@ -59,7 +59,7 @@ <pxt-formvar> <div class="up-arrow"> <rhn-icon type="nav-up" title="Go up"/> -<a href="/network/systems/details/history/history.pxt?sid={formvar:sid}">Return to history list for <rhn-server-name /></a></div> +<a href="/rhn/systems/details/history/History.do?sid={formvar:sid}">Return to history list for <rhn-server-name /></a></div> </pxt-formvar>
diff --git a/web/html/network/systems/details/history/package_event_results.pxt b/web/html/network/systems/details/history/package_event_results.pxt index 380f174..0884b50 100644 --- a/web/html/network/systems/details/history/package_event_results.pxt +++ b/web/html/network/systems/details/history/package_event_results.pxt @@ -57,7 +57,7 @@ <pxt-formvar> <div class="up-arrow"> <rhn-icon type="nav-up" title="Go up"/> -<a href="/network/systems/details/history/history.pxt?sid={formvar:sid}">Return to history list for <rhn-server-name /></a></div> +<a href="/rhn/systems/details/history/History.do?sid={formvar:sid}">Return to history list for <rhn-server-name /></a></div> </pxt-formvar>
</grail-canvas-template> diff --git a/web/include/nav/system_detail.xml b/web/include/nav/system_detail.xml index e1c340c..3332573 100644 --- a/web/include/nav/system_detail.xml +++ b/web/include/nav/system_detail.xml @@ -194,7 +194,7 @@ <rhn-tab-url>/network/systems/details/history/pending.pxt</rhn-tab-url> </rhn-tab> <rhn-tab name="History"> - <rhn-tab-url>/network/systems/details/history/history.pxt</rhn-tab-url> + <rhn-tab-url>/rhn/systems/details/history/History.do</rhn-tab-url> </rhn-tab> </rhn-tab> </rhn-navi-tree>
spacewalk-commits@lists.fedorahosted.org