X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/18eeb7495e094565c1a5044296606fecd53814db..10e55875c83d1d44a0b8d31ff1e49cfec843e9a2:/apt.mlt diff --git a/apt.mlt b/apt.mlt index d51c509..1aef9b1 100644 --- a/apt.mlt +++ b/apt.mlt @@ -2,15 +2,18 @@ val admin = Group.inGroupName "server"; +val nodeNum = case $"node" of + "" => 4 + | node => Web.stoi node; + if $"new" <> "" then - val node = Web.stoi ($"node"); val pkgs = String.tokens Char.isSpace ($"new"); ref ok = true; ref infos = []; foreach pkg in pkgs do - switch AptQuery.query {node = node, pkg = pkg} of + switch AptQuery.query {node = nodeNum, pkg = pkg} of NONE => ok := false; %>Error: Unknown package "<% Web.html pkg %>."
<% @@ -25,7 +28,7 @@ if $"new" <> "" then end; if ok then - val debian = Init.nodeDebian node %> + val debian = Init.nodeDebian nodeNum %> Are you sure these are the packages you wanted?

<% foreach info in infos do %> @@ -35,18 +38,17 @@ Are you sure these are the packages you wanted?



Reason:
<% Web.htmlNl ($"msg") %>

- ">Yes, I want to request these packages. + ">Yes, I want to request these packages. <% end elseif $"req" <> "" then - val node = Web.stoi ($"node"); val pkgs = String.tokens Char.isSpace ($"req"); ref ok = true; foreach pkg in pkgs do - switch AptQuery.query {node = node, pkg = pkg} of + switch AptQuery.query {node = nodeNum, pkg = pkg} of NONE => ok := false; %>Error: Unknown package "<% Web.html pkg %>."
<% @@ -59,7 +61,7 @@ elseif $"req" <> "" then end; if ok then - val id = Apt.add {usr = Init.getUserId(), node = node, data = $"req", msg = $"msg"}; + val id = Apt.add {usr = Init.getUserId(), node = nodeNum, data = $"req", msg = $"msg"}; if not (Apt.notifyNew id) then %>

Error sending e-mail notification

<% end @@ -74,7 +76,7 @@ elseif $"cmd" = "open" then


- +<% ref first = true; @@ -116,7 +118,7 @@ elseif $"cmd" = "list" then


By: <% name %>
Time: <% #stamp req %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Node: <% Web.html (Init.nodeName (#node req)) %>
Packages:
- +<% ref first = true; @@ -161,7 +163,7 @@ elseif $"mod" <> "" then
By: <% name %>
Time: <% #stamp req %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Node: <% Web.html (Init.nodeName (#node req)) %>
Packages:
- +
Requestor: <% #name user %>
Time: <% #stamp req %>
Time: <% #stamp req %> (<% Util.diffFromNow (#stamp req) %> ago)
Node: - +
Machine:
Packages:
Packages:
Reason: