Coder Social home page Coder Social logo

express-admin's Introduction

express-admin's People

Contributors

evcordeiro avatar guoxiangyang avatar joshuakarjala avatar philippwiddra avatar roberto-alexis avatar shortstuffsushi avatar simov avatar sochix avatar therichu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express-admin's Issues

Use knexjs instead of raw queries

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.

Hide fields just in inline view

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

Get error when try to run node app

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

"Malformed" data flagged, cannot save data.

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

Radio input with default value

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)..

url field type

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 :/

Select input with static values

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']"
},

Roles/Groups/Permissions

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?

Remote sql server

Is it possible to specify remote host and port number for mysql database in the config.json file?

Add new item in Many to many relation

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.

Attack csrf

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 !!!!

Add custom class attribute

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 ?

custom schema name is not honored

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

Theme files not working

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

Building a Website with Express-Admin

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

Search option on table view

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.

Timepicker

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

special characters not being escaped in sql queries

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.

Error: null value in column "createdAt" violates not-null constraint.

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 ?

Disable pagination

Hi all,

Can i disable pagination in list view and show all data in the same page?
and how i can do it.

Using express-admin with mutiple column primary key

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?

Password issue

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?

Is there a possibility to run the admin on another route / integrate it in another express app?

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">&nbsp;</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>

German translation needed

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!

Disable the display of "view4" in mainview

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

Self-reference

Trying to self-reference on a oneToMany relationship ("Parent" column) breaks the area with ER_NONUNIQ_TABLE.

Delete as Boolean or TimeStamp or DateTime

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.

File uploads

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?

Default theme

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

Express 4.0

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.

EADDRINUSE

My configuration:

  • node js : v0.10.28
  • latest version of express-admin

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)

some flaws in generation of settings.json

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.

Session key for better embedding.

 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"});

SQLite as DB engine

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.

File Upload

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

Select Options

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?

Support for S3 or cloudinary for images

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.

Add checkbox input

Hi All,

Thanks for the had work and It will awesome if we will have the ability to add checkbox inputs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.