diff --git a/webui/server/index.js b/webui/server/index.js index 49b5bea17..2d4ce3d51 100644 --- a/webui/server/index.js +++ b/webui/server/index.js @@ -34,13 +34,13 @@ co(function* () { } const db = yield mongoose.connect(process.env.DB_URI) - // FIXME : we need to implement landing page for inserting admin account - Account.findByUsername('admin', true, (err, account) => { + Account.count((err, count) => { if (err) { console.error(err); throw err; } - if (!account) { + + if (!count) { const newAccount = new Account(); newAccount.username = 'admin'; newAccount.roles = [ 'admin' ]; diff --git a/webui/src/components/Account/Edit.js b/webui/src/components/Account/Edit.js index e6bdd7131..e4bb09ec3 100644 --- a/webui/src/components/Account/Edit.js +++ b/webui/src/components/Account/Edit.js @@ -12,6 +12,7 @@ const schema = { "type": "string", "title": "Username*", "required": true, + "maxLength": 24 }, "roles": { "type" : "array", diff --git a/webui/src/components/Base/Sidebar.js b/webui/src/components/Base/Sidebar.js index 75c91acc5..521b4bcb3 100644 --- a/webui/src/components/Base/Sidebar.js +++ b/webui/src/components/Base/Sidebar.js @@ -4,8 +4,9 @@ import styled from 'styled-components'; import { media, transitions } from 'helpers/style-utils'; import oc from 'open-color'; -import SubscriberIcon from 'react-icons/lib/md/person-add' -import ProfileIcon from 'react-icons/lib/md/folder-shared'; +import SubscriberIcon from 'react-icons/lib/md/person-add'; +import ProfileIcon from 'react-icons/lib/md/content-copy'; +import AccountIcon from 'react-icons/lib/md/vpn-key'; const Menu = styled.div` display: block; @@ -89,7 +90,7 @@ const Sidebar = ({ isOpen, width, selectedView, onSelectView }) => ( Profile - + Account diff --git a/webui/src/components/Profile/Edit.js b/webui/src/components/Profile/Edit.js index 2485cb5de..4c3e1bb3d 100644 --- a/webui/src/components/Profile/Edit.js +++ b/webui/src/components/Profile/Edit.js @@ -12,6 +12,7 @@ const schema = { "type": "string", "title": "Title*", "required": true, + "maxLength": 24 }, "security": { "title": "",