>
<prop:Text><%=Prado::localize('Status client')%> <i class="fa fa-file-medical-alt"></i></prop:Text>
</com:TActiveLinkButton>
+ <com:Application.Web.Portlets.ComponentActionsMenu
+ ID="CompActions"
+ BigButtons="true"
+ />
<i id="status_client_loading" class="fa fa-sync w3-spin" style="display: none; vertical-align: super; margin-left: 6px;"></i> <span id="status_client_error" class="w3-text-red" style="display: none"></span>
<div id="show_client_container">
<div class="w3-row" style="display: flex; flex-wrap: wrap;">
}
}
$this->setAPIHosts();
+
+ // Set component actions
+ $fd_api_host = $this->getFDAPIHost();
+ if ($fd_api_host) {
+ $this->CompActions->setHost($fd_api_host);
+ $this->CompActions->setComponentType('fd');
+ }
}
public function setDIRClientConfig($sender, $param) {
}
}
+ private function getFDAPIHost() {
+ if (!$this->User->isUserAPIHost($this->UserAPIHosts->SelectedValue)) {
+ // Validation error. Somebody manually modified select values
+ return false;
+ }
+ return $this->UserAPIHosts->SelectedValue;
+ }
+
+
private function getFDName() {
$fdname = null;
if (!$this->User->isUserAPIHost($this->UserAPIHosts->SelectedValue)) {
ClientSide.OnFailure="$('#status_storage_loading').hide();status_storage_show_error(parameter);"
Attributes.onclick="hide_first_tab_containers(event);"
>
- <prop:Text><%=Prado::localize('Status storage')%> <i class="fa fa-file-medical-alt"></i></prop:Text>
+ <prop:Text><i class="fa fa-file-medical-alt"></i> <%=Prado::localize('Status storage')%></prop:Text>
</com:TActiveLinkButton>
<com:TActiveLinkButton
ID="Mount"
CausesValidation="true"
ClientSide.OnLoading="oStorageActions.show_loader(true);"
>
- <prop:Text><%=Prado::localize('Mount')%> <i class="fa fa-caret-down"></i></prop:Text>
+ <prop:Text><i class="fa fa-caret-down"></i> <%=Prado::localize('Mount')%></prop:Text>
</com:TActiveLinkButton>
<com:TActiveLinkButton
ID="Release"
CausesValidation="true"
ClientSide.OnLoading="oStorageActions.show_loader(true);"
>
- <prop:Text><%=Prado::localize('Release')%> <i class="fa fa-caret-right"></i></prop:Text>
+ <prop:Text><i class="fa fa-caret-right"></i> <%=Prado::localize('Release')%></prop:Text>
</com:TActiveLinkButton>
<com:TActiveLinkButton
ID="Umount"
CausesValidation="true"
ClientSide.OnLoading="oStorageActions.show_loader(true);"
>
- <prop:Text><%=Prado::localize('Umount')%> <i class="fa fa-caret-up"></i></prop:Text>
+ <prop:Text><i class="fa fa-caret-up"></i> <%=Prado::localize('Umount')%></prop:Text>
</com:TActiveLinkButton>
+ <com:Application.Web.Portlets.ComponentActionsMenu
+ ID="CompActions"
+ BigButtons="true"
+ />
<com:TCallback ID="MountLoading" OnCallback="mountLoading" />
<com:TCallback ID="ReleaseLoading" OnCallback="releaseLoading" />
<com:TCallback ID="UmountLoading" OnCallback="umountLoading" />
}
}
$this->setAPIHosts();
+
+ // Set component actions
+ $sd_api_host = $this->getSDAPIHost();
+ if ($sd_api_host) {
+ $this->CompActions->setHost($sd_api_host);
+ $this->CompActions->setComponentType('sd');
+ }
}
private function setAPIHosts() {
* Bacula(R) - The Network Backup Solution
* Baculum - Bacula web interface
*
- * Copyright (C) 2013-2019 Kern Sibbald
+ * Copyright (C) 2013-2021 Kern Sibbald
*
* The main author of Baculum is Marcin Haba.
* The original author of Bacula is Kern Sibbald, with contributions
*/
class ComponentActionsMenu extends DirectiveListTemplate {
+ const BIG_BUTTONS = 'BigButtons';
+
/**
* Allowed actions to do with components.
*/
);
}
}
+
+ public function setBigButtons($big_buttons) {
+ $big_buttons = TPropertyValue::ensureBoolean($big_buttons);
+ $this->setViewState(self::BIG_BUTTONS, $big_buttons);
+ }
+
+ public function getBigButtons() {
+ return $this->getViewState(self::BIG_BUTTONS, false);
+ }
}
-<a href="javascript:void(0);" onmousedown="openElementOnCursor(event, '<%=$this->ClientID%>_component_actions', -80, 20);"><i class="fas fa-ellipsis-v fa-lg"></i></a>
+<a href="javascript:void(0);" onmousedown="openElementOnCursor(event, '<%=$this->ClientID%>_component_actions', -80, 20);" style="display: <%=$this->BigButtons ? 'none' : 'inline'%>">
+ <i class="fas fa-ellipsis-v fa-lg"></i>
+</a>
<div id="<%=$this->ClientID%>_component_actions" class="w3-card w3-white w3-padding left" style="display: none">
<i class="fa fa-times w3-right" onclick="$('#<%=$this->ClientID%>_component_actions').hide();" style="cursor: pointer"></i>
<ul class="w3-ul new_element_menu">
</li>
</ul>
</div>
+<span id="<%=$this->ClientID%>_big_buttons_component_actions" style="display: <%=$this->BigButtons ? 'inline' : 'none'%>">
+ <com:TActiveLinkButton
+ OnCommand="componentAction"
+ CommandParameter="start"
+ CssClass="w3-button w3-green w3-margin-bottom"
+ ClientSide.OnLoading="$('#<%=$this->ClientID%>_loader_component_actions').show();"
+ ClientSide.OnComplete="$('#<%=$this->ClientID%>_loader_component_actions').hide();"
+ >
+ <i class='fas fa-play'></i> <%[ Start ]%>
+ </com:TActiveLinkButton>
+ <com:TActiveLinkButton
+ OnCommand="componentAction"
+ CommandParameter="stop"
+ CssClass="w3-button w3-green w3-margin-bottom"
+ ClientSide.OnLoading="$('#<%=$this->ClientID%>_loader_component_actions').show();"
+ ClientSide.OnComplete="$('#<%=$this->ClientID%>_loader_component_actions').hide();"
+ >
+ <i class='fas fa-stop'></i> <%[ Stop ]%>
+ </com:TActiveLinkButton>
+ <com:TActiveLinkButton
+ OnCommand="componentAction"
+ CommandParameter="restart"
+ CssClass="w3-button w3-green w3-margin-bottom"
+ ClientSide.OnLoading="$('#<%=$this->ClientID%>_loader_component_actions').show();"
+ ClientSide.OnComplete="$('#<%=$this->ClientID%>_loader_component_actions').hide();"
+ >
+ <i class='fas fa-sync'></i> <%[ Restart ]%>
+ </com:TActiveLinkButton>
+ <i id="<%=$this->ClientID%>_loader_component_actions" class="fa fa-sync fa-spin" style="vertical-align: super;display: none;"></i>
+</span>
<div id="<%=$this->ClientID%>_component_action_message_box" class="w3-modal" style="display: none">
<div class="w3-modal-content w3-card-4 w3-animate-zoom" style="width:600px">
<header class="w3-container w3-red marked">