guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: hydra: status: Factor out ensurePackagegroupExists.


From: Danny Milosavljevic
Subject: 02/02: hydra: status: Factor out ensurePackagegroupExists.
Date: Sat, 5 May 2018 08:18:06 -0400 (EDT)

dannym pushed a commit to branch master
in repository maintenance.

commit 1537dc05cf56279bce7dd63f310054c548959067
Author: Danny Milosavljevic <address@hidden>
Date:   Sat May 5 14:17:08 2018 +0200

    hydra: status: Factor out ensurePackagegroupExists.
    
    * hydra/nginx/html/status/index.html: Factor out ensurePackagegroupExists.
---
 hydra/nginx/html/status/index.html | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hydra/nginx/html/status/index.html 
b/hydra/nginx/html/status/index.html
index 7f5be64..0feabeb 100644
--- a/hydra/nginx/html/status/index.html
+++ b/hydra/nginx/html/status/index.html
@@ -233,9 +233,7 @@ function isBuildstatusQueued(buildstatus) {
        return buildstatus && buildstatus < 0;
 }
 
-/** Given a TABLE and PACKAGEGROUPID, adds an entry for build BUILDID to it.
-LOGLINK specifies whether to add a link to show the log. */
-function addPackagegroupelement(table, packagegroupid, buildid, system, 
buildtime, buildstatus, loglink) {
+function ensurePackagegroupExists(table, packagegroupid) {
        let rootbody = table.getElementsByTagName("tbody")[0];
        let packagegroups = getElementsByName(rootbody, "packagegroup_" + 
packagegroupid);
        if (packagegroups.length == 0) {
@@ -259,7 +257,13 @@ function addPackagegroupelement(table, packagegroupid, 
buildid, system, buildtim
                rootbody.appendChild(tr);
                packagegroups = [rootbody];
        }
-       let packagegroup = packagegroups[0];
+       return packagegroups[0];
+}
+
+/** Given a TABLE and PACKAGEGROUPID, adds an entry for build BUILDID to it.
+LOGLINK specifies whether to add a link to show the log. */
+function addPackagegroupelement(table, packagegroupid, buildid, system, 
buildtime, buildstatus, loglink) {
+       let packagegroup = ensurePackagegroupExists(table, packagegroupid);
        let buildstd = getElementsByName(packagegroup, "builds")[0];
        updateMultientry(buildstd, buildid, function() {
                let div = document.createElement("div");



reply via email to

[Prev in Thread] Current Thread [Next in Thread]