mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 13:25:26 +02:00
refactor(environments): remove endpoints cache [DTD-100] (#6408)
This commit is contained in:
parent
9ef2e27aae
commit
37d4a80769
51 changed files with 155 additions and 353 deletions
|
@ -15,16 +15,16 @@ function AgentServiceFactory(Agent, AgentVersion1, HttpRequestHelper, Host, Stat
|
|||
return state.endpoint.agentApiVersion;
|
||||
}
|
||||
|
||||
function hostInfo(nodeName) {
|
||||
function hostInfo(endpointId, nodeName) {
|
||||
HttpRequestHelper.setPortainerAgentTargetHeader(nodeName);
|
||||
return Host.info().$promise;
|
||||
return Host.info({ endpointId }).$promise;
|
||||
}
|
||||
|
||||
async function agents() {
|
||||
async function agents(endpointId) {
|
||||
const agentVersion = getAgentApiVersion();
|
||||
const service = agentVersion > 1 ? Agent : AgentVersion1;
|
||||
try {
|
||||
const agents = await service.query({ version: agentVersion }).$promise;
|
||||
const agents = await service.query({ version: agentVersion, endpointId }).$promise;
|
||||
return agents.map(function (item) {
|
||||
return new AgentViewModel(item);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue