feat: add dashboard metrics service
This commit is contained in:
@@ -546,6 +546,125 @@ export class AuthSession {
|
||||
}
|
||||
}
|
||||
|
||||
export class DailyMetric {
|
||||
/**
|
||||
* Creates a new DailyMetric instance.
|
||||
* @param {Partial<DailyMetric>} [$$source = {}] - The source object to create the DailyMetric.
|
||||
*/
|
||||
constructor($$source = {}) {
|
||||
if (!("date" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {string}
|
||||
*/
|
||||
this["date"] = "";
|
||||
}
|
||||
if (!("processedImages" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["processedImages"] = 0;
|
||||
}
|
||||
if (!("succeededTasks" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["succeededTasks"] = 0;
|
||||
}
|
||||
if (!("failedTasks" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["failedTasks"] = 0;
|
||||
}
|
||||
if (!("averageDurationMs" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["averageDurationMs"] = 0;
|
||||
}
|
||||
if (!("auditLogs" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["auditLogs"] = 0;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new DailyMetric instance from a string or object.
|
||||
* @param {any} [$$source = {}]
|
||||
* @returns {DailyMetric}
|
||||
*/
|
||||
static createFrom($$source = {}) {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new DailyMetric(/** @type {Partial<DailyMetric>} */($$parsedSource));
|
||||
}
|
||||
}
|
||||
|
||||
export class DashboardMetrics {
|
||||
/**
|
||||
* Creates a new DashboardMetrics instance.
|
||||
* @param {Partial<DashboardMetrics>} [$$source = {}] - The source object to create the DashboardMetrics.
|
||||
*/
|
||||
constructor($$source = {}) {
|
||||
if (!("todayProcessedImages" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["todayProcessedImages"] = 0;
|
||||
}
|
||||
if (!("successRate" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["successRate"] = 0;
|
||||
}
|
||||
if (!("averageDurationMs" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["averageDurationMs"] = 0;
|
||||
}
|
||||
if (!("failedTasks" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["failedTasks"] = 0;
|
||||
}
|
||||
if (!("todayAuditLogs" in $$source)) {
|
||||
/**
|
||||
* @member
|
||||
* @type {number}
|
||||
*/
|
||||
this["todayAuditLogs"] = 0;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new DashboardMetrics instance from a string or object.
|
||||
* @param {any} [$$source = {}]
|
||||
* @returns {DashboardMetrics}
|
||||
*/
|
||||
static createFrom($$source = {}) {
|
||||
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
|
||||
return new DashboardMetrics(/** @type {Partial<DashboardMetrics>} */($$parsedSource));
|
||||
}
|
||||
}
|
||||
|
||||
export class Hotkey {
|
||||
/**
|
||||
* Creates a new Hotkey instance.
|
||||
|
||||
@@ -9,6 +9,7 @@ import * as AuditLogService from "./auditlogservice.js";
|
||||
import * as AuthService from "./authservice.js";
|
||||
import * as HotkeyService from "./hotkeyservice.js";
|
||||
import * as ImageOptimizationService from "./imageoptimizationservice.js";
|
||||
import * as MetricsService from "./metricsservice.js";
|
||||
import * as OCRService from "./ocrservice.js";
|
||||
import * as SystemInfo from "./systeminfo.js";
|
||||
export {
|
||||
@@ -19,6 +20,7 @@ export {
|
||||
AuthService,
|
||||
HotkeyService,
|
||||
ImageOptimizationService,
|
||||
MetricsService,
|
||||
OCRService,
|
||||
SystemInfo
|
||||
};
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// @ts-check
|
||||
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
|
||||
// This file is automatically generated. DO NOT EDIT
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore: Unused imports
|
||||
import * as models$0 from "../models/models.js";
|
||||
|
||||
/**
|
||||
* @returns {Promise<models$0.DashboardMetrics> & { cancel(): void }}
|
||||
*/
|
||||
export function GetDashboardMetrics() {
|
||||
let $resultPromise = /** @type {any} */($Call.ByID(2761444903));
|
||||
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
|
||||
return $$createType0($result);
|
||||
}));
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {number} days
|
||||
* @returns {Promise<models$0.DailyMetric[]> & { cancel(): void }}
|
||||
*/
|
||||
export function GetProcessingTrend(days) {
|
||||
let $resultPromise = /** @type {any} */($Call.ByID(2069059156, days));
|
||||
let $typingPromise = /** @type {any} */($resultPromise.then(($result) => {
|
||||
return $$createType2($result);
|
||||
}));
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = models$0.DashboardMetrics.createFrom;
|
||||
const $$createType1 = models$0.DailyMetric.createFrom;
|
||||
const $$createType2 = $Create.Array($$createType1);
|
||||
Reference in New Issue
Block a user