/* * Copyright 2007-2017 Charles du Jeu - Abstrium SAS * This file is part of Pydio. * * Pydio is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Pydio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Pydio. If not, see . * * The latest code can be found at . */ const React = require('react') const {muiThemeable} = require('material-ui/styles') const {Paper, Card, CardTitle, CardMedia, CardActions, CardHeader, CardText, FlatButton, List, ListItem, Divider, IconButton, FontIcon} = require('material-ui') import {MessagesConsumerMixin} from '../util/Mixins' const shuffle = require('lodash.shuffle') let Dashboard = React.createClass({ mixins: [MessagesConsumerMixin], getInitialState: function(){ return {kb: []}; }, componentDidMount: function(){ PydioApi.getClient().loadFile('plugins/access.ajxp_conf/res/i18n/kb.json', (transport) => { const data = transport.responseJSON; this.setState({kb: data}); }); }, getOpenIcon: function(link){ return ( {window.open(link)}} /> ); }, getDocButton: function(icon, message, link){ return (
{message}
} fullWidth={true} onTouchTap={()=>{window.open(link)}} />
); }, welcomeClick: function(e){ if(e.target.getAttribute('data-path')){ const p = e.target.getAttribute('data-path'); this.props.pydio.goTo(p); } }, render: function(){ const horizontalFlex = {display:'flex', width:'100%'}; const verticalFlex = {display:'flex', flexDirection:'column', height: '100%'}; const flexFill = {flex:1}; const flexFillNo = {width:120}; const paperStyle = {width:500, marginLeft:12, marginTop: 12}; const flexContainerStyle = {...verticalFlex}; const {primary1Color, accent1Color, accent2Color} = this.props.muiTheme.palette; const textLinkStyle = {cursor: 'pointer', color: accent1Color}; const MEDIA_TEST_CARD = ( } >
); const {pydio} = this.props; const message = (id) => {return pydio.MessageHash['admin_dashboard.' + id]}; const OPEN_IN_NEW_ICON = ; // ADMIN GUIDE BUTTONS const guidesButtons = [ {icon:'clock-start', id:'start', link:'https://pydio.com/en/docs/v8/getting-started'}, {icon:'network', id:'ws', link:'https://pydio.com/en/docs/v8/setup-workspaces-and-users'}, {icon:'account-multiple', id:'users', link:'https://pydio.com/en/docs/v8/groups-admin-and-delegation'}, {icon:'settings', id:'parameters', link:'https://pydio.com/en/docs/v8/pydio-advanced-configuration'}, {icon:'professional-hexagon', id:'advanced', link:'https://pydio.com/en/docs/v8/pydio-advanced-configuration'} ]; // DOCS LIST let kbItems = []; shuffle(this.state.kb).forEach((object) => { kbItems.push(); kbItems.push(); }); // Remove last divider if(kbItems.length) kbItems.pop(); return (