mirror of
https://github.com/foss42/apidash.git
synced 2025-05-30 21:41:50 +08:00
wip: history panes
This commit is contained in:
@ -13,6 +13,13 @@ String humanizeDate(DateTime? date) {
|
||||
return DateFormat('MMMM d, yyyy').format(date);
|
||||
}
|
||||
|
||||
String humanizeTime(DateTime? time) {
|
||||
if (time == null) {
|
||||
return "";
|
||||
}
|
||||
return DateFormat('hh:mm:ss a').format(time);
|
||||
}
|
||||
|
||||
String humanizeDuration(Duration? duration) {
|
||||
if (duration == null) {
|
||||
return "";
|
||||
|
@ -1,10 +1,22 @@
|
||||
import 'package:apidash/models/models.dart';
|
||||
import 'package:apidash/utils/convert_utils.dart';
|
||||
import 'package:apidash/models/models.dart';
|
||||
import 'package:apidash/consts.dart';
|
||||
|
||||
DateTime stripTime(DateTime dateTime) {
|
||||
return DateTime(dateTime.year, dateTime.month, dateTime.day);
|
||||
}
|
||||
|
||||
RequestModel getRequestModelFromHistoryModel(HistoryRequestModel model) {
|
||||
return RequestModel(
|
||||
id: model.historyId,
|
||||
name: model.metaData.name,
|
||||
responseStatus: model.httpResponseModel.statusCode,
|
||||
message: kResponseCodeReasons[model.httpResponseModel.statusCode],
|
||||
httpRequestModel: model.httpRequestModel,
|
||||
httpResponseModel: model.httpResponseModel,
|
||||
);
|
||||
}
|
||||
|
||||
String getHistoryRequestName(HistoryMetaModel model) {
|
||||
if (model.name.isNotEmpty) {
|
||||
return model.name;
|
||||
|
Reference in New Issue
Block a user