X-Git-Url: http://git.hcoop.net/bpt/portal.git/blobdiff_plain/b6dd1aafb4c9cddf89b06c2eeac1b5277046ad9f..2581e0222b4def4ba8cc38b73edf0a3dfe425c1e:/apt.mlt diff --git a/apt.mlt b/apt.mlt index 0679155..6ef3346 100644 --- a/apt.mlt +++ b/apt.mlt @@ -2,6 +2,10 @@ val admin = Group.inGroupName "server"; +val nodeNum = case $"node" of + "" => 2 + | node => Web.stoi node; + if $"new" <> "" then val pkgs = String.tokens Char.isSpace ($"new"); @@ -9,7 +13,7 @@ if $"new" <> "" then ref infos = []; foreach pkg in pkgs do - switch AptQuery.query pkg of + switch AptQuery.query {node = nodeNum, pkg = pkg} of NONE => ok := false; %>Error: Unknown package "<% Web.html pkg %>."
<% @@ -23,17 +27,18 @@ if $"new" <> "" then end end; - if ok then %> + if ok then + val debian = Init.nodeDebian nodeNum %> Are you sure these are the packages you wanted?

<% foreach info in infos do %> - + <% end %>
<% #name info %>
<% #name info %> <% Web.html (#descr info) %>


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

- ">Yes, I want to request these packages. + ">Yes, I want to request these packages. <% end @@ -43,7 +48,7 @@ elseif $"req" <> "" then ref ok = true; foreach pkg in pkgs do - switch AptQuery.query pkg of + switch AptQuery.query {node = nodeNum, pkg = pkg} of NONE => ok := false; %>Error: Unknown package "<% Web.html pkg %>."
<% @@ -56,7 +61,7 @@ elseif $"req" <> "" then end; if ok then - val id = Apt.add (Init.getUserId(), $"req", $"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 @@ -72,10 +77,12 @@ elseif $"cmd" = "open" then +<% ref first = true; val pkgs = String.tokens Char.isSpace (#data req); + val debian = Init.nodeDebian (#node req); foreach pkg in pkgs do if first then @@ -83,11 +90,11 @@ elseif $"cmd" = "open" then else %><% end; - switch AptQuery.query pkg of + switch AptQuery.query {node = #node req, pkg = pkg} of NONE => %><% | SOME info => - %> + %><% end end %> @@ -112,10 +119,12 @@ elseif $"cmd" = "list" then
By: <% name %>
Time: <% #stamp req %>
Node: <% Web.html (Init.nodeName (#node req)) %>
Packages:
Error: Unknown package "<% Web.html pkg %>."<% #name info %><% #name info %> <% Web.html (#descr info) %>
+<% ref first = true; val pkgs = String.tokens Char.isSpace (#data req); + val debian = Init.nodeDebian (#node req); foreach pkg in pkgs do if first then @@ -123,11 +132,11 @@ elseif $"cmd" = "list" then else %><% end; - switch AptQuery.query pkg of + switch AptQuery.query {node = #node req, pkg = pkg} of NONE => %><% | SOME info => - %> + %><% end end %> @@ -155,6 +164,11 @@ elseif $"mod" <> "" then
By: <% name %>
Time: <% #stamp req %>
Node: <% Web.html (Init.nodeName (#node req)) %>
Packages:
Error: Unknown package "<% Web.html pkg %>."<% #name info %><% #name info %> <% Web.html (#descr info) %>
+
Requestor: <% #name user %>
Time: <% #stamp req %>
Node:
Status: +
Machine:
Packages:
Reason: