mirror of
https://github.com/portainer/portainer.git
synced 2025-08-03 04:45:21 +02:00
feat(endpoints): filter endpoints by a list of types (#5308)
* feat(endpoints): filter endpoints by a list of types * docs(endpoints): update api docs for endpoint list
This commit is contained in:
parent
bd47bb8cdc
commit
7b2269fbba
5 changed files with 20 additions and 12 deletions
|
@ -49,7 +49,7 @@ export class EdgeGroupFormController {
|
|||
async getDynamicEndpointsAsync() {
|
||||
const { pageNumber, limit, search } = this.endpoints.state;
|
||||
const start = (pageNumber - 1) * limit + 1;
|
||||
const query = { search, type: 4, tagIds: this.model.TagIds, tagsPartialMatch: this.model.PartialMatch };
|
||||
const query = { search, types: [4], tagIds: this.model.TagIds, tagsPartialMatch: this.model.PartialMatch };
|
||||
|
||||
const response = await this.EndpointService.endpoints(start, limit, query);
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ export class EditEdgeStackViewController {
|
|||
|
||||
async getPaginatedEndpointsAsync(lastId, limit, search) {
|
||||
try {
|
||||
const query = { search, type: 4, endpointIds: this.stackEndpointIds };
|
||||
const query = { search, types: [4], endpointIds: this.stackEndpointIds };
|
||||
const { value, totalCount } = await this.EndpointService.endpoints(lastId, limit, query);
|
||||
const endpoints = _.map(value, (endpoint) => {
|
||||
const status = this.stack.Status[endpoint.Id];
|
||||
|
|
|
@ -56,7 +56,7 @@ class AssoicatedEndpointsSelectorController {
|
|||
|
||||
async getEndpointsAsync() {
|
||||
const { start, search, limit } = this.getPaginationData('available');
|
||||
const query = { search, type: 4 };
|
||||
const query = { search, types: [4] };
|
||||
|
||||
const response = await this.EndpointService.endpoints(start, limit, query);
|
||||
|
||||
|
@ -73,7 +73,7 @@ class AssoicatedEndpointsSelectorController {
|
|||
let response = { value: [], totalCount: 0 };
|
||||
if (this.endpointIds.length > 0) {
|
||||
const { start, search, limit } = this.getPaginationData('associated');
|
||||
const query = { search, type: 4, endpointIds: this.endpointIds };
|
||||
const query = { search, types: [4], endpointIds: this.endpointIds };
|
||||
|
||||
response = await this.EndpointService.endpoints(start, limit, query);
|
||||
}
|
||||
|
|
|
@ -17,11 +17,12 @@ angular.module('portainer.app').factory('EndpointService', [
|
|||
return Endpoints.get({ id: endpointID }).$promise;
|
||||
};
|
||||
|
||||
service.endpoints = function (start, limit, { search, type, tagIds, endpointIds, tagsPartialMatch } = {}) {
|
||||
service.endpoints = function (start, limit, { search, types, tagIds, endpointIds, tagsPartialMatch } = {}) {
|
||||
if (tagIds && !tagIds.length) {
|
||||
return Promise.resolve({ value: [], totalCount: 0 });
|
||||
}
|
||||
return Endpoints.query({ start, limit, search, type, tagIds: JSON.stringify(tagIds), endpointIds: JSON.stringify(endpointIds), tagsPartialMatch }).$promise;
|
||||
return Endpoints.query({ start, limit, search, types: JSON.stringify(types), tagIds: JSON.stringify(tagIds), endpointIds: JSON.stringify(endpointIds), tagsPartialMatch })
|
||||
.$promise;
|
||||
};
|
||||
|
||||
service.snapshotEndpoints = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue