diff --git a/backend/config_parser.py b/backend/config_parser.py
index 87abb9f..64f9330 100644
--- a/backend/config_parser.py
+++ b/backend/config_parser.py
@@ -8,6 +8,8 @@ from nvr_types import File
import platform
import aiofiles
+from subprocess import DEVNULL
+
from global_funcs import *
class NeedNVR(Exception):
@@ -234,7 +236,7 @@ class TranscodeTools:
await proc.communicate()
if delete_source_file:
- os.remove(source_file)
+ self.deleteFile(source_file)
if os.path.exists(source_file + ".avi"):
return source_file + ".avi"
else:
@@ -247,7 +249,7 @@ class TranscodeTools:
await proc.communicate()
if delete_source_file:
- os.remove(source_file)
+ self.deleteFile(source_file)
if os.path.exists(source_file + ".mp4"):
return source_file + ".mp4"
else:
@@ -256,18 +258,21 @@ class TranscodeTools:
async def anytoimage(self, source_file, out_file, delete_source_file = False):
exec_string = ["-y", "-i", source_file, "-ss", "1", "-vframes", "1", out_file]
self.logger.debug(f"execute {exec_string}")
- proc = await asyncio.create_subprocess_exec("ffmpeg", *exec_string)
+ proc = await asyncio.create_subprocess_exec("ffmpeg", *exec_string, stderr=DEVNULL)
await proc.communicate()
if delete_source_file:
- os.remove(source_file)
+ self.deleteFile(source_file)
if os.path.exists(out_file):
return out_file
else:
raise Exception(f"{out_file} not be created")
def deleteFile(self, source_file):
- os.remove(source_file)
+ try:
+ os.remove(source_file)
+ except:
+ pass
async def processing_preview(self, file:File, nvr: NVR, ext = "webp"):
raw_file = file.previewPath(self.transcode_directory)
diff --git a/backend/nvr_types.py b/backend/nvr_types.py
index ec7297e..57a1618 100644
--- a/backend/nvr_types.py
+++ b/backend/nvr_types.py
@@ -47,7 +47,14 @@ class File:
@property
def json(self):
b64 = self.to_b64.replace("==", "")
- return {"filename": self.filename_cleared, "type": self.type, "size": self.size, "b64": b64, "converted":self.converted}
+ return {
+ "filename": self.filename_cleared,
+ "type": self.type,
+ "size": self.size,
+ "b64": b64,
+ "converted":self.converted,
+ "date":self.begin.strftime(NVR_DATE_FORMAT)
+ }
@staticmethod
def from_b64(b64):
diff --git a/frontend/ang_dvrip/src/app/app.module.ts b/frontend/ang_dvrip/src/app/app.module.ts
index 1e0ff40..17db593 100644
--- a/frontend/ang_dvrip/src/app/app.module.ts
+++ b/frontend/ang_dvrip/src/app/app.module.ts
@@ -30,6 +30,7 @@ import {MatProgressSpinnerModule} from "@angular/material/progress-spinner";
import {MatIconModule} from "@angular/material/icon";
import { AboutComponent } from './components/about/about.component';
import { StreamComponent } from './components/stream/stream.component';
+import {MatCardModule} from "@angular/material/card";
@NgModule({
declarations: [
@@ -40,21 +41,21 @@ import { StreamComponent } from './components/stream/stream.component';
AboutComponent,
StreamComponent
],
- imports: [
- BrowserModule,
- AppRoutingModule,
- MatSidenavModule,
- MatFormFieldModule,
- MatInputModule,
- MatSelectModule,
- HttpClientModule,
- BrowserAnimationsModule,
- MatDatepickerModule,
- MatButtonModule,
- MatFormFieldModule,
- MatNativeDateModule,
- MatAutocompleteModule, MatCheckboxModule, MatButtonModule, MatFormFieldModule, MatDatepickerModule, MatRadioModule, MatInputModule, MatSelectModule, MatSlideToggleModule, MatSlideToggleModule, MatToolbarModule, MatListModule, MatTableModule, ReactiveFormsModule, MatDialogModule, FormsModule, MatProgressBarModule, MatProgressSpinnerModule, MatIconModule
- ],
+ imports: [
+ BrowserModule,
+ AppRoutingModule,
+ MatSidenavModule,
+ MatFormFieldModule,
+ MatInputModule,
+ MatSelectModule,
+ HttpClientModule,
+ BrowserAnimationsModule,
+ MatDatepickerModule,
+ MatButtonModule,
+ MatFormFieldModule,
+ MatNativeDateModule,
+ MatAutocompleteModule, MatCheckboxModule, MatButtonModule, MatFormFieldModule, MatDatepickerModule, MatRadioModule, MatInputModule, MatSelectModule, MatSlideToggleModule, MatSlideToggleModule, MatToolbarModule, MatListModule, MatTableModule, ReactiveFormsModule, MatDialogModule, FormsModule, MatProgressBarModule, MatProgressSpinnerModule, MatIconModule, MatCardModule
+ ],
exports: [
BrowserModule,
AppRoutingModule,
diff --git a/frontend/ang_dvrip/src/app/components/history/history.component.css b/frontend/ang_dvrip/src/app/components/history/history.component.css
index e4ba4dd..90437a7 100644
--- a/frontend/ang_dvrip/src/app/components/history/history.component.css
+++ b/frontend/ang_dvrip/src/app/components/history/history.component.css
@@ -13,3 +13,9 @@
.processing {
color: coral;
}
+
+.responsive-grid {
+ display: grid;
+ grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
+ gap: 24px;
+}
diff --git a/frontend/ang_dvrip/src/app/components/history/history.component.html b/frontend/ang_dvrip/src/app/components/history/history.component.html
index 72fa77a..78c7a7a 100644
--- a/frontend/ang_dvrip/src/app/components/history/history.component.html
+++ b/frontend/ang_dvrip/src/app/components/history/history.component.html
@@ -9,41 +9,41 @@
-
- Имя файла / Время обнаружения
- {{element.filename}}
- Размер
- {{baseUtils.getFancySize(element.size)}}
- Действия
-
-
-
-
-
Прогресс загрузки h264x {{status.h264}} %
-Прогресс перекодировки avi {{status.avi}} %
-Прогресс перекодировки mp4 {{status.mp4}} %
-1) Прогресс загрузки h264x {{status.h264}} %
+2) Прогресс перекодировки avi {{status.avi}} %
+3) Прогресс перекодировки mp4 {{status.mp4}} %
+