Skip to content

Commit d1ad17b

Browse files
authored
Merge pull request #157 from simonredfern/develop
Dragable panels so we can reszie the columns
2 parents 695da41 + e3505a3 commit d1ad17b

4 files changed

Lines changed: 64 additions & 33 deletions

File tree

package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"routing-controllers": "^0.10.4",
5555
"socket.io": "^4.7.5",
5656
"socket.io-client": "^4.7.5",
57+
"splitpanes": "^4.0.4",
5758
"typedi": "^0.10.0",
5859
"uuid": "^9.0.1",
5960
"vanilla-jsoneditor": "^2.3.3",

src/assets/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ main {
4646
line-height: 40px;
4747
display: table;
4848
border-bottom: solid 1px var(--el-menu-border-color);
49+
flex-shrink: 0;
4950
}
5051

5152
.menu-left {
@@ -65,7 +66,6 @@ main {
6566
.search-nav {
6667
background-color: #f8f9fb;
6768
padding: 8px 0 8px 8px;
68-
border-right: solid 1px var(--el-menu-border-color);
6969
}
7070

7171
.el-notification__content {

src/views/BodyView.vue

Lines changed: 50 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import SearchNav from '../components/SearchNav.vue'
3030
import Menu from '../components/Menu.vue'
3131
import AutoLogout from '../components/AutoLogout.vue'
3232
import ChatWidget from '../components/ChatWidget.vue'
33+
import { Splitpanes, Pane } from 'splitpanes'
34+
import 'splitpanes/dist/splitpanes.css'
3335
import { onMounted, ref, computed } from 'vue'
3436
import { getCurrentUser } from '../obp'
3537
import { useRoute } from 'vue-router'
@@ -53,49 +55,53 @@ const isChatbotEnabled = import.meta.env.VITE_CHATBOT_ENABLED === 'true'
5355
<template>
5456

5557
<AutoLogout v-if=isLoggedIn />
56-
<el-container class="root">
57-
<el-aside class="search-nav" width="20%">
58-
<!--Left-->
59-
<SearchNav />
60-
</el-aside>
61-
<el-main>
62-
<el-container class="main">
63-
<!--<el-header class="collections">
64-
<Collections />
65-
</el-header>-->
66-
<el-header class="menu">
58+
<Splitpanes class="root">
59+
<Pane :size="20" :min-size="10" :max-size="40">
60+
<div class="search-nav">
61+
<!--Left-->
62+
<SearchNav />
63+
</div>
64+
</Pane>
65+
<Pane :size="80">
66+
<div class="main">
67+
<div class="menu">
6768
<Menu />
68-
</el-header>
69-
<el-container class="middle">
70-
<el-aside class="summary" :width="hasOperationId ? '50%' : '100%'">
69+
</div>
70+
<Splitpanes v-if="hasOperationId" class="middle">
71+
<Pane :size="50">
72+
<div class="summary">
73+
<RouterView name="body" />
74+
</div>
75+
</Pane>
76+
<Pane :size="50">
77+
<div class="preview">
78+
<RouterView name="preview" />
79+
</div>
80+
</Pane>
81+
</Splitpanes>
82+
<div v-else class="middle">
83+
<div class="summary">
7184
<RouterView name="body" />
72-
</el-aside>
73-
<el-main v-if="hasOperationId" class="preview">
74-
<!--right -->
75-
<RouterView class="preview" name="preview" />
76-
</el-main>
77-
</el-container>
78-
79-
<!--<el-footer> -->
80-
<!--Bottom -->
81-
<!--Footer
82-
</el-footer>-->
83-
</el-container>
85+
</div>
86+
</div>
87+
</div>
8488
<ChatWidget v-if="isChatbotEnabled" />
85-
</el-main>
86-
</el-container>
89+
</Pane>
90+
</Splitpanes>
8791
</template>
8892

8993
<style>
9094
.root {
9195
height: 100%;
92-
/* min-height: 100vh; */
9396
}
9497
.summary {
95-
max-height: 100%;
98+
height: 100%;
99+
overflow: auto;
96100
}
97101
.main {
98102
height: 100%;
103+
display: flex;
104+
flex-direction: column;
99105
overflow: hidden;
100106
}
101107
.search-nav {
@@ -104,18 +110,30 @@ const isChatbotEnabled = import.meta.env.VITE_CHATBOT_ENABLED === 'true'
104110
overflow: hidden;
105111
}
106112
.middle {
107-
height: 100%;
113+
flex: 1;
108114
overflow: hidden;
109115
}
110116
.preview {
111117
color: white;
112118
background-color: #151d30;
113-
max-height: 100%;
119+
height: 100%;
120+
overflow: auto;
114121
}
115122
.collections {
116123
margin-left: -20px;
117124
margin-right: -20px;
118125
padding-left: 20px;
119126
padding-right: 20px;
120127
}
128+
129+
/* Splitpanes handle styling */
130+
.splitpanes--vertical > .splitpanes__splitter {
131+
width: 5px;
132+
background-color: #dcdfe6;
133+
border: none;
134+
cursor: col-resize;
135+
}
136+
.splitpanes--vertical > .splitpanes__splitter:hover {
137+
background-color: #409eff;
138+
}
121139
</style>

0 commit comments

Comments
 (0)