This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[action.scheduler] Create simple react dashboard for enterprise admin…
… panel. Just trigger same ol' actions.
- Loading branch information
Showing
5 changed files
with
204 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = function(grunt) { | ||
grunt.initConfig({ | ||
babel: { | ||
options: {}, | ||
|
||
dist: { | ||
files: [ | ||
{ | ||
expand: true, | ||
cwd: 'react/', | ||
src: ['**/*.js'], | ||
dest: 'build/', | ||
ext: '.js' | ||
} | ||
] | ||
} | ||
}, | ||
watch: { | ||
js: { | ||
files: [ | ||
"react/**/*" | ||
], | ||
tasks: ['babel'], | ||
options: { | ||
spawn: false | ||
} | ||
} | ||
} | ||
}); | ||
grunt.loadNpmTasks('grunt-babel'); | ||
grunt.loadNpmTasks('grunt-contrib-watch'); | ||
grunt.registerTask('default', ['babel']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "action.scheduler", | ||
"version": "6.2.0", | ||
"description": "", | ||
"source_path":"react", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "Abstrium SAS", | ||
"license": "AGPL", | ||
"devDependencies": { | ||
"grunt": "~0.4.5", | ||
"grunt-babel": "~5.0.3", | ||
"grunt-contrib-watch": "~0.6.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
(function(global) { | ||
|
||
var MessagesConsumerMixin = AdminComponents.MessagesConsumerMixin; | ||
|
||
var Board = React.createClass({ | ||
|
||
mixins:[MessagesConsumerMixin], | ||
|
||
keys: { | ||
'label':{label:'Label', message:'action.scheduler.12'}, | ||
'schedule':{label:'Schedule', message:'action.scheduler.2'}, | ||
'action_name':{label:'Action', message:'action.scheduler.1'}, | ||
'repository_id':{label:'Workspace', message:'action.scheduler.4s'}, | ||
'user_id':{label:'User(s)', message:'action.scheduler.17'}, | ||
'NEXT_EXECUTION':{label:'Next Execution', message:'action.scheduler.3'}, | ||
'LAST_EXECUTION':{label:'Last Execution', message:'action.scheduler.14'}, | ||
'STATUS':{label:'Status', message:'action.scheduler.13'} | ||
}, | ||
|
||
showTaskCreator: function(){ | ||
global.pydio.Controller.fireAction("scheduler_addTask"); | ||
}, | ||
|
||
runAllTasks: function(){ | ||
global.pydio.Controller.fireAction("scheduler_runAll"); | ||
}, | ||
|
||
showCronExpression: function(){ | ||
global.pydio.Controller.fireAction("scheduler_generateCronExpression"); | ||
}, | ||
|
||
render: function(){ | ||
|
||
return ( | ||
<div className="main-layout-nav-to-stack workspaces-board"> | ||
<div className="left-nav vertical-layout" style={{width:'100%', backgroundColor:'white'}}> | ||
<ReactMUI.Paper zDepth={0} className="vertical-layout layout-fill"> | ||
<div className="vertical-layout workspaces-list layout-fill"> | ||
<h1 className="hide-on-vertical-layout">{this.context.getMessage('18', 'action.scheduler')}</h1> | ||
<div className="button-container"> | ||
<ReactMUI.FlatButton primary={true} label={'+ ' + this.context.getMessage('8', 'action.scheduler')} onClick={this.showTaskCreator}/> | ||
<ReactMUI.FlatButton secondary={true} label={this.context.getMessage('15', 'action.scheduler')} onClick={this.runAllTasks} /> | ||
<ReactMUI.FlatButton secondary={true} label={this.context.getMessage('20', 'action.scheduler')} onClick={this.showCronExpression} /> | ||
</div> | ||
<ReactPydio.SimpleList | ||
node={this.props.currentNode} | ||
dataModel={this.props.dataModel} | ||
className="scheduler-list layout-fill" | ||
actionBarGroups={['get']} | ||
infineSliceCount={1000} | ||
tableKeys={this.keys} | ||
elementHeight={{ | ||
"max-width:480px":201, | ||
"(min-width:480px) and (max-width:760px)":80, | ||
"min-width:760px":ReactPydio.SimpleList.HEIGHT_ONE_LINE | ||
}} | ||
/> | ||
|
||
</div> | ||
</ReactMUI.Paper> | ||
</div> | ||
</div> | ||
); | ||
|
||
} | ||
|
||
}); | ||
|
||
global.Scheduler = { | ||
Board: Board | ||
}; | ||
|
||
})(window); |