mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-15 18:08:17 -07:00
Merge pull request #5531 from thornbill/add-commit-sha
This commit is contained in:
commit
3002a135ad
@ -263,6 +263,7 @@ module.exports = {
|
|||||||
'UserParentalControlPage': 'writable',
|
'UserParentalControlPage': 'writable',
|
||||||
'Windows': 'readonly',
|
'Windows': 'readonly',
|
||||||
// Build time definitions
|
// Build time definitions
|
||||||
|
__COMMIT_SHA__: 'readonly',
|
||||||
__JF_BUILD_VERSION__: 'readonly',
|
__JF_BUILD_VERSION__: 'readonly',
|
||||||
__PACKAGE_JSON_NAME__: 'readonly',
|
__PACKAGE_JSON_NAME__: 'readonly',
|
||||||
__PACKAGE_JSON_VERSION__: 'readonly',
|
__PACKAGE_JSON_VERSION__: 'readonly',
|
||||||
|
@ -208,7 +208,12 @@ function refreshActiveRecordings(view, apiClient) {
|
|||||||
|
|
||||||
function reloadSystemInfo(view, apiClient) {
|
function reloadSystemInfo(view, apiClient) {
|
||||||
view.querySelector('#buildVersion').innerText = __JF_BUILD_VERSION__;
|
view.querySelector('#buildVersion').innerText = __JF_BUILD_VERSION__;
|
||||||
view.querySelector('#webVersion').innerText = __PACKAGE_JSON_VERSION__;
|
|
||||||
|
let webVersion = __PACKAGE_JSON_VERSION__;
|
||||||
|
if (__COMMIT_SHA__) {
|
||||||
|
webVersion += ` (${__COMMIT_SHA__})`;
|
||||||
|
}
|
||||||
|
view.querySelector('#webVersion').innerText = webVersion;
|
||||||
|
|
||||||
queryClient
|
queryClient
|
||||||
.fetchQuery(getSystemInfoQuery(toApi(apiClient)))
|
.fetchQuery(getSystemInfoQuery(toApi(apiClient)))
|
||||||
|
1
src/global.d.ts
vendored
1
src/global.d.ts
vendored
@ -15,6 +15,7 @@ export declare global {
|
|||||||
'viewshow': CustomEvent;
|
'viewshow': CustomEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const __COMMIT_SHA__: string;
|
||||||
const __JF_BUILD_VERSION__: string;
|
const __JF_BUILD_VERSION__: string;
|
||||||
const __PACKAGE_JSON_NAME__: string;
|
const __PACKAGE_JSON_NAME__: string;
|
||||||
const __PACKAGE_JSON_VERSION__: string;
|
const __PACKAGE_JSON_VERSION__: string;
|
||||||
|
@ -61,7 +61,11 @@ function loadCoreDictionary() {
|
|||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
// Log current version to console to help out with issue triage and debugging
|
// Log current version to console to help out with issue triage and debugging
|
||||||
console.log(`${__PACKAGE_JSON_NAME__} version ${__PACKAGE_JSON_VERSION__} build ${__JF_BUILD_VERSION__}`);
|
console.info(
|
||||||
|
`[${__PACKAGE_JSON_NAME__}]
|
||||||
|
version: ${__PACKAGE_JSON_VERSION__}
|
||||||
|
commit: ${__COMMIT_SHA__}
|
||||||
|
build: ${__JF_BUILD_VERSION__}`);
|
||||||
|
|
||||||
// This is used in plugins
|
// This is used in plugins
|
||||||
window.Events = Events;
|
window.Events = Events;
|
||||||
|
@ -23,6 +23,15 @@ const LibarchiveWasm = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const DEV_MODE = process.env.NODE_ENV !== 'production';
|
const DEV_MODE = process.env.NODE_ENV !== 'production';
|
||||||
|
let COMMIT_SHA = '';
|
||||||
|
try {
|
||||||
|
COMMIT_SHA = require('child_process')
|
||||||
|
.execSync('git describe --always --dirty')
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
} catch (err) {
|
||||||
|
console.warn('Failed to get commit sha. Is git installed?', err);
|
||||||
|
}
|
||||||
|
|
||||||
const NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/;
|
const NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/;
|
||||||
|
|
||||||
@ -47,6 +56,7 @@ const config = {
|
|||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new DefinePlugin({
|
new DefinePlugin({
|
||||||
|
__COMMIT_SHA__: JSON.stringify(COMMIT_SHA),
|
||||||
__JF_BUILD_VERSION__: JSON.stringify(
|
__JF_BUILD_VERSION__: JSON.stringify(
|
||||||
process.env.WEBPACK_SERVE ?
|
process.env.WEBPACK_SERVE ?
|
||||||
'Dev Server' :
|
'Dev Server' :
|
||||||
|
Loading…
Reference in New Issue
Block a user