Skip to content

Commit b7dae3e

Browse files
Merge pull request #29 from intel-innersource/p2c/graphs-style
October release frontend changes
2 parents 68bd82d + 7899a5b commit b7dae3e

File tree

20 files changed

+399
-66
lines changed

20 files changed

+399
-66
lines changed

IntelPresentMon/AppCef/Web/presets/preset-0.json

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"signature": {
33
"code": "p2c-cap-load",
4-
"version": "0.9.0"
4+
"version": "0.11.0"
55
},
66
"widgets": [
77
{
@@ -33,6 +33,12 @@
3333
"g": 211,
3434
"b": 233,
3535
"a": 1
36+
},
37+
"backgroundColor": {
38+
"r": 45,
39+
"g": 50,
40+
"b": 96,
41+
"a": 0.4
3642
}
3743
},
3844
{
@@ -64,10 +70,16 @@
6470
"g": 255,
6571
"b": 255,
6672
"a": 0.86
73+
},
74+
"backgroundColor": {
75+
"r": 45,
76+
"g": 50,
77+
"b": 96,
78+
"a": 0.4
6779
}
6880
},
6981
{
70-
"key": 3,
82+
"key": 2,
7183
"metrics": [
7284
{
7385
"key": 10,
@@ -95,10 +107,16 @@
95107
"g": 211,
96108
"b": 233,
97109
"a": 1
110+
},
111+
"backgroundColor": {
112+
"r": 45,
113+
"g": 50,
114+
"b": 96,
115+
"a": 0.4
98116
}
99117
},
100118
{
101-
"key": 4,
119+
"key": 3,
102120
"metrics": [
103121
{
104122
"key": 6,
@@ -165,7 +183,14 @@
165183
"g": 0,
166184
"b": 0,
167185
"a": 0
168-
}
186+
},
187+
"textColor": {
188+
"r": 242,
189+
"g": 242,
190+
"b": 242,
191+
"a": 1
192+
},
193+
"textSize": 11
169194
}
170195
]
171196
}

IntelPresentMon/AppCef/Web/presets/preset-1.json

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"signature": {
33
"code": "p2c-cap-load",
4-
"version": "0.9.0"
4+
"version": "0.11.0"
55
},
66
"widgets": [
77
{
@@ -33,6 +33,12 @@
3333
"g": 211,
3434
"b": 233,
3535
"a": 1
36+
},
37+
"backgroundColor": {
38+
"r": 45,
39+
"g": 50,
40+
"b": 96,
41+
"a": 0.4
3642
}
3743
},
3844
{
@@ -64,6 +70,12 @@
6470
"g": 255,
6571
"b": 255,
6672
"a": 0.86
73+
},
74+
"backgroundColor": {
75+
"r": 45,
76+
"g": 50,
77+
"b": 96,
78+
"a": 0.4
6779
}
6880
},
6981
{
@@ -157,7 +169,14 @@
157169
"g": 0,
158170
"b": 0,
159171
"a": 0
160-
}
172+
},
173+
"textColor": {
174+
"r": 242,
175+
"g": 242,
176+
"b": 242,
177+
"a": 1
178+
},
179+
"textSize": 11
161180
},
162181
{
163182
"key": 3,
@@ -244,7 +263,14 @@
244263
"g": 0,
245264
"b": 0,
246265
"a": 0
247-
}
266+
},
267+
"textColor": {
268+
"r": 242,
269+
"g": 242,
270+
"b": 242,
271+
"a": 1
272+
},
273+
"textSize": 11
248274
},
249275
{
250276
"key": 4,
@@ -331,7 +357,14 @@
331357
"g": 0,
332358
"b": 0,
333359
"a": 0
334-
}
360+
},
361+
"textColor": {
362+
"r": 242,
363+
"g": 242,
364+
"b": 242,
365+
"a": 1
366+
},
367+
"textSize": 11
335368
},
336369
{
337370
"key": 5,
@@ -418,7 +451,14 @@
418451
"g": 0,
419452
"b": 0,
420453
"a": 0
421-
}
454+
},
455+
"textColor": {
456+
"r": 242,
457+
"g": 242,
458+
"b": 242,
459+
"a": 1
460+
},
461+
"textSize": 11
422462
},
423463
{
424464
"key": 6,
@@ -505,7 +545,14 @@
505545
"g": 0,
506546
"b": 0,
507547
"a": 0
508-
}
548+
},
549+
"textColor": {
550+
"r": 242,
551+
"g": 242,
552+
"b": 242,
553+
"a": 1
554+
},
555+
"textSize": 11
509556
},
510557
{
511558
"key": 7,
@@ -592,7 +639,14 @@
592639
"g": 0,
593640
"b": 0,
594641
"a": 0
595-
}
642+
},
643+
"textColor": {
644+
"r": 242,
645+
"g": 242,
646+
"b": 242,
647+
"a": 1
648+
},
649+
"textSize": 11
596650
}
597651
]
598652
}

