Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { AutoTitleService } from 'src/app/core/_services/shared/autotitle.service';
import { Component } from '@angular/core';

import { AutoTitleService } from '@services/shared/autotitle.service';

@Component({
selector: 'app-agent-binaries',
templateUrl: './agent-binaries.component.html',
standalone: false
selector: 'app-agent-binaries',
templateUrl: './agent-binaries.component.html',
standalone: false
})
export class AgentBinariesComponent {
constructor(private titleService: AutoTitleService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class AgentBinariesTableComponent extends BaseTableComponent implements O
item.id.toString().includes(filterValue) ||
item.filename?.toLowerCase().includes(filterValue) ||
item.operatingSystems?.toLowerCase().includes(filterValue) ||
item.agentbinaryType?.toLowerCase().includes(filterValue) ||
item.binaryType?.toLowerCase().includes(filterValue) ||
item.updateTrack?.toLowerCase().includes(filterValue) ||
item.version?.toLowerCase().includes(filterValue)
);
Expand All @@ -78,7 +78,7 @@ export class AgentBinariesTableComponent extends BaseTableComponent implements O
return item.operatingSystems?.toLowerCase().includes(filterValue);
}
case 'type': {
return item.agentbinaryType?.toLowerCase().includes(filterValue);
return item.binaryType?.toLowerCase().includes(filterValue);
}
case 'updateTrack': {
return item.updateTrack?.toLowerCase().includes(filterValue);
Expand All @@ -105,8 +105,8 @@ export class AgentBinariesTableComponent extends BaseTableComponent implements O
dataKey: 'type',
isSortable: true,
isSearchable: true,
render: (agentBinary: JAgentBinary) => agentBinary.agentbinaryType,
export: async (agentBinary: JAgentBinary) => agentBinary.agentbinaryType
render: (agentBinary: JAgentBinary) => agentBinary.binaryType,
export: async (agentBinary: JAgentBinary) => agentBinary.binaryType
},
{
id: AgentBinariesTableCol.OS,
Expand Down
33 changes: 9 additions & 24 deletions src/app/core/_datasources/agent-binaries.datasource.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { catchError, finalize, never, of } from 'rxjs';
import { catchError, finalize, of } from 'rxjs';

import { JAgentBinary } from '../_models/agent-binary.model';
import { BaseDataSource } from './base.datasource';
import { ResponseWrapper } from '../_models/response.model';
import { SERV } from '../_services/main.config';
import { RequestParamBuilder } from '@src/app/core/_services/params/builder-implementation.service';
import { JAgentBinary } from '@models/agent-binary.model';
import { ResponseWrapper } from '@models/response.model';

import { SERV } from '@services/main.config';
import { RequestParamBuilder } from '@services/params/builder-implementation.service';

import { BaseDataSource } from '@datasources/base.datasource';

export class AgentBinariesDataSource extends BaseDataSource<JAgentBinary> {
loadAll(): void {
this.loading = true;


//ToDo: Reactivate sorting
this.sortingColumn.isSortable = false;

Expand All @@ -23,26 +24,10 @@ export class AgentBinariesDataSource extends BaseDataSource<JAgentBinary> {
finalize(() => (this.loading = false))
)
.subscribe((response: ResponseWrapper) => {

(response.data as []).forEach((agentBinary) => {
agentBinary['attributes']['agentbinaryType'] = agentBinary['attributes']['type'];
delete agentBinary['attributes']['type'];
});



const responseData = { data: response.data, included: response.included };
const agentBinaries = this.serializer.deserialize<JAgentBinary[]>(responseData);

const length = response.meta.page.total_elements;

this.setPaginationConfig(
this.pageSize,
length,
this.pageAfter,
this.pageBefore,
this.index
);
this.setPaginationConfig(this.pageSize, length, this.pageAfter, this.pageBefore, this.index);
this.setData(agentBinaries);
})
);
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/_models/agent-binary.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { BaseModel } from '@models/base.model';
* Interface for the agent binary running on the nodes
* @prop filename Filename of agent binary
* @prop operatingSystems Comma separated operating systems the binary runs
* @prop agent Type of agent (e.g. 'python')
* @prop binaryType Type of agent (e.g. 'python')
* @prop updateAvailable Indicating if update is available
* @prop updateTrack e.g 'stable'
* @prop version Version of agent binary
*/
export interface JAgentBinary extends BaseModel {
filename: string;
operatingSystems: string;
agentbinaryType: string;
binaryType: string;
updateAvailable: string;
updateTrack: string;
version: string;
Expand Down
17 changes: 9 additions & 8 deletions src/app/core/_services/metadata.service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { ACTIONARRAY, NOTIFARRAY } from '@src/app/core/_constants/notifications.config';
import { Injectable } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
import { dateFormats, proxytype, serverlog } from '@src/app/core/_constants/settings.config';

import { ACCESS_GROUP_FIELD_MAPPING } from '@src/app/core/_constants/select.config';
import { GlobalService } from '@services/main.service';
import { Injectable } from '@angular/core';
import { SERV } from '@services/main.config';
import { GlobalService } from '@services/main.service';
import { TooltipService } from '@services/shared/tooltip.service';
import { environment } from '@src/environments/environment';

import { fileFormat } from '@src/app/core/_constants/files.config';
import { ACTIONARRAY, NOTIFARRAY } from '@src/app/core/_constants/notifications.config';
import { ACCESS_GROUP_FIELD_MAPPING } from '@src/app/core/_constants/select.config';
import { dateFormats, proxytype, serverlog } from '@src/app/core/_constants/settings.config';
import { environment } from '@src/environments/environment';

@Injectable({
providedIn: 'root'
Expand Down Expand Up @@ -350,8 +351,8 @@ export class MetadataService {
//This variable defines the fields and properties required when creating/editing an Agent Binary.
agentbinary = [
{
name: 'type',
label: 'Type',
name: 'binaryType',
label: 'Binary Type',
type: 'text',
requiredasterisk: true,
tooltip: false,
Expand Down