⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
core
/
history
/
View File Name :
localStorageConverter.ts
import { getDataSourceSrv } from '@grafana/runtime'; import { RichHistoryQuery } from '../../types'; import { RichHistoryLocalStorageDTO } from './RichHistoryLocalStorage'; export const fromDTO = (dto: RichHistoryLocalStorageDTO): RichHistoryQuery => { const datasource = getDataSourceSrv().getInstanceSettings(dto.datasourceName); return { id: dto.ts.toString(), createdAt: dto.ts, datasourceName: dto.datasourceName, datasourceUid: datasource?.uid || '', // will be show on the list as coming from a removed data source starred: dto.starred, comment: dto.comment, queries: dto.queries, }; }; export const toDTO = (richHistoryQuery: RichHistoryQuery): RichHistoryLocalStorageDTO => { const datasource = getDataSourceSrv().getInstanceSettings({ uid: richHistoryQuery.datasourceUid }); if (!datasource) { throw new Error('Datasource not found.'); } return { ts: richHistoryQuery.createdAt, datasourceName: richHistoryQuery.datasourceName, starred: richHistoryQuery.starred, comment: richHistoryQuery.comment, queries: richHistoryQuery.queries, }; };