mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
-bug 12153: Properly refresh list view after performing actions in detail view
-Fix clicking too fast to add panel breaking browser -Add install wizard copy
This commit is contained in:
parent
275a5ffa3c
commit
9237e91344
@ -310,8 +310,6 @@ body.login {
|
||||
width: 1024px;
|
||||
height: 768px;
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
border: 1px solid #E2E2E2;
|
||||
border-top: none;
|
||||
position: relative;
|
||||
}
|
||||
@ -349,7 +347,7 @@ body.login {
|
||||
}
|
||||
|
||||
.install-wizard .step .subtitle {
|
||||
color: #808080;
|
||||
color: #4395C6;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@ -357,6 +355,14 @@ body.login {
|
||||
color: #4A4A4A;
|
||||
font-size: 15px;
|
||||
line-height: 23px;
|
||||
background: url(../images/bg-transparent-white.png);
|
||||
}
|
||||
|
||||
.install-wizard .step ul li {
|
||||
margin: 14px 0 0 18px;
|
||||
width: 465px;
|
||||
font-size: 13px;
|
||||
list-style: disc;
|
||||
}
|
||||
|
||||
.install-wizard .step .field {
|
||||
@ -462,10 +468,10 @@ body.login {
|
||||
.install-wizard .diagram {
|
||||
width: 910px;
|
||||
height: 385px;
|
||||
/*+placement:shift 65px 397px;*/
|
||||
/*+placement:shift 65px 496px;*/
|
||||
position: relative;
|
||||
left: 65px;
|
||||
top: 397px;
|
||||
top: 496px;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
}
|
||||
@ -565,14 +571,19 @@ body.login {
|
||||
/*** Setup form*/
|
||||
.install-wizard .step .setup-form {
|
||||
display: inline-block;
|
||||
background: #F0F0F0;
|
||||
background: url(../images/bg-transparent-white.png);
|
||||
width: 469px;
|
||||
border: 1px solid #CFCFCF;
|
||||
border: 1px solid #DFDFDF;
|
||||
/*+text-shadow:0px 1px 0px #FFFFFF;*/
|
||||
-moz-text-shadow: 0px 1px 0px #FFFFFF;
|
||||
-webkit-text-shadow: 0px 1px 0px #FFFFFF;
|
||||
-o-text-shadow: 0px 1px 0px #FFFFFF;
|
||||
text-shadow: 0px 1px 0px #FFFFFF;
|
||||
/*+box-shadow:inset 0px 1px 5px #FFFFFF;*/
|
||||
-moz-box-shadow: inset 0px 1px 5px #FFFFFF;
|
||||
-webkit-box-shadow: inset 0px 1px 5px #FFFFFF;
|
||||
-o-box-shadow: inset 0px 1px 5px #FFFFFF;
|
||||
box-shadow: inset 0px 1px 5px #FFFFFF;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .title {
|
||||
@ -586,7 +597,6 @@ body.login {
|
||||
display: inline-block;
|
||||
margin: 6px 0 1px 31px;
|
||||
padding: 9px;
|
||||
background: #E2E2E2;
|
||||
color: #57646D;
|
||||
}
|
||||
|
||||
@ -1345,7 +1355,7 @@ div.list-view div.toolbar div.section-switcher div.section-select label {
|
||||
height: 100%;
|
||||
left: 0px;
|
||||
top: 0px;
|
||||
background: #E2E9F0 url(../images/ajax-loader.gif) no-repeat center;
|
||||
background: #F2F2F2 url(../images/ajax-loader.gif) no-repeat center;
|
||||
z-index: 500;
|
||||
/*+opacity:70%;*/
|
||||
filter: alpha(opacity=70);
|
||||
|
||||
BIN
ui/images/bg-transparent-white.png
Normal file
BIN
ui/images/bg-transparent-white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
@ -21,45 +21,197 @@
|
||||
|
||||
// Copy text
|
||||
copy: {
|
||||
// Tooltips
|
||||
'tooltip.addZone.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for the zone.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.dns1': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by guest VMs in the zone. These DNS servers will be accessed via the public network you will add later. The public IP addresses for the zone must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.dns2': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by guest VMs in the zone. These DNS servers will be accessed via the public network you will add later. The public IP addresses for the zone must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.internaldns1': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by system VMs in the zone. These DNS servers will be accessed via the private network interface of the System VMs. The private IP address you provide for the pods must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.internaldns2': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by system VMs in the zone. These DNS servers will be accessed via the private network interface of the System VMs. The private IP address you provide for the pods must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-gateway': function(args) {
|
||||
args.response.success({
|
||||
text: 'The gateway that the guests should use'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-netmask': function(args) {
|
||||
args.response.success({
|
||||
text: 'The netmask in use on the subnet that the guests should use'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-ip-range-start': function(args) {
|
||||
args.response.success({
|
||||
text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-ip-range-end': function(args) {
|
||||
args.response.success({
|
||||
text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for the pod'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-gateway': function(args) {
|
||||
args.response.success({
|
||||
text: 'The gateway for the hosts in that pod.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-netmask': function(args) {
|
||||
args.response.success({
|
||||
text: 'The netmask in use on the subnet the guests will use.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-ip-range-start': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-ip-range-end': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addCluster.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for the cluster. This can be text of your choosing and is not used by CloudStack.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.hostname': function(args) {
|
||||
args.response.success({
|
||||
text: 'The DNS name or IP address of the host.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.username': function(args) {
|
||||
args.response.success({
|
||||
text: 'Usually root.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.password': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the password for the user named above (from your XenServer install).'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.hosttags': function(args) {
|
||||
args.response.success({
|
||||
text: '(Optional) Any labels that you use to categorize hosts for ease of maintenance.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'The name for the storage device.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.server': function(args) {
|
||||
args.response.success({
|
||||
text: '(for NFS, iSCSI, or PreSetup) The IP address or DNS name of the storage device.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.path': function(args) {
|
||||
args.response.success({
|
||||
text: '(for NFS) In NFS this is the exported path from the server. Path (for SharedMountPoint). With KVM this is the path on each host that is where this primary storage is mounted. For example, "/mnt/primary".'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.storageTags': function(args) {
|
||||
args.response.success({
|
||||
text: 'A comma-separated list of any desired tags that you use to categorize storage devices.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addSecondaryStorage.nfsServer': function(args) {
|
||||
args.response.success({
|
||||
text: 'The IP address of the NFS server hosting the secondary storage'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addSecondaryStorage.path': function(args) {
|
||||
args.response.success({
|
||||
text: 'The exported path, located on the server you specified above'
|
||||
});
|
||||
},
|
||||
|
||||
// Intro text
|
||||
whatIsCloudStack: function(args) {
|
||||
args.response.success({
|
||||
text: 'CloudStack is open source software written in java that is designed to deploy and manage large networks of virtual machines, as a highly available, scalable cloud computing platform. CloudStack current supports the most popular open source hypervisors VMware, Oracle VM, KVM, XenServer and Xen Cloud Platform. CloudStack offers three ways to manage cloud computing environments: a easy-to-use web interface, command line and a full-featured RESTful API.'
|
||||
text: 'CloudStack™ is a software platform that pools computing resources to build public, private, and hybrid Infrastructure as a Service (IaaS) clouds. CloudStack™ manages the network, storage, and compute nodes that make up a cloud infrastructure. Use CloudStack™ to deploy, manage, and configure cloud computing environments.<br/><br/>Extending beyond individual virtual machine images running on commodity hardware, CloudStack™ provides a turnkey cloud infrastructure software stack for delivering virtual datacenters as a service - delivering all of the essential components to build, deploy, and manage multi-tier and multi-tenant cloud applications. Both open-source and Premium versions are available, with the open-source version offering nearly identical features. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAZone: function(args) {
|
||||
args.response.success({
|
||||
text: 'A zone is integral to the CloudStack platform -- your entire network is represented via a zone. More text goes here...'
|
||||
text: 'A zone is the largest organizational unit within a CloudStack™ deployment. A zone typically corresponds to a single datacenter, although it is permissible to have multiple zones in a datacenter. The benefit of organizing infrastructure into zones is to provide physical isolation and redundancy. For example, each zone can have its own power supply and network uplink, and the zones can be widely separated geographically (though this is not required).'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAPod: function(args) {
|
||||
args.response.success({
|
||||
text: 'A pod is a part of a zone. More text goes here...'
|
||||
text: 'A pod often represents a single rack. Hosts in the same pod are in the same subnet.<br/><br/>A pod is the second-largest organizational unit within a CloudStack™ deployment. Pods are contained within zones. Each zone can contain one or more pods; in the Basic Installation, you will have just one pod in your zone'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsACluster: function(args) {
|
||||
args.response.success({
|
||||
text: 'A cluster is a part of a zone. More text goes here...'
|
||||
text: 'A cluster provides a way to group hosts. The hosts in a cluster all have identical hardware, run the same hypervisor, are on the same subnet, and access the same shared storage. Virtual machine instances (VMs) can be live-migrated from one host to another within the same cluster, without interrupting service to the user. A cluster is the third-largest organizational unit within a CloudStack™ deployment. Clusters are contained within pods, and pods are contained within zones.<br/><br/>CloudStack™ allows multiple clusters in a cloud deployment, but for a Basic Installation, we only need one cluster. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAHost: function(args) {
|
||||
args.response.success({
|
||||
text: 'A host is a part of a zone. More text goes here...'
|
||||
text: 'A host is a single computer. Hosts provide the computing resources that run the guest virtual machines. Each host has hypervisor software installed on it to manage the guest VMs (except for bare metal hosts, which are a special case discussed in the Advanced Installation Guide). For example, a Linux KVM-enabled server, a Citrix XenServer server, and an ESXi server are hosts. In a Basic Installation, we use a single host running XenServer.<br/><br/>The host is the smallest organizational unit within a CloudStack™ deployment. Hosts are contained within clusters, clusters are contained within pods, and pods are contained within zones. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsPrimaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Primary storage is a part of a zone. More text goes here...'
|
||||
text: 'A CloudStack™ cloud infrastructure makes use of two types of storage: primary storage and secondary storage. Both of these can be iSCSI or NFS servers, or localdisk.<br/><br/><strong>Primary storage</strong> is associated with a cluster, and it stores the disk volumes of each guest VM for all the VMs running on hosts in that cluster. The primary storage server is typically located close to the hosts. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsSecondaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Secondary storage is a part of a zone. More text goes here...'
|
||||
text: 'Secondary storage is associated with a zone, and it stores the following:<ul><li>Templates - OS images that can be used to boot VMs and can include additional configuration information, such as installed applications</li><li>ISO images - OS images that can be bootable or non-bootable</li><li>Disk volume snapshots - saved copies of VM data which can be used for data recovery or to create new templates</ul>'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
@ -350,7 +350,9 @@
|
||||
}
|
||||
},
|
||||
notification: {
|
||||
poll: testData.notifications.testPoll
|
||||
poll: testData.notifications.customPoll({
|
||||
state: 'Destroyed'
|
||||
})
|
||||
},
|
||||
action: function(args) {
|
||||
setTimeout(function() {
|
||||
|
||||
@ -104,18 +104,31 @@
|
||||
/**
|
||||
* Show tooltip for focused form elements
|
||||
*/
|
||||
var showTooltip = function($formContainer) {
|
||||
var $tooltip = elems.tooltip('Hints', 'Help content goes here.');
|
||||
var showTooltip = function($formContainer, sectionID) {
|
||||
var $tooltip = elems.tooltip('Hints', '');
|
||||
|
||||
$formContainer.find('input').focus(function() {
|
||||
var $input = $(this);
|
||||
|
||||
$tooltip.find('p').html('');
|
||||
$tooltip.appendTo($formContainer);
|
||||
$tooltip.css({
|
||||
top: $(this).position().top - 20
|
||||
});
|
||||
|
||||
var content = getCopy(
|
||||
'tooltip.' + sectionID + '.' + $input.attr('name'),
|
||||
$tooltip.find('p')
|
||||
);
|
||||
});
|
||||
|
||||
$formContainer.find('input').blur(function() {
|
||||
$tooltip.remove();
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
$formContainer.find('input:first').focus();
|
||||
}, 600);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -167,9 +180,9 @@
|
||||
intro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('What is CloudStack?');
|
||||
.html('What is CloudStack™?');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('Subtitle text goes here');
|
||||
.html('Introduction to CloudStack™');
|
||||
var $copy = getCopy('whatIsCloudStack', $('<p></p>'));
|
||||
var $continue = elems.nextButton('Continue with basic installation');
|
||||
var $advanced = elems.nextButton('Setup advanced installation').addClass('advanced-installation');
|
||||
@ -249,7 +262,7 @@
|
||||
$addZoneForm.find('.field:last').remove();
|
||||
|
||||
showDiagram('.part.zone');
|
||||
showTooltip($addZoneForm);
|
||||
showTooltip($addZoneForm, 'addZone');
|
||||
|
||||
return $addZone.append(
|
||||
$addZoneForm
|
||||
@ -281,7 +294,7 @@
|
||||
});
|
||||
|
||||
showDiagram('.part.zone');
|
||||
showTooltip($addIPRangeForm);
|
||||
showTooltip($addIPRangeForm, 'addIPRange');
|
||||
|
||||
// Remove unneeded fields
|
||||
$addIPRangeForm.find('.main-desc, .conditional').remove();
|
||||
@ -347,7 +360,7 @@
|
||||
$addPodForm.find('.main-desc, .conditional').remove();
|
||||
|
||||
showDiagram('.part.zone, .part.pod');
|
||||
showTooltip($addPodForm);
|
||||
showTooltip($addPodForm, 'addPod');
|
||||
|
||||
return $addPod.append(
|
||||
$addPodForm
|
||||
@ -416,7 +429,7 @@
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.cluster');
|
||||
showTooltip($addClusterForm);
|
||||
showTooltip($addClusterForm, 'addCluster');
|
||||
|
||||
// Cleanup
|
||||
$addClusterForm.find('.message').remove();
|
||||
@ -510,7 +523,7 @@
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.host');
|
||||
showTooltip($addHostForm);
|
||||
showTooltip($addHostForm, 'addHost');
|
||||
|
||||
// Cleanup
|
||||
$addHostForm.find('.message').remove();
|
||||
@ -601,7 +614,7 @@
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.primaryStorage');
|
||||
showTooltip($addPrimaryStorageForm);
|
||||
showTooltip($addPrimaryStorageForm, 'addPrimaryStorage');
|
||||
|
||||
// Cleanup
|
||||
$addPrimaryStorageForm.find('.message').remove();
|
||||
@ -681,7 +694,7 @@
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.secondaryStorage');
|
||||
showTooltip($addSecondaryStorageForm);
|
||||
showTooltip($addSecondaryStorageForm, 'addSecondaryStorage');
|
||||
|
||||
// Cleanup
|
||||
$addSecondaryStorageForm.find('.message').remove();
|
||||
@ -702,7 +715,6 @@
|
||||
.html('Congratulations!.');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('Click the launch button.');
|
||||
var $copy = getCopy('whatIsACluster', $('<p></p>'));
|
||||
var $continue = elems.nextButton('Launch');
|
||||
|
||||
$continue.click(function() {
|
||||
@ -715,7 +727,6 @@
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
@ -245,6 +245,9 @@
|
||||
|
||||
// Remove existing panels from parent
|
||||
if ($parent) {
|
||||
// Cleanup transitioning panels -- prevent old complete actions from running
|
||||
$parent.siblings().stop();
|
||||
|
||||
_breadcrumb.filter(
|
||||
$('div.panel.maximized')
|
||||
.removeClass('maximized')
|
||||
@ -295,7 +298,7 @@
|
||||
return $(this).width() == $panel.width();
|
||||
});
|
||||
|
||||
if (args.complete) args.complete($panel);
|
||||
if ($panel.is(':visible') && args.complete) args.complete($panel);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -103,11 +103,8 @@
|
||||
var $rows = $table.find('tbody tr');
|
||||
var $row = $($rows[rowIndex]);
|
||||
|
||||
$rows.filter(
|
||||
function() {
|
||||
return this != $row[0];
|
||||
}).removeClass('selected');
|
||||
return $row.toggleClass('selected');
|
||||
$row.siblings().removeClass('selected');
|
||||
return $row.addClass('selected');
|
||||
};
|
||||
|
||||
var computeEvenOddRows = function() {
|
||||
@ -235,9 +232,11 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
$table.find('tbody tr').bind('click', function(event) {
|
||||
if (noSelect == true) return true;
|
||||
var rowIndex = $(this).index();
|
||||
$table.bind('click', function(event) {
|
||||
var $tr = $(event.target).closest('tr');
|
||||
|
||||
if (!$tr.size() || noSelect) return true;
|
||||
var rowIndex = $tr.index();
|
||||
|
||||
toggleSelectRow(rowIndex);
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
$notifications.notifications('add', {
|
||||
section: notification.section,
|
||||
desc: notification.desc,
|
||||
interval: 5000,
|
||||
interval: 2000,
|
||||
_custom: notification._custom,
|
||||
poll: function(args) {
|
||||
var complete = args.complete;
|
||||
@ -51,6 +51,35 @@
|
||||
return true;
|
||||
};
|
||||
|
||||
var replaceListViewItem = function($detailView, newData) {
|
||||
var $row = $detailView.data('list-view-row');
|
||||
|
||||
if (!$row) return;
|
||||
|
||||
var $listView = $row.closest('.list-view');
|
||||
var $newRow;
|
||||
var jsonObj = $row.data('json-obj');
|
||||
|
||||
$listView.listView('replaceItem', {
|
||||
$row: $row,
|
||||
data: $.extend(jsonObj, newData),
|
||||
after: function($newRow) {
|
||||
$detailView.data('list-view-row', $newRow);
|
||||
|
||||
setTimeout(function() {
|
||||
$('.data-table').dataTable('selectRow', $newRow.index());
|
||||
}, 100);
|
||||
}
|
||||
});
|
||||
|
||||
// Refresh detail view context
|
||||
$.extend(
|
||||
$detailView.data('view-args').context[
|
||||
$detailView.data('view-args').section
|
||||
][0], newData
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Available UI actions to perform for buttons
|
||||
*/
|
||||
@ -115,6 +144,7 @@
|
||||
function(args) {
|
||||
$loading.remove();
|
||||
updateTabContent(args.data);
|
||||
replaceListViewItem($detailView, args.data);
|
||||
},
|
||||
|
||||
{},
|
||||
@ -124,7 +154,7 @@
|
||||
);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
} else {
|
||||
// Set loading appearance
|
||||
var $loading = $('<div>').addClass('loading-overlay');
|
||||
$detailView.prepend($loading);
|
||||
@ -159,6 +189,8 @@
|
||||
if (additional && additional.complete) additional.complete($.extend(true, args, {
|
||||
$detailView: $detailView
|
||||
}));
|
||||
|
||||
replaceListViewItem($detailView, args.data);
|
||||
},
|
||||
|
||||
{},
|
||||
@ -305,8 +337,7 @@
|
||||
_custom: $detailView.data('_custom'),
|
||||
context: $detailView.data('view-args').context,
|
||||
response: {
|
||||
data: data,
|
||||
success: function(data) {
|
||||
success: function() {
|
||||
var notificationArgs = {
|
||||
section: id,
|
||||
desc: 'Changed item properties'
|
||||
@ -315,13 +346,16 @@
|
||||
if (!action.notification) {
|
||||
convertInputs($inputs);
|
||||
addNotification(
|
||||
notificationArgs, function(data) {}, []
|
||||
notificationArgs, function() {}, []
|
||||
);
|
||||
replaceListViewItem($detailView, data);
|
||||
} else {
|
||||
$loading.appendTo($detailView);
|
||||
addNotification(
|
||||
$.extend(true, {}, action.notification, notificationArgs),
|
||||
function(args) {
|
||||
replaceListViewItem($detailView, data);
|
||||
|
||||
convertInputs($inputs);
|
||||
$loading.remove();
|
||||
}, []
|
||||
@ -534,7 +568,7 @@
|
||||
var detailViewArgs = $detailView.data('view-args');
|
||||
var fields = tabData.fields;
|
||||
var hiddenFields;
|
||||
var context = detailViewArgs.context;
|
||||
var context = detailViewArgs ? detailViewArgs.context : cloudStack.context;
|
||||
var isMultiple = tabData.multiple || tabData.isMultiple;
|
||||
|
||||
if (isMultiple) {
|
||||
@ -834,6 +868,10 @@
|
||||
$detailView.addClass('detail-view');
|
||||
$detailView.data('view-args', args);
|
||||
|
||||
if (args.$listViewRow) {
|
||||
$detailView.data('list-view-row', args.$listViewRow);
|
||||
}
|
||||
|
||||
// Create toolbar
|
||||
var $toolbar = makeToolbar().appendTo($detailView);
|
||||
|
||||
|
||||
@ -623,7 +623,7 @@
|
||||
/**
|
||||
* Initialize detail view for specific ID from list view
|
||||
*/
|
||||
var createDetailView = function(args, complete) {
|
||||
var createDetailView = function(args, complete, $row) {
|
||||
var $panel = args.$panel;
|
||||
var title = args.title;
|
||||
var id = args.id;
|
||||
@ -632,7 +632,8 @@
|
||||
id: id,
|
||||
jsonObj: args.jsonObj,
|
||||
section: args.section,
|
||||
context: args.context
|
||||
context: args.context,
|
||||
$listViewRow: $row
|
||||
});
|
||||
|
||||
var $detailView, $detailsPanel;
|
||||
@ -812,7 +813,7 @@
|
||||
var isUICustom = $listView.data('view-args') ?
|
||||
$tr.closest('.list-view').data('view-args').uiCustom : false;
|
||||
|
||||
if (options.actionFilter && !isUICustom) {
|
||||
if ($.isFunction(options.actionFilter) && !isUICustom) {
|
||||
allowedActions = options.actionFilter({
|
||||
context: $.extend(true, {}, options.context, {
|
||||
actions: allowedActions,
|
||||
@ -1206,7 +1207,7 @@
|
||||
|
||||
createDetailView(detailViewArgs, function($detailView) {
|
||||
$detailView.data('list-view', $listView);
|
||||
});
|
||||
}, $target.closest('tr'));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -1297,7 +1298,7 @@
|
||||
return $tr;
|
||||
};
|
||||
|
||||
var replaceItem = function($row, data, actionFilter) {
|
||||
var replaceItem = function($row, data, actionFilter, after) {
|
||||
var $newRow;
|
||||
var $listView = $row.closest('.list-view');
|
||||
var viewArgs = $listView.data('view-args');
|
||||
@ -1307,6 +1308,7 @@
|
||||
].listView : listViewArgs;
|
||||
var reorder = targetArgs.reorder;
|
||||
var $table = $row.closest('table');
|
||||
var defaultActionFilter = $row.data('list-view-action-filter');
|
||||
|
||||
$newRow = addTableRows(
|
||||
targetArgs.fields,
|
||||
@ -1314,14 +1316,18 @@
|
||||
$listView.find('table tbody'),
|
||||
targetArgs.actions,
|
||||
{
|
||||
actionFilter: actionFilter,
|
||||
actionFilter: actionFilter ? actionFilter : defaultActionFilter,
|
||||
reorder: reorder
|
||||
}
|
||||
)[0];
|
||||
|
||||
$newRow.data('json-obj', data);
|
||||
|
||||
$row.replaceWith($newRow);
|
||||
$table.dataTable('refresh');
|
||||
|
||||
if (after) after($newRow);
|
||||
|
||||
return $newRow;
|
||||
};
|
||||
|
||||
@ -1330,7 +1336,7 @@
|
||||
if (args == 'prependItem') {
|
||||
return prependItem(this, options.data, options.actionFilter);
|
||||
} else if (args =='replaceItem') {
|
||||
replaceItem(this, options.data, options.actionFilter);
|
||||
replaceItem(options.$row, options.data, options.actionFilter, options.after);
|
||||
} else if (args.sections) {
|
||||
var targetSection;
|
||||
$.each(args.sections, function(key) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user