diff --git a/src/vue-poc/api.xqm b/src/vue-poc/api.xqm index 4ba58fd..d48c547 100644 --- a/src/vue-poc/api.xqm +++ b/src/vue-poc/api.xqm @@ -50,6 +50,26 @@ function vue-api:test-select($q ) }; +(:~ + : generate html report for test + :) +declare +%rest:GET %rest:path("/vue-poc/api/test/html") +%output:method("html") %output:version("5.0") +function vue-api:test-html() +{ +
+something +
    +
  1. A30
  2. +
  3. A50
  4. +
+{for $i in 1 to 50 return

{$i}: +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi aliquam sodales justo, aliquet eleifend ex bibendum eget. Nullam vitae maximus ipsum. Sed maximus felis in interdum maximus. Vestibulum quis urna vel dolor placerat iaculis non at metus. Curabitur nec dictum mauris. Duis placerat magna non pellentesque pulvinar. Nam a eleifend sapien. Suspendisse potenti. Vestibulum nunc massa, eleifend a dolor quis, feugiat condimentum est. Integer diam eros, blandit in purus in, euismod ultrices felis. Donec ipsum magna, elementum non lacus vel, rutrum ornare ante. Integer egestas sapien quam, ut posuere nisi rhoncus nec. Etiam ornare enim eu tellus laoreet, in laoreet urna sodales. Donec interdum, augue non lobortis sodales, leo elit tincidunt mi, vitae varius augue libero vel lectus. Cras imperdiet quis dolor nec gravida. +top

+} +
+}; (:~ : Returns wadl. :) diff --git a/src/vue-poc/app.vue b/src/vue-poc/app.vue index aec6152..ea2f4d3 100644 --- a/src/vue-poc/app.vue +++ b/src/vue-poc/app.vue @@ -40,7 +40,7 @@ - + {{$route.meta.title}} @@ -110,6 +110,7 @@ diff --git a/src/vue-poc/features/form/form-json-schema.vue b/src/vue-poc/features/form/form-json-schema.vue deleted file mode 100644 index cde913b..0000000 --- a/src/vue-poc/features/form/form-json-schema.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/src/vue-poc/features/form/forms.xqm b/src/vue-poc/features/form/forms.xqm index 14d5f4d..4595bb0 100644 --- a/src/vue-poc/features/form/forms.xqm +++ b/src/vue-poc/features/form/forms.xqm @@ -6,14 +6,15 @@ module namespace page = 'quodatum.test.schema'; :) declare %rest:GET %rest:path("/vue-poc/api/form/schema") +%rest:query-param("uri", "{$uri}") %output:method("json") -function page:schema() +function page:schema($uri as xs:string?) as element(json) { - let $s:="schema.json" - =>resolve-uri(static-base-uri()) - =>fetch:text() - =>json:parse() - return $s/* + let $file:=if(empty($uri)) then"person.json" else $uri + let $path:=resolve-uri("schema.json/" || $file ,static-base-uri())=>trace("full") + let $s:=$path=>fetch:text() + =>json:parse() + return trace($s,"JSON")/* }; diff --git a/src/vue-poc/features/form/formschema.vue b/src/vue-poc/features/form/formschema.vue deleted file mode 100644 index 67544f8..0000000 --- a/src/vue-poc/features/form/formschema.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - diff --git a/src/vue-poc/features/form/schema.json b/src/vue-poc/features/form/schema.json deleted file mode 100644 index 510ac6d..0000000 --- a/src/vue-poc/features/form/schema.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "title": "server sourced schema", - "properties": { - "name": { - "type": "string", - "title": "Name ", - "minLength": 8, - "maxLength": 80, - "attrs": { - "placeholder": "Full Name", - "title": "Please enter your full name" - } - }, - "email": { - "type": "string", - "title": "Email label ", - "maxLength": 120, - "attrs": { - "type": "email", - "placeholder": "Email" - } - }, - "lists": { - "type": "string", - "title": "List label ", - "enum": ["Daily New", "Promotion", "Another"] - }, - "arrayInput": { - "type": "array", - "title": "Array label ", - "items": { - "type": "string" - } - } - } - } \ No newline at end of file diff --git a/src/vue-poc/features/form/schema.json/arrays.json b/src/vue-poc/features/form/schema.json/arrays.json new file mode 100644 index 0000000..eb70a85 --- /dev/null +++ b/src/vue-poc/features/form/schema.json/arrays.json @@ -0,0 +1,49 @@ + { + "id": "https://example.com/arrays.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "description": "A representation of a person, company, organization, or place", + "type": "object", + "properties": { + "fruits": { + "type": "array", + "description": "This is a simple array of strings", + "items": { + "type": "string" + } + }, + "sizes": { + "type": "array", + "items": { + "type": "string", + "enum": ["small", "medium", "large"] + }, + "minItems": 1 + }, + "vegetables": { + "type": "array", + "description": "A list of vegetables as editable objects.", + "items": { "$ref": "#/definitions/veggie" } + }, + "coordinate": { + "type": "array", + "title": "Lat/lon coordinates as a tuple", + "items": [{"type": "number", "title": "Latitude"}, {"type": "number", "title": "Longitude"}] + } + }, + "definitions": { + "veggie": { + "type": "object", + "required": [ "veggieName", "veggieLike" ], + "properties": { + "veggieName": { + "type": "string", + "description": "The name of the vegetable." + }, + "veggieLike": { + "type": "boolean", + "description": "Do I like this vegetable?" + } + } + } + } +} \ No newline at end of file diff --git a/src/vue-poc/features/form/schema.json/person.json b/src/vue-poc/features/form/schema.json/person.json new file mode 100644 index 0000000..30699bf --- /dev/null +++ b/src/vue-poc/features/form/schema.json/person.json @@ -0,0 +1,45 @@ +{ + "$id": "https://example.com/person.schema.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Person", + "description": "A few metadata about some person.", + "type": "object", + "required": [ + "firstName", + "lastName" + ], + "properties": { + "type": { + "type": "string", + "const": "person" + }, + "firstName": { + "type": "string", + "description": "\nThe person's first name.\n\nThis description can be a long text with markdown content.\n\n - a list item\n - another one\n " + }, + "lastName": { + "type": "string", + "description": "The person's last name." + }, + "age": { + "description": "Age in years which must be equal to or greater than zero.", + "type": "integer", + "minimum": 0 + }, + "citizen": { + "description": "Is this person a citizen of this country.", + "type": "boolean" + }, + "description": { + "description": "A longer text for the description.", + "type": "string", + "maxLength": 2000 + }, + "homepage": { + "description": "A long string also, but display is forced on single line", + "type": "string", + "maxLength": 2000, + "x-display": "single-line" + } + } + } \ No newline at end of file diff --git a/src/vue-poc/features/form/schema.json/select.json b/src/vue-poc/features/form/schema.json/select.json new file mode 100644 index 0000000..0bb1c67 --- /dev/null +++ b/src/vue-poc/features/form/schema.json/select.json @@ -0,0 +1,133 @@ +{ + "title": "Person", + "type": "object", + "required": ["gender", "fromAjaxObject", "fromAjaxString"], + "properties": { + "gender": { + "type": "string", + "description": "The person's gender.", + "enum": ["male", "female"] + }, + "genderWithTitles": { + "type": "string", + "description": "The person's gender with separate value and title. Also clearable, because not required.", + "oneOf": [{"const": "m", "title": "male"}, {"const": "f", "title": "female"}] + }, + "fromAjaxString": { + "type": "string", + "description": "The values come from an HTTP request.", + "x-fromUrl": "https://koumoul.com/s/data-fair/api/v1/datasets?status=finalized&select=title&owner={context.owner.type}:{context.owner.id}", + "x-itemsProp": "results", + "x-itemTitle": "title", + "x-itemKey": "href" + }, + "fromAjaxStringArray": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The values come from an HTTP request.", + "x-fromUrl": "https://koumoul.com/s/data-fair/api/v1/datasets?status=finalized&select=title&owner={context.owner.type}:{context.owner.id}", + "x-itemsProp": "results", + "x-itemTitle": "title", + "x-itemKey": "href" + }, + "fromAjaxObject": { + "type": "object", + "description": "The values come from an HTTP request and are stored as object.", + "x-fromUrl": "https://koumoul.com/s/data-fair/api/v1/datasets?status=finalized&select=title,schema&owner={context.owner.type}:{context.owner.id}", + "x-itemsProp": "results", + "x-itemTitle": "title", + "x-itemKey": "href", + "properties": { + "href": {"type": "string"}, + "title": {"type": "string"}, + "page": {"type": "string"}, + "schema": {"type": "array"} + } + }, + "fromData": { + "type": "object", + "description": "The values come from another part of the data.", + "x-fromData": "fromAjaxObject.schema", + "x-itemTitle": "x-originalName", + "x-itemKey": "key" + }, + "fromAjaxWithQuery": { + "type": "object", + "description": "The values come from an HTTP request with textual filter.", + "x-fromUrl": "https://koumoul.com/s/data-fair/api/v1/datasets?status=finalized&select=title&q={q}&owner={context.owner.type}:{context.owner.id}", + "x-itemsProp": "results", + "x-itemTitle": "title", + "x-itemKey": "href" + }, + "chartDef": { + "description": "Simple oneOf on object, the title of const property is used as title of the select", + "type": "object", + "x-itemKey": "type", + "oneOf": [{ + "title": "Bar chart", + "properties": { + "type": { + "const": "bar", + "title": "Chose from a type" + }, + "xLabel": { + "type": "string" + }, + "yLabel": { + "type": "string" + }, + "fromAjaxWithDep": { + "type": "object", + "title": "choisir un colonne", + "description": "The values come from an HTTP request with a part of the url that depends on another part of the model.", + "x-fromUrl": "{fromAjaxWithQuery.href}/schema", + "x-itemTitle": "label", + "x-itemKey": "key" + } + } + }, { + "title": "Pie chart", + "properties": { + "type": { + "const": "pie" + }, + "diameter": { + "type": "integer" + } + } + }] + }, + "chartDef2": { + "title": "Chose from a type", + "description": "A conditional form will be rendered below", + "type": "object", + "x-itemKey": "type", + "oneOf": [{ + "title": "Bar chart", + "properties": { + "type": { + "const": "bar" + }, + "xLabel": { + "type": "string" + }, + "yLabel": { + "type": "string" + } + } + }, { + "title": "Pie chart", + "properties": { + "type": { + "const": "pie" + }, + "diameter": { + "type": "integer" + } + } + }] + } + } + } \ No newline at end of file diff --git a/src/vue-poc/features/home.vue b/src/vue-poc/features/home.vue index 77a2320..f02c808 100644 --- a/src/vue-poc/features/home.vue +++ b/src/vue-poc/features/home.vue @@ -2,25 +2,6 @@ @@ -38,19 +47,6 @@ var t1 = performance.now(); this.elapsed= 0.001 *(t1 - t0) }) - }, - onClick(event){ - console.log("event",event); - var isA= "a"== event.originalTarget.localName - - if(isA) { - // alert("stop this"+ event.originalTarget.hash); - console.log("tar",event.originalTarget.hash,document.querySelector(event.originalTarget.hash)); - event.preventDefault(); - this.$router.push({"hash":event.originalTarget.hash}); - // this.$vuetify.goTo(event.originalTarget.hash, { duration: 600, offset: -200, easing: 'easeInOutCubic'}); - - } } }, created:function(){ diff --git a/src/vue-poc/features/images/tasks/pics-01-store-directory.xq b/src/vue-poc/features/images/tasks/pics-01-store-directory.xq index 53d11fc..ae4e7d1 100644 --- a/src/vue-poc/features/images/tasks/pics-01-store-directory.xq +++ b/src/vue-poc/features/images/tasks/pics-01-store-directory.xq @@ -1,7 +1,7 @@ (:~ : create xml file list by scanning $cfg:IMAGEDIR and write to db $cfg:DB-IMAGE :) -import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; +import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; import module namespace fw="quodatum:file.walker"; declare namespace c="http://www.w3.org/ns/xproc-step"; diff --git a/src/vue-poc/features/images/tasks/pics-02-store-meta.xq b/src/vue-poc/features/images/tasks/pics-02-store-meta.xq index 1c0d3d2..84a37ba 100644 --- a/src/vue-poc/features/images/tasks/pics-02-store-meta.xq +++ b/src/vue-poc/features/images/tasks/pics-02-store-meta.xq @@ -3,7 +3,7 @@ : done in batches of 1000 : @return initial number of missing docs :) -import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; +import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; import module namespace imgmeta = "expkg-zone58:image.metadata" ; declare namespace c="http://www.w3.org/ns/xproc-step"; diff --git a/src/vue-poc/features/images/tasks/pics-03-store-image.xq b/src/vue-poc/features/images/tasks/pics-03-store-image.xq index fdd890e..010e243 100644 --- a/src/vue-poc/features/images/tasks/pics-03-store-image.xq +++ b/src/vue-poc/features/images/tasks/pics-03-store-image.xq @@ -3,7 +3,7 @@ : -> :) import module namespace metadata = 'expkg-zone58:image.metadata'; -import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; +import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; for $meta in collection($cfg:DB-IMAGE || "/meta")/metadata let $loc:=db:path($meta)=>tokenize("/") let $name:=$loc[count($loc)-1] diff --git a/src/vue-poc/features/images/tasks/pics-04-store-thumbs.xq b/src/vue-poc/features/images/tasks/pics-04-store-thumbs.xq index f7e6d7f..32ae1f0 100644 --- a/src/vue-poc/features/images/tasks/pics-04-store-thumbs.xq +++ b/src/vue-poc/features/images/tasks/pics-04-store-thumbs.xq @@ -3,7 +3,7 @@ : @return initial number of missing docs :) import module namespace t="expkg-zone58:image.thumbnailator"; -import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; +import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; declare namespace c="http://www.w3.org/ns/xproc-step"; declare variable $CHUNK:=1000; diff --git a/src/vue-poc/features/images/tasks/pics-05-set-original.xq b/src/vue-poc/features/images/tasks/pics-05-set-original.xq index cf343a0..0e1455f 100644 --- a/src/vue-poc/features/images/tasks/pics-05-set-original.xq +++ b/src/vue-poc/features/images/tasks/pics-05-set-original.xq @@ -1,5 +1,5 @@ (:~ set original:) -import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; +import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; for $i in collection($cfg:DB-IMAGE || "/image")/image where $i[file/@path=>contains('original')] diff --git a/src/vue-poc/features/images/tasks/pics-06-keywords.xq b/src/vue-poc/features/images/tasks/pics-06-keywords.xq index d7d5c04..c2fcd52 100644 --- a/src/vue-poc/features/images/tasks/pics-06-keywords.xq +++ b/src/vue-poc/features/images/tasks/pics-06-keywords.xq @@ -4,7 +4,7 @@ : 14569796 14569818 : :) -import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; +import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; declare %updating function local:put($data,$path){ db:replace($cfg:DB-IMAGE,$path,$data) }; diff --git a/src/vue-poc/features/images/tasks/pics-07-datetaken.xq b/src/vue-poc/features/images/tasks/pics-07-datetaken.xq index 021688b..3f8ca9c 100644 --- a/src/vue-poc/features/images/tasks/pics-07-datetaken.xq +++ b/src/vue-poc/features/images/tasks/pics-07-datetaken.xq @@ -4,7 +4,7 @@ : 14569796 14569818 : :) -import module namespace cfg = "quodatum:media.image.configure" at "../../../config.xqm"; +import module namespace cfg = "quodatum:media.image.configure" at "../config.xqm"; declare %updating function local:put($data,$path){ db:replace($cfg:DB-IMAGE,$path,$data) }; diff --git a/src/vue-poc/features/map.vue b/src/vue-poc/features/map.vue index 8f92039..2ab480e 100644 --- a/src/vue-poc/features/map.vue +++ b/src/vue-poc/features/map.vue @@ -13,6 +13,13 @@ diff --git a/src/vue-poc/features/server/basexsettings.xqm b/src/vue-poc/features/server/basexsettings.xqm new file mode 100644 index 0000000..8ca00f9 --- /dev/null +++ b/src/vue-poc/features/server/basexsettings.xqm @@ -0,0 +1,26 @@ +module namespace set = 'quodatum.test.basexsettings'; + +(:~ + : basex settings default and current + :) +declare +%rest:GET %rest:path("/vue-poc/api/server/basexsettings") +%rest:produces("application/json") +%output:method("json") +function set:values() +{ + let $defaults:=doc("basexsettings-921.xml")//*[not(*)] + let $dm:=map:merge($defaults!map:entry(name(.),string(.))) + let $settings:=db:system()//*[not(*)] + let $sm:=map:merge($settings!map:entry(name(.),string(.))) + let $names:=distinct-values((map:keys( $dm),map:keys($sm)))=>sort() + return +{for $name in $names return <_ type="object"> + {$name} + {$dm($name)} + {$sm($name)} + {$dm($name) ne $sm($name)} + } + +}; + diff --git a/src/vue-poc/features/tasks/model.build/tx-model.xq b/src/vue-poc/features/tasks/model.build/tx-model.xq index 49d4d28..ddb2533 100644 --- a/src/vue-poc/features/tasks/model.build/tx-model.xq +++ b/src/vue-poc/features/tasks/model.build/tx-model.xq @@ -19,7 +19,7 @@ declare variable $target as xs:anyURI external :=xs:anyURI("C:/Users/andy/git/vue-poc/src/vue-poc/models.gen.xqm"); -let $config:='import module namespace cfg = "quodatum:media.image.configure" at "config.xqm";' +let $config:='import module namespace cfg = "quodatum:media.image.configure" at "features/images/config.xqm";' let $src:=bf:module(bf:entities($efolder),$config) return ( prof:variables(), diff --git a/src/vue-poc/features/test-html.vue b/src/vue-poc/features/test-html.vue new file mode 100644 index 0000000..78566b0 --- /dev/null +++ b/src/vue-poc/features/test-html.vue @@ -0,0 +1,58 @@ + + + + + diff --git a/src/vue-poc/features/thumbnail/thumbnail.xqm b/src/vue-poc/features/thumbnail/thumbnail.xqm index b37e9f0..c7a6cba 100644 --- a/src/vue-poc/features/thumbnail/thumbnail.xqm +++ b/src/vue-poc/features/thumbnail/thumbnail.xqm @@ -22,7 +22,7 @@ function vue-api:thumbnail($url,$task ) let $x:=fn:parse-xml($task)=>fn:trace("task: ") let $thumb:=fetch:binary($url)=>t:task($x/thumbnail) - return (qweb:download-response("raw","xx.gif"), $thumb) + return (qweb:download-response("basex","xx.gif"), $thumb) }; (:~ diff --git a/src/vue-poc/lib/xqdoc/xqdoc-proj.xqm b/src/vue-poc/lib/xqdoc/xqdoc-proj.xqm index 1b1e770..9b0423e 100644 --- a/src/vue-poc/lib/xqdoc/xqdoc-proj.xqm +++ b/src/vue-poc/lib/xqdoc/xqdoc-proj.xqm @@ -58,7 +58,7 @@ declare function xqd:gendoc( let $ip:= $f/@name/resolve-uri(.,base-uri(.)) let $dest:= file:resolve-path($op,$target) - let $xqdoc:= xqd:xqdoc($ip,map{}) + let $xqdoc:= xqd:xqdoc($ip,map{"source": $ip}) let $xq:= fetch:text($ip) let $params:=map:merge((map{ "source": $xq, @@ -134,11 +134,18 @@ as element(*) xp:parse($xq || "",map{"lang":"xquery","version":"3.1 basex-20161204"}) }; -(:~ Generate xqdoc :) +(:~ + : Generate xqdoc adding custom opts + :) declare function xqd:xqdoc($url as xs:string,$opts as map(*)) as element(xqdoc:xqdoc) { - inspect:xqdoc($url) + inspect:xqdoc($url) + transform with { + for $tag in map:keys($opts) + return insert node { $opts[$tag] } + into xqdoc:module[@type="library"]/xqdoc:comment + } }; (:~ transform xqdoc to html :) diff --git a/src/vue-poc/models.gen.xqm b/src/vue-poc/models.gen.xqm index e004eca..0da61b2 100644 --- a/src/vue-poc/models.gen.xqm +++ b/src/vue-poc/models.gen.xqm @@ -1,9 +1,9 @@ (: entity access maps - : auto generated from xml files in entities folder at: 2019-01-23T21:27:22.427Z + : auto generated from xml files in entities folder at: 2019-02-23T22:59:34.827Z :) module namespace entity = 'quodatum.models.generated'; -import module namespace cfg = "quodatum:media.image.configure" at "config.xqm";declare namespace xqdoc='http://www.xqdoc.org/1.0'; +import module namespace cfg = "quodatum:media.image.configure" at "features/images/config.xqm";declare namespace xqdoc='http://www.xqdoc.org/1.0'; declare namespace ent='https://github.com/Quodatum/app-doc/entity'; declare namespace h='urn:quodatum:vue-poc.history'; declare namespace c='http://www.w3.org/ns/xproc-step'; @@ -176,7 +176,7 @@ hof:top-k-by(admin:logs(), string#1, 2) } }, "data": function() as element(ent:field)* - { collection("doc-doc")//ent:field }, + { collection("doc-doc")/ent:entity/ent:fields/ent:field }, "views": map{ 'filter': 'name description' @@ -254,7 +254,7 @@ hof:top-k-by(admin:logs(), string#1, 2) } }, "data": function() as element(ent:entity)* - { collection("vue-poc")//ent:entity }, + { collection("vue-poc")/ent:entity }, "views": map{ 'filter': 'name description' diff --git a/src/vue-poc/models/entities/entity.field.xml b/src/vue-poc/models/entities/entity.field.xml index 5069e1f..29a565f 100644 --- a/src/vue-poc/models/entities/entity.field.xml +++ b/src/vue-poc/models/entities/entity.field.xml @@ -27,5 +27,5 @@ name description - collection("doc-doc")//ent:field + collection("doc-doc")/ent:entity/ent:fields/ent:field \ No newline at end of file diff --git a/src/vue-poc/models/entities/entity.xml b/src/vue-poc/models/entities/entity.xml index 59c0b67..d27bf4b 100644 --- a/src/vue-poc/models/entities/entity.xml +++ b/src/vue-poc/models/entities/entity.xml @@ -55,5 +55,5 @@ name description - collection("vue-poc")//ent:entity + collection("vue-poc")/ent:entity \ No newline at end of file diff --git a/src/vue-poc/package.json b/src/vue-poc/package.json index 5a39bd9..915f9aa 100644 --- a/src/vue-poc/package.json +++ b/src/vue-poc/package.json @@ -4,9 +4,10 @@ "description": "A vue test", "dependencies": { "ace": "1.4.2", - "vuetify": "1.4.2", - "vue": "2.5.17", - "vue-router": "2.5.3", + "vuetify": "1.5.1", + "vue": "2.6.7", + "vuex": "3.0.1", + "vue-router": "3.0.2", "vue-treeselect": "0.0.25", "google-material": "0.0.0", "js-beautify": "1.6.12", @@ -14,6 +15,6 @@ "qs": "6.4.0", "localforage": "1.7.1", "momentjs": "2.18.1", - "vue-form-generator": "2.2.2" + "vuetify-jsonschema-form": "0.20.1" } } \ No newline at end of file diff --git a/src/vue-poc/router.js b/src/vue-poc/router.js index 729bb67..6fb5129 100644 --- a/src/vue-poc/router.js +++ b/src/vue-poc/router.js @@ -82,11 +82,12 @@ const router = new VueRouter({ { path: 'jobs', name:"jobs", component: Jobs, meta:{title:"Jobs running"} }, { path: 'jobs/:job', name:"jobShow", component: Job, props: true, meta:{title:"Job Status"} }, + { path: 'upload', component: Upload,meta:{title:"Upload"} }, + + { path: 'settings', component: Basexsettings,meta:{title:"BaseX settings"} }, { path: 'ping', component: Ping,meta:{title:"Ping"} }, { path: 'dicetest', component: Dicetest,meta:{title:"Dice test"} }, - { path: 'upload', component: Upload,meta:{title:"Upload"} }, - { path: 'websocket', component: Websocket,meta:{title:"Web socket"} }, - { path: 'settings', component: Basexsettings,meta:{title:"BaseX settings"} } + ] }, { path: '/history', component: { template: '' } @@ -103,11 +104,14 @@ const router = new VueRouter({ { path: 'timeline', component: Timeline,meta:{title:"timeline"} }, { path: 'tree', component: Tree, meta:{title:"tree"} }, { path: 'tree2', component: Tree2, meta:{title:"tree2"} }, + { path: 'form', component: Brutusin, meta:{title:"Form demo"} }, + { path: 'websocket', component: Websocket,meta:{title:"Web socket"} }, ] }, { path: '/puzzle', component: Puzzle, meta:{title:"Jigsaw"} }, - + { path: '/html', component: Testhtml, meta:{title:"HTML test"} }, + { path: '/transform', component: Transform, meta:{title:"XSLT2 Transform"} }, { path: '/validate', component: Validate, meta:{title:"Validate"} }, @@ -126,10 +130,8 @@ const router = new VueRouter({ { path: '/map', component: Leaflet,meta:{title:"map"} }, - { path: '/form', component: Brutusin, meta:{title:"Form demo"} }, - { path: '/form2', component: Formsjson, meta:{title:"Form schema"} }, - { path: '/form3', component: Formsschema, meta:{title:"vue-form-json-schema"} }, - + + { path: '/about', component: About, meta:{title:"About Vue-poc"} }, { path: '*', component: Notfound, meta:{title:"Page not found"} } diff --git a/src/vue-poc/static/app-gen.js b/src/vue-poc/static/app-gen.js index 113cd95..ed6383d 100644 --- a/src/vue-poc/static/app-gen.js +++ b/src/vue-poc/static/app-gen.js @@ -1,4 +1,4 @@ -// generated 2019-02-05T23:14:56.207Z +// generated 2019-03-01T23:13:01.734Z // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/components/qd-autoheight.vue Vue.component('qd-autoheight',{template:` @@ -601,6 +601,8 @@ Vue.component('vp-favorite',{template:` }, favorite(){ + this.$store.commit('increment') + console.log(this.$store.state.count) alert("save"); } } @@ -717,9 +719,11 @@ Vue.component('vp-notifications',{template:` {{ msg.created | fromNow("from") }} msg + + #{{ msg.index }} + + ({{ msg.elapsed }} ms) - {{ msg.elapsed }} ms - #{{ msg.index }} @@ -1213,8 +1217,8 @@ const GEditTabs={ methods: { // add tab return index - addItem(tab){ - //console.log("new: ",tab); + addItem(tab,pos){ + //console.log("new: ",tab," ,pos:",pos); var def={name: "AA"+this.nextId, contentType: "text/xml", mode: "xml", @@ -1223,7 +1227,11 @@ const GEditTabs={ }; var etab = Object.assign(def,tab); etab.id= "T" + this.nextId - this.items.push (etab); + if(pos){ + this.items.splice(pos, 0, etab) + }else{ + this.items.push (etab); + }; this.length++ this.nextId++; var ind=this.items.indexOf(etab) @@ -1262,7 +1270,7 @@ const GEditTabs={ that=this this.restored=Settings.getItem('edit/items') .then(function (v){ - console.log("items ",v) + //console.log("items ",v) v.forEach(v =>that.addItem(v)) }) .catch(error=> { @@ -1500,13 +1508,32 @@ const Notfound=Vue.extend({template:` // src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/about.vue const About=Vue.extend({template:` - - - + + + +
VUE-POC
+ + + + account_circle + close + + + edit + + + add + + + delete + + +
+ + - -

Vue-poc

+ A development environment for managing XML sources and processes. @@ -1538,9 +1565,9 @@ const About=Vue.extend({template:`
- +
+
-
`, @@ -2195,30 +2222,48 @@ created(){ const Tree=Vue.extend({template:` - - vue-jstree@2.1.16 - - todo + + Taxonomy test + + todo - - - {{ selected }} - - - - - - - - - -
    {{ JSON.stringify(data, null, '\t') }}
-    
-
-
+ + + + + + + + + + + + + + + +
+ Select some tags +
+ + + + label + {{ leaf }} + + +
+
+
-
`, @@ -2226,54 +2271,28 @@ const Tree=Vue.extend({template:` data:function(){ return { data: [], - - loadData: function (oriNode, resolve) { - var id = oriNode.data.id ? oriNode.data.id : 0 - console.log("LOAD DATA",id); - HTTP.get("components/tree") - .then(r=>{ - console.log(r); - resolve(r.data) - }) - .catch(error=> { - console.log(error); - - alert("Get query error"+url) - }); - } + items: [], + tree: [], + search: null, + open: [1, 2], + caseSensitive: false } }, methods: { - itemClick (node) { - node.model.selected= !node.model.selected; - console.log(' clicked !',node.model) - }, - - load(){ - this.asyncData = [this.$refs.tree.initializeLoading()]; - this.$refs.tree.handleAsyncLoad(this.asyncData, this.$refs.tree) - }, - - sel1(item){ - if(item.children){ - var res=[]; - for (const node of item.children) {res.push(this.sel1(node))} - return res; - }else{ - return item.selected?item.label:[] - } - } }, computed:{ - selected(){ - return this.sel1(this.data); - }, + }, -mounted: function(){ - this.load() + +created:function(){ + HTTP.get("components/tree") + .then(r=>{ + console.log("loaded tree:",r); + this.items= r.data; + }) } } @@ -2659,7 +2678,7 @@ const Tabs=Vue.extend({template:` add_circle insert_drive_file - {{ curIndex }} + i={{ curIndex }} {{ active.mode }} @@ -2698,7 +2717,9 @@ const Tabs=Vue.extend({template:` Annotations: Errors,Warning and Info - + + {{ active.mode }} + playlist_play @@ -2760,9 +2781,9 @@ const Tabs=Vue.extend({template:` - - tab list - + + + @@ -2776,6 +2797,11 @@ const Tabs=Vue.extend({template:` + + + tab list + +
@@ -2813,7 +2839,10 @@ const Tabs=Vue.extend({template:` methods:{ add(){ - this.curIndex=this.EditTabs.addItem({text:"hi "+ new Date()}) + var tab={name:"@" + this.active.name, + text:"active: "+ JSON.stringify(this.active, null, 2) + } + this.curIndex=this.EditTabs.addItem(tab, this.curIndex+1) }, tabClose(item,index){ @@ -2871,7 +2900,8 @@ const Tabs=Vue.extend({template:` var d=this.active.mode; var f=this.$MimeTypes.mode[d]; var f=f && f.validate; - this.curIndex=this.EditTabs.addItem({text:"validate: todo\n "+ this.curIndex +"\n" + new Date()}) + var t={name:"validate", text:"validate: todo\n "+ this.curIndex +"\n" + new Date()}; + this.curIndex=this.EditTabs.addItem(t) }, @@ -2981,7 +3011,7 @@ const Eval=Vue.extend({template:` play_circle_outlinejobs:run - + more_vert @@ -3221,17 +3251,37 @@ const Evalid=Vue.extend({template:` const Brutusin=Vue.extend({template:` - vue-form-generator@2.2.1 + + Form + + valid + invalid + validate + + vuetify-jsonschema-form@0.21.0 + + + + + + + + show + + + - + - - - + + submit + + - + +

Data:

{{ model | pretty }}
@@ -3242,90 +3292,28 @@ const Brutusin=Vue.extend({template:` `, components: { - "vue-form-generator": VueFormGenerator.component + "v-jsonschema-form": VJsonschemaForm.default }, data() { return { - model: { - id: 1, - name: "John Doe", - password: "J0hnD03!x4", - age: 35, - skills: ["Javascript", "VueJS"], - email: "john.doe@gmail.com", - status: true - }, - schema: { - fields: [{ - type: "input", - inputType: "text", - label: "ID", - model: "id", - readonly: true, - featured: false, - disabled: true - }, { - type: "input", - inputType: "text", - label: "Name", - model: "name", - readonly: false, - featured: true, - required: true, - disabled: false, - placeholder: "User's name", - validator: VueFormGenerator.validators.string - }, { - type: "input", - inputType: "password", - label: "Password", - model: "password", - min: 6, - required: true, - hint: "Minimum 6 characters", - validator: VueFormGenerator.validators.string - }, { - type: "input", - inputType: "number", - label: "Age", - model: "age", - min: 18, - validator: VueFormGenerator.validators.number - }, { - type: "input", - inputType: "email", - label: "E-mail", - model: "email", - placeholder: "User's e-mail address", - validator: VueFormGenerator.validators.email - }, { - type: "checklist", - label: "Skills", - model: "skills", - multi: true, - required: true, - multiSelect: true, - values: ["HTML5", "Javascript", "CSS3", "CoffeeScript", "AngularJS", "ReactJS", "VueJS"] - }, { - type: "switch", - label: "Status", - model: "status", - multi: true, - readonly: false, - featured: false, - disabled: false, - default: true, - textOn: "Active", - textOff: "Inactive" - }] - }, - - formOptions: { - validateAfterLoad: true, - validateAfterChanged: true + model: {}, + schema: null, + schemaUri: "person.json", + schemas: [ + "person.json", + "select.json", + "arrays.json" + ], + formValid: false, + options: { + debug: true, + disableAll: false, + autoFoldObjects: true, + httpLib: HTTP } }; }, + methods:{ onResize(){ var el=this.$refs["page"] @@ -3333,8 +3321,24 @@ const Brutusin=Vue.extend({template:` var h=Math.max(1,window.innerHeight - el.offsetTop)-60 console.log("h",h) el.style.height=h +"px" + }, + applyExample(uri){ + console.log(uri); + this.model={} + this.schema=null + HTTP.get("form/schema",{params: {uri: uri}}) + .then(r=>{ + this.schema=r.data; + }) + }, + submit(){ + alert("todo") + }, + showschema(){ + alert("as") } }, + filters: { pretty: function(value) { return JSON.stringify(value, null, 2); @@ -3342,114 +3346,11 @@ const Brutusin=Vue.extend({template:` }, created:function(){ console.log("form") - } -} - - ); - -// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/form/form-json-schema.vue -const Formsschema=Vue.extend({template:` - - - vue-form-json-schema@1.15.3 - - - - - - `, - - - data: () => ({ - model: {}, - - // A valid JSON Schema object - schema: { - type: 'object', - properties: { - firstName: { - type: 'string', - }, - }, - }, - - // Array of HTML elements or Vue components - uiSchema: [{ - component: 'input', - model: 'firstName', - // Same API as [Vue's render functions](https://vuejs.org/v2/guide/render-function.html#The-Data-Object-In-Depth) - fieldOptions: { - class: ['form-control'], - on: ['input'], - attrs: { - placeholder: 'Please enter your first name', - }, - }, - }] - }), - methods: { - onChange(value) { - this.model = value; - } - } - -} - ); - -// src: file:///C:/Users/andy/git/vue-poc/src/vue-poc/features/form/formschema.vue -const Formsjson=Vue.extend({template:` - - - - vue-json-schema@1.1.1 - - - - - - - - Send - - - - - -
{{ model | pretty }}
-
-
-
-
- - -
-
- `, - - - components: { - "form-schema": window["vue-json-schema"].default - }, - - data: () => ({ - schema2: null, - model: {} - }), - methods: { - submit (e) { - // this.model contains the valid data according your JSON Schema. - // You can submit your model to the server here - console.log(this.model); - alert("no submit yet") - } - }, - created:function(){ HTTP.get("form/schema",{}) .then(r=>{ - this.schema2=r.data; + this.schema=r.data; }) } - } ); @@ -3581,25 +3482,6 @@ const Taskhistory=Vue.extend({template:` const Home=Vue.extend({template:` - -
VUE-POC
- - - - account_circle - close - - - edit - - - add - - - delete - - -
@@ -4199,14 +4081,22 @@ const Report=Vue.extend({template:` arrow_back - todo + Settings - + +
    +
  • +
  • +
  • +
+
    {{ report | pretty }}
+    
+
`, @@ -4227,19 +4117,6 @@ const Report=Vue.extend({template:` var t1 = performance.now(); this.elapsed= 0.001 *(t1 - t0) }) - }, - onClick(event){ - console.log("event",event); - var isA= "a"== event.originalTarget.localName - - if(isA) { - // alert("stop this"+ event.originalTarget.hash); - console.log("tar",event.originalTarget.hash,document.querySelector(event.originalTarget.hash)); - event.preventDefault(); - this.$router.push({"hash":event.originalTarget.hash}); - // this.$vuetify.goTo(event.originalTarget.hash, { duration: 600, offset: -200, easing: 'easeInOutCubic'}); - - } } }, created:function(){ @@ -4626,6 +4503,13 @@ const Leaflet=Vue.extend({template:`
`, +//leaflet + components: { + "l-map": Vue2Leaflet.LMap, + "l-tilelayer": Vue2Leaflet.LTileLayer, + "l-marker": Vue2Leaflet.LMarker + }, + data: function(){ return { zoom: 13, @@ -4648,7 +4532,7 @@ const Documentation=Vue.extend({template:` documentation - list + json @@ -4896,6 +4780,7 @@ const Entity1=Vue.extend({template:` const Namespace=Vue.extend({template:` + @@ -4906,8 +4791,6 @@ const Namespace=Vue.extend({template:` - - refresh @@ -4915,9 +4798,9 @@ const Namespace=Vue.extend({template:` - - + + -