mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 09:27:07 +00:00
Compare commits
5 Commits
12a762f44f
...
285-refact
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f2e25278b | ||
|
|
d2f8444042 | ||
|
|
28beef81de | ||
|
|
9a2fdeab0e | ||
|
|
9a3cf7997e |
@@ -35,7 +35,7 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions } from 'vuex';
|
import { mapActions, mapGetters } from 'vuex';
|
||||||
import DougalNavigation from './components/navigation';
|
import DougalNavigation from './components/navigation';
|
||||||
import DougalFooter from './components/footer';
|
import DougalFooter from './components/footer';
|
||||||
|
|
||||||
@@ -53,7 +53,8 @@ export default {
|
|||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
snackText () { return this.$store.state.snack.snackText },
|
snackText () { return this.$store.state.snack.snackText },
|
||||||
snackColour () { return this.$store.state.snack.snackColour }
|
snackColour () { return this.$store.state.snack.snackColour },
|
||||||
|
...mapGetters(["serverEvent"])
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@@ -75,17 +76,25 @@ export default {
|
|||||||
if (!newVal) {
|
if (!newVal) {
|
||||||
this.$store.commit('setSnackText', "");
|
this.$store.commit('setSnackText', "");
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async serverEvent (event) {
|
||||||
|
if (event.channel == "project" && event.payload?.schema == "public") {
|
||||||
|
// Projects changed in some way or another
|
||||||
|
await this.refreshProjects();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(["setCredentials"])
|
...mapActions(["setCredentials", "refreshProjects"])
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted () {
|
async mounted () {
|
||||||
// Local Storage values are always strings
|
// Local Storage values are always strings
|
||||||
this.$vuetify.theme.dark = localStorage.getItem("darkTheme") == "true";
|
this.$vuetify.theme.dark = localStorage.getItem("darkTheme") == "true";
|
||||||
this.setCredentials()
|
await this.setCredentials();
|
||||||
|
this.refreshProjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<template>
|
||||||
|
<v-tabs :value="tab" show-arrows>
|
||||||
|
<v-tab v-for="tab, index in tabs" :key="index" link :to="tabLink(tab.href)" v-text="tab.text"></v-tab>
|
||||||
|
</v-tabs>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapActions, mapGetters } from 'vuex';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DougalAppBarExtensionProject',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
tabs: [
|
||||||
|
{ href: "summary", text: "Summary" },
|
||||||
|
{ href: "lines", text: "Lines" },
|
||||||
|
{ href: "plan", text: "Plan" },
|
||||||
|
{ href: "sequences", text: "Sequences" },
|
||||||
|
{ href: "calendar", text: "Calendar" },
|
||||||
|
{ href: "log", text: "Log" },
|
||||||
|
{ href: "qc", text: "QC" },
|
||||||
|
{ href: "graphs", text: "Graphs" },
|
||||||
|
{ href: "map", text: "Map" }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
page () {
|
||||||
|
return this.$route.path.split(/\/+/)[3];
|
||||||
|
},
|
||||||
|
|
||||||
|
tab () {
|
||||||
|
return this.tabs.findIndex(t => t.href == this.page);
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
tabLink (href) {
|
||||||
|
return `/projects/${this.$route.params.project}/${href}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -71,17 +71,10 @@
|
|||||||
|
|
||||||
</v-menu>
|
</v-menu>
|
||||||
|
|
||||||
<!--
|
|
||||||
<v-btn small text class="ml-2" title="Log out" link to="/?logout=1">
|
|
||||||
<v-icon small>mdi-logout</v-icon>
|
|
||||||
</v-btn>
|
|
||||||
-->
|
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:extension v-if="$route.matched.find(i => i.name == 'Project')">
|
<template v-slot:extension v-if="appBarExtension">
|
||||||
<v-tabs :value="tab" show-arrows align-with-title>
|
<div :is="appBarExtension"></div>
|
||||||
<v-tab v-for="tab, index in tabs" :key="index" link :to="tabLink(tab.href)" v-text="tab.text"></v-tab>
|
|
||||||
</v-tabs>
|
|
||||||
</template>
|
</template>
|
||||||
</v-app-bar>
|
</v-app-bar>
|
||||||
|
|
||||||
@@ -95,24 +88,17 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
drawer: false,
|
drawer: false,
|
||||||
tabs: [
|
|
||||||
{ href: "summary", text: "Summary" },
|
|
||||||
{ href: "lines", text: "Lines" },
|
|
||||||
{ href: "plan", text: "Plan" },
|
|
||||||
{ href: "sequences", text: "Sequences" },
|
|
||||||
{ href: "calendar", text: "Calendar" },
|
|
||||||
{ href: "log", text: "Log" },
|
|
||||||
{ href: "qc", text: "QC" },
|
|
||||||
{ href: "graphs", text: "Graphs" },
|
|
||||||
{ href: "map", text: "Map" }
|
|
||||||
],
|
|
||||||
path: []
|
path: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
tab () {
|
|
||||||
return this.tabs.findIndex(t => t.href == this.$route.path.split(/\/+/)[3]);
|
appBarExtension () {
|
||||||
|
return this.$route.matched
|
||||||
|
.filter(i => i.meta?.appBarExtension)
|
||||||
|
.map(i => i.meta.appBarExtension)
|
||||||
|
.pop()?.component;
|
||||||
},
|
},
|
||||||
|
|
||||||
...mapGetters(['user', 'loading'])
|
...mapGetters(['user', 'loading'])
|
||||||
@@ -131,9 +117,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
tabLink (href) {
|
|
||||||
return `/projects/${this.$route.params.project}/${href}`;
|
|
||||||
},
|
|
||||||
|
|
||||||
breadcrumbs () {
|
breadcrumbs () {
|
||||||
this.path = this.$route.matched
|
this.path = this.$route.matched
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import Log from '../views/Log.vue'
|
|||||||
import QC from '../views/QC.vue'
|
import QC from '../views/QC.vue'
|
||||||
import Graphs from '../views/Graphs.vue'
|
import Graphs from '../views/Graphs.vue'
|
||||||
import Map from '../views/Map.vue'
|
import Map from '../views/Map.vue'
|
||||||
|
import DougalAppBarExtensionProject from '../components/app-bar-extension-project'
|
||||||
|
|
||||||
Vue.use(VueRouter)
|
Vue.use(VueRouter)
|
||||||
|
|
||||||
@@ -100,7 +100,10 @@ Vue.use(VueRouter)
|
|||||||
text: (ctx) => ctx.$store.state.project.projectName || "…",
|
text: (ctx) => ctx.$store.state.project.projectName || "…",
|
||||||
href: (ctx) => `/projects/${ctx.$store.state.project.projectId || ctx.$route.params.project || ""}/`
|
href: (ctx) => `/projects/${ctx.$store.state.project.projectId || ctx.$route.params.project || ""}/`
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
appBarExtension: {
|
||||||
|
component: DougalAppBarExtensionProject
|
||||||
|
}
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ async function list (projectId, opts = {}) {
|
|||||||
WHERE
|
WHERE
|
||||||
($1::numeric IS NULL OR sequence = $1) AND
|
($1::numeric IS NULL OR sequence = $1) AND
|
||||||
($2::numeric[] IS NULL OR sequence = ANY( $2 )) AND
|
($2::numeric[] IS NULL OR sequence = ANY( $2 )) AND
|
||||||
($3::timestamptz IS NULL OR date(tstamp) = $3) AND
|
|
||||||
($3::timestamptz IS NULL OR
|
($3::timestamptz IS NULL OR
|
||||||
(($4::timestamptz IS NULL AND date(tstamp) = $3) OR
|
(($4::timestamptz IS NULL AND date(tstamp) = $3) OR
|
||||||
date(tstamp) BETWEEN SYMMETRIC $3 AND $4)) AND
|
date(tstamp) BETWEEN SYMMETRIC $3 AND $4)) AND
|
||||||
|
|||||||
Reference in New Issue
Block a user