1
1
<template >
2
- <div class =" grid app-grid-template h-screen" >
3
- <div style =" grid-area : head; background-color : red " >
4
- <h1 >
5
- Gist User Script Manager
6
- </h1 >
7
- <AutoLogin />
2
+ <div class =" app-grid-template h-screen max-h-full overflow-y-hidden" >
3
+ <div style =" grid-area : head;" class =" header-grid-template" >
4
+ <div style =" grid-area : content ;" class =" flex flex-col" >
5
+ <h1 >
6
+ Gist User Script Manager
7
+ </h1 >
8
+ <div class =" self-end" >
9
+ <AutoLogin />
10
+ </div >
11
+ </div >
12
+ <div style =" grid-area : divider;" >
13
+ <div class =" w-full h-px border-gray-400 border-t border-solid" >  ; </div >
14
+ </div >
8
15
</div >
9
- <div style =" grid-area : nav;" class =" nav-grid-template" >
10
- <button @click =" listQuery" class =" w-full mt-2 flex mr-3" >
16
+ <div style =" grid-area : nav;" class =" nav-grid-template h-full " >
17
+ <button @click =" listQuery" class =" mt-2 flex mr-3" style = " width : calc ( 100 % - 8 px ) " >
11
18
<fa type =" fab" icon =" github" class =" h-4 mr-2" />
12
19
refresh
13
20
</button >
14
- <input type =" text" v-model =" filter" class =" form-input w-full mt-2 mr-3" />
21
+ <div class =" flex" style =" width : calc (100% - 8px )" >
22
+ <input type =" text" v-model =" filter" class =" form-input mt-2 mr-3 flex-grow w-full" />
23
+ <fa icon =" filter" class =" h-4 self-center" />
24
+ </div >
15
25
<div class =" overflow-y-auto w-full mt-2 h-full h-full" >
16
- <div v-for =" entry in gistEntries " :key =" entry.id" class =" flex flex-wrap w-full mt-2" >
26
+ <div v-for =" entry in filteredGistEntries " :key =" entry.id" class =" flex flex-wrap w-full mt-2" >
17
27
<a @click =" code = entry.code" class =" w-full cursor-pointer mr-2" >{{ entry.name }}</a >
18
28
<div class =" w-full h-px border-gray-400 border-t border-solid mt-1 mr-2" >  ; </div >
19
29
</div >
20
30
</div >
21
31
</div >
22
32
<div style =" grid-area : main; background-color : yellow " >
23
- <MonacoEditor :code =" code" style = " height : calc ( 100 % - 50 px ) " />
33
+ <MonacoEditor :code =" code" class = " h-full " />
24
34
</div >
25
35
</div >
26
36
</template >
29
39
import {List } from " @/__gen_gql/List" ;
30
40
import listGql from " @/List.gql" ;
31
41
import {useGraphQlClient } from " @/useGraphQlClient" ;
32
- import {onMounted , ref } from " vue" ;
42
+ import {onMounted , ref , computed } from " vue" ;
43
+
33
44
export {default as AutoLogin } from ' ./AutoLogin' ;
34
45
export {default as MonacoEditor } from ' ./MonacoEditor' ;
35
46
@@ -54,6 +65,8 @@ export const code = ref<string>("");
54
65
55
66
export const filter = ref <string >(" " );
56
67
68
+ export const filteredGistEntries = computed (() => gistEntries .value .filter (({name }) => filter .value === ' ' || name .toLowerCase ().includes (filter .value .toLowerCase ())));
69
+
57
70
onMounted (() => {
58
71
listQuery ();
59
72
});
@@ -62,23 +75,32 @@ onMounted(() => {
62
75
63
76
<style scoped>
64
77
.app-grid-template {
78
+ display : grid ;
65
79
grid-template-areas :
66
80
" head head head"
67
81
" . nav main" ;
68
82
grid-template-rows : 70px minmax (0 , 1fr );
69
83
grid-template-columns : 8px 160px 1fr ;
70
- height : 100vh ;
71
- max-height : 100% ;
72
- overflow-y : hidden ;
73
84
}
85
+
86
+ .header-grid-template {
87
+ display : grid ;
88
+ grid-template-areas :
89
+ " . . ."
90
+ " . content ."
91
+ " . . ."
92
+ " divider divider divider" ;
93
+ grid-template-columns : 8px 1fr 8px ;
94
+ grid-template-rows : 8px auto 1fr 1px ;
95
+ }
96
+
74
97
.nav-grid-template {
75
98
display : grid ;
76
99
grid-template-areas :
77
100
" button"
78
101
" filter"
79
102
" result" ;
80
103
grid-template-rows : auto auto 1fr ;
81
- height : 100% ;
82
104
}
83
105
</style >
84
106
0 commit comments