Merge pull request #710 from dermotduffy/build-data-in-diagnostics
Add git information to diagnostics
This commit is contained in:
@@ -62,6 +62,7 @@
|
|||||||
"eslint-plugin-prettier": "^4.0.0",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"prettier": "^2.6.0",
|
"prettier": "^2.6.0",
|
||||||
"rollup": "^2.75.6",
|
"rollup": "^2.75.6",
|
||||||
|
"rollup-plugin-git-info": "^1.0.0",
|
||||||
"rollup-plugin-serve": "^1.1.0",
|
"rollup-plugin-serve": "^1.1.0",
|
||||||
"rollup-plugin-styles": "^4.0.0",
|
"rollup-plugin-styles": "^4.0.0",
|
||||||
"rollup-plugin-terser": "^7.0.2",
|
"rollup-plugin-terser": "^7.0.2",
|
||||||
|
|||||||
+3
-1
@@ -8,6 +8,7 @@ import json from '@rollup/plugin-json';
|
|||||||
import styles from 'rollup-plugin-styles';
|
import styles from 'rollup-plugin-styles';
|
||||||
import image from '@rollup/plugin-image';
|
import image from '@rollup/plugin-image';
|
||||||
import replace from '@rollup/plugin-replace';
|
import replace from '@rollup/plugin-replace';
|
||||||
|
import gitInfo from 'rollup-plugin-git-info';
|
||||||
|
|
||||||
const watch = process.env.ROLLUP_WATCH === 'true' || process.env.ROLLUP_WATCH === '1';
|
const watch = process.env.ROLLUP_WATCH === 'true' || process.env.ROLLUP_WATCH === '1';
|
||||||
const dev = watch || process.env.DEV === 'true' || process.env.DEV === '1';
|
const dev = watch || process.env.DEV === 'true' || process.env.DEV === '1';
|
||||||
@@ -29,6 +30,7 @@ const serveopts = {
|
|||||||
* @type {import('rollup').RollupOptions['plugins']}
|
* @type {import('rollup').RollupOptions['plugins']}
|
||||||
*/
|
*/
|
||||||
const plugins = [
|
const plugins = [
|
||||||
|
gitInfo({ enableBuildDate: true, updateVersion: false }),
|
||||||
styles({
|
styles({
|
||||||
modules: false,
|
modules: false,
|
||||||
// Behavior of inject mode, without actually injecting style
|
// Behavior of inject mode, without actually injecting style
|
||||||
@@ -46,7 +48,7 @@ const plugins = [
|
|||||||
include: 'node_modules/**',
|
include: 'node_modules/**',
|
||||||
}),
|
}),
|
||||||
typescript(),
|
typescript(),
|
||||||
json(),
|
json({ exclude: 'package.json' }),
|
||||||
babel({
|
babel({
|
||||||
babelHelpers: 'bundled',
|
babelHelpers: 'bundled',
|
||||||
exclude: 'node_modules/**',
|
exclude: 'node_modules/**',
|
||||||
|
|||||||
+8
-3
@@ -39,7 +39,6 @@ import './components/viewer.js';
|
|||||||
import { isConfigUpgradeable } from './config-mgmt.js';
|
import { isConfigUpgradeable } from './config-mgmt.js';
|
||||||
import {
|
import {
|
||||||
CAMERA_BIRDSEYE,
|
CAMERA_BIRDSEYE,
|
||||||
CARD_VERSION,
|
|
||||||
MEDIA_PLAYER_SUPPORT_BROWSE_MEDIA,
|
MEDIA_PLAYER_SUPPORT_BROWSE_MEDIA,
|
||||||
REPO_URL,
|
REPO_URL,
|
||||||
} from './const.js';
|
} from './const.js';
|
||||||
@@ -98,6 +97,7 @@ import { ResolvedMediaCache } from './utils/ha/resolved-media.js';
|
|||||||
import { supportsFeature } from './utils/ha/update.js';
|
import { supportsFeature } from './utils/ha/update.js';
|
||||||
import { isValidMediaShowInfo } from './utils/media-info.js';
|
import { isValidMediaShowInfo } from './utils/media-info.js';
|
||||||
import { View } from './view.js';
|
import { View } from './view.js';
|
||||||
|
import pkg from '../package.json';
|
||||||
|
|
||||||
/** A note on media callbacks:
|
/** A note on media callbacks:
|
||||||
*
|
*
|
||||||
@@ -127,7 +127,7 @@ import { View } from './view.js';
|
|||||||
|
|
||||||
/* eslint no-console: 0 */
|
/* eslint no-console: 0 */
|
||||||
console.info(
|
console.info(
|
||||||
`%c FRIGATE-HASS-CARD \n%c ${localize('common.version')} ${CARD_VERSION} `,
|
`%c FRIGATE-HASS-CARD \n%c ${localize('common.version')} ${pkg.version} `,
|
||||||
'color: pink; font-weight: bold; background: black',
|
'color: pink; font-weight: bold; background: black',
|
||||||
'color: white; font-weight: bold; background: dimgray',
|
'color: white; font-weight: bold; background: dimgray',
|
||||||
);
|
);
|
||||||
@@ -1385,11 +1385,16 @@ export class FrigateCard extends LitElement {
|
|||||||
icon: 'mdi:information',
|
icon: 'mdi:information',
|
||||||
context: {
|
context: {
|
||||||
ha_version: this._hass.config.version,
|
ha_version: this._hass.config.version,
|
||||||
card_version: CARD_VERSION,
|
card_version: pkg.version,
|
||||||
browser: navigator.userAgent,
|
browser: navigator.userAgent,
|
||||||
date: new Date(),
|
date: new Date(),
|
||||||
frigate_version: Object.fromEntries(frigateVersionMap),
|
frigate_version: Object.fromEntries(frigateVersionMap),
|
||||||
lang: getLanguage(),
|
lang: getLanguage(),
|
||||||
|
git: {
|
||||||
|
...(pkg['gitVersion'] && { build_version: pkg['gitVersion'] }),
|
||||||
|
...(pkg['buildDate'] && { build_date: pkg['buildDate'] }),
|
||||||
|
...(pkg['gitDate'] && { commit_date: pkg['gitDate'] }),
|
||||||
|
},
|
||||||
...(this._rawConfig && { config: this._rawConfig }),
|
...(this._rawConfig && { config: this._rawConfig }),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
+7
-6
@@ -1,5 +1,3 @@
|
|||||||
export const CARD_VERSION = '4.0.0-rc.1' as const;
|
|
||||||
|
|
||||||
export const CAMERA_BIRDSEYE = 'birdseye' as const;
|
export const CAMERA_BIRDSEYE = 'birdseye' as const;
|
||||||
export const REPO_URL = 'https://github.com/dermotduffy/frigate-hass-card' as const;
|
export const REPO_URL = 'https://github.com/dermotduffy/frigate-hass-card' as const;
|
||||||
export const TROUBLESHOOTING_URL = `${REPO_URL}#troubleshooting` as const;
|
export const TROUBLESHOOTING_URL = `${REPO_URL}#troubleshooting` as const;
|
||||||
@@ -7,9 +5,12 @@ export const TROUBLESHOOTING_URL = `${REPO_URL}#troubleshooting` as const;
|
|||||||
export const CONF_CAMERAS = 'cameras' as const;
|
export const CONF_CAMERAS = 'cameras' as const;
|
||||||
export const CONF_CAMERAS_ARRAY_CAMERA_ENTITY =
|
export const CONF_CAMERAS_ARRAY_CAMERA_ENTITY =
|
||||||
`${CONF_CAMERAS}.#.camera_entity` as const;
|
`${CONF_CAMERAS}.#.camera_entity` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_FRIGATE_CAMERA_NAME = `${CONF_CAMERAS}.#.frigate.camera_name` as const;
|
export const CONF_CAMERAS_ARRAY_FRIGATE_CAMERA_NAME =
|
||||||
export const CONF_CAMERAS_ARRAY_FRIGATE_CLIENT_ID = `${CONF_CAMERAS}.#.frigate.client_id` as const;
|
`${CONF_CAMERAS}.#.frigate.camera_name` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_FRIGATE_LABEL = `${CONF_CAMERAS}.#.frigate.label` as const;
|
export const CONF_CAMERAS_ARRAY_FRIGATE_CLIENT_ID =
|
||||||
|
`${CONF_CAMERAS}.#.frigate.client_id` as const;
|
||||||
|
export const CONF_CAMERAS_ARRAY_FRIGATE_LABEL =
|
||||||
|
`${CONF_CAMERAS}.#.frigate.label` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_FRIGATE_URL = `${CONF_CAMERAS}.#.frigate.url` as const;
|
export const CONF_CAMERAS_ARRAY_FRIGATE_URL = `${CONF_CAMERAS}.#.frigate.url` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_FRIGATE_ZONE = `${CONF_CAMERAS}.#.frigate.zone` as const;
|
export const CONF_CAMERAS_ARRAY_FRIGATE_ZONE = `${CONF_CAMERAS}.#.frigate.zone` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_ID = `${CONF_CAMERAS}.#.id` as const;
|
export const CONF_CAMERAS_ARRAY_ID = `${CONF_CAMERAS}.#.id` as const;
|
||||||
@@ -23,7 +24,7 @@ export const CONF_CAMERAS_ARRAY_LIVE_PROVIDER =
|
|||||||
`${CONF_CAMERAS}.#.live_provider` as const;
|
`${CONF_CAMERAS}.#.live_provider` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_DEPENDENCIES_CAMERAS =
|
export const CONF_CAMERAS_ARRAY_DEPENDENCIES_CAMERAS =
|
||||||
`${CONF_CAMERAS}.#.dependencies.cameras` as const;
|
`${CONF_CAMERAS}.#.dependencies.cameras` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_DEPENDENCIES_ALL_CAMERAS =
|
export const CONF_CAMERAS_ARRAY_DEPENDENCIES_ALL_CAMERAS =
|
||||||
`${CONF_CAMERAS}.#.dependencies.all_cameras` as const;
|
`${CONF_CAMERAS}.#.dependencies.all_cameras` as const;
|
||||||
export const CONF_CAMERAS_ARRAY_TRIGGERS_MOTION =
|
export const CONF_CAMERAS_ARRAY_TRIGGERS_MOTION =
|
||||||
`${CONF_CAMERAS}.#.triggers.motion` as const;
|
`${CONF_CAMERAS}.#.triggers.motion` as const;
|
||||||
|
|||||||
@@ -2695,6 +2695,13 @@ rimraf@^3.0.2:
|
|||||||
dependencies:
|
dependencies:
|
||||||
glob "^7.1.3"
|
glob "^7.1.3"
|
||||||
|
|
||||||
|
rollup-plugin-git-info@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/rollup-plugin-git-info/-/rollup-plugin-git-info-1.0.0.tgz#f6d9f474718d9453eeb5049772a24ca4b9ac310e"
|
||||||
|
integrity sha512-AL2jzfDvOLze+Sakz3yuQjq9wY/wIj3j49yYnhuXtr6qP4qKzD039haPFa8uaLb0rzDBj2P5S8fWvJyYeIjOVw==
|
||||||
|
dependencies:
|
||||||
|
"@rollup/plugin-json" "^4.1.0"
|
||||||
|
|
||||||
rollup-plugin-serve@^1.1.0:
|
rollup-plugin-serve@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/rollup-plugin-serve/-/rollup-plugin-serve-1.1.0.tgz#0654a57021a21b903340c69940f7463706e8288d"
|
resolved "https://registry.yarnpkg.com/rollup-plugin-serve/-/rollup-plugin-serve-1.1.0.tgz#0654a57021a21b903340c69940f7463706e8288d"
|
||||||
|
|||||||
Reference in New Issue
Block a user