600cd153e0
- Add archived to device type & db - Add archive/unarchive handlers to webapp backend - Add archive toggle & styling to webapp frontend
39 lines
969 B
TypeScript
39 lines
969 B
TypeScript
import {Injectable} from '@angular/core';
|
|
import {HttpClient} from '@angular/common/http';
|
|
import {Observable} from 'rxjs';
|
|
import {getBasePath} from 'app/app.routing';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class DashboardDeviceArchiveDialogService
|
|
{
|
|
|
|
|
|
/**
|
|
* Constructor
|
|
*
|
|
* @param {HttpClient} _httpClient
|
|
*/
|
|
constructor(
|
|
private _httpClient: HttpClient
|
|
)
|
|
{
|
|
}
|
|
|
|
// -----------------------------------------------------------------------------------------------------
|
|
// @ Public methods
|
|
// -----------------------------------------------------------------------------------------------------
|
|
|
|
|
|
archiveDevice(wwn: string): Observable<any>
|
|
{
|
|
return this._httpClient.post( `${getBasePath()}/api/device/${wwn}/archive`, {});
|
|
}
|
|
|
|
unarchiveDevice(wwn: string): Observable<any>
|
|
{
|
|
return this._httpClient.post( `${getBasePath()}/api/device/${wwn}/unarchive`, {});
|
|
}
|
|
}
|