Skip to content

Commit b31a53e

Browse files
authored
add version info to gui (#636)
1 parent 05bb0b9 commit b31a53e

18 files changed

Lines changed: 515 additions & 31 deletions

File tree

AGENTS.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# AGENTS Instructions
22
- Do not ever use non-ascii characters for source code or comments (permissible inside of strings if absolutely necessary but avoid if possible)
3-
- Do not attempt a build unless explicitly instructed.
4-
- Do not run tests unless explicitly instructed.
53
- Do not ever modify files in .git subfolders.
6-
- After finishing all changes, run a conversion pass over every changed/created text file to enforce CRLF and eliminate any stray LF.
7-
- Do not run CRLF normalization on any non-text or binary files (for example: .png, .jpg, .gif, .mp3, .wav, .fbx, .unity). Limit normalization to plain text source/config files only.
8-
- Use this PowerShell script directly in the current shell to normalize line endings (preserves file encoding). Do not wrap it in a nested powershell -Command invocation, because nested PowerShell quoting can corrupt variable and string parsing:
9-
- $paths = git status --porcelain | ForEach-Object { $_.Substring(3) }; foreach ($p in $paths) { if (Test-Path $p) { $bytes = [System.IO.File]::ReadAllBytes($p); $hadBom = $bytes.Length -ge 3 -and $bytes[0] -eq 0xEF -and $bytes[1] -eq 0xBB -and $bytes[2] -eq 0xBF; $sr = New-Object System.IO.StreamReader($p, $true); $text = $sr.ReadToEnd(); $enc = $sr.CurrentEncoding; $sr.Close(); if ($enc.WebName -eq "utf-8") { $enc = New-Object System.Text.UTF8Encoding($hadBom) }; $text = $text -replace "`r?`n", "`r`n"; $sw = New-Object System.IO.StreamWriter($p, $false, $enc); $sw.NewLine = "`r`n"; $sw.Write($text); $sw.Close(); } }
4+
- After finishing all changes, use `$normalize-crlf` to normalize changed/created text files; do not run ad hoc line-ending scripts directly.
105
- If unexpected new files appear, ignore them and continue without asking for instruction.
116
- For value conversion casts (numeric or enum conversions), use C-style casts `(T)value` instead of `static_cast<T>(value)`.
127
- For const, pointer, reference, up/down, or reinterpret casts, use C++ cast syntax (`const_cast`, `dynamic_cast`, `reinterpret_cast`, etc.).
138
- Do not bind unused names in structured bindings. Prefer binding only needed values (for example use `.first` from `emplace()` or iterate entries without destructuring unused keys).
14-
- Do not fully qualify namespaces when not needed by local scope (for example prefer `MetricUse` or `svc::MetricUse` over `pmon::svc::MetricUse` when already inside `pmon::svc::acts` or with suitable using scope).
9+
- Do not fully qualify namespaces when not needed by local scope (for example prefer `MetricUse` or `svc::MetricUse` over `pmon::svc::MetricUse` when already inside `pmon::svc::acts` or with suitable using scope).

IntelPresentMon/AppCef/CefNano.vcxproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
<ClInclude Include="source\util\AsyncEndpointCollection.h" />
5757
<ClInclude Include="source\util\AsyncEndpointManager.h" />
5858
<ClInclude Include="source\util\async\CheckPathExistence.h" />
59+
<ClInclude Include="source\util\async\GetAppInfo.h" />
5960
<ClInclude Include="source\util\async\GetTopGpuProcess.h" />
6061
<ClInclude Include="source\util\async\LoadEnvVars.h" />
6162
<ClInclude Include="source\util\async\LoadFile.h" />
@@ -160,7 +161,7 @@
160161
<ClCompile>
161162
<WarningLevel>Level3</WarningLevel>
162163
<SDLCheck>true</SDLCheck>
163-
<PreprocessorDefinitions>_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
164+
<PreprocessorDefinitions>PM_VER_FILE_STR=&quot;$(PresentMonFileVersion)&quot;;PM_VER_PRODUCT_STR=&quot;$(PresentMonProductVersion)&quot;;PM_BUILD_WINSDK_VERSION_STR=&quot;$(WindowsTargetPlatformVersion)&quot;;PM_BUILD_CRT_RUNTIME_STR=&quot;MultiThreadedDebug&quot;;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
164165
<ConformanceMode>true</ConformanceMode>
165166
<FloatingPointModel>Fast</FloatingPointModel>
166167
<LanguageStandard>stdcpplatest</LanguageStandard>
@@ -188,7 +189,7 @@
188189
<FunctionLevelLinking>true</FunctionLevelLinking>
189190
<IntrinsicFunctions>true</IntrinsicFunctions>
190191
<SDLCheck>true</SDLCheck>
191-
<PreprocessorDefinitions>NDEBUG;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
192+
<PreprocessorDefinitions>PM_VER_FILE_STR=&quot;$(PresentMonFileVersion)&quot;;PM_VER_PRODUCT_STR=&quot;$(PresentMonProductVersion)&quot;;PM_BUILD_WINSDK_VERSION_STR=&quot;$(WindowsTargetPlatformVersion)&quot;;PM_BUILD_CRT_RUNTIME_STR=&quot;MultiThreaded&quot;;NDEBUG;_SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
192193
<ConformanceMode>true</ConformanceMode>
193194
<FloatingPointModel>Fast</FloatingPointModel>
194195
<LanguageStandard>stdcpplatest</LanguageStandard>

IntelPresentMon/AppCef/ipm-ui-vue/src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function cyclePreset() {
4141
// === Computed ===
4242
const inSettings = computed(() => {
4343
const routeName = typeof route.name === 'symbol' ? route.name.toString() : route.name;
44-
return ['capture-config', 'overlay-config', 'data-config', 'other-config', 'flash-config', 'logging-config']
44+
return ['capture-config', 'overlay-config', 'data-config', 'other-config', 'flash-config', 'logging-config', 'about-config']
4545
.includes(routeName ?? '')
4646
});
4747
const targetName = computed(() => {
@@ -182,6 +182,9 @@ watch(() => loadout.widgets, async () => {
182182
<v-list-item color="primary" :to="{ name: 'other-config' }">
183183
<v-list-item-title class="nav-item">Other</v-list-item-title>
184184
</v-list-item>
185+
<v-list-item color="primary" :to="{ name: 'about-config' }">
186+
<v-list-item-title class="nav-item">About</v-list-item-title>
187+
</v-list-item>
185188
</v-list>
186189
</v-navigation-drawer>
187190

IntelPresentMon/AppCef/ipm-ui-vue/src/core/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { type Adapter } from './adapter'
88
import { type Spec } from '@/core/spec'
99
import { type Binding, type KeyOption, type ModifierOption, Action } from '@/core/hotkey'
1010
import { type EnvVars } from './env-vars'
11+
import { type AppInfo } from './app-info'
1112
import { delayFor } from './timing'
1213

1314
export enum FileLocation {
@@ -54,6 +55,9 @@ export class Api {
5455
static async loadEnvVars(): Promise<EnvVars> {
5556
return await this.invokeEndpointFuture('loadEnvVars', {});
5657
}
58+
static async getAppInfo(): Promise<AppInfo> {
59+
return await this.invokeEndpointFuture('getAppInfo', {});
60+
}
5761
static async introspect(): Promise<{metrics: Metric[], stats: Stat[], units: Unit[], adapters: Adapter[], systemDeviceId: number, defaultAdapterId: number}> {
5862
const introData = await this.invokeEndpointFuture('Introspect', {});
5963
if (!Array.isArray(introData.metrics) || !Array.isArray(introData.stats) ||
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright (C) 2022 Intel Corporation
2+
// SPDX-License-Identifier: MIT
3+
4+
export interface AppInfo {
5+
productName: string;
6+
productVersion: string;
7+
fileVersion: string;
8+
apiVersion: string;
9+
middlewareApiVersion: string;
10+
buildId: string;
11+
buildHash: string;
12+
buildHashShort: string;
13+
buildDateTime: string;
14+
buildConfig: string;
15+
buildDirty: boolean;
16+
isDebugBuild: boolean;
17+
compileDate: string;
18+
compileTime: string;
19+
serviceBuildId: string;
20+
serviceBuildTime: string;
21+
serviceVersion: string;
22+
cefVersion: string;
23+
cefVersionMajor: number;
24+
cefVersionMinor: number;
25+
cefVersionPatch: number;
26+
chromeVersion: string;
27+
chromeVersionMajor: number;
28+
chromeVersionMinor: number;
29+
chromeVersionBuild: number;
30+
chromeVersionPatch: number;
31+
cefProcessType: string;
32+
msvcVersion: string;
33+
winSdkVersion: string;
34+
crtVersion: string;
35+
crtRuntime: string;
36+
logLevel: string;
37+
verboseModules: string;
38+
devModeEnabled: boolean;
39+
debugBlocklistEnabled: boolean;
40+
chromiumDebugEnabled: boolean;
41+
}

IntelPresentMon/AppCef/ipm-ui-vue/src/router/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import CaptureConfigView from '@/views/CaptureConfigView.vue'
99
import FlashConfigView from '@/views/FlashConfigView.vue'
1010
import OtherConfigView from '@/views/OtherConfigView.vue'
1111
import LoggingConfigView from '@/views/LoggingConfigView.vue'
12+
import AboutConfigView from '@/views/AboutConfigView.vue'
1213

1314
const router = createRouter({
1415
history: createMemoryHistory(),
@@ -64,6 +65,11 @@ const router = createRouter({
6465
name: 'other-config',
6566
component: OtherConfigView,
6667
},
68+
{
69+
path: '/about',
70+
name: 'about-config',
71+
component: AboutConfigView,
72+
},
6773
{
6874
path: '/flash',
6975
name: 'flash-config',
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
<!-- Copyright (C) 2022 Intel Corporation -->
2+
<!-- SPDX-License-Identifier: MIT -->
3+
4+
<script setup lang="ts">
5+
import { computed, onMounted, ref } from 'vue';
6+
import { Api } from '@/core/api';
7+
import { signature as preferencesSignature } from '@/core/preferences';
8+
import { signature as loadoutSignature } from '@/core/loadout';
9+
import { type AppInfo } from '@/core/app-info';
10+
11+
interface InfoRow {
12+
label: string;
13+
value: string;
14+
}
15+
16+
defineOptions({ name: 'AboutConfigView' });
17+
18+
const appInfo = ref<AppInfo|null>(null);
19+
const errorMessage = ref('');
20+
21+
function boolText(value: boolean): string {
22+
return value ? 'Yes' : 'No';
23+
}
24+
25+
const applicationRows = computed<InfoRow[]>(() => {
26+
if (appInfo.value === null) {
27+
return [];
28+
}
29+
return [
30+
{ label: 'Product', value: appInfo.value.productName },
31+
{ label: 'Product Version', value: appInfo.value.productVersion },
32+
{ label: 'API Version', value: appInfo.value.apiVersion },
33+
{ label: 'Middleware API Version', value: appInfo.value.middlewareApiVersion },
34+
{ label: 'Preferences Format', value: preferencesSignature.version },
35+
{ label: 'Loadout Format', value: loadoutSignature.version },
36+
{ label: 'UI Dev Mode', value: boolText(appInfo.value.devModeEnabled) },
37+
{ label: 'Chromium Debugging', value: boolText(appInfo.value.chromiumDebugEnabled) },
38+
{ label: 'Debug Blocklist', value: boolText(appInfo.value.debugBlocklistEnabled) },
39+
{ label: 'Log Level', value: appInfo.value.logLevel },
40+
{ label: 'Verbose Modules', value: appInfo.value.verboseModules },
41+
];
42+
});
43+
44+
const buildRows = computed<InfoRow[]>(() => {
45+
if (appInfo.value === null) {
46+
return [];
47+
}
48+
return [
49+
{ label: 'Git Hash', value: appInfo.value.buildHash },
50+
{ label: 'Short Hash', value: appInfo.value.buildHashShort },
51+
{ label: 'Build Date/Time', value: appInfo.value.buildDateTime },
52+
{ label: 'Build Config', value: appInfo.value.buildConfig },
53+
{ label: 'Dirty Build', value: boolText(appInfo.value.buildDirty) },
54+
];
55+
});
56+
57+
const serviceRows = computed<InfoRow[]>(() => {
58+
if (appInfo.value === null) {
59+
return [];
60+
}
61+
return [
62+
{ label: 'Service Build ID', value: appInfo.value.serviceBuildId },
63+
{ label: 'Service Build Time', value: appInfo.value.serviceBuildTime },
64+
{ label: 'Service Version', value: appInfo.value.serviceVersion },
65+
];
66+
});
67+
68+
const runtimeRows = computed<InfoRow[]>(() => {
69+
if (appInfo.value === null) {
70+
return [];
71+
}
72+
return [
73+
{ label: 'CEF Version', value: appInfo.value.cefVersion },
74+
{ label: 'MSVC Version', value: appInfo.value.msvcVersion },
75+
{ label: 'Windows SDK', value: appInfo.value.winSdkVersion },
76+
{ label: 'CRT Version', value: appInfo.value.crtVersion },
77+
{ label: 'CRT Runtime', value: appInfo.value.crtRuntime },
78+
];
79+
});
80+
81+
onMounted(async () => {
82+
try {
83+
appInfo.value = await Api.getAppInfo();
84+
}
85+
catch (e) {
86+
errorMessage.value = e instanceof Error ? e.message : String(e);
87+
}
88+
});
89+
</script>
90+
91+
<template>
92+
<div class="page-wrap">
93+
<h2 class="mt-5 ml-5 header-top">
94+
About
95+
</h2>
96+
97+
<v-card class="page-card">
98+
<v-progress-linear v-if="appInfo === null && errorMessage === ''" indeterminate color="primary" class="mt-4"></v-progress-linear>
99+
100+
<v-alert v-if="errorMessage !== ''" type="error" variant="tonal" class="mt-5">
101+
{{ errorMessage }}
102+
</v-alert>
103+
104+
<template v-if="appInfo !== null">
105+
<v-card-title class="section-title">Application</v-card-title>
106+
<v-table density="compact" class="info-table">
107+
<tbody>
108+
<tr v-for="row in applicationRows" :key="row.label">
109+
<td class="info-label">{{ row.label }}</td>
110+
<td class="info-value">{{ row.value }}</td>
111+
</tr>
112+
</tbody>
113+
</v-table>
114+
115+
<v-card-title class="section-title">Build</v-card-title>
116+
<v-table density="compact" class="info-table">
117+
<tbody>
118+
<tr v-for="row in buildRows" :key="row.label">
119+
<td class="info-label">{{ row.label }}</td>
120+
<td class="info-value">{{ row.value }}</td>
121+
</tr>
122+
</tbody>
123+
</v-table>
124+
125+
<v-card-title class="section-title">Service</v-card-title>
126+
<v-table density="compact" class="info-table">
127+
<tbody>
128+
<tr v-for="row in serviceRows" :key="row.label">
129+
<td class="info-label">{{ row.label }}</td>
130+
<td class="info-value">{{ row.value }}</td>
131+
</tr>
132+
</tbody>
133+
</v-table>
134+
135+
<v-card-title class="section-title">Runtime</v-card-title>
136+
<v-table density="compact" class="info-table">
137+
<tbody>
138+
<tr v-for="row in runtimeRows" :key="row.label">
139+
<td class="info-label">{{ row.label }}</td>
140+
<td class="info-value">{{ row.value }}</td>
141+
</tr>
142+
</tbody>
143+
</v-table>
144+
</template>
145+
</v-card>
146+
</div>
147+
</template>
148+
149+
<style scoped>
150+
.header-top {
151+
color: white;
152+
user-select: none;
153+
}
154+
.page-card {
155+
margin: 15px 0;
156+
padding: 0 15px 15px;
157+
}
158+
.page-wrap {
159+
max-width: 750px;
160+
flex-grow: 1;
161+
}
162+
.section-title {
163+
color: rgba(255, 255, 255, 0.7);
164+
font-size: 16px;
165+
padding: 18px 0 6px;
166+
}
167+
.info-table {
168+
background: transparent;
169+
}
170+
.info-label {
171+
width: 210px;
172+
color: rgba(255, 255, 255, 0.7);
173+
white-space: nowrap;
174+
}
175+
.info-value {
176+
overflow-wrap: anywhere;
177+
user-select: text;
178+
}
179+
</style>

IntelPresentMon/AppCef/source/DataBindAccessor.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,14 @@ namespace p2c::client::cef
8181
}
8282
}
8383

84+
const util::KernelWrapper* DataBindAccessor::GetKernelWrapper() const
85+
{
86+
return pKernelWrapper;
87+
}
88+
8489
void DataBindAccessor::ClearKernelWrapper()
8590
{
8691
std::lock_guard lk{ kernelMtx };
8792
pKernelWrapper = nullptr;
8893
}
89-
}
94+
}

IntelPresentMon/AppCef/source/DataBindAccessor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace p2c::client::cef
1919
CefRefPtr<CefV8Value>& retval,
2020
CefString& exception) override;
2121
void ResolveAsyncEndpoint(uint64_t uid, bool success, CefRefPtr<CefValue> pArgs);
22+
const util::KernelWrapper* GetKernelWrapper() const;
2223
void ClearKernelWrapper();
2324
private:
2425
// data
@@ -29,4 +30,4 @@ namespace p2c::client::cef
2930
IMPLEMENT_REFCOUNTING(DataBindAccessor);
3031
friend class DBAKernelHandler;
3132
};
32-
}
33+
}

IntelPresentMon/AppCef/source/util/ActionClientServer.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@ namespace p2c::client::util
88
SymmetricActionClient{ std::move(pipeName), std::move(context) }
99
{
1010
auto res = DispatchSync(kproc::kact::OpenSession::Params{ GetCurrentProcessId() });
11+
serviceBuildId_ = std::move(res.serviceBuildId);
12+
serviceBuildTime_ = std::move(res.serviceBuildTime);
13+
serviceVersion_ = std::move(res.serviceVersion);
14+
middlewareApiVersion_ = std::move(res.middlewareApiVersion);
1115
EstablishSession_(res.kernelPid);
1216
}
13-
}
17+
18+
const std::string& CefClient::GetServiceBuildId() const
19+
{
20+
return serviceBuildId_;
21+
}
22+
23+
const std::string& CefClient::GetServiceBuildTime() const
24+
{
25+
return serviceBuildTime_;
26+
}
27+
28+
const std::string& CefClient::GetServiceVersion() const
29+
{
30+
return serviceVersion_;
31+
}
32+
33+
const std::string& CefClient::GetMiddlewareApiVersion() const
34+
{
35+
return middlewareApiVersion_;
36+
}
37+
}

0 commit comments

Comments
 (0)