mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Update import statements for UserProfile component to use FileUtil.getFileRoute instead of FileUtil.getFileURL
This commit is contained in:
@@ -25,8 +25,24 @@ export default class InBetween extends SerializableObject {
|
||||
endValue: number | Date | string,
|
||||
) {
|
||||
super();
|
||||
this.endValue = endValue;
|
||||
this.startValue = startValue;
|
||||
|
||||
if (
|
||||
typeof startValue === "string" &&
|
||||
OneUptimeDate.isValidDateString(startValue)
|
||||
) {
|
||||
this.startValue = OneUptimeDate.fromString(startValue);
|
||||
} else {
|
||||
this.startValue = startValue;
|
||||
}
|
||||
|
||||
if (
|
||||
typeof endValue === "string" &&
|
||||
OneUptimeDate.isValidDateString(endValue)
|
||||
) {
|
||||
this.endValue = OneUptimeDate.fromString(endValue);
|
||||
} else {
|
||||
this.endValue = endValue;
|
||||
}
|
||||
}
|
||||
|
||||
public override toJSON(): JSONObject {
|
||||
|
||||
@@ -935,6 +935,10 @@ export default class OneUptimeDate {
|
||||
return this.getGmtOffsetFriendlyString(offset) + " " + timezone;
|
||||
}
|
||||
|
||||
public static isValidDateString(date: string): boolean {
|
||||
return moment(date).isValid();
|
||||
}
|
||||
|
||||
public static getGmtOffsetFriendlyString(offset: number): string {
|
||||
const hours: number = Math.abs(offset) / 60;
|
||||
const minutes: number = Math.abs(offset) % 60;
|
||||
|
||||
@@ -261,6 +261,8 @@ export default class JSONFunctions {
|
||||
return val;
|
||||
} else if (val instanceof DatabaseProperty) {
|
||||
return val;
|
||||
} else if (val instanceof SerializableObject) {
|
||||
return val;
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === Typeof.Object &&
|
||||
|
||||
@@ -234,6 +234,7 @@ export default class BaseAnalyticsAPI<
|
||||
let groupBy: GroupBy<AnalyticsDataModel> = {};
|
||||
|
||||
if (req.body) {
|
||||
|
||||
query = JSONFunctions.deserialize(
|
||||
req.body["query"],
|
||||
) as Query<AnalyticsDataModel>;
|
||||
|
||||
@@ -386,10 +386,12 @@ export default class ModelAPI {
|
||||
);
|
||||
|
||||
if (result.isSuccess()) {
|
||||
return BaseModel.fromJSONObject(
|
||||
const baseModel: TBaseModel = BaseModel.fromJSONObject(
|
||||
result.data as JSONObject,
|
||||
data.modelType,
|
||||
);
|
||||
|
||||
return baseModel;
|
||||
}
|
||||
|
||||
this.checkStatusCode(result);
|
||||
|
||||
@@ -35,7 +35,7 @@ const DashboardLogsViewer: FunctionComponent<ComponentProps> = (
|
||||
type RefreshQueryFunction = () => Query<Log>;
|
||||
|
||||
const refreshQuery: RefreshQueryFunction = (): Query<Log> => {
|
||||
let query: Query<Log> = {};
|
||||
const query: Query<Log> = {};
|
||||
|
||||
if (props.telemetryServiceIds && props.telemetryServiceIds.length > 0) {
|
||||
query.serviceId = new Includes(props.telemetryServiceIds);
|
||||
@@ -49,11 +49,10 @@ const DashboardLogsViewer: FunctionComponent<ComponentProps> = (
|
||||
query.spanId = new Includes(props.spanIds);
|
||||
}
|
||||
|
||||
if (props.logQuery) {
|
||||
query = {
|
||||
...query,
|
||||
...props.logQuery,
|
||||
};
|
||||
if (props.logQuery && Object.keys(props.logQuery).length > 0) {
|
||||
for (const key in props.logQuery) {
|
||||
(query as any)[key] = (props.logQuery as any)[key] as any;
|
||||
}
|
||||
}
|
||||
|
||||
return query;
|
||||
|
||||
@@ -113,11 +113,15 @@ const IncidentView: FunctionComponent<
|
||||
},
|
||||
});
|
||||
|
||||
setTelemetryQuery(
|
||||
incident?.telemetryQuery
|
||||
? (JSONFunctions.deserialize(incident?.telemetryQuery as any) as any)
|
||||
: null,
|
||||
);
|
||||
let telemetryQuery: TelemetryIncidentQuery | null = null;
|
||||
|
||||
if (incident?.telemetryQuery) {
|
||||
telemetryQuery = JSONFunctions.deserialize(
|
||||
incident?.telemetryQuery as any,
|
||||
) as any;
|
||||
}
|
||||
|
||||
setTelemetryQuery(telemetryQuery);
|
||||
setIncidentStates(incidentStates.data as IncidentState[]);
|
||||
setIncidentStateTimeline(
|
||||
incidentTimelines.data as IncidentStateTimeline[],
|
||||
|
||||
Reference in New Issue
Block a user