1
1
<template >
2
2
<div class =" grid app-grid-template h-screen" >
3
3
<div style =" grid-area : head; background-color : red " >
4
+ <h1 >
5
+ Gist User Script Manager
6
+ </h1 >
4
7
<AutoLogin />
5
8
</div >
6
- <div style =" grid-area : nav; background-color : green " >
7
- <button @click =" listQuery" >refresh</button >
8
- <a v-for =" entry in gistEntries" :key =" entry.id" href =" javascript:void(0)" @click =" code = entry.code" >
9
- {{ entry.name }}
10
- </a >
9
+ <div style =" grid-area : nav;" class =" nav-grid-template" >
10
+ <button @click =" listQuery" class =" w-full mt-2 flex mr-3" >
11
+ <fa type =" fab" icon =" github" class =" h-4 mr-2" />
12
+ refresh
13
+ </button >
14
+ <input type =" text" v-model =" filter" class =" form-input w-full mt-2 mr-3" />
15
+ <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" >
17
+ <a @click =" code = entry.code" class =" w-full cursor-pointer mr-2" >{{ entry.name }}</a >
18
+ <div class =" w-full h-px border-gray-400 border-t border-solid mt-1 mr-2" >  ; </div >
19
+ </div >
20
+ </div >
11
21
</div >
12
22
<div style =" grid-area : main; background-color : yellow " >
13
23
<MonacoEditor :code =" code" style =" height : calc (100% - 50px )" />
@@ -33,7 +43,7 @@ interface GistEntries {
33
43
34
44
export const gistEntries = ref <GistEntries []>([]);
35
45
export const listQuery = async () => {
36
- gistEntries .value = (await graphQlClient .value <List >(listGql )).viewer .gists .edges .map (({node }) => ({
46
+ gistEntries .value = (await graphQlClient .value <List >(listGql ))? .viewer .gists .edges .map (({node }) => ({
37
47
id: node .name ,
38
48
name: node .files [0 ].name ,
39
49
code: node .files [0 ].text
@@ -42,6 +52,8 @@ export const listQuery = async () => {
42
52
43
53
export const code = ref <string >(" " );
44
54
55
+ export const filter = ref <string >(" " );
56
+
45
57
onMounted (() => {
46
58
listQuery ();
47
59
});
@@ -51,10 +63,22 @@ onMounted(() => {
51
63
<style scoped>
52
64
.app-grid-template {
53
65
grid-template-areas :
54
- " head head"
55
- " nav main" ;
56
- grid-template-rows : 70px 1fr ;
57
- grid-template-columns : 150px 1fr ;
66
+ " head head head"
67
+ " . nav main" ;
68
+ grid-template-rows : 70px minmax (0 , 1fr );
69
+ grid-template-columns : 8px 160px 1fr ;
70
+ height : 100vh ;
71
+ max-height : 100% ;
72
+ overflow-y : hidden ;
73
+ }
74
+ .nav-grid-template {
75
+ display : grid ;
76
+ grid-template-areas :
77
+ " button"
78
+ " filter"
79
+ " result" ;
80
+ grid-template-rows : auto auto 1fr ;
81
+ height : 100% ;
58
82
}
59
83
</style >
60
84
0 commit comments