IntelPresentMon/AppCef/Web/presets/preset-2.json

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"signature": {
33
"code": "p2c-cap-load",
4-
"version": "0.9.0"
4+
"version": "0.11.0"
55
},
66
"widgets": [
77
{
@@ -33,6 +33,12 @@
3333
"g": 211,
3434
"b": 233,
3535
"a": 1
36+
},
37+
"backgroundColor": {
38+
"r": 45,
39+
"g": 50,
40+
"b": 96,
41+
"a": 0.4
3642
}
3743
},
3844
{
@@ -64,6 +70,12 @@
6470
"g": 255,
6571
"b": 255,
6672
"a": 0.86
73+
},
74+
"backgroundColor": {
75+
"r": 45,
76+
"g": 50,
77+
"b": 96,
78+
"a": 0.4
6779
}
6880
},
6981
{
@@ -157,7 +169,14 @@
157169
"g": 0,
158170
"b": 0,
159171
"a": 0
160-
}
172+
},
173+
"textColor": {
174+
"r": 242,
175+
"g": 242,
176+
"b": 242,
177+
"a": 1
178+
},
179+
"textSize": 11
161180
},
162181
{
163182
"key": 3,
@@ -250,7 +269,14 @@
250269
"g": 0,
251270
"b": 0,
252271
"a": 0
253-
}
272+
},
273+
"textColor": {
274+
"r": 242,
275+
"g": 242,
276+
"b": 242,
277+
"a": 1
278+
},
279+
"textSize": 11
254280
},
255281
{
256282
"key": 4,
@@ -320,7 +346,14 @@
320346
"g": 0,
321347
"b": 0,
322348
"a": 0
323-
}
349+
},
350+
"textColor": {
351+
"r": 242,
352+
"g": 242,
353+
"b": 242,
354+
"a": 1
355+
},
356+
"textSize": 11
324357
}
325358
]
326359
}

IntelPresentMon/AppCef/Web/src/App.vue

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@
5454
</v-list-item-content>
5555
</v-list-item>
5656

57+
<v-list-item v-if="isDevelopment" color="primary">
58+
<v-list-item-content>
59+
<v-btn @click="doPresetUpdate">Update Presets</v-btn>
60+
</v-list-item-content>
61+
</v-list-item>
62+
5763
</v-list>
5864
</v-navigation-drawer>
5965

@@ -105,7 +111,7 @@ import { Metrics } from '@/store/metrics'
105111
import { Preferences as PrefStore } from '@/store/preferences'
106112
import { Preferences } from '@/core/preferences'
107113
import { Hotkey } from '@/store/hotkey'
108-
import { Api } from '@/core/api'
114+
import { Api, FileLocation } from '@/core/api'
109115
import { Notifications } from '@/store/notifications'
110116
import { Action } from '@/core/hotkey'
111117
import { Processes } from '@/store/processes'
@@ -158,6 +164,13 @@ export default Vue.extend({
158164
PrefStore.setAttribute({attr:'selectedPreset', val:Preset.Slot1});
159165
}
160166
},
167+
async doPresetUpdate() {
168+
for (let i = 0; i < 3; i++) {
169+
const presetFileName = `preset-${i}.json`;
170+
await Loadout.parseAndReplace(await Api.loadPreset(presetFileName));
171+
await Api.storeFile(Loadout.fileContents, FileLocation.Documents, `loadouts\\${presetFileName}`);
172+
}
173+
},
161174
async dismissNotification() {
162175
await Notifications.dismiss();
163176
},
@@ -210,6 +223,9 @@ export default Vue.extend({
210223
},
211224
212225
computed: {
226+
isDevelopment(): boolean {
227+
return process?.env?.NODE_ENV === 'development';
228+
},
213229
widgets(): Widget[] {
214230
return Loadout.widgets;
215231
},
@@ -319,16 +335,22 @@ export default Vue.extend({
319335
if (presetNew === Preset.Custom) {
320336
try {
321337
await Loadout.parseAndReplace(await Api.loadConfig('custom-auto.json'));
322-
} catch (e) {}
323-
return;
324-
}
325-
try {
326-
await Loadout.parseAndReplace(await Api.loadPreset(`preset-${presetNew}.json`));
327-
}
328-
catch (e) {
329-
await Notifications.notify({text:`Failed to load preset file #${presetNew}.`});
330-
console.error([`Failed to load preset file #${presetNew}.`, e]);
338+
}
339+
catch (e) {
340+
await Notifications.notify({text:`Failed to load autosave loadout file.`});
341+
console.error([`Failed to load autosave loadout file.`, e]);
342+
}
331343
}
344+
else {
345+
const presetFileName = `preset-${presetNew}.json`;
346+
try {
347+
await Loadout.parseAndReplace(await Api.loadPreset(presetFileName));
348+
}
349+
catch (e) {
350+
await Notifications.notify({text:`Failed to load preset file [${presetFileName}].`});
351+
console.error([`Failed to load preset file [${presetFileName}].`, e]);
352+
}
353+
}
332354
},
333355
}
334356
});

0 commit comments

Comments
 (0)