Add timeline to menu.
This commit is contained in:
+12
-2
@@ -371,6 +371,16 @@ export class FrigateCard extends LitElement {
|
||||
});
|
||||
}
|
||||
|
||||
if (this._getConfig().menu.buttons.timeline) {
|
||||
buttons.push({
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
title: localize('config.view.views.timeline'),
|
||||
icon: 'mdi:chart-gantt',
|
||||
style: this._view?.is('timeline') ? this._getEmphasizedStyle() : {},
|
||||
tap_action: createFrigateCardCustomAction('timeline') as FrigateCardCustomAction,
|
||||
});
|
||||
}
|
||||
|
||||
if (this._getConfig().menu.buttons.download && this._view?.isViewerView()) {
|
||||
buttons.push({
|
||||
type: 'custom:frigate-card-menu-icon',
|
||||
@@ -649,8 +659,7 @@ export class FrigateCard extends LitElement {
|
||||
// Load the default view.
|
||||
let camera;
|
||||
if (this._cameras?.size) {
|
||||
if (this._view?.camera &&
|
||||
this._getConfig().view.update_cycle_camera) {
|
||||
if (this._view?.camera && this._getConfig().view.update_cycle_camera) {
|
||||
const keys = Array.from(this._cameras.keys());
|
||||
const currentIndex = keys.indexOf(this._view.camera);
|
||||
const targetIndex = currentIndex + 1 >= keys.length ? 0 : currentIndex + 1;
|
||||
@@ -827,6 +836,7 @@ export class FrigateCard extends LitElement {
|
||||
case 'live':
|
||||
case 'snapshot':
|
||||
case 'snapshots':
|
||||
case 'timeline':
|
||||
if (this._view) {
|
||||
this._changeView({
|
||||
view: new View({
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
"snapshot": "Most recent snapshot",
|
||||
"snapshots": "Snapshots gallery",
|
||||
"image": "Static image",
|
||||
"current": "Current view"
|
||||
"current": "Current view",
|
||||
"timeline": "Timeline view"
|
||||
},
|
||||
"timeout_seconds": "Reset to default view X seconds after user action (0=never)",
|
||||
"update_cycle_camera": "Cycle through cameras when default view updates",
|
||||
|
||||
@@ -127,6 +127,7 @@ const FRIGATE_CARD_GENERAL_ACTIONS = [
|
||||
'live',
|
||||
'snapshot',
|
||||
'snapshots',
|
||||
'timeline',
|
||||
'download',
|
||||
'frigate_ui',
|
||||
'fullscreen',
|
||||
@@ -591,6 +592,7 @@ const menuConfigDefault = {
|
||||
clips: true,
|
||||
snapshots: true,
|
||||
image: false,
|
||||
timeline: true,
|
||||
download: true,
|
||||
frigate_ui: true,
|
||||
fullscreen: true,
|
||||
@@ -609,6 +611,7 @@ const menuConfigSchema = z
|
||||
clips: z.boolean().default(menuConfigDefault.buttons.clips),
|
||||
snapshots: z.boolean().default(menuConfigDefault.buttons.snapshots),
|
||||
image: z.boolean().default(menuConfigDefault.buttons.image),
|
||||
timeline: z.boolean().default(menuConfigDefault.buttons.timeline),
|
||||
download: z.boolean().default(menuConfigDefault.buttons.download),
|
||||
frigate_ui: z.boolean().default(menuConfigDefault.buttons.frigate_ui),
|
||||
fullscreen: z.boolean().default(menuConfigDefault.buttons.fullscreen),
|
||||
|
||||
Reference in New Issue
Block a user