This commit is contained in:
string 2025-10-16 09:42:50 +05:30
parent 16c83ec322
commit 58f727fb49
3 changed files with 353 additions and 336 deletions

View File

@ -8,8 +8,10 @@ import { Observable } from 'rxjs';
providedIn: 'root' providedIn: 'root'
}) })
export class AdditionalcontainerService { export class AdditionalcontainerService {
baseurl = environment.sureops; // baseurl = environment.sureops;
private baseURL = "Gaurav_testing/Gaurav_testing" ; baseurl = environment.backendUrl;
private baseURL = "Gaurav_testing/Gaurav_testing";
constructor(private apiRequest: ApiRequestService, constructor(private apiRequest: ApiRequestService,
private _http: HttpClient,) { } private _http: HttpClient,) { }
@ -44,7 +46,7 @@ export class AdditionalcontainerService {
const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}/${service}`; const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}/${service}`;
return this._http.get(url); return this._http.get(url);
} }
// get all by project id and profile id // get all by project id and profile id
getAllContainers(projId: number, profileId: number): Observable<any> { getAllContainers(projId: number, profileId: number): Observable<any> {
const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}`; const url = `${this.baseurl}/sureops/Additional_container/copt_to_deployment/${projId}/${profileId}`;
return this._http.get(url); return this._http.get(url);
@ -52,24 +54,24 @@ export class AdditionalcontainerService {
///////////////////////////////////// /////////////////////////////////////
getAll(page?: number, size?: number): Observable<any> { getAll(page?: number, size?: number): Observable<any> {
return this.apiRequest.get(this.baseURL); return this.apiRequest.get(this.baseURL);
} }
getById(id: number): Observable<any> { getById(id: number): Observable<any> {
const _http = this.baseURL + "/" + id; const _http = this.baseURL + "/" + id;
return this.apiRequest.get(_http); return this.apiRequest.get(_http);
} }
create(data: any): Observable<any> { create(data: any): Observable<any> {
return this.apiRequest.post(this.baseURL, data); return this.apiRequest.post(this.baseURL, data);
} }
updategaurav(id: number, data: any): Observable<any> { updategaurav(id: number, data: any): Observable<any> {
const _http = this.baseURL + "/" + id; const _http = this.baseURL + "/" + id;
return this.apiRequest.put(_http, data); return this.apiRequest.put(_http, data);
} }
delete(id: number): Observable<any> { delete(id: number): Observable<any> {
const _http = this.baseURL + "/" + id; const _http = this.baseURL + "/" + id;
return this.apiRequest.delete(_http); return this.apiRequest.delete(_http);
} }
} }

View File

@ -19,7 +19,7 @@ export class Dashboard3Service {
private updateURL = 'update_Dashbord1_Lineby_id'; private updateURL = 'update_Dashbord1_Lineby_id';
constructor(private _http: HttpClient, constructor(private _http: HttpClient,
private apiRequest: ApiRequestService) { } private apiRequest: ApiRequestService) { }
getAll(module_id: number,page?: number, size?: number): Observable<any> { getAll(module_id: number, page?: number, size?: number): Observable<any> {
// create Request URL params // create Request URL params
let me = this; let me = this;
let params: HttpParams = new HttpParams(); let params: HttpParams = new HttpParams();
@ -30,44 +30,41 @@ export class Dashboard3Service {
return this.apiRequest.get(this.getAllURL, params); return this.apiRequest.get(this.getAllURL, params);
} }
create(data:any): Observable<any> { create(data: any): Observable<any> {
return this.apiRequest.post(this.addDataURl, data); return this.apiRequest.post(this.addDataURl, data);
} }
deleteField(id:number){ deleteField(id: number) {
let _http = this.deleteFieldURL + "/" + id; let _http = this.deleteFieldURL + "/" + id;
return this.apiRequest.delete(_http); return this.apiRequest.delete(_http);
} }
getById(id:number) getById(id: number) {
{
let _http = this.getbyidURL + "/" + id; let _http = this.getbyidURL + "/" + id;
return this.apiRequest.get(_http); return this.apiRequest.get(_http);
} }
addToDB(line:any):Observable<any> addToDB(line: any): Observable<any> {
{ return this.apiRequest.put(this.editURL, line);
return this.apiRequest.put(this.editURL,line);
} }
UpdateLineData(id:number, line:any) UpdateLineData(id: number, line: any) {
{
// line = { // line = {
// headers: new HttpHeaders({ // headers: new HttpHeaders({
// 'Content-Type': 'application/json' // 'Content-Type': 'application/json'
// }) // })
// }; // };
let _http = this.updateURL + "/" + id; let _http = this.updateURL + "/" + id;
return this.apiRequest.put(_http,line); return this.apiRequest.put(_http, line);
} }
getcount(moduleId: number):Observable<any>{ getcount(moduleId: number): Observable<any> {
return this.apiRequest.get(`get_dashboard/${moduleId}`); return this.apiRequest.get(`get_dashboard/${moduleId}`);
} }
updateDash(dashboardHeader: any): Observable<any> { updateDash(dashboardHeader: any): Observable<any> {
return this.apiRequest.put('update_dashboard_header', dashboardHeader); return this.apiRequest.put('update_dashboard_header', dashboardHeader);
} }
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
resetConditions() { resetConditions() {
this.ids = []; // Reset the ids array to an empty array this.ids = []; // Reset the ids array to an empty array
this.numberIds = []; this.numberIds = [];
this.passwordIds = []; this.passwordIds = [];
@ -83,154 +80,154 @@ resetConditions() {
this.decimalIds = []; this.decimalIds = [];
this.percentageIds = []; this.percentageIds = [];
this.buttonIds = []; this.buttonIds = [];
} }
//////////// Text //////////// Text
ids: any[] = []; ids: any[] = [];
setCondition(condition: any) { setCondition(condition: any) {
this.ids.push(condition); this.ids.push(condition);
} }
getConditions(): any[] { getConditions(): any[] {
return this.ids; return this.ids;
} }
////////// Number ////////// Number
numberIds: any[] = []; numberIds: any[] = [];
setnumber(id: any) { setnumber(id: any) {
this.numberIds.push(id); this.numberIds.push(id);
} }
getnumber(): any[] { getnumber(): any[] {
return this.numberIds; return this.numberIds;
} }
////////////// password ////////////// password
passwordIds: any[] = []; passwordIds: any[] = [];
setpassword(id: any) { setpassword(id: any) {
this.passwordIds.push(id); this.passwordIds.push(id);
} }
getpassword(): any[] { getpassword(): any[] {
return this.passwordIds; return this.passwordIds;
} }
////////////// Textarea ////////////// Textarea
textareaIds: any[] = []; textareaIds: any[] = [];
setTextarea(id: any) { setTextarea(id: any) {
this.textareaIds.push(id); this.textareaIds.push(id);
} }
getTextarea(): any[] { getTextarea(): any[] {
return this.textareaIds; return this.textareaIds;
} }
////////////// Date ////////////// Date
dateIds: any[] = []; dateIds: any[] = [];
setDate(id: any) { setDate(id: any) {
this.dateIds.push(id); this.dateIds.push(id);
} }
getDate(): any[] { getDate(): any[] {
return this.dateIds; return this.dateIds;
} }
////////////// Datetime ////////////// Datetime
datetimeIds: any[] = []; datetimeIds: any[] = [];
setDatetime(id: any) { setDatetime(id: any) {
this.datetimeIds.push(id); this.datetimeIds.push(id);
} }
getDatetime(): any[] { getDatetime(): any[] {
return this.datetimeIds; return this.datetimeIds;
} }
////////////// Email ////////////// Email
emailIds: any[] = []; emailIds: any[] = [];
setEmail(id: any) { setEmail(id: any) {
this.emailIds.push(id); this.emailIds.push(id);
} }
getEmail(): any[] { getEmail(): any[] {
return this.emailIds; return this.emailIds;
} }
////////////// Select ////////////// Select
selectIds: any[] = []; selectIds: any[] = [];
setSelect(id: any) { setSelect(id: any) {
this.selectIds.push(id); this.selectIds.push(id);
} }
getSelect(): any[] { getSelect(): any[] {
return this.selectIds; return this.selectIds;
} }
////////////// Radio ////////////// Radio
radioIds: any[] = []; radioIds: any[] = [];
setRadio(id: any) { setRadio(id: any) {
this.radioIds.push(id); this.radioIds.push(id);
} }
getRadio(): any[] { getRadio(): any[] {
return this.radioIds; return this.radioIds;
} }
////////////// Checkbox ////////////// Checkbox
checkboxIds: any[] = []; checkboxIds: any[] = [];
setCheckbox(id: any) { setCheckbox(id: any) {
this.checkboxIds.push(id); this.checkboxIds.push(id);
} }
getCheckbox(): any[] { getCheckbox(): any[] {
return this.checkboxIds; return this.checkboxIds;
} }
////////////// fileupload ////////////// fileupload
fileuloadIds: any[] = []; fileuloadIds: any[] = [];
setFileUpload(id: any) { setFileUpload(id: any) {
this.fileuloadIds.push(id); this.fileuloadIds.push(id);
} }
getFileupload(): any[] { getFileupload(): any[] {
return this.fileuloadIds; return this.fileuloadIds;
} }
////////////// Url ////////////// Url
urlIds: any[] = []; urlIds: any[] = [];
setUrl(id: any) { setUrl(id: any) {
this.urlIds.push(id); this.urlIds.push(id);
} }
getUrl(): any[] { getUrl(): any[] {
return this.urlIds; return this.urlIds;
} }
////////////// Decimal ////////////// Decimal
decimalIds: any[] = []; decimalIds: any[] = [];
setDecimal(id: any) { setDecimal(id: any) {
this.decimalIds.push(id); this.decimalIds.push(id);
} }
getDecimal(): any[] { getDecimal(): any[] {
return this.decimalIds; return this.decimalIds;
} }
////////////// Percentage ////////////// Percentage
percentageIds: any[] = []; percentageIds: any[] = [];
setPercentage(id: any) { setPercentage(id: any) {
this.percentageIds.push(id); this.percentageIds.push(id);
} }
getPercentage(): any[] { getPercentage(): any[] {
return this.percentageIds; return this.percentageIds;
} }
////////////// Button ////////////// Button
buttonIds: any[] = []; buttonIds: any[] = [];
setButton(id: any) { setButton(id: any) {
this.buttonIds.push(id); this.buttonIds.push(id);
} }
getButton(): any[] { getButton(): any[] {
return this.buttonIds; return this.buttonIds;
} }
@ -240,12 +237,12 @@ getButton(): any[] {
getAllDash(): Observable<any> { getAllDash(): Observable<any> {
// create Request URL params // create Request URL params
return this.apiRequest.get(`get_Dashboard_header`); return this.apiRequest.get(`get_Dashboard_header`);
} }
getAllByModuleId(module_id: number,page?: number, size?: number): Observable<any> { getAllByModuleId(module_id: number, page?: number, size?: number): Observable<any> {
// create Request URL params // create Request URL params
let me = this; let me = this;
let params: HttpParams = new HttpParams(); let params: HttpParams = new HttpParams();
@ -256,53 +253,67 @@ getAllByModuleId(module_id: number,page?: number, size?: number): Observable<any
return this.apiRequest.get(this.getAllURL, params); return this.apiRequest.get(this.getAllURL, params);
} }
///////schedule ///////schedule
public saveData(data: any): Observable<any> { public saveData(data: any): Observable<any> {
return this.apiRequest.post(`DashboardSchedule/DashboardSchedule`, data); return this.apiRequest.post(`DashboardSchedule/DashboardSchedule`, data);
} }
public getDetails(): Observable<any> { public getDetails(): Observable<any> {
return this.apiRequest.get(`DashboardSchedule/DashboardSchedule`); return this.apiRequest.get(`DashboardSchedule/DashboardSchedule`);
} }
public getDetailsById(id: number): Observable<any> { public getDetailsById(id: number): Observable<any> {
return this.apiRequest.get(`DashboardSchedule/DashboardSchedule/${id}`); return this.apiRequest.get(`DashboardSchedule/DashboardSchedule/${id}`);
} }
public deleteById(id: number): Observable<any> { public deleteById(id: number): Observable<any> {
return this.apiRequest.delete(`DashboardSchedule/DashboardSchedule/${id}`); return this.apiRequest.delete(`DashboardSchedule/DashboardSchedule/${id}`);
} }
public updateData(data: any, id: number): Observable<any> { public updateData(data: any, id: number): Observable<any> {
return this.apiRequest.put(`DashboardSchedule/DashboardSchedule/${id}`, data); return this.apiRequest.put(`DashboardSchedule/DashboardSchedule/${id}`, data);
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
public getDynamicDashDetails(): Observable<any> { public getDynamicDashDetails(): Observable<any> {
return this.apiRequest.get(`Dashboard/Dashboard`); return this.apiRequest.get(`Dashboard/Dashboard`);
} }
public getChartData(tableName: string, jobType: string, xAxis?: any, yAxes?: any, sureId?: number, parameter?: string, parameterValue?: string): Observable<any> {
let url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&xAxis=${xAxis}&yAxes=${yAxes}`;
if (sureId) {
url += `&sureId=${sureId}`;
}
if (parameter) {
url += `&parameter=${encodeURIComponent(parameter)}`;
}
if (parameterValue) {
url += `&parameterValue=${encodeURIComponent(parameterValue)}`;
}
public getChartData(tableName: string, jobType: string, xAxis?:any,yAxes?:any ): Observable<any> {
const url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&xAxis=${xAxis}&yAxes=${yAxes}`;
return this._http.get(url); return this._http.get(url);
} }
public getUrlChartData(tableName: string, jobType: string, xAxis:any,yAxes:any,store:any,chartUrl:any): Observable<any> { public getUrlChartData(tableName: string, jobType: string, xAxis: any, yAxes: any, store: any, chartUrl: any, sureId?: number): Observable<any> {
const url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&url=${chartUrl}&xAxis=${xAxis}&yAxes=${yAxes}&datastore_name=${store}`; let url = `${baseUrl}/chart/getdashjson/${jobType}?tableName=${tableName}&url=${chartUrl}&xAxis=${xAxis}&yAxes=${yAxes}&datastore_name=${store}`;
if (sureId) {
url += `&sureId=${sureId}`;
}
return this._http.get(url); return this._http.get(url);
} }
featchDynamicUrlDetails(url): Observable<any> { featchDynamicUrlDetails(url): Observable<any> {
return this._http.get(`${url}`); return this._http.get(`${url}`);
} }
private filteredDataSubject = new BehaviorSubject<any[]>([]); private filteredDataSubject = new BehaviorSubject<any[]>([]);
filteredData$ = this.filteredDataSubject.asObservable(); filteredData$ = this.filteredDataSubject.asObservable();
updateFilteredData(filteredData: any[]) { updateFilteredData(filteredData: any[]) {
this.filteredDataSubject.next(filteredData); this.filteredDataSubject.next(filteredData);
} }
} }

View File

@ -62,7 +62,11 @@ export class AlertsService {
return this.apiRequest.get(`AlertRules/columnlist/${id}/${tableName}`); return this.apiRequest.get(`AlertRules/columnlist/${id}/${tableName}`);
} }
public getColumnfromurl(url: any): Observable<any> { public getColumnfromurl(url: any, sureId?: number): Observable<any> {
return this.apiRequest.get(`chart/getAllKeys?apiUrl=${url}`); let apiUrl = `chart/getAllKeys?apiUrl=${url}`;
if (sureId) {
apiUrl += `&sureId=${sureId}`;
}
return this.apiRequest.get(apiUrl);
} }
} }