simov / express-admin Goto Github PK
View Code? Open in Web Editor NEWMySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
License: MIT License
MySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
License: MIT License
Hi,
I have a url field type, and i want to display it in the list view as a link.
I made some changes. in the setting file i add "url": true
"listview": { "show": true, "url": true },
and in the listview.js:
{{^mtm}} {{#listview.url}} <a href="{{.}}" title="{{.}}" target="_blank">{{.}}</a> {{/listview.url}} {{^listview.url}} {{.}} {{/listview.url}} {{/mtm}}
But nothing change :/
Hi, There's a command to add a new admin user ?
Hi!
I was trying to use express-admin with postgresql database.
My tables are placed in a schema with custom name.
After creating initial configuration I saw all my tables from custom schema at http://localhost:3000/ but if I click on any table name or on the plus sign, it spits a small stack trace
error: relation "vendor" does not exist
at Connection.parseE (/home/aol/develop/web/express-admin/node_modules/express-admin/node_modules/pg/lib/connection.js:558:11)
at Connection.parseMessage (/home/aol/develop/web/express-admin/node_modules/express-admin/node_modules/pg/lib/connection.js:387:17)
at null.<anonymous> (/home/aol/develop/web/express-admin/node_modules/express-admin/node_modules/pg/lib/connection.js:92:20)
at Socket.EventEmitter.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:746:14)
at Socket.EventEmitter.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:408:10)
at emitReadable (_stream_readable.js:404:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
GET /vendor/add 500 5ms - 820b
After some digging I've managed to enable sql queries logging and found out that schema name is not present in the query:
SELECT "vendor"."id" AS __pk,"vendor"."name","vendor"."id" FROM "vendor" WHERE "id"=null ;
As a quick test I've hacked into utils/query.js and hardcoded schema name into queries, which proved the root cause of the issue - the aforementioned error disappeared.
Unfortunately, I do not have much free time now to wrap my head around the express-admin sources to contribute a fix, but I'd be glad if this issue would be resolved soon.
Thanks in advance,
Andrey
Trying to self-reference on a oneToMany relationship ("Parent" column) breaks the area with ER_NONUNIQ_TABLE.
Hi,
There aren't not any token in the form, i try to change data select with some things don't exit in the database => the item was saved !!!!
Hello Guys,
It looks like an awesome product. Can you help me know how I can set the theme for it please. The present admin panel shows css
My configuration:
My config.json:
{
"mysql": {
"database": "xxxxx",
"user": "xxxxx",
"password": "xxxxx"
},
"server": {
"port": 3306
},
"app": {
"layouts": true,
"themes": true,
"languages": true
}
}
The error:
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1042:14)
at listen (net.js:1064:10)
at Server.listen (net.js:1138:5)
at Function.app.listen (/home/xxxxxx/node_modules/express-admin/node_modules/express/lib/application.js:533:24)
Hi,
Do we have support for uploading images to S3 / cloudinary from the upload type control.
I want to upload images to my S3 account.
Thoughts??
Thanks for creating such a wonderful module.
In MySql it is possible to have tables with multiple columns in the primary key for example:
CREATE TABLE users (
first_name VARCHAR(50),
last_name VARCHAR(50),
address TEXT,
PRIMARY KEY (first_name, last_name)
);
I currently have such a table, and want to use express-admin, however it seems that the settings.json file only allows for one column value to be put in the pk
field.
The result is that I can see a list view of my table, but am not able to select any individual record to edit it.
Is there any solution for this?
Hi,
Thx for add this new input type in the new version, i think that's miss something, in the add new item view. the false option should be defined as default value(checked)..
Is there a way to integrate the express-admin into an existing express-app in a way that it is accessible under a specific route, other than /
?
Normally the following code should work and display the express-admin over the route /admin
. The problem is it redirects normally (to /admin/login
) but only returns a part of the page it normally should (the returning html is appended at the end).
If this approach does not work at all, is there an other option for running the page as part of another project?
var express = require('express');
var expressAdmin = require('express-admin');
var app = express();
app.use('/static', express.static(__dirname + '/static/'));
app.get('/', function(req, res){
res.send('Hello World');
});
var expressAdminArgs = {
dpath: './express-admin-config/',
config: require('./express-admin-config/config.json'),
settings: require('./express-admin-config/settings.json'),
custom: require('./express-admin-config/custom.json'),
users: require('./express-admin-config/users.json')
};
expressAdmin.initDatabase(expressAdminArgs, function (err) {
if(err) {
console.log(err);
} else {
expressAdmin.initSettings(expressAdminArgs);
// Especially this lines are interesting:
var admin = expressAdmin.initServer(expressAdminArgs);
app.use('/admin', admin);
app.listen(3000);
}
});
The response for http://localhost/admin/login
:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<link rel="shortcut icon" href="/express-admin/favicon.ico" />
<link id="bootstrap" href="" rel="stylesheet" type="text/css" media="all" />
</head>
<body id="express-admin" class="container">
<div id="wrapper">
<section id="content">
</section>
<div id="footer-push"> </div>
</div>
<footer>
<p><small><a href="http://simov.github.io/express-admin-site/" target="_blank" class="text-muted">Express Admin</a></small></p>
</footer>
</body>
</html>
While this error occurs, mysql server needs to be reconnected. https://github.com/felixge/node-mysql#server-disconnects
Hi,
The searching in list view pages, is it possible ?
Is it possible to use a SQLite file as database?
This would be very convenient for some cases where embedded databases are used.
Most (all?) of the calls should work like in SQL i guess.
Hi all,
Can i add custom class for each field: by adding it in setting file or to check the name of field in form template ?
Hi, when i start the server, i get in the first load (login page) an alert "Access denied!" (without any submitting)
path.js:116 throw new TypeError('Arguments to path.resolve must be strings');
^
TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (path.js:116:15)
at Object. (C:\nodejs\express_admin\app.js:9:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
Seems like the queries are pretty standard, which would make them an ideal candidate for knexjs. Knex supports the same databases, which would cut your code base down so there is less to manage.
In case file upload option is used, and the file name contains 'space' character, it's file url wont work
When creating entries through admin interface, sql throws up error incase entries contain special characters like ' or ".
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Cox',created='2013-12-12',city_id=1 WHERE id
=1' at line 1.
Hi again, i am having this issue creating a new entry in my database.
Actually i don't have this report on local (dev) environnement wich works with mysql
but it still don't assign the createdAt or updatedAt fields.
MariaDB [db_dev]> select * from Subjects;
+----------------+-----------------+----+---------------------+---------------------+
| name | level | id | createdAt | updatedAt |
+----------------+-----------------+----+---------------------+---------------------+
| name | level | 1 | 0000-00-00 00:00:00 | 0000-00-00 00:00:00 |
+----------------+-----------------+----+---------------------+---------------------+
But in my production environnement on pg it throws me this error each time i try a save.
i don't know if it's related i am using sequelize to having my model:
so my model subjects is :
module.exports = function(sequelize, DataTypes) {
return Subject = sequelize.define("Subject", {
name: DataTypes.STRING,
level: DataTypes.STRING
});
}
and my database table looks like :
+-----------+--------------+------+-----+---------+------------------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+------------------------------------+
| name | varchar(255) | YES | | NULL | |
| level | varchar(255) | YES | | NULL | |
| id | int(11) | NO | PRI | NULL | auto_increment |
| createdAt | datetime | NO | | NULL | |
| updatedAt| datetime | NO | | NULL | |
+-----------+--------------+------+-----+---------+-------------------------------------+
and the table on settings.json :
"Subjects": {
"slug": "Subjects",
"table": {
"name": "Subjects",
"pk": "id",
"verbose": "Subjects"
},
"columns": [
{
"name": "name",
"verbose": "name",
"control": {
"text": true
},
"type": "varchar(255)",
"allowNull": true,
"defaultValue": null,
"listview": {
"show": true
},
"editview": {
"show": true
}
},
{
"name": "level",
"verbose": "level",
"control": {
"text": true
},
"type": "varchar(255)",
"allowNull": true,
"defaultValue": null,
"listview": {
"show": true
},
"editview": {
"show": true
}
},
{
"name": "id",
"verbose": "id",
"control": {
"text": true
},
"type": "int(11)",
"allowNull": false,
"defaultValue": null,
"listview": {
"show": false
},
"editview": {
"show": false
}
},
{
"name": "createdAt",
"verbose": "createdAt",
"control": {
"text": true
},
"type": "datetime",
"allowNull": false,
"defaultValue": null,
"listview": {
"show": false
},
"editview": {
"show": false
}
},
{
"name": "updatedAt",
"verbose": "updatedAt",
"control": {
"text": true
},
"type": "datetime",
"allowNull": false,
"defaultValue": null,
"listview": {
"show": false
},
"editview": {
"show": false
}
}
],
"mainview": {
"show": true
},
"listview": {
"order": {},
"page": 25
},
"editview": {
"readonly": false
}
}
So i am looking for a way to make them be setted on Actual time automaticly is that possible ?
Are there any plans to create permissions?
i.e. Some users being able to access only parts of the admin.
If there are, what are the considerations on this feature up to now?
Hey @philippwiddra can you translate a few words for me?
I recently added a few more keys inside config/lang/de.json
like: access-denied, find-user, invalid-password, order, clear, asc, desc
Can you pull the latest master into a new branch of your repository, translate the words and make a pull request?
Thanks!
From what I gather, there's no option to customize how deletion is dealt with. In many cases we want to "soft delete" records so as not to lose the information. If this is not a feature, it could be a great addition to express-admin.
Hi,
Is the many to one relation can be displayed in list view?
From what I gather, selects are simply Arrays with Values, and the Value is both the value
and the "text" of the option. i.e.
"control": {
"select": true,
"options": [
"Value1",
"Value2",
]
},
Returns
<select>
<option value="Value1">Value1</option>
<option value="Value2">Value2</option>
</select>
I believe it would be pretty easy to change this to also accept objects, with
{ valueKey: "Verbose" }
. So the text on the option would be the Verbose
, and the value of the option would be the object key.
i.e.
<option value="valueKey">Verbose</option>
It also could be done while still accepting arrays, which would make the change rather harmless.
What do you guys think? Is there something like that in the making?
Hi all,
Can i disable pagination in list view and show all data in the same page?
and how i can do it.
Hi,
In oneToMany relation, in case we have "pk" with a string type we get a prob in edit view.
How do we set the path for the uploaded file? If there's a way, this should be documented, if there isn't, I suggest we flag this as a feature, I'm gonna need it and I have no problems building it into express-admin and making the pull request. :D
Hi guys, thanks for your app.
I would know if it's possible, somehow, to run a script at object's creation to fill a column.
Thx
I have a table postgresql defined as
CREATE TABLE store.testtbl
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
parent uuid NOT NULL,
name character varying NOT NULL,
CONSTRAINT testtbl_pk PRIMARY KEY (id ),
CONSTRAINT testtbl_uniq_id_pid UNIQUE (id , parent )
)
WITH (
OIDS=FALSE
);
which yeilds the following generation of settings.json:
===== skip ===
"testtbl": {
"slug": "testtbl",
"table": {
"name": "testtbl",
"pk": "",
"verbose": "testtbl"
},
"columns": [
{
"name": "name",
"verbose": "name",
"control": {
"text": true
},
"type": "varchar(null)",
"allowNull": false,
"defaultValue": null,
"listview": {
"show": true
},
"editview": {
"show": true
}
},
{
"name": "parent",
"verbose": "parent",
"control": {
"text": true
},
"type": "uuid",
"allowNull": false,
"defaultValue": null,
"listview": {
"show": true
},
"editview": {
"show": true
}
},
{
"name": "id",
"verbose": "id",
"control": {
"text": true
},
"type": "uuid",
"allowNull": false,
"defaultValue": "uuid_generate_v4()",
"listview": {
"show": true
},
"editview": {
"show": true
}
}
],
"mainview": {
"show": true
},
"listview": {
"order": {},
"page": 25
},
"editview": {
"readonly": false
}
},
===== skip ===
While it is not absolutely clear, why "pk"
is left empty, "type": "varchar(null)"
is definitely a flaw which leads to problems with form validation during record editing.
This is more of a question than an issue. Is it possible to use this application to build a website.
For instance I would like to setup my backend using Express-Admin. What would be the best way to create an express website that will look at my pages and content then render them to the browser. Essentially like a CMS. Is this possible or is this not what express-admin is for ?
Thank you in advance.
Ryan
I have an Raspberry PI running,
node app.js /root/config
then i give my password to the database (MariaDB (compatible with Mysql))
and enter the password for the new admin user,
but when i type it in the gui, it prompts not the right password... (wtf)
Is there any reason for this?
How do I display values like COUNT, AVG and SUM from the database?
var app = express()
.set('views', path.resolve(__dirname, './views'))
.set('view engine', 'html')
.engine('html', consolidate.hogan)
.use(express.logger('dev'))
.use(express.bodyParser())
.use(express.cookieParser('very secret - required'))
.use(express.session())
.use(r.auth.status)// session middleware
.use(express.csrf())
.use(express.methodOverride())
.use(express.static(path.join(__dirname, 'public')))
.use(express.static(path.join(__dirname, 'node_modules/express-admin-static')));
The session here has no key set. If embedding express-admin into another expressjs app, session conflict seems to happen.(From my own experience, I fixed it by specifying another key for the main app) It should be a good idea to use
use(express.session({key: "express-admin"});
Hi,
In case we have many to many relation and we try to add new item in the select multiple (not to select exsiting one), we get this link "click to add" but this link don't work.
Hi All,
Thanks for the had work and It will awesome if we will have the ability to add checkbox inputs.
Is it possible to create tables + admin config having files titles as table columns and uploading files ( like videos and images) to the server using express-admin? Or should that be created as a separate view?
Is it possible to specify remote host and port number for mysql database in the config.json file?
Hi again,
how can i change the default theme with another theme to be the new default one.(but not with the theme button), thx
Is there btw a configurable search option for table views? Let's say I have 50000 records, it's quite cumbersome to page through them. Some config for Search over "columns: [...] would be already an improvement.
Hi,
I case i want to disable the display of "view4" in "mainview":
"view4": {
"app": {
"path" : "/var/www/myProjet/custom/app4/app",
"slug": "view4",
"verbose": "Breadcrumbs",
"mainview": {
"show": false // I change this
}
}
}
I got this problem:
Cannot set property 'header' of undefined at exports.admin
Hi,
When i'm add "root": "/admin" in config.json. i get this message "This webpage has a redirect loop"
Hi there. Wondering if you're considering bumping to Express 4.0 any time soon. We're consuming Express-Admin in our app, and we're on 4.0, but when we pass that app reference to the Admin app, we get all the 4.0 warnings (as you might expect). At any rate, I'm just curious if you've thought about making the jump. I could PR the necessary updates, if you'd like.
Hi again,
I have a specific need, i want to hide a field(i my case a select) just in inline view. I peeked in the source code but I couldn't find how to make it work, any help plz.
thx
Hi guys thanks for work,
I wonder if you can implement an option to date control like a timepicker
"control": {
"Date": true,
"dissable_date": true,
"dissable_time": false
}
Thanks
I have a public schema but keep getting this error when trying to run the admin.
Would it be possible to upload files into blob fields?
Hi,
there is a solution to make for select input options with static values (not from DB but added manually), for example
"control": {
"select": true,
"options": "['Yes' , 'No']"
},
This is my first go round with a tool like this, so it is quite possible I'm experiencing an issue related to mis-configuration of my server. Anyway, I'm using this to keep an eye on my MPOS cryptocoin pools databases. In the "Shares" section, every user's share is logged with a timestamp, like so: Thu Jun 19 2014 20:04:31 GMT-0400 (EDT)
It is flagging the timestamps as "Malformed" and won't allow me to save data in other fields as a result. Is there something I can set to have it ignore the malformed bits? I wonder if the timestamp problem is due to some mis-configuration on my end?
Very nice tool, by the way! Much more convenient and tons easier to use than mySQL Workbench or phpmyadmin and others!
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.