[fix] edit panel

This commit is contained in:
Andy Bunce 2020-11-13 11:35:47 +00:00
parent d28c1b94aa
commit 482834b75c
6 changed files with 45 additions and 15 deletions

View file

@ -177,7 +177,7 @@
methods:{ methods:{
file (val) { file (val) {
// with query, resulting in /register?plan=private // with query, resulting in /register?plan=private
router.push({ path: 'edit', query: { url: this.url+"/"+val,protocol:this.protocol }}) router.push({ path: 'edit', query: { url: this.fullurl(val) }})
}, },
folder (item) { folder (item) {
this.url=this.url+item.name+"/" this.url=this.url+item.name+"/"
@ -240,9 +240,13 @@
}, },
selectNone(){ selectNone(){
this.items.forEach(item=>{item.selected=false}) this.items.forEach(item=>{item.selected=false})
} },
fullurl(val){
return this.protocol + ":" +this.url+"/"+val
},
}, },
computed: { computed: {
icon(){ icon(){
return (this.protocol=="xmldb")?"developer_mode":"folder" return (this.protocol=="xmldb")?"developer_mode":"folder"
}, },

View file

@ -1,6 +1,6 @@
<!DOCTYPE html> <!DOCTYPE html>
<template id="edit"> <template id="edit">
<v-container > <v-container fluid >
<v-snackbar top color="error" v-model="snackbar"> <v-snackbar top color="error" v-model="snackbar">
{{ message }} {{ message }}
<v-btn text @click="snackbar = false"><v-icon>highlight_off</v-icon></v-btn> <v-btn text @click="snackbar = false"><v-icon>highlight_off</v-icon></v-btn>

View file

@ -23,12 +23,12 @@ declare
%output:method("json") %output:method("json")
function vue-api:edit-get($url as xs:string) function vue-api:edit-get($url as xs:string)
{ {
let $u:=resolve:uri($url) let $u:=resolve:uri($url)=>trace("RESOLVE: ")
return <json type="object">{ return <json type="object">{
element protocol{ $u?protocol}, element protocol{ $u?protocol},
element uri { $u?uri }, element uri { $u?uri },
element mimetype { fetch:content-type($u?uri) }, element mimetype { $u?fnMime() },
element data { $u?fnGet() } element data { $u?fnGet() =>serialize()}
}</json> }</json>
}; };

View file

@ -6,6 +6,14 @@
<template v-slot:item.name="{ item }"> <template v-slot:item.name="{ item }">
<span>{{ item.name }} </span> <span>{{ item.name }} </span>
</template> </template>
<template v-slot:item.icon="{ item }">
<v-chip label>
<v-icon left>
{{item.icon }}
</v-icon>
{{item.icon }}
</v-chip>
</template>
<template v-slot:actions> <template v-slot:actions>
<v-list-item @click="remove"> <v-list-item @click="remove">
<v-list-item-avatar><v-icon>delete</v-icon></v-list-item-avatar> <v-list-item-avatar><v-icon>delete</v-icon></v-list-item-avatar>

View file

@ -43,19 +43,25 @@ as map(*){
default default
return $protocol return $protocol
let $_:=trace($protocol,"protocol: ")
let $getfn:= switch ($protocol) let $getfn:= switch ($protocol)
case "xmldb" case "xmldb"
return function(){ doc($uri)} return function(){ doc($uri)}
default default
return function(){ fetch:text($uri)} return function(){ fetch:text($uri)}
let $getct:= switch ($protocol)
case "xmldb"
return function(){ "text/xml" }
default
return function(){ fetch:content-type($uri)}
return map{ return map{
"protocol": $protocol, "protocol": $protocol,
"uri": $uri, "uri": $uri,
"isDrive": $isDrive, "isDrive": $isDrive,
"fnGet": $getfn "fnGet": $getfn,
"fnMime": $getct
} }
}; };

View file

@ -1,4 +1,4 @@
// generated 2020-11-07T23:04:20.292Z // generated 2020-11-13T11:31:22.679Z
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue
Vue.component('qd-autoheight',{template:` Vue.component('qd-autoheight',{template:`
@ -2882,7 +2882,7 @@ const Files=Vue.extend({template:`
methods:{ methods:{
file (val) { file (val) {
// with query, resulting in /register?plan=private // with query, resulting in /register?plan=private
router.push({ path: 'edit', query: { url: this.url+"/"+val,protocol:this.protocol }}) router.push({ path: 'edit', query: { url: this.fullurl(val) }})
}, },
folder (item) { folder (item) {
this.url=this.url+item.name+"/" this.url=this.url+item.name+"/"
@ -2945,9 +2945,13 @@ const Files=Vue.extend({template:`
}, },
selectNone(){ selectNone(){
this.items.forEach(item=>{item.selected=false}) this.items.forEach(item=>{item.selected=false})
} },
fullurl(val){
return this.protocol + ":" +this.url+"/"+val
},
}, },
computed: { computed: {
icon(){ icon(){
return (this.protocol=="xmldb")?"developer_mode":"folder" return (this.protocol=="xmldb")?"developer_mode":"folder"
}, },
@ -3496,7 +3500,7 @@ created:function(){
// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/edit/edit.vue // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/edit/edit.vue
const Edit=Vue.extend({template:` const Edit=Vue.extend({template:`
<v-container> <v-container fluid>
<v-snackbar top color="error" v-model="snackbar"> <v-snackbar top color="error" v-model="snackbar">
{{ message }} {{ message }}
<v-btn text @click="snackbar = false"><v-icon>highlight_off</v-icon></v-btn> <v-btn text @click="snackbar = false"><v-icon>highlight_off</v-icon></v-btn>
@ -6227,6 +6231,14 @@ const Mimetype=Vue.extend({template:`
<template v-slot:item.name="{ item }"> <template v-slot:item.name="{ item }">
<span>{{ item.name }} </span> <span>{{ item.name }} </span>
</template> </template>
<template v-slot:item.icon="{ item }">
<v-chip label>
<v-icon left>
{{item.icon }}
</v-icon>
{{item.icon }}
</v-chip>
</template>
<template v-slot:actions> <template v-slot:actions>
<v-list-item @click="remove"> <v-list-item @click="remove">
<v-list-item-avatar><v-icon>delete</v-icon></v-list-item-avatar> <v-list-item-avatar><v-icon>delete</v-icon></v-list-item-avatar>