/[gli]/trunk/src/net/server/html/webgli/partitioning3.pyhtml
Gentoo

Contents of /trunk/src/net/server/html/webgli/partitioning3.pyhtml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1406 - (show annotations) (download)
Wed Apr 5 18:29:18 2006 UTC (11 years, 10 months ago) by agaffney
File size: 4601 byte(s)
  src/net/server/html/webgli/partitioning[234].pyhtml:
  small fixes for new partioning code

1 <? include /webgli/top.pyhtml ?>
2 <: if 'recommended' in post_params:
3 <?
4 try:
5 shared_info.devices[shared_info.drive_to_partition].do_recommended()
6 except GLIException, error:
7 shared_info.error_message = error.get_error_msg()
8 self.redirect("/webgli/partitioning2.pyhtml?editdrive=" + shared_info.drive_to_partition)
9 ?>
10 <: elif 'cleardrive' in post_params:
11 <?
12 shared_info.devices[shared_info.drive_to_partition].clear_partitions()
13 shared_info.error_message = "Partition table cleared successfully"
14 self.redirect("/webgli/partitioning2.pyhtml?editdrive=" + shared_info.drive_to_partition)
15 ?>
16 <: else:
17 <?
18 if post_params['editpart2']:
19 post_params['editpart'] = post_params['editpart2']
20 if get_params['editpart']:
21 post_params['editpart'] = get_params['editpart']
22 ?>
23 <form name="part3" action="/webgli/partitioning4.pyhtml" method="POST" enctype="multipart/form-data">
24 <input type="hidden" name="editpart" value="<% post_params['editpart'] %>">
25 <?
26 drive_to_partition = shared_info.drive_to_partition
27 partlist = shared_info.devices[drive_to_partition].get_ordered_partition_list()
28 tmpparts = shared_info.devices[drive_to_partition] #.get_partitions()
29 ?>
30 <: if not post_params['editpart']:
31 ERROR: You must select a partition to edit!<br>\n"
32 <!-- return wrap_in_webgli_template(data) -->
33 <: else:
34 <?
35 editpart = float(post_params['editpart'])
36 #part_to_edit = partlist[editpart]
37 #tmppart = tmpparts[part_to_edit]
38 part_types = [("ext2", _(u"Old, stable, but no journaling")),
39 ("ext3", _(u"ext2 with journaling and b-tree indexing (RECOMMENDED)")),
40 ("linux-swap", _(u"Swap partition for memory overhead")),
41 ("fat32", _(u"Windows filesystem format used in Win9X and XP")),
42 ("ntfs", _(u"Windows filesystem format used in Win2K and NT")),
43 ("jfs", _(u"IBM's journaling filesystem. stability unknown.")),
44 ("xfs", _(u"Don't use this unless you know you need it.")),
45 ("reiserfs", _(u"B*-tree based filesystem. great performance. Only V3 supported.")),
46 ("extended", _(u"Create an extended partition containing other logical partitions"))]
47 mountpoints = ["","/","/boot","/etc","/home","/lib","/mnt","/mnt/windows","/opt","/root","/usr","/usr/local","/usr/portage","/var"]
48 if editpart != -1:
49 tmppart = tmpparts[float(editpart)]
50 ?>
51 <: if editpart == -1 or tmppart.get_type() == "free":
52 <?
53 # partition size first
54 if editpart == -1:
55 free_mb = 0
56 else:
57 free_mb = tmppart.get_mb()
58 ?>
59 Enter the size of the new partition in MB (max <% str(free_mb) %> MB). If creating an extended partition input its entire size (not just the first logical size): <input type="text" name="size" value="<% str(free_mb) %>"><br>
60 <!-- # partition type -->
61 Choose the filesystem type for this new partition:<br>
62 <table>
63 <tr>
64 <td>Filesystem</td>
65 <td>Description</td>
66 </tr>
67 <: for part_type in part_types:
68 <tr>
69 <td><input type="radio" name="filesystem" value="<% part_type[0] %>"> <% part_type[0] %></td><td><% part_type[1] %></td>
70 </tr>
71 :>
72 </table><br>
73 <input type="submit" value="Create"> &nbsp; <input type="button" value="Cancel" onclick="location.go(-1)">
74 <: else:
75 <?
76 #tmppart = tmpparts[float(editpart)]
77 editpart = int(editpart)
78 ?>
79 <h2>Partition Information:</h2>
80 <b>Minor:</b> <% drive_to_partition + str(editpart) %><br> - <% ("Primary", "Logical")[tmppart.is_logical()] %> Partition<br>
81 <b>Filesystem type:</b><select name="filesystem" size="1">
82 <: for i,part_type in enumerate(part_types):
83 <option value="<% part_types[i][0] %>" <? if part_types[i][0] == tmppart.get_type(): print "selected" ?>><% part_types[i][0] %> - <% part_types[i][1] %></option>
84 :>
85 </select><br> -
86 <b>Options:</b> <input type="text" name="fsopts" value="<% (tmppart.get_mkfsopts() or "") %>"><br> -
87 <b>MountPoint:</b> <select name="mountpoint" size="1">
88 <: for mtpnt in mountpoints:
89 <option value="<% mtpnt %>" <? if mtpnt == tmppart.get_mountpoint(): print "selected" ?>><% mtpnt %></option>
90 :>
91 </select><br> -
92 <b>Mount Options:</b> <input type="text" name="mountopts" value="<% (tmppart.get_mountopts() or "") %>"><br> -
93 <b>Size (MB)</b> <% str(tmppart.get_mb()) %>MB <br>
94 Format this partition? <br><input type="radio" name="format" value="True" <? if tmppart.get_format(): print "checked" ?>>True<br><input type="radio" name="format" value="False" <? if not tmppart.get_format(): print "checked" ?>>False<br>
95 <hr>
96 <table border="0">
97 <tr>
98 <td><input type="submit" name="DelPartition" value="DELETE PARTITION"></td>
99 <td><input type="submit" name="SavePartition" value="Save Changes"></td>
100 <td><input type="submit" name="Cancel" value="Cancel"></td>
101 </tr>
102 </table>
103 </form>
104 :>
105 <? include /webgli/bottom.pyhtml ?>
106 :>

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20