Skip to content

Instantly share code, notes, and snippets.

@gistlyn
Last active Jul 5, 2020
Embed
What would you like to do?
SharpData UI
{{
var AppSvgs = {
'action/home.svg': 'home',
'device/storage.svg': 'db',
'action/list.svg': 'table',
'navigation/first_page.svg': 'chevron-first',
'navigation/last_page.svg': 'chevron-last',
'navigation/expand_more.svg': 'chevron-down',
'navigation/chevron_left.svg': 'chevron-left',
'navigation/chevron_right.svg': 'chevron-right',
'navigation/expand_less.svg': 'chevron-up',
'content/clear.svg': 'clear',
'content/filter_list.svg': 'filter',
}
}}
{{#each AppSvgs}}
{{`/lib/svg/material/${it.Key}` |> svgAddFile(it.Value,'app')}}
{{/each}}
{{#svg fields app}}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="black" width="48px" height="48px">
<path d="M0 0h24v24H0V0z" fill="none"/>
<path d="M4 5v13h17V5H4zm10 2v9h-3V7h3zM6 7h3v9H6V7zm13 9h-3V7h3v9z" fill="#ffffff"/>
</svg>
{{/svg}}
{{#svg external-link app}}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#ffffff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
<polyline points="15 3 21 3 21 9"/>
<line x1="10" y1="14" x2="21" y2="3"/>
</svg>
{{/svg}}
{{#svg loading app}}
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="24px" height="30px" viewBox="0 0 24 30" style="enable-background:new 0 0 50 50">
<rect x="0" y="10" width="4" height="10" fill="#333" opacity="0.2">
<animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0s" dur="0.6s" repeatCount="indefinite" />
<animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />
<animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0s" dur="0.6s" repeatCount="indefinite" />
</rect>
<rect x="8" y="10" width="4" height="10" fill="#333" opacity="0.2">
<animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.15s" dur="0.6s" repeatCount="indefinite" />
<animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />
<animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.15s" dur="0.6s" repeatCount="indefinite" />
</rect>
<rect x="16" y="10" width="4" height="10" fill="#333" opacity="0.2">
<animate attributeName="opacity" attributeType="XML" values="0.2; 1; .2" begin="0.3s" dur="0.6s" repeatCount="indefinite" />
<animate attributeName="height" attributeType="XML" values="10; 20; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />
<animate attributeName="y" attributeType="XML" values="10; 5; 10" begin="0.3s" dur="0.6s" repeatCount="indefinite" />
</rect>
</svg>
{{/svg}}
{{#svg logo app}}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff" width="48px" height="48px">
<path d="M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z"/>
<path d="M0 0h24v24H0z" fill="none"/>
</svg>
{{/svg}}
{{#svg excel app}}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px">
<path fill="#4CAF50" d="M41,10H25v28h16c0.553,0,1-0.447,1-1V11C42,10.447,41.553,10,41,10z"/>
<path fill="#FFF" d="M32 15H39V18H32zM32 25H39V28H32zM32 30H39V33H32zM32 20H39V23H32zM25 15H30V18H25zM25 25H30V28H25zM25 30H30V33H25zM25 20H30V23H25z"/>
<path fill="#2E7D32" d="M27 42L6 38 6 10 27 6z"/>
<path fill="#FFF" d="M19.129,31l-2.411-4.561c-0.092-0.171-0.186-0.483-0.284-0.938h-0.037c-0.046,0.215-0.154,0.541-0.324,0.979L13.652,31H9.895l4.462-7.001L10.274,17h3.837l2.001,4.196c0.156,0.331,0.296,0.725,0.42,1.179h0.04c0.078-0.271,0.224-0.68,0.439-1.22L19.237,17h3.515l-4.199,6.939l4.316,7.059h-3.74V31z"/>
</svg>
{{/svg}}
{{htmlError}}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="/favicon.png" rel="icon">
<link rel="stylesheet" href="/lib/css/bootstrap/bootstrap.css">
<title>{{ title ?? 'Sharp Data' }}</title>
</head>
<body>
{{ 'buttons,buttons-svg' |> cssIncludes }}
{{ 'app' |> cssIncludes |> svgFill('#444') }}
{{#if fileExists('/bundle.css') }}
<link rel="stylesheet" href="/bundle.css">
{{else}}
{{ 'content:/src/css/' |> bundleCss({ minify:false, cache:false, out:'/app.bundle.css' }) }}
{{/if}}
<style>
{{ {
'.home-link': ['home','#4183B8'],
'.first-link': ['chevron-first','#4183B8'],
'.left-link': ['chevron-left','#4183B8'],
'.right-link': ['chevron-right','#4183B8'],
'.last-link': ['chevron-last','#4183B8'],
} |> toList |> map => `${it.Key} { ${it.Value[0].svgBackgroundImageCss(it.Value[1])} }` |> joinln |> raw }}
.text-close::after { content:'\00D7'; }
</style>
<i hidden>{{ '/js/hot-fileloader.js' |> ifDebugIncludeScript }}</i>
<script>
CONFIG = {
debug: {{ debugMode |> json }},
desktop: {{ desktopInfo |> json }},
hasExcel: {{ (isWin ? typeofProgId('Excel.Application') != null : false) |> json }},
namedDbs: {{ dbNamedConnections |> json }},
tables: {}
}
{{#if resolveArg('tables')}}
CONFIG.tables.main = {{ resolveArg('tables').split(',') |> json }};
{{else}}
CONFIG.tables.main = {{ dbTableNames |> json }};
{{/if}}
{{#each dbNamedConnections}}
{{#if resolveArg(`tables_${it}`) }}
CONFIG.tables['{{it}}'] = {{ resolveArg(`tables_${it}`).split(',') |> json }};
{{else}}
CONFIG.tables['{{it}}'] = {{ {} |> dbTableNames({ namedConnection:it }) |> json }};
{{/if}}
{{/each}}
</script>
<noscript>You need to enable JavaScript to run this app.</noscript>
{{page}}
{{ [
`/lib/js/vue/vue.min.js`,
`/lib/js/vue-router/vue-router.min.js`,
`/lib/js/vue-class-component/vue-class-component.min.js`,
`/lib/js/vue-property-decorator/vue-property-decorator.min.js`,
`/lib/js/@servicestack/desktop/servicestack-desktop.min.js`,
`/lib/js/@servicestack/client/servicestack-client.min.js`,
`/lib/js/@servicestack/vue/servicestack-vue.min.js`,
] |> map => `<script src="${it}"></script>` |> joinln |> raw }}
<script>
var ALIASES = {
'vue': { default: Vue },
'vue-router': { default: VueRouter },
'vue-class-component': VueClassComponent,
'vue-property-decorator': VuePropertyDecorator,
'@servicestack/vue': ServiceStackVue
};
var global = window;
window.exports = {};
window.require = function(name) {
return ALIASES[name] || exports[name] || window[name] || exports;
};
Object.assign(window, window["@servicestack/desktop"], window["@servicestack/client"]);
</script>
{{#if fileExists('/bundle.js') }}
<script src="/bundle.js"></script>
{{else}}
{{ [
'content:/src/components/',
'content:/src/shared/',
'content:/src/',
] |> bundleJs({ minify:false, cache:false, iife:true, out:`/app.bundle.js` }) }}
{{/if}}
{{ ['custom/'] |> bundleJs({ minify:false, bundle:false }) }}
{{ scripts |> raw }}
{{initError |> htmlError}}
{{htmlError}}
</body>
</html>
debug false
name Chinook SharpData UI
appName sharpdata
# Configure below. Supported dialects: sqlite, mysql, postgres, sqlserver
db.connections[chinook] { db:sqlite, connection:'chinook.sqlite' }
.grid-layout{display:grid;width:100vw;height:100vh;grid-column-gap:5px;grid-template-columns:250px auto;grid-template-rows:80px auto;grid-template-areas:"head head" "nav main"}header{background:#fff;grid-area:head;display:grid;grid-template-columns:auto auto;grid-template-areas:"breadcrumb auth"}.site-breadcrumbs{padding-left:0;height:80px}nav{background:#fff;grid-area:nav;padding:0 2px 0 10px;overflow-x:hidden;overflow-y:auto;display:grid;grid-template-rows:40px auto;grid-template-areas:"filter" "sidebar"}#nav-filter{grid-area:filter;margin:2px 0 0 0}#sidebar{grid-area:sidebar;overflow-x:hidden;overflow-y:scroll}main{background:#fff;grid-area:main;padding:2px;grid-row-gap:5px;overflow:auto;display:grid}.main-query,.loading-query{height:38px;font-size:20px;padding-top:1px}.main-container{overflow-y:scroll}
::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background-color:#f1f1f1}.navbar{border-radius:0;background:#4183b8 !important}a{color:#4183b8}a:hover{text-decoration:none}.form-check input[type=checkbox],.form-check input[type=radio]{margin-top:7px}.breadcrumb{background:none}.result{margin:10px;color:#349268}.stacktrace{background:#f1f1f1;padding:1em;margin:1em 0 .5em 0;border-radius:5px;border:1px solid #ccc;white-space:pre-wrap}.results-none{color:#6c757d}table.results{border:1px solid #eee;background:#fefefe}table.results thead tr{background:#eee}table.results th{text-align:left;color:#757575;font-size:13px;line-height:18px;border-bottom:1px solid #e0e0e0;padding:5px;overflow:hidden;white-space:nowrap}table.results td{color:#212121;font-size:12px;padding:5px;max-width:300px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}table.results td.row-component{max-width:900px}table.results tr.filters td{text-overflow:unset}th .modal-content,td .modal-content{font-size:1rem}.noselect{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.svg-btn,.btn-link,.th-link{cursor:pointer;user-select:none}.btn-link{text-decoration:none}#sidebar .selected{font-weight:bold}.datamodel{white-space:nowrap}.close,.text-close{user-select:none}.text-close{cursor:pointer;font-size:1.5em;color:#999}.text-close:hover{color:#666}.results-label{color:#666;vertical-align:bottom;line-height:36px}table.results .filters td{padding:0 1px;margin:0}.filters input{min-width:50px;width:100%;font-size:11px}.btn-compact.btn-sm{padding:.1rem .4rem}.jsonviewer .ib{display:inline-block}.jsonviewer table{border-collapse:collapse;border:solid 1px #ccc;clear:left}.jsonviewer th{text-align:left;padding:4px 8px;text-shadow:#fff 1px 1px -1px;background:#f1f1f1;white-space:nowrap;font-weight:bold}.jsonviewer td{padding:8px 8px 0 8px;vertical-align:top;line-height:18px}.jsonviewer dl{margin:0;clear:left}.jsonviewer dt{font-weight:bold;width:160px;clear:left;float:left;display:block;white-space:nowrap;line-height:26px}.jsonviewer dd{display:block;float:left;line-height:26px;max-width:600px;margin:0}.jsonviewer dl dl dt{font-weight:bold}.jsonviewer hr{display:none}.jsonviewer td dl HR{display:block;padding:0;clear:left;border:none}.jsonviewer td dl{padding:4px;margin:0;height:100%;max-width:700px}.jsonviewer dl td dl dt{padding:2px;margin:0 10px 0 0;font-weight:bold;width:120px;overflow:hidden;clear:left;float:left;display:block}.jsonviewer dl td dl dd{margin:0;padding:2px;display:block;float:left}
(function(){
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u},__awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},__generator=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},Results;Object.defineProperty(exports,"__esModule",{value:!0});exports.Results=void 0;var vue_1=require("vue"),vue_property_decorator_1=require("vue-property-decorator"),shared_1=require("../../shared"),client_1=require("@servicestack/client"),desktop_1=require("@servicestack/desktop"),FormatString=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"lower",{get:function(){return(""+this.value).toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUrl",{get:function(){return typeof this.value=="string"&&this.value.startsWith("http")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return typeof this.value=="string"&&this.value.substring(this.value.indexOf("://")+3)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return typeof this.value=="string"&&this.value.startsWith("/Date(")?client_1.toDateFmt(this.value):this.value},enumerable:!1,configurable:!0}),__decorate([vue_property_decorator_1.Prop({"default":""})],t.prototype,"value",void 0),__decorate([vue_property_decorator_1.Prop({"default":""})],t.prototype,"href",void 0),__decorate([vue_property_decorator_1.Component({template:'<a v-if="isUrl" :href="value" target="_blank">{{url}}<\/a>\n <i v-else-if="lower == \'false\'" class="svg svg-md bool-off-muted"><\/i>\n <i v-else-if="lower == \'true\'" class="svg svg-md bool-on-muted"><\/i>\n <a v-else-if="href" :href="href">{{format}}<\/a>\n <span v-else>{{format}}<\/span>\n'})],t)}(vue_1.default);vue_1.default.component("format",FormatString);Results=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.showSelectColumns=!1,t.skip=0,t.take=100,t.total=null,t.orderBy="",t.filters={},t.fields=[],t.results=[],t.openComponents=[],t.loading=!1,t.responseStatus=null,t}return __extends(t,n),Object.defineProperty(t.prototype,"store",{get:function(){return shared_1.store},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columns",{get:function(){return shared_1.store.getColumnSchemas(this.db,this.table)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.skip||this.orderBy||Object.keys(this.filters).length>0||this.fields.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rowComponent",{get:function(){return shared_1.getRowComponent(this.db,this.table)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fieldNames",{get:function(){var i=this,n,t=(n=this.columns)===null||n===void 0?void 0:n.map(function(n){return n.columnName});return this.fields.length>0&&(t=t.filter(function(n){return i.fields.indexOf(n)>=0})),t},enumerable:!1,configurable:!0}),t.prototype.showRowComponent=function(n){return this.openComponents.indexOf(n)>=0},t.prototype.toggleRowComponent=function(n){this.showRowComponent(n)?this.openComponents=this.openComponents.filter(function(t){return t!=n}):this.openComponents.push(n)},t.prototype.rowComponentClass=function(n){return"svg svg-chevron-"+(this.showRowComponent(n)?"down":"right")+" svg-md btn-link align-top"},t.prototype.min=function(n,t){return Math.min(n,t)},t.prototype.onUrlChange=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return[4,this.reset()];case 1:return n.sent(),[2]}})})},t.prototype.clear=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return this.$route.query.filter&&this.$router.push(this.$route.path),[4,shared_1.saveTableSettings(this.db,this.table,null)];case 1:return n.sent(),[4,this.reset()];case 2:return n.sent(),[2]}})})},t.prototype.reset=function(){return __awaiter(this,void 0,void 0,function(){var n,t,i;return __generator(this,function(r){switch(r.label){case 0:return n=shared_1.getTableSettings(this.db,this.table)||{},this.skip=n.skip||0,this.orderBy=n.orderBy||"",this.filters=n.filters||{},this.fields=n.fields||[],this.$route.query.filter&&(t=client_1.splitOnFirst(this.$route.query.filter,":"),this.filters=(i={},i[t[0]]=t[1],i)),this.results=[],[4,shared_1.loadTable(this,this.db,this.table)];case 1:return r.sent(),[4,this.search()];case 2:return r.sent(),[2]}})})},t.prototype.handleSelectColumns=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return this.showSelectColumns=!1,[4,this.search()];case 1:return n.sent(),[2]}})})},t.prototype.viewNext=function(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(i){switch(i.label){case 0:return(this.skip+=n,typeof this.total!="number")?[2]:(t=Math.floor(this.total/100)*100,this.skip>t&&(this.skip=t),this.skip<0&&(this.skip=0),[4,this.search()]);case 1:return i.sent(),[2]}})})},Object.defineProperty(t.prototype,"filterQuery",{get:function(){var t=this,n="";return Object.keys(this.filters).forEach(function(i){t.filters[i]&&(n+="&",n+=encodeURIComponent(i)+"="+encodeURIComponent(t.filters[i]))}),n},enumerable:!1,configurable:!0}),t.prototype.filterSearch=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return this.skip=0,[4,this.search()];case 1:return n.sent(),[2]}})})},t.prototype.createFilteredUrl=function(n){n===void 0&&(n="json");var t="/db/"+this.db+"/"+this.table+"?format="+n;return t+=this.filterQuery,this.fields.length>0&&(t+="&fields="+encodeURIComponent(this.fields.join(","))),this.orderBy&&(t+="&orderBy="+encodeURIComponent(this.orderBy)),t},t.prototype.createUrl=function(n){n===void 0&&(n="json");var t=this.createFilteredUrl(n);return this.skip>0&&(t+="&skip="+this.skip),this.take&&(t+="&take="+this.take),t},t.prototype.search=function(){return __awaiter(this,void 0,void 0,function(){var n,t,i=this;return __generator(this,function(r){switch(r.label){case 0:return this.openComponents=[],n=this,[4,shared_1.exec(this,function(){return __awaiter(i,void 0,void 0,function(){var t,i,n;return __generator(this,function(r){switch(r.label){case 0:return t=this.createUrl(),[4,fetch(t)];case 1:return i=r.sent(),[4,i.text()];case 2:return n=r.sent(),[2,n&&JSON.parse(n)||[]]}})})})];case 1:return n.results=r.sent(),this.rowComponent&&this.results.length==1&&this.openComponents.push(0),t=this,[4,shared_1.exec(this,function(){return __awaiter(i,void 0,void 0,function(){var n,t,i;return __generator(this,function(r){switch(r.label){case 0:return n="/db/"+this.db+"/"+this.table+"/total?format=json",n+=this.filterQuery,[4,fetch(n)];case 1:return t=r.sent(),[4,t.text()];case 2:return i=r.sent(),[2,parseInt(i)||null]}})})})];case 2:return t.total=r.sent(),[4,shared_1.saveTableSettings(this.db,this.table,{skip:this.skip,filters:this.filters,orderBy:this.orderBy,fields:this.fields})];case 3:return r.sent(),[2]}})})},t.prototype.openCsv=function(){return __awaiter(this,void 0,void 0,function(){var t,n;return __generator(this,function(i){switch(i.label){case 0:return t=this.createFilteredUrl("csv"),n=desktop_1.desktopSaveDownloadUrl(this.db+"-"+this.table+"-"+shared_1.dateFmtHMS()+".csv",t)+"?open=true",shared_1.store.hasExcel&&(n+="&start=excel"),[4,fetch(n)];case 1:return i.sent(),[2]}})})},t.prototype.open=function(n){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(i){switch(i.label){case 0:return t=this.createUrl(n),[4,shared_1.openUrl(t)];case 1:return i.sent(),[2]}})})},t.prototype.mounted=function(){return __awaiter(this,void 0,void 0,function(){var n=this;return __generator(this,function(t){switch(t.label){case 0:return shared_1.bus.$on("settings",function(){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return[4,this.reset()];case 1:return[2,n.sent()]}})})}),[4,this.reset()];case 1:return t.sent(),[2]}})})},t.prototype.humanize=function(n){return client_1.humanize(n)},t.prototype.renderValue=function(n){return Array.isArray(n)?n.join(", "):typeof n=="undefined"?"":typeof n=="object"?JSON.stringify(n):n+""},t.prototype.getField=function(n,t){return client_1.getField(n,t)},t.prototype.getLink=function(n,t){var i=shared_1.store.dbConfigs[this.db],r=i&&i.links&&i.links[this.table]&&i.links[this.table][t];return r&&r(client_1.getField(n,t))},t.prototype.setOrderBy=function(n){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return this.orderBy=this.orderBy==n?"-"+n:this.orderBy=="-"+n?"":n,[4,this.search()];case 1:return t.sent(),[2]}})})},t.prototype.helpFilters=function(){return"Search Filters:\n Use '=null' or '!=null' to search NULL columns\n Use '<= < > >= <> !=' prefix to search with that operator\n Use ',' suffix to perform an IN(values) search on integers\n Use '%' prefix or suffix to perform a LIKE wildcard search\n Use '=' prefix to perform an exact coerced search\nOtherwise a 'string equality' search is performed"},__decorate([vue_property_decorator_1.Prop()],t.prototype,"db",void 0),__decorate([vue_property_decorator_1.Prop()],t.prototype,"table",void 0),__decorate([vue_property_decorator_1.Watch("$route",{immediate:!0,deep:!0})],t.prototype,"onUrlChange",null),__decorate([vue_property_decorator_1.Component({template:'<div>\n <div v-if="!loading" class="main-query text-nowrap">\n <span class="btn svg svg-fields svg-2x" title="View Columns" @click="showSelectColumns=!showSelectColumns"><\/span>\n <button class="btn first-link svg-2x" :disabled="skip==0" title="<< first" @click="viewNext(-total)"><\/button>\n <button class="btn left-link svg-2x" :disabled="skip==0" title="< previous" @click="viewNext(-100)"><\/button>\n <button class="btn right-link svg-2x" :disabled="results.length < take" title="next >" @click="viewNext(100)"><\/button>\n <button class="btn last-link svg-2x" :disabled="results.length < take" title="last >>" @click="viewNext(total)"><\/button>\n <span class="px-1 results-label">Showing Results {{skip+1}} - {{min(skip + results.length,total)}} <span v-if="total!=null">of {{total}}<\/span><\/span>\n <button v-if="dirty" class="btn svg-clear svg-lg" @click="clear()" title="reset query"><\/button>\n <button v-if="store.hasExcel" class="btn btn-outline-success btn-sm btn-compact" @click="openCsv()" \n :title="store.hasExcel ? \'Open in Excel\' : \'Open CSV\'"><i class="svg-md svg-excel"><\/i>{{store.hasExcel ? \'excel\' : \'csv\' }}<\/button>\n <span class="btn btn-sm px-1" @click="open(\'html\')"><i class="svg-md svg-external-link"><\/i> html<\/span>\n <span class="btn btn-sm px-0" @click="open(\'csv\')"><i class="svg-md svg-external-link"><\/i> csv<\/span>\n <span class="btn btn-sm pl-1" @click="open(\'json\')"><i class="svg-md svg-external-link"><\/i> json<\/span>\n <\/div>\n <div v-else class="loading-query">\n <span class="svg svg-loading svg-2x ml-1"><\/span>Loading {{ this.columns?.length ? \'results\' : \'schema\' }}... \n <\/div>\n <div v-if="showSelectColumns">\n <select-columns :columns="columns" v-model="fields" @done="handleSelectColumns($event)" />\n <\/div>\n <table class="results">\n <thead><tr class="noselect">\n <th v-for="f in fieldNames" :key="f" @click="setOrderBy(f)" class="th-link">\n <div class="text-nowrap">\n {{ humanize(f) }}\n <span v-if="orderBy==f" class="svg svg-chevron-up svg-md align-top"><\/span>\n <span v-else-if="orderBy==\'-\'+f" class="svg svg-chevron-down svg-md align-top"><\/span>\n <\/div>\n <\/th>\n <\/tr><\/thead>\n <tbody>\n <tr class="filters">\n <td v-for="(f,j) in fieldNames">\n <input type="text" v-model="filters[f]" @keydown.enter.stop="filterSearch()">\n <span v-if="j==fieldNames.length-1" style="margin:0 0 0 -23px;"><i class="svg svg-btn svg-filter svg-md" :title="helpFilters()" /><\/span>\n <\/td>\n <\/tr>\n <template v-for="(r,i) in results">\n <tr :key="i">\n <td v-for="(f,j) in fieldNames" :key="j" :title="renderValue(getField(r,f))">\n <span v-if="j == 0 && rowComponent" :class="rowComponentClass(i)" @click="toggleRowComponent(i)"><\/span>\n <format :value="getField(r,f)" :href="getLink(r,f)" />\n <\/td>\n <\/tr>\n <tr v-if="showRowComponent(i)">\n <td class="row-component" :colspan="fieldNames.length">\n <component :is="rowComponent" :db="db" :table="table" :row="r" :columns="columns"><\/component>\n <\/td> \n <\/tr>\n <\/template>\n <\/tbody>\n <\/table>\n <error-view :responseStatus="responseStatus" />\n<\/div>'})],t)}(vue_1.default);exports.Results=Results;exports.default=Results;vue_1.default.component("results",Results);
})();
(function(){
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u};Object.defineProperty(exports,"__esModule",{value:!0});var vue_1=require("vue"),vue_property_decorator_1=require("vue-property-decorator"),SelectColumns=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.selectedColumns=[],t}return __extends(t,n),t.prototype.mounted=function(){this.selectedColumns=this.value;this.$nextTick(function(){var n;if((n=document.querySelector(".modal"))!==null&&n!==void 0)return n.focus()})},t.prototype.onInputValues=function(){return this.selectedColumns},__decorate([vue_property_decorator_1.Prop()],t.prototype,"columns",void 0),__decorate([vue_property_decorator_1.Prop({"default":function(){return[]}})],t.prototype,"value",void 0),__decorate([vue_property_decorator_1.Emit("input")],t.prototype,"onInputValues",null),__decorate([vue_property_decorator_1.Component({template:'<div class="modal" tabindex="-1" role="dialog" @keyup.esc="$emit(\'done\')" style="display:block;background:rgba(0,0,0,.25)">\n <div class="modal-dialog" role="document" style="margin-top:120px">\n <div class="modal-content">\n <div class="modal-header">\n <h5 class="modal-title noselect">\n Column Preferences\n <\/h5>\n <button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="$emit(\'done\')">\n <span aria-hidden="true">&times;<\/span>\n <\/button>\n <\/div>\n <div class="modal-body ml-2">\n <div class="form-check">\n <input class="form-check-input" type="radio" name="exampleRadios" id="allColumns" :checked="selectedColumns.length==0" \n @click="selectedColumns=[]" @change="onInputValues">\n <label class="form-check-label noselect" for="allColumns">View all columns<\/label>\n <\/div>\n <hr>\n <div v-for="c in columns" :key="c.columnName" class="form-check">\n <input class="form-check-input" type="checkbox" :id="c.columnName" :value="c.columnName" v-model="selectedColumns" @change="onInputValues">\n <label class="form-check-label noselect" :for="c.columnName">{{c.columnName}}<\/label>\n <\/div>\n <div class="form-group text-right">\n <span class="btn btn-link" @click="$emit(\'done\')">Close<\/span>\n <button class="btn btn-primary" @click="$emit(\'done\')">Done<\/button>\n <\/div>\n <\/div>\n <\/div>\n <\/div>\n<\/div>'})],t)}(vue_1.default);vue_1.default.component("select-columns",SelectColumns);
})();
(function(){
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u},__awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},__generator=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e};Object.defineProperty(exports,"__esModule",{value:!0});exports.Viewer=void 0;var vue_property_decorator_1=require("vue-property-decorator"),shared_1=require("../../shared"),Viewer=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.txtFilter="",t.results=[],t.loading=!1,t.responseStatus=null,t}return __extends(t,n),Object.defineProperty(t.prototype,"store",{get:function(){return shared_1.store},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"db",{get:function(){return this.$route.params.db},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"table",{get:function(){return this.$route.params.table},enumerable:!1,configurable:!0}),t.prototype.filtered=function(n){var t=this;return this.txtFilter?n.filter(function(n){return n.toLowerCase().indexOf(t.txtFilter.toLowerCase())>=0}):n},t.prototype.link=function(n,t){return"/"+n+"/"+t},t.prototype.tableName=function(n,t){var i,r=shared_1.store.dbConfigs[n];return r&&r.tableName?(i=r.tableName(t))!==null&&i!==void 0?i:t:t},t.prototype.mounted=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(){return[2]})})},t.prototype.submit=function(){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(){return[2]})})},__decorate([vue_property_decorator_1.Prop({"default":""})],t.prototype,"name",void 0),__decorate([vue_property_decorator_1.Component({template:'<section id="home" class="grid-layout">\n <header id="header">\n <h1>\n <nav class="site-breadcrumbs">\n <ol class="breadcrumb">\n <li class="breadcrumb-item">\n <router-link to="/"><i class="home-link svg-3x mb-1" title="home" /><\/router-link>\n <\/li>\n <li v-if="db" class="breadcrumb-item">{{db}}<\/li>\n <li v-if="table" class="breadcrumb-item active">{{table}}<\/li>\n <li v-if="!db && !table" class="breadcrumb-item">Select Table<\/li>\n <li v-if="loading"><i class="svg-loading svg-lg ml-2 mb-1" title="loading..." /><\/li>\n <\/ol>\n <\/nav>\n <\/h1>\n <h1 v-else-if="loading">\n <i class="fab fa-loading"><\/i>\n Loading...\n <\/h1>\n <div v-else-if="responseStatus">\n <error-summary :responseStatus="responseStatus" />\n <\/div>\n <\/header>\n \n <nav id="left">\n <div id="nav-filter">\n <i v-if="txtFilter" class="text-close" style="position:absolute;margin:0 0 0 215px;" title="clear" @click="txtFilter=\'\'"><\/i>\n <v-input v-model="txtFilter" id="txtFilter" placeholder="filter" inputClass="form-control" />\n <\/div>\n <div id="sidebar" class="">\n <div>\n <template v-for="(tables,d) in store.tables">\n <div v-if="filtered(tables).length > 0" class="ml-1 mt-2">\n <h4>\n <i class="svg-db svg-2x"><\/i>\n {{d}}\n <\/h4>\n <div v-for="t in filtered(tables)" :key="t" :class="[\'datamodel\',{selected:t==table}]" :title="t">\n <router-link class="ml-3" :to="link(d,t)">{{tableName(d,t)}}<\/router-link>\n <span v-if="store.getColumnTotal(d,t) != null" class="text-muted">({{store.getColumnTotal(d,t)}})<\/span>\n <\/div>\n <\/div>\n <\/template> \n <\/div>\n <\/div>\n <\/nav>\n \n <main v-if="db && table">\n <div v-if="!responseStatus" class="main-container">\n <results :db="db" :table="table" />\n <\/div>\n <div v-else><error-view :responseStatus="responseStatus" class="mt-5" /><\/div>\n <\/main>\n \n <\/section>'})],t)}(vue_property_decorator_1.Vue);exports.Viewer=Viewer;exports.default=Viewer;vue_property_decorator_1.Vue.component("viewer",Viewer);
})();
(function(){
"use strict";function getRowComponent(n,t){return n=n.toLowerCase(),t=t.toLowerCase(),rowComponents[n]&&rowComponents[n][t]||null}function registerRowComponent(n,t,i,r){vue_1.default.component(r,i);n=n.toLowerCase();t=t.toLowerCase();rowComponents[n]||(rowComponents[n]={});rowComponents[n][t]=r}function dbConfig(n,t){var i,u,r;if(n=="main"||!(exports.store.namedDbs.indexOf(n)<0)){if(t.showTables&&t.showTables.length>0&&vue_1.default.set(exports.store.tables,n,t.showTables),t.rowComponents)for(i=0,u=Object.keys(t.rowComponents);i<u.length;i++)r=u[i],registerRowComponent(n,r,t.rowComponents[r],r);vue_1.default.set(exports.store.dbConfigs,n,t)}}function loadSettings(){return __awaiter(this,void 0,void 0,function(){var n,t,i;return __generator(this,function(r){switch(r.label){case 0:return(r.trys.push([0,4,5,6]),!exports.store.desktop)?[3,2]:[4,desktop_1.desktopTextFile("settings.json")];case 1:return t=r.sent(),[3,3];case 2:t=localStorage.getItem("settings.json");r.label=3;case 3:return n=t,n&&(settings=JSON.parse(n)||{},log("loaded",settings),exports.bus.$emit("settings")),[3,6];case 4:return i=r.sent(),log("Could not retrieve desktopTextFile 'settings.json'",i),[3,6];case 5:return settingsLoaded=!0,[7];case 6:return[2]}})})}function saveSettings(){return __awaiter(this,void 0,void 0,function(){var n,t;return __generator(this,function(i){switch(i.label){case 0:return(i.trys.push([0,4,,5]),n=JSON.stringify(settings),!exports.store.desktop)?[3,2]:[4,desktop_1.desktopSaveTextFile("settings.json",n)];case 1:return i.sent(),[3,3];case 2:localStorage.setItem("settings.json",n);i.label=3;case 3:return[3,5];case 4:return t=i.sent(),log("Could not retrieve saveDesktopTextFile 'settings.json'",t),[3,5];case 5:return[2]}})})}function getTableSettings(n,t){return settings[n]&&settings[n][t]||null}function saveTableSettings(n,t,i){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(r){switch(r.label){case 0:return settingsLoaded?(settings[n]||(settings[n]={}),i?settings[n][t]=i:delete settings[n][t],[4,saveSettings()]):[2];case 1:return r.sent(),[2]}})})}function log(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return exports.store.debug&&console.log.apply(console,arguments),t}function openUrl(n){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(t){switch(t.label){case 0:return exports.store.desktop?[4,desktop_1.evaluateCode("openUrl('"+n+"')")]:[3,2];case 1:return t.sent(),[3,3];case 2:window.open(n);t.label=3;case 3:return[2]}})})}function exec(n,t){return __awaiter(this,void 0,void 0,function(){var i;return __generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,3,4]),n.loading=!0,n.responseStatus=null,[4,t()];case 1:return[2,r.sent()];case 2:return i=r.sent(),log(i),n.responseStatus=i.responseStatus||(typeof i=="string"?{errorCode:"Error",message:i}:null)||i,n.$emit("error",n.responseStatus),[3,4];case 3:return n.loading=!1,[7];case 4:return[2]}})})}function loadTable(n,t,i){return __awaiter(this,void 0,void 0,function(){var r=this;return __generator(this,function(u){switch(u.label){case 0:return exports.store.getColumnSchemas(t,i).length>0?[2]:[4,exec(n,function(){return __awaiter(r,void 0,void 0,function(){var r,n,u;return __generator(this,function(f){switch(f.label){case 0:return[4,fetch("/db/"+t+"/"+i+"/meta?format=json")];case 1:return r=f.sent(),[4,r.text()];case 2:return n=f.sent(),n&&(u=JSON.parse(n),exports.store.columns[t]||vue_1.default.set(exports.store.columns,t,{}),vue_1.default.set(exports.store.columns[t],i,u)),[2]}})})})];case 1:return u.sent(),[2]}})})}function sharpData(n,t,i){return __awaiter(this,void 0,void 0,function(){var r;return __generator(this,function(u){switch(u.label){case 0:return r="/db/"+n+"/"+t+"?format=json",i&&(r=client_1.appendQueryString(r,i)),[4,fetch(r)];case 1:return[4,u.sent().json()];case 2:return[2,u.sent()]}})})}var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u},__awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},__generator=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},vue_1,client_1,rowComponents,Roles,EventBus,settings,settingsLoaded;Object.defineProperty(exports,"__esModule",{value:!0});exports.sharpData=exports.loadTable=exports.exec=exports.openUrl=exports.dateFmtHMS=exports.log=exports.saveTableSettings=exports.getTableSettings=exports.saveSettings=exports.loadSettings=exports.bus=exports.splitPascalCase=exports.dbConfig=exports.store=exports.Roles=exports.registerRowComponent=exports.getRowComponent=exports.RowComponent=exports.client=void 0;vue_1=require("vue");client_1=require("@servicestack/client");exports.client=new client_1.JsonServiceClient("/");var desktop_1=require("@servicestack/desktop"),vue_property_decorator_1=require("vue-property-decorator"),RowComponent=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),__decorate([vue_property_decorator_1.Prop()],t.prototype,"db",void 0),__decorate([vue_property_decorator_1.Prop()],t.prototype,"table",void 0),__decorate([vue_property_decorator_1.Prop()],t.prototype,"row",void 0),__decorate([vue_property_decorator_1.Prop()],t.prototype,"columns",void 0),t}(vue_1.default);exports.RowComponent=RowComponent;rowComponents={};exports.getRowComponent=getRowComponent;exports.registerRowComponent=registerRowComponent,function(n){n.Admin="Admin"}(Roles=exports.Roles||(exports.Roles={}));exports.store={debug:global.CONFIG.debug,desktop:global.CONFIG.desktop,hasExcel:global.CONFIG.hasExcel,namedDbs:global.CONFIG.namedDbs,tables:global.CONFIG.tables,totals:{},columns:{},getColumnTotal:function(n,t){var i=this.totals[n]&&this.totals[n][t];return i!=null?i:null},getColumnSchemas:function(n,t){return this.columns[n]&&this.columns[n][t]||[]},dbConfigs:{}};exports.dbConfig=dbConfig;exports.splitPascalCase=function(n){return client_1.humanize(n).split(" ").map(client_1.toPascalCase).join(" ")};EventBus=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.store=exports.store,t}return __extends(t,n),t}(vue_1.default);exports.bus=new EventBus({data:exports.store});settings={};settingsLoaded=!1;exports.loadSettings=loadSettings;exports.saveSettings=saveSettings;exports.getTableSettings=getTableSettings;exports.saveTableSettings=saveTableSettings;exports.log=log;exports.dateFmtHMS=function(n){return n===void 0&&(n=new Date),""+(n.getFullYear()-2e3)+client_1.padInt(n.getMonth()+1)+client_1.padInt(n.getDate())+"-"+client_1.padInt(n.getHours())+client_1.padInt(n.getMinutes())+client_1.padInt(n.getSeconds())};exports.openUrl=openUrl;exports.exec=exec;exports.loadTable=loadTable;exports.sharpData=sharpData;vue_1.default.filter("upper",function(n){if(n!==null&&n!==void 0)return n.toUpperCase()});vue_1.default.filter("json",function(n){return n&&JSON.stringify(n)}),function(){return __awaiter(void 0,void 0,void 0,function(){return __generator(this,function(n){switch(n.label){case 0:return[4,loadSettings()];case 1:return n.sent(),[2]}})})}(),function(){return __awaiter(void 0,void 0,void 0,function(){var i,n,r,t,u;return __generator(this,function(f){switch(f.label){case 0:i=function(n){var r,t,u,i,f;return __generator(this,function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),[4,fetch("/db/"+n+"/totals?format=json")];case 1:return r=e.sent(),[4,r.text()];case 2:return t=e.sent(),t&&(u=JSON.parse(t),i={},u.forEach(function(n){i[n.key]=n.value}),vue_1.default.set(exports.store.totals,n,i)),[3,4];case 3:return f=e.sent(),log("Can't retrieve totals for '"+n+"':",f),[3,4];case 4:return[2]}})};n=[];for(r in exports.store.tables)n.push(r);t=0;f.label=1;case 1:return(t<n.length)?(u=n[t],[5,i(u)]):[3,4];case 2:f.sent();f.label=3;case 3:return t++,[3,1];case 4:return[2]}})})}(),function(){return __awaiter(void 0,void 0,void 0,function(){var n,t;return __generator(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),n=exports.store,[4,desktop_1.desktopInfo()];case 1:return n.desktop=i.sent(),log("In Desktop app:",exports.store.desktop),[3,3];case 2:return t=i.sent(),log("Not in Desktop app:",t),[3,3];case 3:return[2]}})})}();
})();
(function(){
"use strict";var routes;Object.defineProperty(exports,"__esModule",{value:!0});exports.redirect=exports.router=exports.Routes=void 0;var vue_1=require("vue"),vue_router_1=require("vue-router"),vue_2=require("@servicestack/vue"),Viewer_1=require("../components/Viewer"),Routes;(function(n){n.Home="/";n.ViewTable="/:db/:table";n.Forbidden="/forbidden"})(Routes=exports.Routes||(exports.Routes={}));vue_1.default.use(vue_router_1.default);routes=[{path:Routes.Home,component:Viewer_1.Viewer},{path:Routes.ViewTable,component:Viewer_1.Viewer},{path:Routes.Forbidden,component:vue_2.Forbidden},{path:"*",redirect:"/"},];exports.router=new vue_router_1.default({mode:"history",linkActiveClass:"active",routes:routes});exports.default=exports.router;exports.redirect=function(n){var t=n.indexOf("://")>=0;t?location.href=n:exports.router.push({path:n})};
})();
(function(){
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u};Object.defineProperty(exports,"__esModule",{value:!0});exports.App=void 0;var vue_1=require("vue"),vue_property_decorator_1=require("vue-property-decorator"),shared_1=require("./shared"),App=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"store",{get:function(){return shared_1.store},enumerable:!1,configurable:!0}),__decorate([vue_property_decorator_1.Component({template:"<div>\n <router-view><\/router-view>\n <\/div>"})],t)}(vue_1.default);exports.App=App;exports.default=App;
})();
(function(){
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u},vue_property_decorator_1,ErrorView;Object.defineProperty(exports,"__esModule",{value:!0});exports.ErrorView=void 0;vue_property_decorator_1=require("vue-property-decorator");ErrorView=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.showStackTrace=!1,t}return __extends(t,n),__decorate([vue_property_decorator_1.Prop({"default":null})],t.prototype,"responseStatus",void 0),__decorate([vue_property_decorator_1.Component({template:'<div v-if="responseStatus" class="noplugin-error alert alert-danger mt-3 mr-3">\n <div>{{responseStatus.errorCode}}: {{responseStatus.message}}<\/div>\n <div v-if="responseStatus.stackTrace">\n <button v-if="!showStackTrace" class="btn btn-link" style="margin-left: -1em" @click="showStackTrace=true">\n <i class="svg-chevron-right svg-lg mb-1" title="expand" />StackTrace<\/button>\n <div v-if="showStackTrace" class="stacktrace">{{responseStatus.stackTrace}}<\/div>\n <\/div>\n<\/div>'})],t)}(vue_property_decorator_1.Vue);exports.ErrorView=ErrorView;exports.default=ErrorView;vue_property_decorator_1.Vue.component("error-view",ErrorView);
})();
(function(){
"use strict";var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=this&&this.__decorate||function(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u};Object.defineProperty(exports,"__esModule",{value:!0});exports.JsonViewer=void 0;var vue_property_decorator_1=require("vue-property-decorator"),client_1=require("@servicestack/client"),show=function(n){return typeof n!="string"||n.substr(0,2)!=="__"},keyFmt=function(n){return client_1.humanize(client_1.toPascalCase(n))},uniqueKeys=function(n){for(var r,t,u={},i=0,f=n.length;i<f;i++){r=n[i];for(t in r)r.hasOwnProperty(t)&&show(t)&&(u[t]=t)}return u},valueFmt=function(n,t,i){return i},num=function(n){return n},date=function(n){return client_1.toDate(n)},pad=function(n){return n<10?"0"+n:n},dmft=function(n){return n.getFullYear()+"/"+pad(n.getMonth()+1)+"/"+pad(n.getDate())},str=function(n){return n.substr(0,6)==="/Date("?dmft(date(n)):n},obj=function(n){return"<dl>\n "+Object.keys(n).filter(show).map(function(t){return'<dt class="ib">'+keyFmt(t)+"<\/dt><dd>"+valueFmt(t,n[t],val(n[t]))+"<\/dd>"}).join("")+"\n <\/dl>"},arr=function(n){if(typeof n[0]=="string"||typeof n[0]=="number")return"<span>"+n.join(", ")+"<\/span>";var t=uniqueKeys(n);return"\n <table>\n <thead>\n <tr>\n "+Object.keys(t).map(function(n){return"<th><b><\/b>"+keyFmt(n)+"<\/th>"}).join("")+"\n <\/tr>\n <\/thead>\n <tbody>\n "+n.map(function(n){return"<tr>\n "+Object.keys(t).filter(show).map(function(t){return"<td>"+valueFmt(t,n[t],val(n[t]))+"<\/td>"}).join("")+"\n <\/tr>"}).join("")+"\n <\/tbody>\n <\/table>"},val=function(n,t){return(t&&(valueFmt=t),n==null)?"":typeof n=="number"?""+num(n):typeof n=="string"?str(n):typeof n=="boolean"?n?"true":"false":n.length?arr(n):obj(n)},JsonViewer=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),Object.defineProperty(t.prototype,"html",{get:function(){return this.json?val(JSON.parse(this.json)):val(this.value)},enumerable:!1,configurable:!0}),__decorate([vue_property_decorator_1.Prop({"default":null})],t.prototype,"value",void 0),__decorate([vue_property_decorator_1.Prop({"default":null})],t.prototype,"json",void 0),__decorate([vue_property_decorator_1.Component({template:'<div class="jsonviewer">\n <div v-html="html"><\/div>\n <span class="clearfix"><\/span>\n <\/div>'})],t)}(vue_property_decorator_1.Vue);exports.JsonViewer=JsonViewer;exports.default=JsonViewer;vue_property_decorator_1.Vue.component("jsonviewer",JsonViewer);
})();
(function(){
"use strict";var vue_1,vue_2;Object.defineProperty(exports,"__esModule",{value:!0});require("./app.scss");require("es6-shim");vue_1=require("vue");vue_2=require("@servicestack/vue");vue_1.default.use(vue_2.default);var App_1=require("./App"),router_1=require("./shared/router"),app=new vue_1.default({el:"#app",render:function(n){return n(App_1.App)},router:router_1.router});
})();
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment