1814 |
_s "" |
_s "" |
1815 |
), ":\t\t\t\tcheck shared files for removal"; |
), ":\t\t\t\tcheck shared files for removal"; |
1816 |
|
|
1817 |
|
"disk", Arg_one (fun arg o -> |
1818 |
|
let buf = o.conn_buf in |
1819 |
|
Printf.bprintf buf "working on dir %s\n" arg; |
1820 |
|
Printf.bprintf buf "bsize %Ld\n" (MlUnix.bsize arg); |
1821 |
|
Printf.bprintf buf "blocks %Ld\n" (MlUnix.blocks arg); |
1822 |
|
Printf.bprintf buf "bfree %Ld\n" (MlUnix.bfree arg); |
1823 |
|
Printf.bprintf buf "bavail %Ld\n" (MlUnix.bavail arg); |
1824 |
|
Printf.bprintf buf "fnamelen %Ld\n" (MlUnix.fnamelen arg); |
1825 |
|
Printf.bprintf buf "filesystem %s\n" (MlUnix.filesystem arg); |
1826 |
|
Printf.bprintf buf "disktotal %Ld\n" (MlUnix.disktotal arg); |
1827 |
|
Printf.bprintf buf "diskfree %Ld\n" (MlUnix.diskfree arg); |
1828 |
|
Printf.bprintf buf "diskused %Ld\n" (MlUnix.diskused arg); |
1829 |
|
Printf.bprintf buf "percentused %d\n" (MlUnix.percentused arg); |
1830 |
|
Printf.bprintf buf "percentfree %d\n" (MlUnix.percentfree arg); |
1831 |
|
_s "" |
1832 |
|
), "debug command (example: disk .)"; |
1833 |
|
|
1834 |
"shares", Arg_none (fun o -> |
"shares", Arg_none (fun o -> |
1835 |
|
|
1836 |
let buf = o.conn_buf in |
let buf = o.conn_buf in |
1853 |
\\<tr\\>\\<td\\>"; |
\\<tr\\>\\<td\\>"; |
1854 |
|
|
1855 |
html_mods_table_header buf "sharesTable" "shares" [ |
html_mods_table_header buf "sharesTable" "shares" [ |
1856 |
( "0", "srh ac", "Click to unshare directory", "Unshare" ) ; |
( "0", "srh ac", "Click to unshare directory", "Unshare" ) ; |
1857 |
( "1", "srh ar", "Priority", "P" ) ; |
( "1", "srh ar", "Priority", "P" ) ; |
1858 |
( "0", "srh", "Directory", "Directory" ) ; |
( "0", "srh", "Directory", "Directory" ) ; |
1859 |
( "0", "srh", "Strategy", "Strategy" ) ]; |
( "0", "srh", "Strategy", "Strategy" ) ; |
1860 |
|
( "1", "srh ar", "MB used", "MB used" ) ; |
1861 |
|
( "1", "srh ar", "MB free", "MB free" ) ; |
1862 |
|
( "1", "srh ar", "% free", "% free" ) ; |
1863 |
|
( "0", "srh", "Filesystem", "FS" ) ]; |
1864 |
|
|
1865 |
let counter = ref 0 in |
let counter = ref 0 in |
1866 |
|
|
1870 |
*) |
*) |
1871 |
|
|
1872 |
List.iter (fun shared_dir -> |
List.iter (fun shared_dir -> |
1873 |
incr counter; |
let dir = shared_dir.shdir_dirname in |
1874 |
Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\> |
incr counter; |
1875 |
|
Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\> |
1876 |
\\<td title=\\\"Click to unshare this directory\\\" |
\\<td title=\\\"Click to unshare this directory\\\" |
1877 |
onMouseOver=\\\"mOvr(this);\\\" |
onMouseOver=\\\"mOvr(this);\\\" |
1878 |
onMouseOut=\\\"mOut(this);\\\" |
onMouseOut=\\\"mOut(this);\\\" |
1882 |
class=\\\"srb\\\"\\>Unshare\\</td\\> |
class=\\\"srb\\\"\\>Unshare\\</td\\> |
1883 |
\\<td class=\\\"sr ar\\\"\\>%d\\</td\\> |
\\<td class=\\\"sr ar\\\"\\>%d\\</td\\> |
1884 |
\\<td class=\\\"sr\\\"\\>%s\\</td\\> |
\\<td class=\\\"sr\\\"\\>%s\\</td\\> |
1885 |
|
\\<td class=\\\"sr\\\"\\>%s\\</td\\> |
1886 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1887 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1888 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1889 |
\\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>" |
\\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>" |
1890 |
(if !counter mod 2 == 0 then "dl-1" else "dl-2") |
(if !counter mod 2 == 0 then "dl-1" else "dl-2") |
1891 |
shared_dir.shdir_dirname |
dir |
1892 |
shared_dir.shdir_priority |
shared_dir.shdir_priority |
1893 |
shared_dir.shdir_dirname |
dir |
1894 |
shared_dir.shdir_strategy; |
shared_dir.shdir_strategy |
1895 |
|
(if (MlUnix.diskused dir) = Int64.of_int (-1) then "---" |
1896 |
|
else (size_of_int64 (MlUnix.diskused dir))) |
1897 |
|
(if (MlUnix.diskfree dir) = Int64.of_int (-1) then "---" |
1898 |
|
else (size_of_int64 (MlUnix.diskfree dir))) |
1899 |
|
(if (MlUnix.percentfree dir) = (-1) then "---" |
1900 |
|
else string_of_int(MlUnix.percentfree dir)) |
1901 |
|
(MlUnix.filesystem dir); |
1902 |
) |
) |
1903 |
!!shared_directories; |
!!shared_directories; |
1904 |
|
|
1905 |
|
incr counter; |
1906 |
|
let dir = !!temp_directory in |
1907 |
|
Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\> |
1908 |
|
\\<td title=\\\"\\\" |
1909 |
|
class=\\\"srb\\\"\\>------\\</td\\> |
1910 |
|
\\<td class=\\\"sr ar\\\"\\>%d\\</td\\> |
1911 |
|
\\<td class=\\\"sr\\\"\\>%s\\</td\\> |
1912 |
|
\\<td class=\\\"sr\\\"\\>%s\\</td\\> |
1913 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1914 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1915 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1916 |
|
\\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>" |
1917 |
|
(if !counter mod 2 == 0 then "dl-1" else "dl-2") |
1918 |
|
0 |
1919 |
|
dir |
1920 |
|
"temp_directory" |
1921 |
|
(if (MlUnix.diskused dir) = Int64.of_int (-1) then "---" |
1922 |
|
else (size_of_int64 (MlUnix.diskused dir))) |
1923 |
|
(if (MlUnix.diskfree dir) = Int64.of_int (-1) then "---" |
1924 |
|
else (size_of_int64 (MlUnix.diskfree dir))) |
1925 |
|
(if (MlUnix.percentfree dir) = (-1) then "---" |
1926 |
|
else string_of_int(MlUnix.percentfree dir)) |
1927 |
|
(MlUnix.filesystem dir); |
1928 |
|
|
1929 |
|
let dir = Sys.getcwd () in |
1930 |
|
incr counter; |
1931 |
|
Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\> |
1932 |
|
\\<td title=\\\"\\\" |
1933 |
|
class=\\\"srb\\\"\\>------\\</td\\> |
1934 |
|
\\<td class=\\\"sr ar\\\"\\>%d\\</td\\> |
1935 |
|
\\<td class=\\\"sr\\\"\\>%s\\</td\\> |
1936 |
|
\\<td class=\\\"sr\\\"\\>%s\\</td\\> |
1937 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1938 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1939 |
|
\\<td class=\\\"sr ar\\\"\\>%s\\</td\\> |
1940 |
|
\\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>" |
1941 |
|
(if !counter mod 2 == 0 then "dl-1" else "dl-2") |
1942 |
|
0 |
1943 |
|
dir |
1944 |
|
"core_directory" |
1945 |
|
(if (MlUnix.diskused dir) = Int64.of_int (-1) then "---" |
1946 |
|
else (size_of_int64 (MlUnix.diskused dir))) |
1947 |
|
(if (MlUnix.diskfree dir) = Int64.of_int (-1) then "---" |
1948 |
|
else (size_of_int64 (MlUnix.diskfree dir))) |
1949 |
|
(if (MlUnix.percentfree dir) = (-1) then "---" |
1950 |
|
else string_of_int(MlUnix.percentfree dir)) |
1951 |
|
(MlUnix.filesystem dir); |
1952 |
|
|
1953 |
Printf.bprintf buf "\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>"; |
Printf.bprintf buf "\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>"; |
1954 |
end |
end |