5 local vgname
= "sharevg"
6 local lvname
= "homelv"
11 <br> <font ><strong>您的系统上还没有共享卷。</strong></font>
15 <strong>共享卷</strong>是一个虚拟的磁盘,所有共享都会放在这个磁盘上,以方便管理。共享卷是由一个以上的硬盘或Raid组成的大的磁盘.
16 <a href="volumes_create_sharelv.cgi?todo=disks">点击此处创建共享卷</a>
21 local shares
= smbshare
.get()
22 local options
= "<option id=_select style=\"color:blue;\" value=myselect selected>------ 共享列表 ------</option>"
23 local hiddens
= [[<input type=hidden id="myselect">]]
24 local style
= [[style="background-image:url(icons/volume.png);"]]
26 for s
in pairs(shares
) do
28 if not shares
[s
].comment
then shares
[s
].comment
="" end
29 if not shares
[s
].path
then shares
[s
].path
="" end
30 options
= options
..[[<option ]]..style
..[[ value="]]..s
..[[">]]..s
..[[</option>]]
31 hiddens
= hiddens
..[[<input type=hidden id="]]..s
..[[" value="]]..s
.."|"..shares
[s
].path
.."|"..shares
[s
].comment
..[[">]]
36 <form action="shares_edit_share.cgi",method="post">
37 <table width="80%"><tr><td>
38 <select class="icon-menu" name="selTitle" size=10 id="titles" onchange="setOtherText(this)" width="100%">
46 <table width="90%" cellspacing="2" cellpadding="5" border="0">
47 <tr class=color_table_row1><td>
49 <input type="text" id="share" name="share">
51 <tr class=color_table_row2><td>
53 <input type="text" id="path" name="path">
55 <tr class=color_table_row1><td>
56 <strong>共享描述 </strong>
57 <input type="text" id="comment" name="comment">
60 <input type=hidden name=todo value="">
61 <input type="submit" value="新建共享" onclick="return mysubmit(1)">
62 <input type="submit" value="更新共享" onclick="return mysubmit(2)">
63 <input type="submit" value="删除共享" onclick="return mysubmit(3)">
75 function setOtherText(obj) {
76 if (!document.layers) {
77 var share = document.getElementById("share");
78 var path = document.getElementById("path");
79 var comment = document.getElementById("comment");
80 var str = document.getElementById(obj.value).value;
81 var arr = str.split("|");
90 comment.value = arr[2];
94 function mysubmit(value) {
96 document.forms[0].todo.value="edit_create";
97 }else if (value == 2) {
98 document.forms[0].todo.value="edit_update";
99 } else if (value == 3) {
100 var ss = "您要删除共享\""+document.getElementById("share").value + "\"吗?";
102 document.forms[0].todo.value="delete";
103 document.forms[0].action="shares.cgi";
108 document.forms[0].submit();
114 -------------------------
116 -------------------------
118 if is_vg_exist(vgname
) then
120 print("<h3>共享管理</h3>")
122 elseif qp
.todo
=="delete" then
123 if qp
.share
and qp
.share
~= "" then
124 local sh_list
= smbshare
.get()
125 if not sh_list
[qp
.share
] then
126 ui_message_err("共享 <strong>"..qp
.share
.."</strong>不存在<br>")
129 smbshare
.remove(qp
.share
)
131 sh_list
= smbshare
.get()
132 if not sh_list
[qp
.share
] then
133 print("共享 <strong>"..qp
.share
.."</strong>已删除<br>")
135 ui_message_err("共享 <strong>"..qp
.share
.."</strong>删除失败.<br>")
138 ui_message_err("请指定要删除的共享名.")