summaryrefslogtreecommitdiff
path: root/skins/stone_flat/filesys.tmpl
blob: c4870a27a677d2a9a649e055a3f04ce415a3a28c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!-- filesys Template -->
<?% IF ! global.bodyinc.defined;global.bodyinc = 1 %?>
<body class="frame">
<?% INCLUDE status.inc %?>
<?% INCLUDE header.inc %?>
<div id="body">
<?% END %?>

<?% IF param.headingText %?>
<h1><?% param.headingText %?></h1>
<?% END %?>

<?%
statusfiles = [];
trash = param.usage.shift;

IF param.graphic;
    FILTER null;
        FOREACH device IN param.usage;
            name = reentities(device.first).split('/').last;
            free = 100 - device.5;
            d = [
                [ device.3, device.4],
                [ device.5, free],
            ];

            USE my_graph = GD.Graph.pie(300, 200);

            label = gettext('Total space');
            label = "${device.0} - ${device.6} - ${label} ${device.2}";
            my_graph.set(
                pie_height => 20,
                axislabelclr => 'black',
                shadow => 1,
            );
            my_graph.set_title_font(param.font,10);
            my_graph.set_value_font(param.font,10);
            my_graph.set_label_font(param.font,6);

            file = writefile("status_filesys_${name}.gif", my_graph.plot(d).gif );
            statusfiles.push([label, file]);
        END;
    END;
%?>

<?% FOREACH file IN statusfiles %?>
<table class="editortable" summary="">
    <tr><td class="editorhead"><?% file.0 %?></td></tr>
    <tr>
        <td class="editortext" align="center">
          <img src="<?% file.1 %?>" alt="<?% file.0 %?>" />
        </td>
    </tr>
    <tr><td class="editorbottom"></td></tr>
</table>
<?% END %?>

<?% ELSE; # not param.graphic; %?>
<table class="editortable" summary="">
  <tr>
    <td class="editorhead">&nbsp;</td>
  </tr>
  <tr>
    <td class="editortext">
      <table summary="" width="100%">
            <?% FOREACH field IN trash %?>
                <th><?% field %?></th>
            <?% END %?>
            </tr>
            <?% FOREACH zeile IN data %?>
            <tr <?% ' class="two"' IF loop.count mod 2 == 0 %?>>
                <?% FOREACH field IN zeile %?>
                <td><?% field %?></td>
                <?% END %?>
            </tr>
            <?% END %?>
      </table>
    </td>
  </tr>
  <tr><td class="editorbottom"></td></tr>
</table>
<?% END %?>