The URL format is: ?open=(Storage|Client|Volume|Pool|Job)&id=(storageid|clientid|volumeid|poolid|jobid)
$(tab_rel).show();
},
+ switchTabByNo: function(tab_no) {
+ var tab_rel;
+ var tabs = $$('div[id=' + this.window_id + '] span.tab');
+ for (var i = 0, j = 1; i < tabs.length; i++, j++) {
+ if (tab_no === j) {
+ tab_rel = tabs[i].readAttribute('rel');
+ break;
+ }
+ }
+
+ if (tab_rel) {
+ this.switchTab(tab_rel);
+ }
+ },
+
openConfigurationWindow: function(slideWindowObj) {
if(this.is_progress() === false) {
this.progress(true);
checked: [],
objects: {},
windowSize: null,
+ initElementId: null,
size: {
widthNormal : '53%',
if (opts.hasOwnProperty('actions_obj')) {
this.actionsRequest = opts.actions_obj;
}
+
+ if (this.initElementId) {
+ this.openConfigurationById(this.initElementId);
+ this.initElementId = null;
+ // for open window by init element, default set second tab
+ this.configurationObj.switchTabByNo(2);
+ }
+
this.showProgress(false);
this.markAllChecked(false);
this.setLoadRequest();
var el = $(element).down('input[type=hidden]')
if(el) {
var val = el.getValue();
- this.loadRequest.ActiveControl.CallbackParameter = val;
- this.loadRequest.dispatch();
- this.configurationObj.openConfigurationWindow(this);
+ this.openConfigurationById(val);
}
}.bind(this);
this.setSearch();
this.revertSortingFromCookie();
},
+ openConfigurationById: function(id) {
+ this.loadRequest.ActiveControl.CallbackParameter = id;
+ this.loadRequest.dispatch();
+ this.configurationObj.openConfigurationWindow(this);
+ },
+
isConfigurationOpen: function() {
var is_open = false;
$$(this.elements.configurationWindows, this.elements.configurationProgress).each(function(el) {
}
}
return el;
+ },
+ setInitElementId: function(id) {
+ this.initElementId = id;
}
});
});
</prop:ClientSide.OnComplete>
</com:TActiveButton>
- <com:TActiveButton ID="MediaBtn" CssClass="media-btn">
+ <com:TActiveButton ID="VolumeBtn" CssClass="media-btn">
<prop:Attributes.onmouseover>
showTip(
this,
<div id="content">
<com:Application.Portlets.StorageList ID="StorageWindow" ButtonID="<%=$this->StorageBtn->ClientID%>" WindowTitle="<%[ Storage Daemons ]%>" />
<com:Application.Portlets.ClientList ID="ClientWindow" ButtonID="<%=$this->ClientBtn->ClientID%>" WindowTitle="<%[ Clients ]%>" />
- <com:Application.Portlets.VolumeList ID="VolumeWindow" ButtonID="<%=$this->MediaBtn->ClientID%>" WindowTitle="<%[ Volumes ]%>" />
+ <com:Application.Portlets.VolumeList ID="VolumeWindow" ButtonID="<%=$this->VolumeBtn->ClientID%>" WindowTitle="<%[ Volumes ]%>" />
<com:Application.Portlets.PoolList ID="PoolWindow" ButtonID="<%=$this->PoolBtn->ClientID%>" WindowTitle="<%[ Pools ]%>" />
<com:Application.Portlets.JobList ID="JobWindow" ButtonID="<%=$this->JobBtn->ClientID%>" WindowTitle="<%[ Jobs ]%>" />
<com:Application.Portlets.JobRunList ID="JobRunWindow" ButtonID="<%=$this->JobRunBtn->ClientID%>" WindowTitle="<%[ Jobs for run ]%>" />
<script type="text/javascript">
var oMonitor;
document.observe("dom:loaded", function() {
+ <%=(!is_null($this->initWindowId) && !is_null($this->initElementId) ?
+ 'SlideWindow.getObj("' . $this->initWindowId . 'Window").setInitElementId("' . $this->initElementId . '");'
+ : '')%>
<%=(!is_null($this->openWindow) ?
'$("' . $this->openWindow . '").click(); window.history.pushState("", "", "/");'
- : '')%>
+ : '')%>
});
</script>
</com:TContent>
public $openWindow = null;
- public $windowIds = array('Storage', 'Client', 'Media', 'Pool', 'Job', 'JobRun');
+ public $initWindowId = null;
+
+ public $initElementId = null;
+
+ public $windowIds = array('Storage', 'Client', 'Volume', 'Pool', 'Job', 'JobRun');
public function onInit($param) {
parent::onInit($param);
$appConfig = $this->getModule('configuration')->getApplicationConfig();
$this->SettingsWizardBtn->Visible = $this->User->getIsAdmin();
- $this->MediaBtn->Visible = $this->User->getIsAdmin();
+ $this->VolumeBtn->Visible = $this->User->getIsAdmin();
$this->ClearBvfsCache->Visible = $this->User->getIsAdmin();
$this->Logging->Visible = $this->User->getIsAdmin();
}
public function setWindowOpen() {
- if (isset($this->Request['open']) && in_array($this->Request['open'], $this->windowIds)) {
+ if (isset($this->Request['open']) && in_array($this->Request['open'], $this->windowIds) && $this->Request['open'] != 'JobRun') {
$btn = $this->Request['open'] . 'Btn';
$this->openWindow = $this->{$btn}->ClientID;
+ if (isset($this->Request['id']) && (is_numeric($this->Request['id']))) {
+ $this->initWindowId = $this->Request['open'];
+ $this->initElementId = $this->Request['id'];
+ }
}
}
}
}
public function prepareData($forceReload = false) {
- $allowedButtons = array('MediaBtn', 'ReloadVolumes');
+ $allowedButtons = array('VolumeBtn', 'ReloadVolumes');
if($this->Page->IsPostBack || $this->Page->IsCallBack || $forceReload) {
if(in_array($this->getPage()->CallBackEventTarget->ID, $allowedButtons) || $forceReload) {
$params = $this->getUrlParams('volumes', $this->getPage()->VolumeWindow->ID);