Patch title: Release 87 bulk changes
Abstract:
File: /pliant/appli/backup/display.pli
Key:
    Removed line
    Added line
   
module "/pliant/language/unsafe.pli"
module "engine.pli"
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/util/encoding/http.pli"
module "/pliant/fullpliant/this_computer.pli"



method page backup_display_area a
  arg_rw HtmlPage page ; arg_rw Data:BackupArea a
  implicit page
    title "Backup area '"+keyof:a+"'"
    header "Area specification and disk summary"
      table columns 4
        cell [ID]
        cell [Action]
        cell [Disk path]
        cell [Logical path]
        each p a:path
          cell
             fixed (text keyof:p)
          cell
             select "" p:exclude
               option "Include" "false"
               option "Exclude" "true"
          cell
             input "" p:disk
          cell
             input "" p:logical
      if not is_read_only
        input "ID: " (var Str pid) length 4 noeol
        button "Create new path" noeol
          a:path create pid
          reload_page
        button "Delete the path"
          a:path delete pid
          reload_page
      table columns 3
        read_only
          cell [Last studyed on]
          cell
            input "" a:study
          cell void
          cell header [Total] ; cell void ; cell void
          cell [Number of files]
          cell
            input "" a:total_nb
          cell void
          cell [Amount of datas]
          cell
            text (string a:total_size\2^20)+" MB"
          cell void
          cell header [Removed] ; cell void ; cell void
          cell [Number of files]
          cell
            if a:removed_nb>0
              input "" a:removed_nb
          cell void
          cell [Amount of datas]
          cell
            if a:removed_nb>0
              text (string a:removed_size\2^20)+" MB"
          cell void
          cell header [Lost] ; cell void ; cell void
          cell [Number of files]
          cell
            if a:lost_nb>0
              input "" a:lost_nb
          cell void
          cell [Amount of datas]
          cell
            if a:lost_nb>0
              text (string a:lost_size\2^20)+" MB"
          cell void
          cell header [Corrupted] ; cell void ; cell void
          cell [Number of files]
          cell
            if a:corrupted_nb>0
              input "" a:corrupted_nb
          cell void
          cell [Amount of datas]
          cell
            if a:corrupted_nb>0
              text (string a:corrupted_size\2^20)+" MB"
          cell void
      if not is_read_only
        button "Record files changes" noeol
          a update "modify"
          reload_page
        button "Record files changes and removed" noeol
          a update "modify remove"
          reload_page
        button "Record files changes and deleted" noeol
          para
            [Files that are missing on the disks will be rem
          [Are you sure you want to do that ? ]
          button "yes" noeol
            a update "modify delete"
            goto_backward
          button "no"
            goto_backward
        button "Check files integrity"
          a update "check"
          reload_page
        var CBool all := true
        each bl backup_database:data:line
          if not (exists a:line:(keyof bl))
           all := false
        if not all
          var Str line
          button "Include area '"+keyof:a+"' in backup line"
            if line<>""
              a:line create line
              a compute
            reload_page
          select "" line
            option "" ""
            each bl backup_database:data:line
              if not (exists a:line:(keyof bl))
                option keyof:bl keyof:bl
    header "Extra informations"
      table columns 2
        cell [Comments:]
        cell (text_input "" a:comment rows 5 columns 60)
        cell [Options:]
        cell (input "" a:options length 60)
    each l a:line
      header "Status sumary for '"+keyof:l+"' backup line"
        table columns 3
          cell [All at once]
          cell
            select "" l:once
              option "no" "false"
              option "yes" "true"
          cell [Should we rebackup all files when one has ch
          cell [Cycle]
          cell
            input "" l:cycle length 5
          cell [Make a new backup every 'cycle' CDs]
          cell [Last medium]
          cell
            text l:medium
          cell
            [On what medium did we backup last time.]
          read_only
            cell [Number of pending files]
            cell
              input "" l:pending_nb
            cell void
            cell [Amount of pending datas]
            cell
              text (string l:pending_size\2^20)+" MB"
            cell void
            cell [Oldest pending file]
            cell
              input "" l:pending_oldest
            cell void
            cell [Maximum failed backups]
            cell
              if l:max_failures>0
                input "" l:max_failures
            cell void
        if not is_read_only
          button "Remove area '"+keyof:a+"' from backup line
            title "Remove area from backup line"
            text "Are you sure that you want to remove '"+ke
            button "yes" noeol
              var Str line := keyof l
              a:line delete line
              backup_database:data:line:line compute
              goto_backward
            button "no"
             goto_backward
    header "Files list"
      each f a:file
module "/pliant/language/unsafe.pli"
module "engine.pli"
module "/pliant/protocol/http/server.pli"
module "/pliant/protocol/http/style/default.style"
module "/pliant/util/encoding/http.pli"
module "/pliant/fullpliant/this_computer.pli"



method page backup_display_area a
  arg_rw HtmlPage page ; arg_rw Data:BackupArea a
  implicit page
    title "Backup area '"+keyof:a+"'"
    header "Area specification and disk summary"
      table columns 4
        cell [ID]
        cell [Action]
        cell [Disk path]
        cell [Logical path]
        each p a:path
          cell
             fixed (text keyof:p)
          cell
             select "" p:exclude
               option "Include" "false"
               option "Exclude" "true"
          cell
             input "" p:disk
          cell
             input "" p:logical
      if not is_read_only
        input "ID: " (var Str pid) length 4 noeol
        button "Create new path" noeol
          a:path create pid
          reload_page
        button "Delete the path"
          a:path delete pid
          reload_page
      table columns 3
        read_only
          cell [Last studyed on]
          cell
            input "" a:study
          cell void
          cell header [Total] ; cell void ; cell void
          cell [Number of files]
          cell
            input "" a:total_nb
          cell void
          cell [Amount of datas]
          cell
            text (string a:total_size\2^20)+" MB"
          cell void
          cell header [Removed] ; cell void ; cell void
          cell [Number of files]
          cell
            if a:removed_nb>0
              input "" a:removed_nb
          cell void
          cell [Amount of datas]
          cell
            if a:removed_nb>0
              text (string a:removed_size\2^20)+" MB"
          cell void
          cell header [Lost] ; cell void ; cell void
          cell [Number of files]
          cell
            if a:lost_nb>0
              input "" a:lost_nb
          cell void
          cell [Amount of datas]
          cell
            if a:lost_nb>0
              text (string a:lost_size\2^20)+" MB"
          cell void
          cell header [Corrupted] ; cell void ; cell void
          cell [Number of files]
          cell
            if a:corrupted_nb>0
              input "" a:corrupted_nb
          cell void
          cell [Amount of datas]
          cell
            if a:corrupted_nb>0
              text (string a:corrupted_size\2^20)+" MB"
          cell void
      if not is_read_only
        button "Record files changes" noeol
          a update "modify"
          reload_page
        button "Record files changes and removed" noeol
          a update "modify remove"
          reload_page
        button "Record files changes and deleted" noeol
          para
            [Files that are missing on the disks will be rem
          [Are you sure you want to do that ? ]
          button "yes" noeol
            a update "modify delete"
            goto_backward
          button "no"
            goto_backward
        button "Check files integrity"
          a update "check"
          reload_page
        var CBool all := true
        each bl backup_database:data:line
          if not (exists a:line:(keyof bl))
           all := false
        if not all
          var Str line
          button "Include area '"+keyof:a+"' in backup line"
            if line<>""
              a:line create line
              a compute
            reload_page
          select "" line
            option "" ""
            each bl backup_database:data:line
              if not (exists a:line:(keyof bl))
                option keyof:bl keyof:bl
    header "Extra informations"
      table columns 2
        cell [Comments:]
        cell (text_input "" a:comment rows 5 columns 60)
        cell [Options:]
        cell (input "" a:options length 60)
    each l a:line
      header "Status sumary for '"+keyof:l+"' backup line"
        table columns 3
          cell [All at once]
          cell
            select "" l:once
              option "no" "false"
              option "yes" "true"
          cell [Should we rebackup all files when one has ch
          cell [Cycle]
          cell
            input "" l:cycle length 5
          cell [Make a new backup every 'cycle' CDs]
          cell [Last medium]
          cell
            text l:medium
          cell
            [On what medium did we backup last time.]
          read_only
            cell [Number of pending files]
            cell
              input "" l:pending_nb
            cell void
            cell [Amount of pending datas]
            cell
              text (string l:pending_size\2^20)+" MB"
            cell void
            cell [Oldest pending file]
            cell
              input "" l:pending_oldest
            cell void
            cell [Maximum failed backups]
            cell
              if l:max_failures>0
                input "" l:max_failures
            cell void
        if not is_read_only
          button "Remove area '"+keyof:a+"' from backup line
            title "Remove area from backup line"
            text "Are you sure that you want to remove '"+ke
            button "yes" noeol
              var Str line := keyof l
              a:line delete line
              backup_database:data:line:line compute
              goto_backward
            button "no"
             goto_backward
    header "Files list"
      each f a:file
        link keyof:f (http_encode keyof:a)+"/"+(http_encode 
        link keyof:f (http_slash_encode keyof:a)+"/"+(http_slash_encode keyof:f) no_extension
        part test_failure
          each fl f:line
           if fl:failure>0
             fixed [ ] ; highlight "failed"
             leave test_failure
        if f:status=backup_temporary
          fixed [ ] ; small [temporary]
        eif f:status=backup_removed
          fixed [ ] ; small [removed]
        eif f:status>=backup_lost
          fixed [ ] ; highlight (shunt f:status=backup_lost 
        part pending
          each al a:line
            if (a backup_required f keyof:al)
              fixed [ ] ; small [pending]
              leave pending  
        fixed [ ]
        if a:total_size>0 and (cast 100*f:size\a:total_size 
          small
            text (repeat (cast 100*f:size\a:total_size Int) 
        eol  


method page backup_display_line l
  arg_rw HtmlPage page ; arg_rw Data:BackupLine l
  implicit page
    title "Backup line '"+keyof:l+"'"
    header "'"+keyof:l+"' line summary"
      table columns 3
        cell void
        cell [Engraving options]
        cell
          input "" l:options
        cell void
        cell [Medium header]
        cell
          input "" l:medium_header
        cell void
        cell [Medium counter]
        cell
          input "" l:medium_counter
        cell void
        read_only
          cell header [Total] ; cell void ; cell void
          cell [Number of files]
          cell
            input "" l:total_nb
          cell void
          cell [Amount of datas]
          cell
            text (string l:total_size\2^20)+" MB"
          cell void
          cell header [Removed] ; cell void ; cell void
          cell [Number of files]
          cell
            if l:removed_nb>0
              input "" l:removed_nb
          cell void
          cell [Amount of datas]
          cell
            if l:removed_nb>0
              text (string l:removed_size\2^20)+" MB"
          cell void
          cell header [Lost] ; cell void ; cell void
          cell [Number of files]
          cell
            if l:lost_nb>0
              input "" l:lost_nb
          cell void
          cell [Amount of datas]
          cell
            if l:lost_nb>0
              text (string l:lost_size\2^20)+" MB"
          cell void
          cell header [Corrupted] ; cell void ; cell void
          cell [Number of files]
          cell
            if l:corrupted_nb>0
              input "" l:corrupted_nb
          cell void
          cell [Amount of datas]
          cell
            if l:corrupted_nb>0
              text (string l:corrupted_size\2^20)+" MB"
          cell void
          cell header [Pending] ; cell void ; cell void
          cell [Number of files]
          cell
            input "" l:pending_nb
          cell void
          cell [Amount of datas]
          cell
            text (string l:pending_size\2^20)+" MB"
          cell void
          cell [Oldest]
          cell
            input "" l:pending_oldest
    header "Areas involved in '"+keyof:l+"' line"
      table columns 8
        cell header [Area ID]
        cell header [Mode]
        cell header [Total size]
        cell header [Disk size]
        cell header [Pending]
        cell header [Max failures]
        cell header [Troubles]
        cell void
        each a backup_database:data:area
          var Data:BackupAreaLine al :> a:line:(keyof l)
          if exists:al
            cell
              text keyof:a
            cell
              if al:once
                [once]
              if al:cycle=defined
                text " cycle "+(string al:cycle)
            cell
              text (string a:total_size\2^20)+" MB"
            cell
              text (string (a:total_size-a:removed_size-a:lo
            cell
              if al:pending_size>0
                text (string al:pending_size\2^20)+" MB"
            if al:max_failures>0
              cell color (color hsl 0 10 70)
                text (string al:max_failures)
            else
              cell void
            cell
              if a:lost_nb+a:corrupted_nb>0
                highlight (shunt a:lost_nb>0 "lost" "")+" "+
            cell
        part test_failure
          each fl f:line
           if fl:failure>0
             fixed [ ] ; highlight "failed"
             leave test_failure
        if f:status=backup_temporary
          fixed [ ] ; small [temporary]
        eif f:status=backup_removed
          fixed [ ] ; small [removed]
        eif f:status>=backup_lost
          fixed [ ] ; highlight (shunt f:status=backup_lost 
        part pending
          each al a:line
            if (a backup_required f keyof:al)
              fixed [ ] ; small [pending]
              leave pending  
        fixed [ ]
        if a:total_size>0 and (cast 100*f:size\a:total_size 
          small
            text (repeat (cast 100*f:size\a:total_size Int) 
        eol  


method page backup_display_line l
  arg_rw HtmlPage page ; arg_rw Data:BackupLine l
  implicit page
    title "Backup line '"+keyof:l+"'"
    header "'"+keyof:l+"' line summary"
      table columns 3
        cell void
        cell [Engraving options]
        cell
          input "" l:options
        cell void
        cell [Medium header]
        cell
          input "" l:medium_header
        cell void
        cell [Medium counter]
        cell
          input "" l:medium_counter
        cell void
        read_only
          cell header [Total] ; cell void ; cell void
          cell [Number of files]
          cell
            input "" l:total_nb
          cell void
          cell [Amount of datas]
          cell
            text (string l:total_size\2^20)+" MB"
          cell void
          cell header [Removed] ; cell void ; cell void
          cell [Number of files]
          cell
            if l:removed_nb>0
              input "" l:removed_nb
          cell void
          cell [Amount of datas]
          cell
            if l:removed_nb>0
              text (string l:removed_size\2^20)+" MB"
          cell void
          cell header [Lost] ; cell void ; cell void
          cell [Number of files]
          cell
            if l:lost_nb>0
              input "" l:lost_nb
          cell void
          cell [Amount of datas]
          cell
            if l:lost_nb>0
              text (string l:lost_size\2^20)+" MB"
          cell void
          cell header [Corrupted] ; cell void ; cell void
          cell [Number of files]
          cell
            if l:corrupted_nb>0
              input "" l:corrupted_nb
          cell void
          cell [Amount of datas]
          cell
            if l:corrupted_nb>0
              text (string l:corrupted_size\2^20)+" MB"
          cell void
          cell header [Pending] ; cell void ; cell void
          cell [Number of files]
          cell
            input "" l:pending_nb
          cell void
          cell [Amount of datas]
          cell
            text (string l:pending_size\2^20)+" MB"
          cell void
          cell [Oldest]
          cell
            input "" l:pending_oldest
    header "Areas involved in '"+keyof:l+"' line"
      table columns 8
        cell header [Area ID]
        cell header [Mode]
        cell header [Total size]
        cell header [Disk size]
        cell header [Pending]
        cell header [Max failures]
        cell header [Troubles]
        cell void
        each a backup_database:data:area
          var Data:BackupAreaLine al :> a:line:(keyof l)
          if exists:al
            cell
              text keyof:a
            cell
              if al:once
                [once]
              if al:cycle=defined
                text " cycle "+(string al:cycle)
            cell
              text (string a:total_size\2^20)+" MB"
            cell
              text (string (a:total_size-a:removed_size-a:lo
            cell
              if al:pending_size>0
                text (string al:pending_size\2^20)+" MB"
            if al:max_failures>0
              cell color (color hsl 0 10 70)
                text (string al:max_failures)
            else
              cell void
            cell
              if a:lost_nb+a:corrupted_nb>0
                highlight (shunt a:lost_nb>0 "lost" "")+" "+
            cell
              link "edit" "../area/"+(http_encode keyof:a) n
              link "edit" "../area/"+(http_slash_encode keyof:a) no_extension


method page backup_display
  arg_rw HtmlPage page
  implicit page
    title "Backups administration"
    link "configure cdrom settings" "configure"
    header "Backup lines"
      table columns 7
        cell header [Line ID]
        cell header [Pending count]
        cell header [Pending MB]
        cell header [Oldest pending]
        cell header [Max failures]
        cell header [Troubles]
        cell void
        each l backup_database:data:line
          cell
            text keyof:l
          cell
            if l:pending_nb>0
              text (string l:pending_nb)
          cell
            if l:pending_size>0
              text (string l:pending_size\2^20)+" MB"
          cell
            if l:pending_oldest=defined
              text (string l:pending_oldest)
          if l:max_failures>0
            cell color (color hsl 0 10 70)
              text (string l:max_failures)
          else
            cell void
          cell
            if l:lost_nb+l:corrupted_nb>0
              highlight (shunt l:lost_nb>0 "lost" "")+" "+(s
           cell


method page backup_display
  arg_rw HtmlPage page
  implicit page
    title "Backups administration"
    link "configure cdrom settings" "configure"
    header "Backup lines"
      table columns 7
        cell header [Line ID]
        cell header [Pending count]
        cell header [Pending MB]
        cell header [Oldest pending]
        cell header [Max failures]
        cell header [Troubles]
        cell void
        each l backup_database:data:line
          cell
            text keyof:l
          cell
            if l:pending_nb>0
              text (string l:pending_nb)
          cell
            if l:pending_size>0
              text (string l:pending_size\2^20)+" MB"
          cell
            if l:pending_oldest=defined
              text (string l:pending_oldest)
          if l:max_failures>0
            cell color (color hsl 0 10 70)
              text (string l:max_failures)
          else
            cell void
          cell
            if l:lost_nb+l:corrupted_nb>0
              highlight (shunt l:lost_nb>0 "lost" "")+" "+(s
           cell
            link "edit" "line/"+(http_encode keyof:l) no_ext
            link "edit" "line/"+(http_slash_encode keyof:l) no_extension
      if not is_read_only
        input "Line ID: " (var Str lid) noeol
        button "Create the new line" noeol
          backup_database:data:line create lid
          reload_page
        button "Delete the line"
          backup_database:data:line delete lid
          reload_page
    header "Backup areas"
      table columns 5
        cell header [Area ID]
        cell header [Size]
        cell header [Max failures]
        cell header [Troubles]
        cell void
        each a backup_database:data:area
          cell
            text keyof:a
          cell
            text (string a:total_size\2^20)+" MB"
          var Int max_failures := 0
          each l2 a:line
            max_failures := max max_failures l2:max_failures
          if max_failures>0
            cell color (color hsl 0 10 70)
              text string:max_failures
          else
            cell void
          cell
            if a:lost_nb+a:corrupted_nb>0
              highlight (shunt a:lost_nb>0 "lost" "")+" "+(s
          cell
      if not is_read_only
        input "Line ID: " (var Str lid) noeol
        button "Create the new line" noeol
          backup_database:data:line create lid
          reload_page
        button "Delete the line"
          backup_database:data:line delete lid
          reload_page
    header "Backup areas"
      table columns 5
        cell header [Area ID]
        cell header [Size]
        cell header [Max failures]
        cell header [Troubles]
        cell void
        each a backup_database:data:area
          cell
            text keyof:a
          cell
            text (string a:total_size\2^20)+" MB"
          var Int max_failures := 0
          each l2 a:line
            max_failures := max max_failures l2:max_failures
          if max_failures>0
            cell color (color hsl 0 10 70)
              text string:max_failures
          else
            cell void
          cell
            if a:lost_nb+a:corrupted_nb>0
              highlight (shunt a:lost_nb>0 "lost" "")+" "+(s
          cell
            link "edit" "area/"+(http_encode keyof:a) no_ext
            link "edit" "area/"+(http_slash_encode keyof:a) no_extension
      if not is_read_only
        input "Area ID: " (var Str aid) noeol
        button "Create the new area" noeol
          backup_database:data:area create aid
          reload_page
        button "Delete the area"
          backup_database:data:area delete aid
          each l backup_database:data:line
            l compute
          reload_page



      if not is_read_only
        input "Area ID: " (var Str aid) noeol
        button "Create the new area" noeol
          backup_database:data:area create aid
          reload_page
        button "Delete the area"
          backup_database:data:area delete aid
          each l backup_database:data:line
            l compute
          reload_page