2
0
Fork 0

Make js work agian

This commit is contained in:
Willem 2017-12-23 22:45:27 +01:00
parent 63a761bbc0
commit 3f929f9607
16 changed files with 4258 additions and 130 deletions

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
var config = require('./example-config.json'); var config = require('./example-config.json');
var favicon = require('static-favicon'); //var favicon = require('static-favicon');
var cookieParser = require('cookie-parser') var cookieParser = require('cookie-parser')
var path = require('path'); var path = require('path');
var winston = require('winston'); var winston = require('winston');
@ -46,7 +46,7 @@ var buildOptions = {
} }
tcrud.setup.expressBuild(buildOptions); tcrud.setup.expressBuild(buildOptions);
server.use(favicon()); //server.use(favicon());
server.use(cookieParser(config.options.cookieParser.secretKey)); server.use(cookieParser(config.options.cookieParser.secretKey));
//server.get('/ui/thtml/*', tcrud.setup.express.renderTemplatePath('thtml/')); //server.get('/ui/thtml/*', tcrud.setup.express.renderTemplatePath('thtml/'));

View file

@ -1,4 +1,4 @@
var pgDB = require('pg'); const { Pool } = require('pg');
var pgDBNamed = require('node-postgres-named'); var pgDBNamed = require('node-postgres-named');
module.exports = { module.exports = {
@ -8,8 +8,10 @@ module.exports = {
function load(tcrud) { function load(tcrud) {
const pool = new Pool({connectionString: 'postgres://postgres:postgresql@localhost/moviedb'});
// Create backend with id and uri // Create backend with id and uri
tcrud.backend.database.loadPostgres('pg/moviedb','postgres://postgres:postgresql@localhost/moviedb',pgDB,pgDBNamed); tcrud.backend.database.loadPostgres('pg/moviedb', pool, pgDBNamed);
} }
function setup(tcrud,tcrudModel) { function setup(tcrud,tcrudModel) {

View file

@ -1,4 +1,4 @@
var pgDB = require('pg'); const { Pool } = require('pg');
var pgDBNamed = require('node-postgres-named'); var pgDBNamed = require('node-postgres-named');
module.exports = { module.exports = {
@ -7,8 +7,10 @@ module.exports = {
}; };
function load(tcrud) { function load(tcrud) {
const pool = new Pool({connectionString: 'postgres://postgres:postgresql@localhost/pagila'});
// Create backend with id and uri // Create backend with id and uri
tcrud.backend.database.loadPostgres('pg/pagila','postgres://postgres:postgresql@localhost/pagila',pgDB,pgDBNamed); tcrud.backend.database.loadPostgres('pg/pagila',pool,pgDBNamed);
} }
function setup(tcrud,tcrudModel) { function setup(tcrud,tcrudModel) {

683
example/package-lock.json generated Normal file
View file

@ -0,0 +1,683 @@
{
"name": "node-ff-tcrud-example",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ansi-styles": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz",
"integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg="
},
"ansicolors": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.2.1.tgz",
"integrity": "sha1-vgiVmQl7dKXJxKhKDNvNtivYeu8="
},
"async": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/async/-/async-2.1.4.tgz",
"integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=",
"requires": {
"lodash": "4.17.4"
},
"dependencies": {
"lodash": {
"version": "4.17.4",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
}
}
},
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"requires": {
"core-js": "2.5.2",
"regenerator-runtime": "0.11.1"
}
},
"big-number": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/big-number/-/big-number-0.3.1.tgz",
"integrity": "sha1-rHMCDApZu3nrF8LOLbd/d9l04BM="
},
"bl": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.1.tgz",
"integrity": "sha1-ysMo977kVzDUBLaSID/LWQ4XLV4=",
"requires": {
"readable-stream": "2.2.7"
}
},
"bluebird": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz",
"integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw="
},
"bson": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz",
"integrity": "sha1-k8ENOeqltYQVy8QFLz5T5WKwtyw="
},
"buffer-shims": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz",
"integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E="
},
"buffer-writer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-1.0.1.tgz",
"integrity": "sha1-Iqk2kB4wKa/NdUfrRIfOtpejvwg="
},
"cardinal": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/cardinal/-/cardinal-1.0.0.tgz",
"integrity": "sha1-UOIcGwqjdyn5N33vGWtanOyTLuk=",
"requires": {
"ansicolors": "0.2.1",
"redeyed": "1.0.1"
}
},
"chalk": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
"integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=",
"requires": {
"ansi-styles": "1.0.0",
"has-color": "0.1.7",
"strip-ansi": "0.1.1"
}
},
"colors": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs="
},
"cookie": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
},
"cookie-parser": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.3.tgz",
"integrity": "sha1-D+MfoZ0AC5X0qt8fU/3CuKIDuqU=",
"requires": {
"cookie": "0.3.1",
"cookie-signature": "1.0.6"
}
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"core-js": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.2.tgz",
"integrity": "sha1-vEZIZW59ydyA19PHu8Fy2W50TmM="
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
},
"cycle": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz",
"integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI="
},
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
},
"denque": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/denque/-/denque-1.2.2.tgz",
"integrity": "sha512-x92Ql74lcTbGylXILO9Xf9S0cMpEPP04zVp2bB9e2C7G/n/Q1SgLl78RaSYEPSgpDX9uLgQXCEGAS5BI5dP3yA=="
},
"es6-promise": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz",
"integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q="
},
"esprima": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-3.0.0.tgz",
"integrity": "sha1-U88kes2ncxPlUcOqLnM0LT+099k="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express-winston": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/express-winston/-/express-winston-2.4.0.tgz",
"integrity": "sha1-J6ts2TBT4t/cNbzuoUoHfcfVLkk=",
"requires": {
"chalk": "0.4.0",
"lodash": "4.11.2"
}
},
"eyes": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
"integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"generate-function": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
"integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ="
},
"generic-pool": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/generic-pool/-/generic-pool-3.2.0.tgz",
"integrity": "sha512-JjcXDHT84icN/kFaF5+rNd1trZsgJFVqTSgM9dv6eayxSIQKMq0ilBJ+5pvf0SgimacMlZEsav4oL+4dUE4E2g=="
},
"has-color": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz",
"integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8="
},
"hooks-fixed": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-2.0.2.tgz",
"integrity": "sha512-YurCM4gQSetcrhwEtpQHhQ4M7Zo7poNGqY4kQGeBS6eZtOcT3tnNs01ThFa0jYBByAiYt1MjMjP/YApG0EnAvQ=="
},
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"js-string-escape": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
"integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8="
},
"kareem": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/kareem/-/kareem-1.5.0.tgz",
"integrity": "sha1-4+QQHZ3P3imXadr0tNtk2JXRdEg="
},
"lodash": {
"version": "4.11.2",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.11.2.tgz",
"integrity": "sha1-1rQzixEKWOIdrlzrz9u/0rxM2zs="
},
"lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
},
"long": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz",
"integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s="
},
"lru-cache": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz",
"integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==",
"requires": {
"pseudomap": "1.0.2",
"yallist": "2.1.2"
}
},
"mongodb": {
"version": "2.2.33",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.33.tgz",
"integrity": "sha1-tTfEcdNKZlG0jzb9vyl1A0Dgi1A=",
"requires": {
"es6-promise": "3.2.1",
"mongodb-core": "2.1.17",
"readable-stream": "2.2.7"
}
},
"mongodb-core": {
"version": "2.1.17",
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.17.tgz",
"integrity": "sha1-pBizN6FKFJkPtRC5I97mqBMXPfg=",
"requires": {
"bson": "1.0.4",
"require_optional": "1.0.1"
}
},
"mongoose": {
"version": "4.13.6",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-4.13.6.tgz",
"integrity": "sha512-H+loD0D8UCwGmbOzWV7rZAf6/efRr9CPGB1Bess/IIjiWvpRQNo4zH4UHkueKoEbMWdnSYenjdEL8A0Q8p7JXg==",
"requires": {
"async": "2.1.4",
"bson": "1.0.4",
"hooks-fixed": "2.0.2",
"kareem": "1.5.0",
"lodash.get": "4.4.2",
"mongodb": "2.2.33",
"mpath": "0.3.0",
"mpromise": "0.5.5",
"mquery": "2.3.3",
"ms": "2.0.0",
"muri": "1.3.0",
"regexp-clone": "0.0.1",
"sliced": "1.0.1"
}
},
"mpath": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.3.0.tgz",
"integrity": "sha1-elj3iem1/TyUUgY0FXlg8mvV70Q="
},
"mpromise": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.5.tgz",
"integrity": "sha1-9bJCWddjrMIlewoMjG2Gb9UXMuY="
},
"mquery": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/mquery/-/mquery-2.3.3.tgz",
"integrity": "sha512-NC8L14kn+qxJbbJ1gbcEMDxF0sC3sv+1cbRReXXwVvowcwY1y9KoVZFq0ebwARibsadu8lx8nWGvm3V0Pf0ZWQ==",
"requires": {
"bluebird": "3.5.0",
"debug": "2.6.9",
"regexp-clone": "0.0.1",
"sliced": "0.0.5"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"sliced": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz",
"integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8="
}
}
},
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"mssql": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/mssql/-/mssql-4.1.0.tgz",
"integrity": "sha512-ekht0eILEV0P1CbpkwpAxhgO+/5goYizUJrt7pgDm3fP6lGKe0+8V9jhTvQZ8DPHkycSd0wYGUoz/YA7VN7kQQ==",
"requires": {
"debug": "2.6.9",
"generic-pool": "3.2.0",
"tedious": "2.1.5"
},
"dependencies": {
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
}
}
},
"muri": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/muri/-/muri-1.3.0.tgz",
"integrity": "sha512-FiaFwKl864onHFFUV/a2szAl7X0fxVlSKNdhTf+BM8i8goEgYut8u5P9MqQqIYwvaMxjzVESsoEm/2kfkFH1rg=="
},
"mysql2": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-1.5.1.tgz",
"integrity": "sha1-JBHW+5WK+GsjBLelO8VLJud+aCs=",
"requires": {
"cardinal": "1.0.0",
"denque": "1.2.2",
"generate-function": "2.0.0",
"iconv-lite": "0.4.19",
"long": "3.2.0",
"lru-cache": "4.1.1",
"named-placeholders": "1.1.1",
"object-assign": "4.1.1",
"readable-stream": "2.3.2",
"safe-buffer": "5.1.1",
"seq-queue": "0.0.5",
"sqlstring": "2.3.0"
},
"dependencies": {
"readable-stream": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.2.tgz",
"integrity": "sha1-WgTfBeT1f+Pw3Gj90R3FyXx+b00=",
"requires": {
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "1.0.7",
"safe-buffer": "5.1.1",
"string_decoder": "1.0.3",
"util-deprecate": "1.0.2"
}
}
}
},
"named-placeholders": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.1.tgz",
"integrity": "sha1-O3oNJiA910s6nfTJz7gnsvuQfmQ=",
"requires": {
"lru-cache": "2.5.0"
},
"dependencies": {
"lru-cache": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.0.tgz",
"integrity": "sha1-2COIrpyWC+y+oMc7uet5tsbOmus="
}
}
},
"node-postgres-named": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/node-postgres-named/-/node-postgres-named-2.4.1.tgz",
"integrity": "sha1-GgfQZjaI2V48wQVy04xfUOJyIsk=",
"requires": {
"lodash": "4.11.2"
}
},
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"packet-reader": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-0.3.1.tgz",
"integrity": "sha1-zWLmCvjX/qinBexP+ZCHHEaHHyc="
},
"parseurl": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M="
},
"pg": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/pg/-/pg-7.4.0.tgz",
"integrity": "sha1-4lYGHSxScjw8hY3vuX8RWcpmD4M=",
"requires": {
"buffer-writer": "1.0.1",
"js-string-escape": "1.0.1",
"packet-reader": "0.3.1",
"pg-connection-string": "0.1.3",
"pg-pool": "2.0.3",
"pg-types": "1.12.1",
"pgpass": "1.0.2",
"semver": "4.3.2"
},
"dependencies": {
"semver": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-4.3.2.tgz",
"integrity": "sha1-x6BxWKgL7dBSNVt3DYLWZA+AO+c="
}
}
},
"pg-connection-string": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-0.1.3.tgz",
"integrity": "sha1-2hhHsglA5C7hSSvq9l1J2RskXfc="
},
"pg-pool": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-2.0.3.tgz",
"integrity": "sha1-wCIDLIlJ8xKk+R+2QJzgQHa+Mlc="
},
"pg-types": {
"version": "1.12.1",
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-1.12.1.tgz",
"integrity": "sha1-1kCH45A7WP+q0nnnWVxSIIoUw9I=",
"requires": {
"postgres-array": "1.0.2",
"postgres-bytea": "1.0.0",
"postgres-date": "1.0.3",
"postgres-interval": "1.1.1"
}
},
"pgpass": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.2.tgz",
"integrity": "sha1-Knu0G2BltnkH6R2hsHwYR8h3swY=",
"requires": {
"split": "1.0.1"
}
},
"postgres-array": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-1.0.2.tgz",
"integrity": "sha1-jgsy6wO/d6XAp4UeBEHBaaJWojg="
},
"postgres-bytea": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz",
"integrity": "sha1-AntTPAqokOJtFy1Hz5zOzFIazTU="
},
"postgres-date": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.3.tgz",
"integrity": "sha1-4tiXAu/bJY/52c7g/pG9BpdSV6g="
},
"postgres-interval": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.1.1.tgz",
"integrity": "sha512-OkuCi9t/3CZmeQreutGgx/OVNv9MKHGIT5jH8KldQ4NLYXkvmT9nDVxEuCENlNwhlGPE374oA/xMqn05G49pHA==",
"requires": {
"xtend": "4.0.1"
}
},
"process-nextick-args": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
},
"pseudomap": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
"integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
},
"readable-stream": {
"version": "2.2.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz",
"integrity": "sha1-BwV6y+JGeyIELTb5jFrVBwVOlbE=",
"requires": {
"buffer-shims": "1.0.0",
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "1.0.7",
"string_decoder": "1.0.3",
"util-deprecate": "1.0.2"
}
},
"redeyed": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/redeyed/-/redeyed-1.0.1.tgz",
"integrity": "sha1-6WwZO0DAgWsArshCaY5hGF5VSYo=",
"requires": {
"esprima": "3.0.0"
}
},
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
},
"regexp-clone": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz",
"integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk="
},
"require_optional": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz",
"integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==",
"requires": {
"resolve-from": "2.0.0",
"semver": "5.4.1"
}
},
"resolve-from": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz",
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
},
"safe-buffer": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg=="
},
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg=="
},
"seq-queue": {
"version": "0.0.5",
"resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz",
"integrity": "sha1-1WgS4cAXpuTnw+Ojeh2m143TyT4="
},
"serve-favicon": {
"version": "2.4.5",
"resolved": "https://registry.npmjs.org/serve-favicon/-/serve-favicon-2.4.5.tgz",
"integrity": "sha512-s7F8h2NrslMkG50KxvlGdj+ApSwaLex0vexuJ9iFf3GLTIp1ph/l1qZvRe9T9TJEYZgmq72ZwJ2VYiAEtChknw==",
"requires": {
"etag": "1.8.1",
"fresh": "0.5.2",
"ms": "2.0.0",
"parseurl": "1.3.2",
"safe-buffer": "5.1.1"
}
},
"sliced": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz",
"integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E="
},
"split": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
"requires": {
"through": "2.3.8"
}
},
"sprintf": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.5.tgz",
"integrity": "sha1-j4PjmpMXwaUCy324BQ5Rxnn27c8="
},
"sqlstring": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.0.tgz",
"integrity": "sha1-UluKT9Jtb3GqYegipsr5dtMa0qg="
},
"stack-trace": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
"integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA="
},
"string_decoder": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"requires": {
"safe-buffer": "5.1.1"
}
},
"strip-ansi": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
"integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE="
},
"tedious": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/tedious/-/tedious-2.1.5.tgz",
"integrity": "sha1-hVdNIs3hdp3+TMSg1pcXWxPl0xg=",
"requires": {
"babel-runtime": "6.26.0",
"big-number": "0.3.1",
"bl": "1.2.1",
"iconv-lite": "0.4.19",
"readable-stream": "2.2.7",
"sprintf": "0.1.5"
}
},
"through": {
"version": "2.3.8",
"resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
"integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"winston": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/winston/-/winston-2.4.0.tgz",
"integrity": "sha1-gIBQuT1SZh7Z+2wms/DIJnCLCu4=",
"requires": {
"async": "1.0.0",
"colors": "1.0.3",
"cycle": "1.0.3",
"eyes": "0.1.8",
"isstream": "0.1.2",
"stack-trace": "0.0.10"
},
"dependencies": {
"async": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz",
"integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k="
}
}
},
"xtend": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
"integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
}
}
}

