mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.19'
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
commit
f683d2dd24
@ -32,7 +32,6 @@ import org.springframework.stereotype.Component;
|
||||
import com.cloud.storage.DiskOfferingVO;
|
||||
import com.cloud.storage.Storage;
|
||||
import com.cloud.utils.db.Attribute;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
@ -60,16 +59,6 @@ public class DiskOfferingDaoImpl extends GenericDaoBase<DiskOfferingVO, Long> im
|
||||
_computeOnlyAttr = _allAttributes.get("computeOnly");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DiskOfferingVO> searchIncludingRemoved(SearchCriteria<DiskOfferingVO> sc, final Filter filter, final Boolean lock, final boolean cache) {
|
||||
return super.searchIncludingRemoved(sc, filter, lock, cache);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <K> List<K> customSearchIncludingRemoved(SearchCriteria<K> sc, final Filter filter) {
|
||||
return super.customSearchIncludingRemoved(sc, filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<DiskOfferingVO> executeList(final String sql, final Object... params) {
|
||||
StringBuilder builder = new StringBuilder(sql);
|
||||
|
||||
@ -3651,7 +3651,7 @@ public class QueryManagerImpl extends MutualExclusiveIdsManagerBase implements Q
|
||||
public ListResponse<ServiceOfferingResponse> searchForServiceOfferings(ListServiceOfferingsCmd cmd) {
|
||||
Pair<List<ServiceOfferingJoinVO>, Integer> result = searchForServiceOfferingsInternal(cmd);
|
||||
result.first();
|
||||
ListResponse<ServiceOfferingResponse> response = new ListResponse<ServiceOfferingResponse>();
|
||||
ListResponse<ServiceOfferingResponse> response = new ListResponse<>();
|
||||
List<ServiceOfferingResponse> offeringResponses = ViewResponseHelper.createServiceOfferingResponse(result.first().toArray(new ServiceOfferingJoinVO[result.first().size()]));
|
||||
response.setResponses(offeringResponses, result.second());
|
||||
return response;
|
||||
|
||||
@ -38,11 +38,13 @@ import com.cloud.offering.DiskOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.server.ResourceTag;
|
||||
import com.cloud.user.AccountManager;
|
||||
import com.cloud.utils.db.Attribute;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
|
||||
import static org.apache.cloudstack.query.QueryService.SortKeyAscending;
|
||||
|
||||
@Component
|
||||
public class DiskOfferingJoinDaoImpl extends GenericDaoBase<DiskOfferingJoinVO, Long> implements DiskOfferingJoinDao {
|
||||
|
||||
@ -57,7 +59,6 @@ public class DiskOfferingJoinDaoImpl extends GenericDaoBase<DiskOfferingJoinVO,
|
||||
|
||||
private final SearchBuilder<DiskOfferingJoinVO> dofIdSearch;
|
||||
private SearchBuilder<DiskOfferingJoinVO> diskOfferingSearch;
|
||||
private final Attribute _typeAttr;
|
||||
|
||||
protected DiskOfferingJoinDaoImpl() {
|
||||
|
||||
@ -69,9 +70,6 @@ public class DiskOfferingJoinDaoImpl extends GenericDaoBase<DiskOfferingJoinVO,
|
||||
diskOfferingSearch.and("idIN", diskOfferingSearch.entity().getId(), SearchCriteria.Op.IN);
|
||||
diskOfferingSearch.done();
|
||||
|
||||
|
||||
_typeAttr = _allAttributes.get("type");
|
||||
|
||||
_count = "select count(distinct id) from disk_offering_view WHERE ";
|
||||
}
|
||||
|
||||
@ -166,6 +164,8 @@ public class DiskOfferingJoinDaoImpl extends GenericDaoBase<DiskOfferingJoinVO,
|
||||
|
||||
@Override
|
||||
public List<DiskOfferingJoinVO> searchByIds(Long... offeringIds) {
|
||||
Filter searchFilter = new Filter(DiskOfferingJoinVO.class, "sortKey", SortKeyAscending.value());
|
||||
searchFilter.addOrderBy(DiskOfferingJoinVO.class, "id", true);
|
||||
// set detail batch query size
|
||||
int DETAILS_BATCH_SIZE = 2000;
|
||||
String batchCfg = configDao.getValue("detail.batch.query.size");
|
||||
@ -184,7 +184,7 @@ public class DiskOfferingJoinDaoImpl extends GenericDaoBase<DiskOfferingJoinVO,
|
||||
}
|
||||
SearchCriteria<DiskOfferingJoinVO> sc = diskOfferingSearch.create();
|
||||
sc.setParameters("idIN", ids);
|
||||
List<DiskOfferingJoinVO> accounts = searchIncludingRemoved(sc, null, null, false);
|
||||
List<DiskOfferingJoinVO> accounts = searchIncludingRemoved(sc, searchFilter, null, false);
|
||||
if (accounts != null) {
|
||||
uvList.addAll(accounts);
|
||||
}
|
||||
@ -200,7 +200,7 @@ public class DiskOfferingJoinDaoImpl extends GenericDaoBase<DiskOfferingJoinVO,
|
||||
}
|
||||
SearchCriteria<DiskOfferingJoinVO> sc = diskOfferingSearch.create();
|
||||
sc.setParameters("idIN", ids);
|
||||
List<DiskOfferingJoinVO> accounts = searchIncludingRemoved(sc, null, null, false);
|
||||
List<DiskOfferingJoinVO> accounts = searchIncludingRemoved(sc, searchFilter, null, false);
|
||||
if (accounts != null) {
|
||||
uvList.addAll(accounts);
|
||||
}
|
||||
|
||||
@ -34,5 +34,6 @@ public interface ServiceOfferingJoinDao extends GenericDao<ServiceOfferingJoinVO
|
||||
ServiceOfferingJoinVO newServiceOfferingView(ServiceOffering offering);
|
||||
|
||||
Map<Long, List<String>> listDomainsOfServiceOfferingsUsedByDomainPath(String domainPath);
|
||||
|
||||
List<ServiceOfferingJoinVO> searchByIds(Long... id);
|
||||
}
|
||||
|
||||
@ -45,10 +45,13 @@ import com.cloud.server.ResourceTag.ResourceObjectType;
|
||||
import com.cloud.storage.DiskOfferingVO;
|
||||
import com.cloud.user.AccountManager;
|
||||
import com.cloud.utils.db.GenericDaoBase;
|
||||
import com.cloud.utils.db.Filter;
|
||||
import com.cloud.utils.db.SearchBuilder;
|
||||
import com.cloud.utils.db.SearchCriteria;
|
||||
import com.cloud.utils.db.TransactionLegacy;
|
||||
|
||||
import static org.apache.cloudstack.query.QueryService.SortKeyAscending;
|
||||
|
||||
@Component
|
||||
public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJoinVO, Long> implements ServiceOfferingJoinDao {
|
||||
|
||||
@ -233,6 +236,9 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJo
|
||||
|
||||
@Override
|
||||
public List<ServiceOfferingJoinVO> searchByIds(Long... offeringIds) {
|
||||
Filter searchFilter = new Filter(ServiceOfferingJoinVO.class, "sortKey", SortKeyAscending.value());
|
||||
searchFilter.addOrderBy(ServiceOfferingJoinVO.class, "id", true);
|
||||
|
||||
// set detail batch query size
|
||||
int DETAILS_BATCH_SIZE = 2000;
|
||||
String batchCfg = configDao.getValue("detail.batch.query.size");
|
||||
@ -251,9 +257,9 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJo
|
||||
}
|
||||
SearchCriteria<ServiceOfferingJoinVO> sc = srvOfferingSearch.create();
|
||||
sc.setParameters("idIN", ids);
|
||||
List<ServiceOfferingJoinVO> accounts = searchIncludingRemoved(sc, null, null, false);
|
||||
if (accounts != null) {
|
||||
uvList.addAll(accounts);
|
||||
List<ServiceOfferingJoinVO> offerings = searchIncludingRemoved(sc, searchFilter, null, false);
|
||||
if (offerings != null) {
|
||||
uvList.addAll(offerings);
|
||||
}
|
||||
curr_index += DETAILS_BATCH_SIZE;
|
||||
}
|
||||
@ -267,9 +273,9 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJo
|
||||
}
|
||||
SearchCriteria<ServiceOfferingJoinVO> sc = srvOfferingSearch.create();
|
||||
sc.setParameters("idIN", ids);
|
||||
List<ServiceOfferingJoinVO> accounts = searchIncludingRemoved(sc, null, null, false);
|
||||
if (accounts != null) {
|
||||
uvList.addAll(accounts);
|
||||
List<ServiceOfferingJoinVO> offerings = searchIncludingRemoved(sc, searchFilter, null, false);
|
||||
if (offerings != null) {
|
||||
uvList.addAll(offerings);
|
||||
}
|
||||
}
|
||||
return uvList;
|
||||
|
||||
@ -617,6 +617,12 @@ export default {
|
||||
explicitlyAllowRowSelection: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
currentPage: {
|
||||
type: Number
|
||||
},
|
||||
pageSize: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
inject: ['parentFetchData', 'parentToggleLoading'],
|
||||
@ -850,8 +856,9 @@ export default {
|
||||
},
|
||||
updateOrder (data) {
|
||||
const promises = []
|
||||
const previousSortKeys = this.pageSize && this.currentPage ? this.pageSize * (this.currentPage - 1) : 0
|
||||
data.forEach((item, index) => {
|
||||
promises.push(this.handleUpdateOrder(item.id, index + 1))
|
||||
promises.push(this.handleUpdateOrder(item.id, previousSortKeys + index + 1))
|
||||
})
|
||||
Promise.all(promises).catch((reason) => {
|
||||
console.log(reason)
|
||||
|
||||
@ -417,6 +417,8 @@
|
||||
:columns="columns"
|
||||
:items="items"
|
||||
:actions="actions"
|
||||
:currentPage="page"
|
||||
:pageSize="pageSize"
|
||||
:columnKeys="columnKeys"
|
||||
:selectedColumns="selectedColumns"
|
||||
ref="listview"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user