aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/editor/EditorSidebar.vue9
-rw-r--r--components/footer/SiteFooter.vue46
-rw-r--r--layouts/default.vue6
-rw-r--r--layouts/editor.vue5
-rw-r--r--nuxt.config.ts22
-rw-r--r--package-lock.json28
-rw-r--r--package.json1
-rw-r--r--pages/editor/category/[id].vue7
-rw-r--r--pages/editor/item/[id].vue7
-rw-r--r--pages/editor/quest/[id].vue7
10 files changed, 108 insertions, 30 deletions
diff --git a/components/editor/EditorSidebar.vue b/components/editor/EditorSidebar.vue
index 48e187f..7ac4996 100644
--- a/components/editor/EditorSidebar.vue
+++ b/components/editor/EditorSidebar.vue
@@ -52,8 +52,8 @@ const setSelectedType = (type: 'quests' | 'items') => {
#sidebar-container {
width: 20rem;
border-right: 1px solid var(--color-border);
- height: calc(100vh - 73px);
- max-height: calc(100vh - 73px);
+ height: 100%;
+ max-height: 100%;
background-color: var(--color-background);
user-select: none;
position: relative;
@@ -94,8 +94,9 @@ const setSelectedType = (type: 'quests' | 'items') => {
}
}
- #quests {
- max-height: calc(100vh - 73px - 46px - 30px);
+ #quests,
+ #items {
+ max-height: calc(100% - 46px - 30px);
overflow-y: auto;
}
diff --git a/components/footer/SiteFooter.vue b/components/footer/SiteFooter.vue
new file mode 100644
index 0000000..4204fab
--- /dev/null
+++ b/components/footer/SiteFooter.vue
@@ -0,0 +1,46 @@
+<script setup land="ts">
+const config = useAppConfig();
+const runtimeConfig = useRuntimeConfig();
+</script>
+
+<template>
+ <footer id="footer">
+ <p id="copyright-license">
+
+ </p>
+ <p id="git-commit-hash">
+ <font-awesome-icon :icon="['fas', 'code-branch']" />
+ <NuxtLink to="https://github.com/LMBishop/quests-web-editor/">quests-web-editor</NuxtLink>
+ <span>@</span>
+ <NuxtLink :to="`https://github.com/LMBishop/quests-web-editor/commit/${runtimeConfig.public.gitCommitHash}`">
+ {{ runtimeConfig.public.gitCommitHashShort }}
+ </NuxtLink>
+ <span>
+ ({{ runtimeConfig.public.gitBranch }})
+ </span>
+ </p>
+ </footer>
+</template>
+
+<style lang="scss" scoped>
+#footer {
+ max-height: 40px;
+ padding: 0.5rem;
+ border-top: 1px solid var(--color-border-soft);
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+}
+
+#git-commit-hash {
+ display: flex;
+ color: var(--color-text-mute);
+ align-items: center;
+ gap: 0.3rem;
+ align-self: flex-end;
+
+ a {
+ text-decoration: none;
+ }
+}
+</style> \ No newline at end of file
diff --git a/layouts/default.vue b/layouts/default.vue
index 087f064..b01df84 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -7,12 +7,16 @@
<div id="content">
<slot />
</div>
+
+ <SiteFooter />
</template>
<style scoped>
#content {
display: flex;
- height: calc(100vh - 73px);
+ height: calc(100vh - 114px);
+ max-height: calc(100vh - 114px);
+ overflow-y: auto;
flex-direction: row;
}
diff --git a/layouts/editor.vue b/layouts/editor.vue
index d37a285..f1cccb2 100644
--- a/layouts/editor.vue
+++ b/layouts/editor.vue
@@ -19,13 +19,16 @@ sessionStore.setTaskTypeAliases(taskDefinitions.aliases);
<slot />
</div>
</div>
+
+ <SiteFooter />
</template>
<style lang="scss" scoped>
#editor-container {
display: flex;
background-color: var(--color-background-soft);
- max-height: calc(100vh - 73px);
+ height: calc(100vh - 114px);
+ max-height: calc(100vh - 114px);
flex-direction: row;
}
diff --git a/nuxt.config.ts b/nuxt.config.ts
index 819b910..db228a9 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -1,9 +1,11 @@
-// https://nuxt.com/docs/api/configuration/nuxt-config
+import { execSync } from "child_process";
+
export default defineNuxtConfig({
components: [
{ path: '~/components', pathPrefix: true },
{ path: '~/components/base', pathPrefix: false },
{ path: '~/components/header', pathPrefix: false },
+ { path: '~/components/footer', pathPrefix: false },
],
devtools: { enabled: true },
modules: [
@@ -21,4 +23,22 @@ export default defineNuxtConfig({
"@fortawesome/free-regular-svg-icons",
],
},
+ hooks: {
+ "build:before": () => {
+ const gitCommitHash = execSync('git rev-parse HEAD').toString().trim();
+ const gitCommitHashShort = gitCommitHash.slice(0, 8);
+ const gitBranch = execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
+
+ process.env.GIT_COMMIT_HASH = gitCommitHash;
+ process.env.GIT_COMMIT_HASH_SHORT = gitCommitHashShort;
+ process.env.GIT_BRANCH = gitBranch;
+ }
+ },
+ runtimeConfig: {
+ public: {
+ gitCommitHash: process.env.GIT_COMMIT_HASH,
+ gitCommitHashShort: process.env.GIT_COMMIT_HASH_SHORT,
+ gitBranch: process.env.GIT_BRANCH
+ }
+ }
})
diff --git a/package-lock.json b/package-lock.json
index 9d2ce49..278db43 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -16,6 +16,7 @@
"@fortawesome/vue-fontawesome": "^3.0.6",
"@pinia/nuxt": "^0.5.1",
"file-saver": "^2.0.5",
+ "git-describe": "^4.1.1",
"jszip": "^3.10.1",
"nuxt": "^3.10.3",
"pinia": "^2.1.7",
@@ -3297,8 +3298,7 @@
"node_modules/@types/semver": {
"version": "7.5.7",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.7.tgz",
- "integrity": "sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg==",
- "dev": true
+ "integrity": "sha512-/wdoPq1QqkSj9/QOeKkFquEuPzQbHTWAMPH/PaUMB+JuR31lXhlWXRZ52IpfDYVlDOUBvX09uBrPwxGT1hjNBg=="
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "6.21.0",
@@ -6083,6 +6083,30 @@
"node": ">=4"
}
},
+ "node_modules/git-describe": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/git-describe/-/git-describe-4.1.1.tgz",
+ "integrity": "sha512-JC8ganO5kO80G8+XE98TDDjnMXQN3Estk3qdJuG2EGRF/l6zuMTMcN+8OSfQZ5FWpqIRLB015anWX4aSRgnxAQ==",
+ "dependencies": {
+ "@types/semver": "^7.3.8",
+ "lodash": "^4.17.21"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ },
+ "optionalDependencies": {
+ "semver": "^5.6.0"
+ }
+ },
+ "node_modules/git-describe/node_modules/semver": {
+ "version": "5.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "optional": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
"node_modules/git-up": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/git-up/-/git-up-7.0.0.tgz",
diff --git a/package.json b/package.json
index ef5b178..3c5fa4f 100644
--- a/package.json
+++ b/package.json
@@ -18,6 +18,7 @@
"@fortawesome/vue-fontawesome": "^3.0.6",
"@pinia/nuxt": "^0.5.1",
"file-saver": "^2.0.5",
+ "git-describe": "^4.1.1",
"jszip": "^3.10.1",
"nuxt": "^3.10.3",
"pinia": "^2.1.7",
diff --git a/pages/editor/category/[id].vue b/pages/editor/category/[id].vue
index 3189d2a..cf79f61 100644
--- a/pages/editor/category/[id].vue
+++ b/pages/editor/category/[id].vue
@@ -32,13 +32,6 @@ const categoryName = sessionStore.getCategoryById(categoryId)?.display.name;
</template>
<style scoped>
-#pane-container {
- width: 100%;
- flex-grow: 1;
- height: calc(100vh - 73px);
- max-height: calc(100vh - 73px);
-}
-
#options-container {
width: 100%;
display: flex;
diff --git a/pages/editor/item/[id].vue b/pages/editor/item/[id].vue
index c2456be..451a76d 100644
--- a/pages/editor/item/[id].vue
+++ b/pages/editor/item/[id].vue
@@ -29,13 +29,6 @@ const item = sessionStore.getItemById(itemId);
</template>
<style scoped>
-#pane-container {
- width: 100%;
- flex-grow: 1;
- height: calc(100vh - 73px);
- max-height: calc(100vh - 73px);
-}
-
#options-container {
width: 100%;
display: flex;
diff --git a/pages/editor/quest/[id].vue b/pages/editor/quest/[id].vue
index bc480d9..34dafa8 100644
--- a/pages/editor/quest/[id].vue
+++ b/pages/editor/quest/[id].vue
@@ -87,13 +87,6 @@ const showYaml = () => {
</template>
<style scoped>
-#pane-container {
- width: 100%;
- flex-grow: 1;
- height: calc(100vh - 73px);
- max-height: calc(100vh - 73px);
-}
-
#options-container {
width: 100%;
display: flex;