]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Pages/Home.page
baculum: Tweak allowed resources for normal (not admin) users
[bacula/bacula] / gui / baculum / protected / Pages / Home.page
1 <%@ MasterClass="Application.Layouts.Main" Theme="Baculum-v1"%>
2 <com:TContent ID="Main">
3         <div id="top">
4                 <img id="logo" src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/logo.png" alt="Baculum" />
5                 <div id="directors"><com:TLabel ForControl="Director" Text="<%[ Director: ]%>" />
6                         <com:TActiveDropDownList ID="Director" OnTextChanged="director" />
7                 </div>
8                 <div id="panel_switcher">
9                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/dashboard.png" alt="" onclick="$('<%=$this->Dashboard->ClientID%>').click()" />
10                         <com:TActiveLinkButton ID="Dashboard" Text="<%[ Dashboard ]%>" Attributes.onclick="PanelWindow.show('dashboard'); return false;" />
11                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/workspace.png" alt="" onclick="$('<%=$this->Workspace->ClientID%>').click()"/>
12                         <com:TActiveLinkButton ID="Workspace" Text="<%[ Workspace ]%>" Attributes.onclick="PanelWindow.show('container'); return false;" />
13                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/graphs.png" alt="" onclick="$('<%=$this->Graphs->ClientID%>').click()" />
14                         <com:TActiveLinkButton ID="Graphs" Text="<%[ Graphs ]%>" Attributes.onclick="PanelWindow.show('graphs'); return false;" />
15                 </div>
16                 <com:Application.Portlets.TrayBar ID="TrayBar" />
17         </div>
18         <div id="dashboard">
19                 <div>
20                         <div class="dashboard_graph">
21                                 <div id="jobs_summary_graph">
22                                         <script type="text/javascript">
23                                                 var oJobsStates = <%=$this->jobs_states%>;
24                                         </script>
25                                 </div>
26                                 <span><%[ Jobs status summary ]%></span>
27                         </div>
28                         <div id="dashboard_icons">
29                                 <fieldset class="dashboard_field">
30                                         <legend><%[ Clients ]%></legend>
31                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/client.png" alt="" />
32                                         <p><span><%[ Number of clients: ]%></span><span id="clients_no"></span></p>
33                                         <p><span><%[ Most often used: ]%></span><span id="clients_most"></span></p>
34                                         <p><span><%[ Jobs count on most used: ]%></span><span id="clients_jobs"></span> <%[ jobs ]%></p>
35                                 </fieldset>
36                                 <fieldset class="dashboard_field">
37                                         <legend><%[ Quick job access ]%></legend>
38                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/quick-access.png" alt="" />
39                                         <p><span><%[ Jump to job (last 100): ]%></span></p><select id="jobs_to_view"></select>
40                                         <p class="right"><a href="javascript:void(0)" onclick="SlideWindow.getObj('JobWindow').quickJumpToElement($('jobs_to_view').value, '<%=$this->JobBtn->ClientID%>', PanelWindow);"><%[ View ]%></a></p>
41                                 </fieldset>
42                                 <fieldset class="dashboard_field">
43                                         <legend><%[ Finished jobs ]%></legend>
44                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/finished-jobs.png" alt="" />
45                                         <p><span><%[ Most often used: ]%></span><span id="jobs_most"></span></p>
46                                         <p><span><%[ Execution count most used: ]%></span><span id="jobs_most_count"></span> <%[ times ]%></p>
47                                 </fieldset>
48                                 <fieldset class="dashboard_field"<%=$this->User->getIsAdmin() === false ? ' style="display: none;"' : ''%>>
49                                         <legend><%[ Database ]%></legend>
50                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/database.png" alt="" />
51                                         <p><span><%[ Database type: ]%></span><span><%=$this->dbtype%></span></p>
52                                         <p><span><%[ Database size: ]%></span><span id="database_size"></span></p>
53                                 </fieldset>
54                                 <fieldset class="dashboard_field">
55                                         <legend><%[ Pools ]%></legend>
56                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/tapes.png" alt="" />
57                                         <p><span><%[ Number of pools: ]%></span><span id="pools_no"></span></p>
58                                         <p><span><%[ Most often used: ]%></span><span id="pools_most"></span></p>
59                                         <p><span><%[ Jobs count on most used: ]%></span><span id="pools_jobs"></span> <%[ jobs ]%></p>
60                                 </fieldset>
61                                 <fieldset class="dashboard_field">
62                                         <legend><%[ Job Totals ]%></legend>
63                                         <img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/jobtotals.png" alt="" />
64                                         <p><span><%[ Total bytes: ]%></span><span id="jobs_total_bytes"></span></p>
65                                         <p><span><%[ Total files: ]%></span><span id="jobs_total_files"></span></p>
66                                 </fieldset>
67                                 <fieldset class="dashboard_field">
68                                         <legend><%[ Restore Wizard ]%></legend>
69                                         <a class="big" href="<%=$this->Service->constructUrl('RestoreWizard')%>" style="line-height: 73px; margin: 0 45px"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/restore.png" alt="" /><%[ Perform Restore ]%></a>
70                                 </fieldset>
71                                 <fieldset class="dashboard_field"<%=$this->User->getIsAdmin() === false ? ' style="display: none;"' : ''%>>
72                                         <legend><%[ Configuration Wizard ]%></legend>
73                                         <a class="big" href="<%=$this->Service->constructUrl('ConfigurationWizard')%>" style="line-height: 73px; margin: 0 45px"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/setting.png" alt="" /><%[ Baculum Settings ]%></a>
74                                 </fieldset>
75                         </div>
76                                 <div style="clear: both"></div>
77                 </div>
78         </div>
79         <div id="container" style="display: none;">
80                 <div id="menu-left">
81                         <com:TActiveButton ID="StorageBtn" CssClass="storage-btn">
82                                 <prop:Attributes.onmouseover>
83                                         showTip(
84                                                 this,
85                                                 '<%=Prado::localize('Storage Daemons')%>',
86                                                 '<%=Prado::localize('Configuration of storage daemons.')%>'
87                                         );
88                                 </prop:Attributes.onmouseover>
89                                 <prop:ClientSide.OnLoading>
90                                         SlideWindow.getObj('StorageWindow').showProgress(true);
91                                 </prop:ClientSide.OnLoading>
92                                 <prop:ClientSide.OnComplete>
93                                         SlideWindow.getObj('StorageWindow').setWindowElementsEvent({
94                                                 repeater_id: '<%=$this->StorageWindow->Repeater->ClientID%>',
95                                                 grid_id: '<%=$this->StorageWindow->DataGrid->ClientID%>',
96                                                 request_obj: <%=$this->StorageWindow->DataElementCall->ActiveControl->Javascript%>
97                                         });
98                                 </prop:ClientSide.OnComplete>
99                         </com:TActiveButton>
100                         <com:TActiveButton ID="ClientBtn" CssClass="client-btn">
101                                 <prop:Attributes.onmouseover>
102                                         showTip(
103                                                 this,
104                                                 '<%=Prado::localize('Clients')%>',
105                                                 '<%=Prado::localize('Configuration of clients daemons.')%>'
106                                         );
107                                 </prop:Attributes.onmouseover>
108                                 <prop:ClientSide.OnLoading>
109                                         SlideWindow.getObj('ClientWindow').showProgress(true);
110                                 </prop:ClientSide.OnLoading>
111                                 <prop:ClientSide.OnComplete>
112                                         SlideWindow.getObj('ClientWindow').setWindowElementsEvent({
113                                                 repeater_id: '<%=$this->ClientWindow->Repeater->ClientID%>',
114                                                 grid_id: '<%=$this->ClientWindow->DataGrid->ClientID%>',
115                                                 request_obj: <%=$this->ClientWindow->DataElementCall->ActiveControl->Javascript%>
116                                         });
117                                 </prop:ClientSide.OnComplete>
118                         </com:TActiveButton>
119                         <com:TActiveButton ID="VolumeBtn" CssClass="media-btn">
120                                 <prop:Attributes.onmouseover>
121                                         showTip(
122                                                 this,
123                                                 '<%=Prado::localize('Volumes')%>',
124                                                 '<%=Prado::localize('Management of volumes.')%>'
125                                         );
126                                 </prop:Attributes.onmouseover>
127                                 <prop:ClientSide.OnLoading>
128                                         SlideWindow.getObj('VolumeWindow').showProgress(true);
129                                 </prop:ClientSide.OnLoading>
130                                 <prop:ClientSide.OnComplete>
131                                         SlideWindow.getObj('VolumeWindow').setWindowElementsEvent({
132                                                 repeater_id: '<%=$this->VolumeWindow->Repeater->ClientID%>',
133                                                 grid_id: '<%=$this->VolumeWindow->DataGrid->ClientID%>',
134                                                 request_obj: <%=$this->VolumeWindow->DataElementCall->ActiveControl->Javascript%>
135                                         });
136                                 </prop:ClientSide.OnComplete>
137                         </com:TActiveButton>
138                         <com:TActiveButton ID="PoolBtn" CssClass="pool-btn">
139                                 <prop:Attributes.onmouseover>
140                                         showTip(
141                                                 this,
142                                                 '<%=Prado::localize('Pools')%>',
143                                                 '<%=Prado::localize('Management of volumes pools.')%>'
144                                         );
145                                 </prop:Attributes.onmouseover>
146                                 <prop:ClientSide.OnLoading>
147                                         SlideWindow.getObj('PoolWindow').showProgress(true);
148                                 </prop:ClientSide.OnLoading>
149                                 <prop:ClientSide.OnComplete>
150                                         SlideWindow.getObj('PoolWindow').setWindowElementsEvent({
151                                                 repeater_id: '<%=$this->PoolWindow->Repeater->ClientID%>',
152                                                 grid_id: '<%=$this->PoolWindow->DataGrid->ClientID%>',
153                                                 request_obj: <%=$this->PoolWindow->DataElementCall->ActiveControl->Javascript%>
154                                         });
155                                 </prop:ClientSide.OnComplete>
156                         </com:TActiveButton>
157                         <com:TActiveButton ID="JobBtn" CssClass="job-btn">
158                                 <prop:Attributes.onmouseover>
159                                         showTip(
160                                                 this,
161                                                 '<%=Prado::localize('Jobs')%>',
162                                                 '<%=Prado::localize('Jobs settings.')%>'
163                                         );
164                                 </prop:Attributes.onmouseover>
165                                 <prop:ClientSide.OnLoading>
166                                         SlideWindow.getObj('JobWindow').showProgress(true);
167                                 </prop:ClientSide.OnLoading>
168                                 <prop:ClientSide.OnComplete>
169                                         SlideWindow.getObj('JobWindow').setWindowElementsEvent({
170                                                 repeater_id: '<%=$this->JobWindow->Repeater->ClientID%>',
171                                                 grid_id: '<%=$this->JobWindow->DataGrid->ClientID%>',
172                                                 request_obj: <%=$this->JobWindow->DataElementCall->ActiveControl->Javascript%>,
173                                                 actions_obj: <%=$this->JobWindow->RunJobCall->ActiveControl->Javascript%>
174                                         });
175                                 </prop:ClientSide.OnComplete>
176                         </com:TActiveButton>
177                         <com:TActiveButton ID="JobRunBtn" CssClass="jobrun-btn">
178                                 <prop:Attributes.onmouseover>
179                                         showTip(
180                                                 this,
181                                                 '<%=Prado::localize('Run job')%>',
182                                                 '<%=Prado::localize('Starting jobs.')%>'
183                                         );
184                                 </prop:Attributes.onmouseover>
185                                 <prop:ClientSide.OnLoading>
186                                         SlideWindow.getObj('JobRunWindow').showProgress(true);
187                                 </prop:ClientSide.OnLoading>
188                                 <prop:ClientSide.OnComplete>
189                                         SlideWindow.getObj('JobRunWindow').setWindowElementsEvent({
190                                                 repeater_id: '<%=$this->JobRunWindow->Repeater->ClientID%>',
191                                                 grid_id: '<%=$this->JobRunWindow->DataGrid->ClientID%>',
192                                                 request_obj: <%=$this->JobRunWindow->DataElementCall->ActiveControl->Javascript%>
193                                         });
194                                 </prop:ClientSide.OnComplete>
195                         </com:TActiveButton>
196                         <com:TActiveButton CssClass="restore-btn" OnClick="restore">
197                                 <prop:Attributes.onmouseover>
198                                         showTip(
199                                                 this,
200                                                 '<%=Prado::localize('Restore')%>',
201                                                 '<%=Prado::localize('Restore wizard.')%>'
202                                         );
203                                 </prop:Attributes.onmouseover>
204                         </com:TActiveButton>
205                         <com:TActiveButton ID="SettingsWizardBtn" CssClass="setting-btn" OnClick="configuration">
206                                 <prop:Attributes.onmouseover>
207                                         showTip(
208                                                 this,
209                                                 '<%=Prado::localize('Settings')%>',
210                                                 '<%=Prado::localize('Management settings wizard.')%>'
211                                         );
212                                 </prop:Attributes.onmouseover>
213                         </com:TActiveButton>
214                 </div>
215                 <com:TActivePanel ID="Content">
216                         <div id="content">
217                                 <com:Application.Portlets.StorageList ID="StorageWindow" ButtonID="<%=$this->StorageBtn->ClientID%>" WindowTitle="<%[ Storage Daemons ]%>" />
218                                 <com:Application.Portlets.ClientList ID="ClientWindow" ButtonID="<%=$this->ClientBtn->ClientID%>" WindowTitle="<%[ Clients ]%>" />
219                                 <com:Application.Portlets.VolumeList ID="VolumeWindow" ButtonID="<%=$this->VolumeBtn->ClientID%>" WindowTitle="<%[ Volumes ]%>" />
220                                 <com:Application.Portlets.PoolList ID="PoolWindow" ButtonID="<%=$this->PoolBtn->ClientID%>" WindowTitle="<%[ Pools ]%>" />
221                                 <com:Application.Portlets.JobList ID="JobWindow" ButtonID="<%=$this->JobBtn->ClientID%>" WindowTitle="<%[ Jobs ]%>" />
222                                 <com:Application.Portlets.JobRunList ID="JobRunWindow" ButtonID="<%=$this->JobRunBtn->ClientID%>" WindowTitle="<%[ Jobs for run ]%>" />
223                                 <div id="configuration">
224                                         <div id="configuration-box">
225                                                 <div id="configuration-progress" class="configuration-progress"></div>
226                                         </div>
227                                         <com:Application.Portlets.VolumeConfiguration ID="VolumeConfiguration" />
228                                         <com:Application.Portlets.StorageConfiguration ID="StorageConfiguration" />
229                                         <com:Application.Portlets.ClientConfiguration ID="ClientConfiguration" />
230                                         <com:Application.Portlets.PoolConfiguration ID="PoolConfiguration" />
231                                         <com:Application.Portlets.JobConfiguration ID="JobConfiguration" />
232                                         <com:Application.Portlets.JobRunConfiguration ID="JobRunConfiguration" />
233                                 </div>
234                         </div>
235                 </com:TActivePanel>
236         </div>
237         <div id="graphs" style="display: none;">
238                 <select id="time_range" name="time_range">
239                         <option value="23400"><%[ Last 6 hours ]%></option>
240                         <option value="43200"><%[ Last 12 hours ]%></option>
241                         <option value="86400" selected="selected"><%[ Today ]%></option>
242                         <option value="172800"><%[ Two days ]%></option>
243                         <option value="604800"><%[ Last week ]%></option>
244                         <option value="1209600"><%[ Last two weeks ]%></option>
245                         <option value="2592000"><%[ Last month ]%></option>
246                         <option value="7776000"><%[ Last three months ]%></option>
247                         <option value="15768000"><%[ Last six months ]%></option>
248                         <option value="31536000"><%[ Last year ]%></option>
249                 </select>
250                 <span>
251                         <%[ Date From: ]%> <com:TDatePicker ID="DateFrom" DateFormat="yyyy-MM-dd" Width="80px" />
252                         <%[ Date To: ]%> <com:TDatePicker ID="DateTo" DateFormat="yyyy-MM-dd" Width="80px" />
253                 </span>
254                 <span><%[ Client: ]%></span>
255                 <com:TActiveDropDownList ID="Clients" CssClass="textbox" AutoPostBack="false" Width="160px" Style="display: inline" />
256                 <span><%[ Job name: ]%></span>
257                 <com:TActiveDropDownList ID="Jobs" CssClass="textbox" AutoPostBack="false" Width="160px" Style="display: inline" />
258                 <p><%[ Legend: ]%></p>
259                 <div id="legend"></div>
260                 <div id="graphs_content">
261                         <script type="text/javascript">
262                                 var jobs = <%=$this->getJobs()%>;
263                         </script>
264                 </div>
265                 <script type="text/javascript">
266                         var graph_lang = {
267                                 "graph_title": "<%[ Graph: Jobs size / Time ]%>",
268                                 "xaxis_title": "<%[ Time ]%>",
269                                 "yaxis_title": "<%[ Jobs size (GiB) ]%>"
270                         };
271                         var graph;
272                         document.observe("dom:loaded", function() {
273                                 PanelWindow.onShow = function() {
274                                         if (PanelWindow.currentWindowId === 'graphs' && typeof(graph) == "undefined") {
275                                                 graph = new GraphClass(jobs, graph_lang, 'graphs_content', 'legend', 'time_range', '<%=$this->DateFrom->ClientID%>', '<%=$this->DateTo->ClientID%>', '<%=$this->Clients->ClientID%>', '<%=$this->Jobs->ClientID%>');
276                                         } else if (PanelWindow.currentWindowId === 'dashboard') {
277                                                 Dashboard.update_all(Statistics, TEXT);
278                                         }
279                                 };
280                         });
281                 </script>
282                 <p class="right bold italic"><%[ Tip: for getting zoom, please mark area on graph. ]%></p>
283                 <p class="right bold italic"><%[ Tip 2: for back from zoom, please click somewhere on graph. ]%></p>
284         </div>
285         <div id="console">
286                 <a id="clear_bvfs_cache" href="javascript: void(0)"><com:TActiveImageButton ID="ClearBvfsCache" OnCallback="clearBvfsCache" Attributes.onclick="return (confirm('<%=Prado::localize('This action will clear bvfs cache that was created during preparing restore files. There is not recommended use this action during restore job working. Are you sure?')%>'));" ImageUrl="<%=$this->getPage()->getTheme()->getBaseUrl()%>/trash_icon.png" AlternateText="<%[ clear bvfs cache ]%>" /><com:TLabel ForControl="ClearBvfsCache"><%[ clear bvfs cache ]%></com:TLabel></a>
287                 <a id="logging" href="javascript:void(0)"><com:TActiveCheckBox ID="Logging" OnCallback="setDebug" Attributes.onclick="return (this.checked === false || confirm('<%=Prado::localize('Debug files enable possibility to save most of actions executed on Baculum WebGUI. Debug functionality should be enabled if is happening shomething wrong with Baculum or something that looks like a bug. Logs can be useful for detecting a problems in Baculum working. After confirmation this message Baculum debug files will be continuously saving in /protected/Data/ directory. Are you sure?')%>'));" /><com:TLabel ForControl="Logging"><%[ Enable debug ]%></com:TLabel></a>
288                 <a id="volumes_tools_launcher" href="javascript:void(0)" <%=$this->User->getIsAdmin() === false ? ' style="display: none;"' : ''%>><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/tape_tools_icon.png" alt="<%[ volumes tools ]%>" /><span><%[ volumes tools ]%></span></a>
289                 <a id="console_launcher" href="javascript:void(0)"><img src="<%=$this->getPage()->getTheme()->getBaseUrl()%>/console_icon.png" alt="<%[ Bacula console ]%>" /><span><%[ show console ]%></span></a>
290                 <com:Application.Portlets.VolumesTools ID="VolumesTools" />
291                 <com:Application.Portlets.Console ID="Console" />
292         </div>
293         <div id="bottom"></div>
294         <script type="text/javascript">
295                 var oMonitor;
296                 document.observe("dom:loaded", function() {
297                         <%=(!is_null($this->initWindowId) && !is_null($this->initElementId) ?
298                                 'SlideWindow.getObj("' . $this->initWindowId . 'Window").setInitElementId("' . $this->initElementId . '");'
299                         : '')%>
300                         <%=(!is_null($this->openWindow) ?
301                                 'PanelWindow.show("container");
302                                 $("' . $this->openWindow . '").click();
303                                 window.history.pushState("", "", "/");'
304                         : '')%>
305                 });
306                 var TEXT = {
307                         level: '<%[ level ]%>',
308                         status: '<%[ status ]%>',
309                         starttime: '<%[ start time ]%>'
310                 }
311         </script>
312 </com:TContent>