Skip to content

Commit 87aa539

Browse files
committed
Add dev header
1 parent ce1384b commit 87aa539

File tree

6 files changed

+32
-4
lines changed

6 files changed

+32
-4
lines changed
File renamed without changes.

src/App.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<template>
2+
<div v-if="dev" class="dev-header">
3+
<p>This is the OpenShock <b>DEVELOPMENT</b> environment. <u>No data is saved</u>, and regularly overwritten by production data</p>
4+
</div>
25
<div id="app">
36
<router-view/>
47
</div>
@@ -13,6 +16,27 @@ export default {
1316
'$store.state.settings.dark'(val, old) {
1417
$('body').attr('data-color-scheme', val ? 'dark' : 'white');
1518
}
19+
},
20+
computed: {
21+
dev() {
22+
return config.dev === true || config.dev === 'true';
23+
}
1624
}
1725
}
18-
</script>
26+
</script>
27+
28+
<style lang="scss">
29+
30+
.dev-header {
31+
top: 0;
32+
left: 0;
33+
right: 0;
34+
height: 25px;
35+
background-color: orangered;
36+
color: #fff;
37+
text-align: center;
38+
z-index: 999;
39+
line-height: 25px;
40+
}
41+
42+
</style>

src/globals/config/config.container.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ const config = {
22
name: "OPENSHOCK_NAME",
33
webUiUrl: "OPENSHOCK_URL/#/", // WebUI URL is formatted like "OPENSHOCK_URL/#/"
44
apiUrl: "OPENSHOCK_API_URL/",
5-
shortUrl: "OPENSHOCK_SHARE_URL/" // No trailing slash since this can be _anything_.
5+
shortUrl: "OPENSHOCK_SHARE_URL/", // No trailing slash since this can be _anything_.
6+
dev: "OPENSHOCK_DEV"
67
}
78

89
global.config = config;

src/globals/config/config.local.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ const config = {
22
name: "OpenShock",
33
webUiUrl: "https://localhost:8080/#/",
44
apiUrl: "https://localhost/",
5-
shortUrl: "https://shockl.ink/"
5+
shortUrl: "https://shockl.ink/",
6+
dev: false
67
}
78

89
global.config = config;

src/globals/config/config.production.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ const config = {
22
name: "OpenShock",
33
webUiUrl: "https://openshock.app/#/",
44
apiUrl: "https://api.openshock.app/",
5-
shortUrl: "https://shockl.ink/"
5+
shortUrl: "https://shockl.ink/",
6+
dev: false
67
}
78

89
global.config = config;

startup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ inject OPENSHOCK_NAME $OPENSHOCK_NAME
3131
inject OPENSHOCK_URL $OPENSHOCK_URL
3232
inject OPENSHOCK_API_URL $OPENSHOCK_API_URL
3333
inject OPENSHOCK_SHARE_URL $OPENSHOCK_SHARE_URL
34+
inject OPENSHOCK_DEV $OPENSHOCK_DEV
3435

3536
# Start nginx as normal.
3637
# If something breaks, see: https://github.com/nginxinc/docker-nginx/blob/master/mainline/debian/Dockerfile

0 commit comments

Comments
 (0)