]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Web/Portlets/ClientConfiguration.tpl
baculum: Add link to go back from job configuration window
[bacula/bacula] / gui / baculum / protected / Web / Portlets / ClientConfiguration.tpl
1 <%@ MasterClass="Application.Web.Portlets.ConfigurationPanel"%>
2 <com:TContent ID="ConfigurationWindowContent">
3         <com:TActivePanel DefaultButton="Status">
4                 <h4><%[ Client name: ]%> <com:TActiveLabel ID="ClientName" /><com:TActiveLabel ID="ClientIdentifier" Visible="false" /></h4>
5                 <com:TActiveLabel ID="ClientDescription" CssClass="description" />
6                 <span class="text tab tab_active" rel="client_actions_tab"><%[ Actions ]%></span>
7                 <span class="text tab" rel="client_console_tab"><%[ Console status ]%></span>
8                 <span class="text tab" rel="client_jobs_tab"><%[ Jobs for Client ]%></span>
9                 <hr class="tabs" />
10                 <div id="client_actions_tab">
11                         <com:TValidationSummary
12                                 ID="ValidationSummary"
13                                 CssClass="validation-error-summary"
14                                 ValidationGroup="ClientGroup"
15                                 AutoUpdate="true"
16                                 Display="Dynamic"
17                                 HeaderText="<%[ There is not possible to run selected action because: ]%>" />
18                         <com:TCallback ID="ReloadClients" OnCallback="Page.ClientWindow.prepareData" ClientSide.OnComplete="SlideWindow.getObj('ClientWindow').setLoadRequest();" />
19                         <div class="button center">
20                                 <com:BActiveButton ID="Status" Text="<%[ Status ]%>" OnClick="status">
21                                         <prop:ClientSide.OnSuccess>
22                                                 ConfigurationWindow.getObj('ClientWindow').progress(false);
23                                                 ConfigurationWindow.getObj('ClientWindow').switchTab('client_console_tab');
24                                         </prop:ClientSide.OnSuccess>
25                                 </com:BActiveButton>
26                         </div>
27                 </div>
28                 <div id="client_console_tab" style="display: none">
29                         <div class="field-full">
30                                 <com:TActiveTextBox ID="ShowClient" TextMode="MultiLine" CssClass="textbox-auto" Style="height: 440px" ReadOnly="true" />
31                         </div>
32                 </div>
33                 <div id="client_jobs_tab" style="display: none">
34                         <div style="max-height: 444px; overflow-y: auto;">
35                                 <com:TActiveDataGrid
36                                         ID="JobsForClient"
37                                         EnableViewState="false"
38                                         AutoGenerateColumns="false"
39                                         AllowSorting="false"
40                                         CellPadding="5px"
41                                         CssClass="window-section-detail"
42                                         ItemStyle.CssClass="slide-window-element"
43                                         AlternatingItemStyle.CssClass="slide-window-element-alternating"
44                                         >
45                                         <com:TActiveBoundColumn HeaderText="ID" DataField="jobid" />
46                                         <com:TActiveTemplateColumn HeaderText="<%[ Job name ]%>" SortExpression="name">
47                                                 <prop:ItemTemplate>
48                                                         <div title="<%=$this->getParent()->Data['name']%>"><%=$this->getPage()->JobWindow->formatJobName($this->getParent()->Data['name'])%></div>
49                                                         <input type="hidden" name="<%=$this->getParent()->ClientID%>" value="<%=$this->getParent()->Data['jobid']%>" />
50                                                 </prop:ItemTemplate>
51                                         </com:TActiveTemplateColumn>
52                                         <com:TActiveTemplateColumn>
53                                                 <prop:HeaderText>
54                                                         <span title="<%=Prado::localize('Type')%>" style="cursor: help">T</span>
55                                                 </prop:HeaderText>
56                                                 <prop:ItemTemplate>
57                                                         <%=$this->getParent()->Data['type']%>
58                                                 </prop:ItemTemplate>
59                                         </com:TActiveTemplateColumn>
60                                         <com:TActiveTemplateColumn>
61                                                 <prop:HeaderText>
62                                                         <span title="<%=Prado::localize('Level')%>" style="cursor: help">L</span>
63                                                 </prop:HeaderText>
64                                                 <prop:ItemTemplate>
65                                                         <%=$this->getParent()->Data['level']%>
66                                                 </prop:ItemTemplate>
67                                         </com:TActiveTemplateColumn>
68                                         <com:TActiveTemplateColumn HeaderText="<%[ Job status ]%>" SortExpression="jobstatus">
69                                                 <prop:ItemTemplate>
70                                                         <div class="job-status-<%=$this->getPage()->JobWindow->getJobStatusLetter($this->getParent()->Data)%>" title="<%=$this->getPage()->JobWindow->getJobStatusDescription($this->getParent()->Data)%>"><%=$this->getPage()->JobWindow->getJobStatusValue($this->getParent()->Data)%></div>
71                                                 </prop:ItemTemplate>
72                                         </com:TActiveTemplateColumn>
73                                         <com:TActiveTemplateColumn HeaderText="<%[ Size ]%>" SortExpression="jobbytes">
74                                                 <prop:ItemTemplate>
75                                                         <div class="size" rel="<%=$this->getParent()->Data['jobbytes']%>"><%=$this->getParent()->Data['jobbytes']%></div>
76                                                 </prop:ItemTemplate>
77                                         </com:TActiveTemplateColumn>
78                                         <com:TActiveBoundColumn SortExpression="jobfiles" HeaderText="<%[ Files ]%>" DataField="jobfiles" />
79                                         <com:TActiveTemplateColumn HeaderText="<%[ End time ]%>" SortExpression="endtime">
80                                                 <prop:ItemTemplate>
81                                                         <%=$this->getParent()->Data['endtime']%>
82                                                         <%=in_array($this->getParent()->Data['jobstatus'], $this->getPage()->JobWindow->runningJobStates) ? '<img src="' . $this->getPage()->getTheme()->getBaseUrl() . '/loader-alter.gif" />' : ''%>
83                                                 </prop:ItemTemplate>
84                                         </com:TActiveTemplateColumn>
85                                 </com:TActiveDataGrid>
86                         </div>
87                         <p class="center bold" id="no_jobs_for_client" style="display: none"><%[ No jobs for the client. ]%></p>
88                         <script type="text/javascript">
89                                 var bind_jobs_for_client_action = function() {
90                                         var grid_id = '<%=$this->JobsForClient->ClientID%>';
91                                         var no_jobs_msg_id = 'no_jobs_for_client';
92                                         if (!document.getElementById(grid_id)) {
93                                                 $('#' + no_jobs_msg_id).show();
94                                                 return;
95                                         }
96                                         $('#' + no_jobs_msg_id).hide();
97                                         SlideWindow.makeSortable(grid_id);
98                                         var odd_rows = ['#' + grid_id, 'tr.' + SlideWindow.elements.contentItems].join(' ');
99                                         var even_rows = ['#' + grid_id, 'tr.' + SlideWindow.elements.contentAlternatingItems].join(' ');
100                                         var callback = <%=$this->OpenJobCall->ActiveControl->Javascript%>;
101                                         $(odd_rows + ', ' + even_rows).each(function(index, el) {
102                                                 $(el).on('click', function(e) {
103                                                         var el = $(e.srcElement||e.target);
104
105                                                         if (el.length === 1) {
106                                                                 el = el.parents('tr').find('input[type=hidden]');
107                                                                 if (el.length === 1) {
108                                                                         var val = el[0].value;
109                                                                         callback.setCallbackParameter(val);
110                                                                         callback.dispatch();
111                                                                         ConfigurationWindow.getObj('ClientWindow').progress(true);
112                                                                 }
113                                                         }
114                                                 });
115                                         }.bind(this));
116                                         SlideWindow.sortTable(grid_id, 0, true);
117                                 }.bind(this);
118                         </script>
119                         <com:TCallback ID="OpenJobCall" OnCallback="openJob">
120                                 <prop:ClientSide.OnComplete>
121                                         ConfigurationWindow.getObj('ClientWindow').progress(false);
122                                         ConfigurationWindow.getObj('JobWindow').switchTabByNo(2);
123                                         ConfigurationWindow.getObj('JobWindow').show();
124                                 </prop:ClientSide.OnComplete>
125                         </com:TCallback>
126                 </div>
127         </com:TActivePanel>
128 </com:TContent>