View file

@ -7,15 +7,15 @@
"start": "node example.js" "start": "node example.js"
}, },
"dependencies": { "dependencies": {
"cookie-parser": "1.0.1", "cookie-parser": "^1.4.3",
"debug": "2.2.0", "debug": "^3.1.0",
"express-winston": "0.3.1", "express-winston": "^2.4.0",
"static-favicon": "1.0.0", "mongoose": "^4.13.6",
"winston": "0.7.3", "mssql": "^4.1.0",
"node-postgres-named": "2.2.0", "mysql2": "^1.5.1",
"pg": "4.4.0", "node-postgres-named": "^2.4.1",
"mssql": "2.1.6", "pg": "^7.4.0",
"mysql2": "0.15.8", "serve-favicon": "^2.4.5",
"mongoose": "3.8.13" "winston": "^2.4.0"
} }
} }

View file

@ -5,8 +5,8 @@ module.exports = {
loadModule: function(key,dbModule) { loadModule: function(key,dbModule) {
tcrudSetup.pluginLoad(new DatabasePlugin(key,dbModule)); tcrudSetup.pluginLoad(new DatabasePlugin(key,dbModule));
}, },
loadPostgres: function(key,dbUri,pgDB,pgDBNamed) { loadPostgres: function(key,dbPool,pgDBNamed) {
tcrudSetup.pluginLoad(new DatabasePlugin(key,new PostgresModule(dbUri,pgDB,pgDBNamed))); tcrudSetup.pluginLoad(new DatabasePlugin(key,new PostgresModule(dbPool,pgDBNamed)));
}, },
loadMysql2: function(key,pool) { loadMysql2: function(key,pool) {
tcrudSetup.pluginLoad(new DatabasePlugin(key,new Mysql2Module(pool))); tcrudSetup.pluginLoad(new DatabasePlugin(key,new Mysql2Module(pool)));
@ -18,14 +18,13 @@ module.exports = {
//------- PostgresModule Object //------- PostgresModule Object
function PostgresModule(dbUri,pgDB,pgDBNamed) { function PostgresModule(dbPool,pgDBNamed) {
this.dbUri = dbUri; this.dbPool = dbPool;
this.pgDB = pgDB;
this.pgDBNamed = pgDBNamed; this.pgDBNamed = pgDBNamed;
} }
PostgresModule.prototype.query = function(sqlQuery,params, cb) { PostgresModule.prototype.query = function(sqlQuery,params, cb) {
var self = this; var self = this;
self.pgDB.connect(self.dbUri, function(err, client, done) { self.dbPool.connect(function(err, client, done) {
self.pgDBNamed.patch(client); self.pgDBNamed.patch(client);
client.query(sqlQuery, params, function(err, result) { client.query(sqlQuery, params, function(err, result) {
done(); // release client from pool done(); // release client from pool

View file

@ -18,10 +18,10 @@ module.exports = (function () {
'(^|\\s\\/\\/.*)': '', // rm comment lines '(^|\\s\\/\\/.*)': '', // rm comment lines
'(\\/\\*[\\s\\*\\!][\\s\\S]*?\\*\\/)': '', // rm comment blocks '(\\/\\*[\\s\\*\\!][\\s\\S]*?\\*\\/)': '', // rm comment blocks
}; };
ctx.hostFileCSSNodeModule({file: 'bootstrap.css', path: 'bootswatch/paper', filterRegex: filter}); ctx.hostFileCSSNodeModule({file: 'bootstrap.css', path: 'bootswatch/dist/darkly', filterRegex: filter});
ctx.hostFileJSNodeModule({file: 'bootstrap.js', path: 'bootstrap/dist/js'}); ctx.hostFileJSNodeModule({file: 'bootstrap.js', path: 'bootstrap/dist/js'});
ctx.hostFileCSSFontNodeModule({file: 'glyphicons-halflings-regular.ttf', path: 'bootswatch/fonts/', fontFamily: 'Glyphicons Halflings'}); ctx.hostFileCSSFontNodeModule({file: 'glyphicons-halflings-regular.ttf', path: 'bootstrap/fonts/', fontFamily: 'Glyphicons Halflings'});
}; };
}; };
})(); })();

View file

@ -10,8 +10,8 @@ module.exports = (function () {
}; };
this.configServer = function(ctx) { this.configServer = function(ctx) {
ctx.hostTemplateCSS('css/flot'); //ctx.hostTemplateCSS('css/flot');
ctx.hostTemplateCSS('css/panel'); //ctx.hostTemplateCSS('css/panel');
ctx.hostTemplateCSS('css/style'); ctx.hostTemplateCSS('css/style');
}; };
}; };

View file

@ -3,12 +3,15 @@
tcrudUI.controller('ApplicationController',function($scope,$http,$location,navigationService) { tcrudUI.controller('ApplicationController',function($scope,$http,$location,navigationService) {
console.log('start menu controller'); console.log('start menu controller');
$scope.goLink = function ( path ) { $scope.goLink = function ( path ) {
$location.path( path ); $location.path( path );
console.log('goto link3: '+path);
return false;
}; };
$scope.navigationService = navigationService; $scope.navigationService = navigationService;
$scope.applicationMenu = {}; $scope.applicationMenu = {};
$http.get('<%= troot.tmeta.tserver.tslugs.tbase %>/<%= troot.tmeta.tserver.tslugs.tserver %>/config/menu').success(function(data, status, headers, config) { $http.get('<%= troot.tmeta.tserver.tslugs.tbase %>/<%= troot.tmeta.tserver.tslugs.tserver %>/config/menu').then(function ok(response) {
$scope.applicationMenu = data.data; $scope.applicationMenu = response.data.data;
$scope.applicationMenuKeys = Object.keys(data.data); $scope.applicationMenuKeys = Object.keys(response.data.data);
console.log('Menu keys',$scope.applicationMenuKeys);
}); });
}); });

View file

@ -11,14 +11,19 @@ $(document.createElement('div')).attr('ng-include','\''+serverUrl+'/api/plugin/a
var tcrudUI = angular.module('tcrudUI', ['ngRoute','ngTouch','ngAnimate', 'ui.grid', 'ui.grid.pagination','ui.grid.cellNav', 'ui.grid.edit', 'ui.grid.resizeColumns', 'ui.grid.pinning', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.exporter', 'ui.grid.importer', 'ui.grid.grouping', 'ui.grid.autoResize']). var tcrudUI = angular.module('tcrudUI', ['ngRoute','ngTouch','ngAnimate', 'ui.grid', 'ui.grid.pagination','ui.grid.cellNav', 'ui.grid.edit', 'ui.grid.resizeColumns', 'ui.grid.pinning', 'ui.grid.selection', 'ui.grid.moveColumns', 'ui.grid.exporter', 'ui.grid.importer', 'ui.grid.grouping', 'ui.grid.autoResize']).
config(['$routeProvider', '$locationProvider', '$sceDelegateProvider', function($routeProvider, $locationProvider, $sceDelegateProvider) { config(['$routeProvider', '$locationProvider', '$sceDelegateProvider', function($routeProvider, $locationProvider, $sceDelegateProvider) {
console.log('config angular...');
console.log('config serverUrl: ', serverUrl);
// init routes // init routes
pageRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); }); pageRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); });
crudRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); }); crudRouteInit.forEach(function(init) { init($routeProvider, $locationProvider); });
$sceDelegateProvider.resourceUrlWhitelist(['self',serverUrl+'/**']); $sceDelegateProvider.resourceUrlWhitelist(['self',serverUrl+'/**']);
$routeProvider.otherwise({ redirectTo: '/ui' }); $routeProvider.otherwise({ redirectTo: '/ui' });
$locationProvider.html5Mode({requireBase: false}); $locationProvider.html5Mode({requireBase: false});
console.log('config angular done.');
}]); }]);
tcrudUI.run(['$route', function($route) { tcrudUI.run(['$route', function($route) {

View file

@ -56,8 +56,8 @@ function <%= tview.tlist.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%
}; };
var fetchData = function() { var fetchData = function() {
$http.get('<%= tapiPrefix %>/<%= tview.tlist.tplugin.formatJSON.tslug %>').success(function(data, status, headers, config) { $http.get('<%= tapiPrefix %>/<%= tview.tlist.tplugin.formatJSON.tslug %>').then(function(response) {
$scope.uiTableMain.data = data.data; $scope.uiTableMain.data = response.data.data;
}); });
}; };
@ -71,8 +71,8 @@ function <%= tview.tlist.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%
$location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tedit.tplugin.angular.tslug %>/'+$scope.gridApi.selection.getSelectedRows()[0].country_id); $location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tedit.tplugin.angular.tslug %>/'+$scope.gridApi.selection.getSelectedRows()[0].country_id);
}; };
$http.get('<%= tapiPrefix2 %>').success(function(data, status, headers, config) { $http.get('<%= tapiPrefix2 %>').then(function(response) {
var tview = data.data.tview; var tview = response.data.data.tview;
tview.tlist.tfields.forEach(function (fieldKey) { tview.tlist.tfields.forEach(function (fieldKey) {
var field = tview.tmeta.tfields[fieldKey]; var field = tview.tmeta.tfields[fieldKey];
$scope.uiTableMain.columnDefs.push({ $scope.uiTableMain.columnDefs.push({
@ -91,7 +91,7 @@ function <%= tview.tlist.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%
function <%= tview.tcreate.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tcreate.tplugin.angular.tcontroller.postfix %>(<%= tview.tcreate.tplugin.angular.tcontroller.argu %>) { function <%= tview.tcreate.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tcreate.tplugin.angular.tcontroller.postfix %>(<%= tview.tcreate.tplugin.angular.tcontroller.argu %>) {
$scope.data = {}; $scope.data = {};
$scope.tcreateData = function () { $scope.tcreateData = function () {
$http.post('<%= tapiPrefix %>/<%= tview.tcreate.tplugin.formatJSON.tslug %>', $scope.data).success(function(data) { $http.post('<%= tapiPrefix %>/<%= tview.tcreate.tplugin.formatJSON.tslug %>', $scope.data).then(function(response) {
<% if (tview.tlist) { %> <% if (tview.tlist) { %>
$location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tlist.tplugin.angular.tslug %>'); $location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tlist.tplugin.angular.tslug %>');
<% } else { %> <% } else { %>
@ -106,8 +106,8 @@ function <%= tview.tcreate.tplugin.angular.tcontroller.prefix %><%= tviewCode %>
<% if (tview.tread) { %> <% if (tview.tread) { %>
function <%= tview.tread.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tread.tplugin.angular.tcontroller.postfix %>(<%= tview.tread.tplugin.angular.tcontroller.argu %>) { function <%= tview.tread.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tread.tplugin.angular.tcontroller.postfix %>(<%= tview.tread.tplugin.angular.tcontroller.argu %>) {
$scope.data = {}; $scope.data = {};
$http.get('<%= tapiPrefix %>/<%= tview.tread.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>).success(function(data) { $http.get('<%= tapiPrefix %>/<%= tview.tread.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>).then(function(response) {
$scope.data = data.data; $scope.data = response.data.data;
}); });
<%- include('controller-action-none', {tview: tview,taction: 'tread'}); %> <%- include('controller-action-none', {tview: tview,taction: 'tread'}); %>
} }
@ -117,14 +117,14 @@ function <%= tview.tread.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%
function <%= tview.tedit.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tedit.tplugin.angular.tcontroller.postfix %>(<%= tview.tedit.tplugin.angular.tcontroller.argu %>) { function <%= tview.tedit.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tedit.tplugin.angular.tcontroller.postfix %>(<%= tview.tedit.tplugin.angular.tcontroller.argu %>) {
$scope.data = {}; $scope.data = {};
var fetchData = function() { var fetchData = function() {
$http.get('<%= tapiPrefix %>/<%= tview.tread.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>).success(function(data) { $http.get('<%= tapiPrefix %>/<%= tview.tread.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>).then(function(response) {
$scope.data = data.data; $scope.data = response.data.data;
}); });
}; };
fetchData(); fetchData();
$scope.teditData = function () { $scope.teditData = function () {
$http.put('<%= tapiPrefix %>/<%= tview.tedit.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>, $scope.data ).success(function(data) { $http.put('<%= tapiPrefix %>/<%= tview.tedit.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>, $scope.data ).then(function(response) {
<% if (tview.tread) { %> <% if (tview.tread) { %>
$location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tread.tplugin.angular.tslug %>/' + <%= ejsRouteParams %>); $location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tread.tplugin.angular.tslug %>/' + <%= ejsRouteParams %>);
<% } else { %> <% } else { %>
@ -133,7 +133,7 @@ function <%= tview.tedit.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%
}); });
} }
$scope.tdeleteData = function () { $scope.tdeleteData = function () {
$http.delete('<%= tapiPrefix %>/<%= tview.tdelete.tplugin.formatJSON.tslug %>/'+ <%= ejsRouteParams %>, $scope.data).success(function(data) { $http.delete('<%= tapiPrefix %>/<%= tview.tdelete.tplugin.formatJSON.tslug %>/'+ <%= ejsRouteParams %>, $scope.data).then(function(response) {
<% if (tview.tlist) { %> <% if (tview.tlist) { %>
$location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tlist.tplugin.angular.tslug %>'); $location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tlist.tplugin.angular.tslug %>');
<% } else { %> <% } else { %>
@ -155,12 +155,12 @@ function <%= tview.tedit.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%
<% if (tview.tdelete) { %> <% if (tview.tdelete) { %>
function <%= tview.tdelete.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tdelete.tplugin.angular.tcontroller.postfix %>(<%= tview.tdelete.tplugin.angular.tcontroller.argu %>) { function <%= tview.tdelete.tplugin.angular.tcontroller.prefix %><%= tviewCode %><%= tview.tdelete.tplugin.angular.tcontroller.postfix %>(<%= tview.tdelete.tplugin.angular.tcontroller.argu %>) {
$scope.data = {}; $scope.data = {};
$http.get('<%= tapiPrefix %>/<%= tview.tread.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>).success(function(data) { $http.get('<%= tapiPrefix %>/<%= tview.tread.tplugin.formatJSON.tslug %>/' + <%= ejsRouteParams %>).then(function(response) {
$scope.data = data.data; $scope.data = response.data.data;
console.log('delete obj: '+JSON.stringify(data.data)); console.log('delete obj: '+JSON.stringify(data.data));
}); });
$scope.tdeleteData = function () { $scope.tdeleteData = function () {
$http.delete('<%= tapiPrefix %>/<%= tview.tdelete.tplugin.formatJSON.tslug %>/'+ <%= ejsRouteParams %>, $scope.data).success(function(data) { $http.delete('<%= tapiPrefix %>/<%= tview.tdelete.tplugin.formatJSON.tslug %>/'+ <%= ejsRouteParams %>, $scope.data).then(function(response) {
<% if (tview.tlist) { %> <% if (tview.tlist) { %>
$location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tlist.tplugin.angular.tslug %>'); $location.url('<%= tview.tmeta.tplugin.angular.tbase %>/<%= tview.tslug %>/<%= tview.tlist.tplugin.angular.tslug %>');
<% } else { %> <% } else { %>

View file

@ -1,49 +1,43 @@
<div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="navbar navbar-expand-lg fixed-top navbar-dark bg-primary" role="navigation">
<div class="container"> <div class="container">
<button type="button" class="navbar-menu" ng-click="isMenuExpanded = !isMenuExpanded;isExpanded = false"> <a href="." class="navbar-brand">TCrud</a>
<span class="sr-only">Toggle menu</span> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="icon-bar"></span> <span class="navbar-toggler-icon"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button> </button>
<div class="navbar-collapse navbar-header-left" ng-include="'/api/plugin/angular/thtml/application-top-action'"></div> <div class="collapse navbar-collapse" id="navbarResponsive">
<div class="navbar-collapse navbar-header-left" ng-include="'/api/plugin/angular/thtml/application-top-tabs'"></div> <ul class="navbar-nav">
<button type="button" class="navbar-toggle navbar-header-right" ng-click="isExpanded = !isExpanded;isMenuExpanded = false"> <li class="nav-item dropdown">
<span class="sr-only">Toggle navigation</span> <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" id="themes">Themes <span class="caret"></span></a>
<span class="icon-bar"></span> <div class="dropdown-menu" aria-labelledby="themes">
<span class="icon-bar"></span> <a class="dropdown-item" href="../default/">Default</a>
<span class="icon-bar"></span> <div class="dropdown-divider"></div>
</button> <a class="dropdown-item" href="../cerulean/">Cerulean</a>
<div class="for-sm-view-hide"> <a class="dropdown-item" href="../yeti/">Yeti</a>
<div class="navbar-collapse"> </div>
<div class="navbar-right"> </li>
<ul class="nav navbar-nav navbar-right"><li><a href="/">Logout</a></li></ul> <li class="nav-item">
</div> <a class="nav-link" href="../help/">Help</a>
</div>
</div> <div class="navbar-collapse navbar-header-left" ng-include="'/api/plugin/angular/thtml/application-top-action'"></div>
</div> <div class="navbar-collapse navbar-header-left" ng-include="'/api/plugin/angular/thtml/application-top-tabs'"></div>
<div class="container"> </li>
<div class="for-lg-view-hide"> </ul>
<div class="navbar-collapse" ng-show="isExpanded" ng-click="isExpanded = false"> <ul class="nav navbar-nav ml-auto">
<div class="navbar-right"> <li class="nav-item">
<ul class="nav navbar-nav navbar-right"><li><a href="/">Logout</a></li></ul> <a href="/">Logout</a>
</div> </li>
</div> </ul>
</div> <ul class="nav navbar-nav-menu" ng-repeat="menuKey in applicationMenuKeys">
<div class="for-menu-view-hide"> <li>
<div class="navbar-collapse" ng-show="isMenuExpanded" ng-click="isMenuExpanded = false"> <ul class="nav navbar-nav">
<ul class="nav navbar-nav-menu" ng-repeat="menuKey in applicationMenuKeys"> <li class="navbar-nav-menu-group"><i class="{{applicationMenu[menuKey].icon}}"></i>&nbsp;{{applicationMenu[menuKey].name}}</li>
<li> <li class="" ng-repeat="item in applicationMenu[menuKey].items">
<ul class="nav navbar-nav"> <a ng-click="goLink(item.link)"><i class="{{item.icon}}"></i>&nbsp;{{item.name}}</a>
<li class="navbar-nav-menu-group"><i class="{{applicationMenu[menuKey].icon}}"></i>&nbsp;{{applicationMenu[menuKey].name}}</li> </li>
<li class="" ng-repeat="item in applicationMenu[menuKey].items"> </ul>
<a href="{{item.link}}" ng-click="goLink('{{item.link}}')"><i class="{{item.icon}}"></i>&nbsp;{{item.name}}</a> </li>
</li> <br/>
</ul> </ul>
</li>
<br/>
</ul>
</div>
</div> </div>
</div> </div>
<p>{{navigationService.pageTitle}}</p> <p>{{navigationService.pageTitle}}</p>
@ -65,5 +59,4 @@
</div> </div>
</div> </div>
</div> </div>

View file

@ -39,7 +39,7 @@ function XPageServerPlugins($scope, $http) {
}); });
}; };
$http.get('<%= troot.tmeta.tserver.tslugs.tbase %>/<%= troot.tmeta.tserver.tslugs.tserver %>/<%= troot.tmeta.tplugin.serverInfoPlugins.tslug %>').success(function(data, status, headers, config) { $http.get('<%= troot.tmeta.tserver.tslugs.tbase %>/<%= troot.tmeta.tserver.tslugs.tserver %>/<%= troot.tmeta.tplugin.serverInfoPlugins.tslug %>').then(function(response) {
$scope.serverPlugins = data.data; $scope.serverPlugins = response.data.data;
}); });
} }

View file

@ -19,13 +19,13 @@ crudRouteInit.push(function ($routeProvider, $locationProvider) {
}); });
function XPageServerTechRoutes($scope, $http) { function XPageServerTechRoutes($scope, $http) {
$http.get('<%= troot.tmeta.tserver.tslugs.tbase %>/<%= troot.tmeta.tserver.tslugs.tserver %>/<%= troot.tmeta.tplugin.serverConfigRoutes.tslug %>?groups=api/server,api/plugin,tentity/json,tentity/xml,tentity/rss,tentity/csv,tentity/angular,tentity/config').success(function(data, status, headers, config) { $http.get('<%= troot.tmeta.tserver.tslugs.tbase %>/<%= troot.tmeta.tserver.tslugs.tserver %>/<%= troot.tmeta.tplugin.serverConfigRoutes.tslug %>?groups=api/server,api/plugin,tentity/json,tentity/xml,tentity/rss,tentity/csv,tentity/angular,tentity/config').then(function(response) {
$scope.serverRoutes = data.data; $scope.serverRoutes = response.data.data;
}); });
} }
function XPageServerModelRoutes($scope, $http) { function XPageServerModelRoutes($scope, $http) {
$http.get('<%= troot.tmeta.tserver.tslug %>/json/server/routes?groups=moviedb,pagila').success(function(data, status, headers, config) { $http.get('<%= troot.tmeta.tserver.tslug %>/json/server/routes?groups=moviedb,pagila').then(function(response) {
$scope.serverRoutes = data.data; $scope.serverRoutes = response.data.data;
}); });
} }

3440
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

View file

@ -15,40 +15,41 @@
"url": "http://code.ff.internal/ff/tcrud" "url": "http://code.ff.internal/ff/tcrud"
}, },
"dependencies": { "dependencies": {
"angular": "1.4.8", "angular": "^1.6.7",
"angular-animate": "1.4.8", "angular-animate": "^1.6.7",
"angular-resource": "1.4.8", "angular-resource": "^1.6.7",
"angular-route": "1.4.8", "angular-route": "^1.6.7",
"angular-touch": "1.4.8", "angular-touch": "^1.6.7",
"angular-ui-grid": "3.1.1", "angular-ui-grid": "^4.0.11",
"body-parser": "1.0.1", "body-parser": "^1.18.2",
"bootstrap": "3.3.6", "bootstrap": "^3.3.7",
"bootswatch": "3.3.6", "bootswatch": "^4.0.0-beta.2",
"clone": "1.0.0", "clone": "^2.1.1",
"cors": "2.7.1", "cors": "^2.8.4",
"debug": "2.2.0", "debug": "^3.1.0",
"ejs": "2.3.1", "dev": "^0.1.3",
"es5-ff-spa-loader": "0.3.0", "ejs": "^2.5.7",
"express": "4.11.0", "es5-ff-spa-loader": "^0.3.0",
"fetch": "0.3.x", "express": "^4.16.2",
"flot": "0.8.0-alpha", "fetch": "^1.1.0",
"font-awesome": "4.5.0", "flot": "^0.8.0-alpha",
"fontfaceonload": "0.1.7", "font-awesome": "^4.7.0",
"fontmin": "0.9.1", "fontfaceonload": "^1.0.2",
"fs-extra": "0.16.3", "fontmin": "^0.9.6",
"jquery": "2.1.4", "fs-extra": "^5.0.0",
"node-crud": "2.0.8", "jquery": "^3.2.1",
"raw-body": "1.2.2", "node-crud": "^2.1.4",
"require-all": "2.0.0", "raw-body": "^2.3.2",
"topcoat-fonts": "0.2.4", "require-all": "^2.2.0",
"type-is": "1.1.0", "topcoat-fonts": "^0.3.0",
"underscore": "1.8.2", "type-is": "^1.6.15",
"validate.io": "1.5.0", "underscore": "^1.8.3",
"xml-mapping": "1.6.1" "validate.io": "^2.0.7",
"xml-mapping": "^1.7.1"
}, },
"devDependencies": { "devDependencies": {
"mocha": "2.1.0", "mocha": "4.0.1",
"mocha-jenkins-reporter": "0.1.4", "mocha-jenkins-reporter": "0.3.10",
"mocha-jshint": "0.0.9" "mocha-jshint": "2.3.1"
} }
} }