-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Realtime support with Sockets-io (#102)
* Added socket to development envirment * Realtime image locking * Image locking fixes (#94) * Realtime annotation collaberation * Removed autosave * Production socket server * Fixed annotation session changing * Username duplication errror * Socket connection toastr * Navbar backend status * Fixed mobile navbar text alignment * Tasks (#103) * Created task model * Tasks webpage * Webpage updates * Create scan task * Realtime task progress updates and scan example task * Formatting * Created scanning task (#101) * Added tasks webpage to navbar * Delete tasks * Created task javascript model * Datasets javascript model * Import task * Task completion flag * Fixed coco annotation importer * Show only log warnings/errors * Login disabled sockets * Removed exporting of empty segmentations * Fixed production envirment * Added secret key to compose file * Connection lost warning, & formatting * Warning and error updates for tasks * Created admin model * Created undo model * Added dataset name to navbar (#88)
- Loading branch information
Showing
45 changed files
with
4,331 additions
and
3,014 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
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,51 @@ | ||
from flask_restplus import Namespace, Resource, reqparse | ||
from flask_login import login_required, current_user | ||
|
||
from ..util import query_util | ||
from ..config import Config | ||
from ..models import TaskModel | ||
|
||
|
||
api = Namespace('tasks', description='Task related operations') | ||
|
||
|
||
@api.route('/') | ||
class Task(Resource): | ||
@login_required | ||
def get(self): | ||
""" Returns all tasks """ | ||
query = TaskModel.objects.only( | ||
'group', 'id', 'name', 'completed', 'progress', | ||
'priority', 'creator', 'desciption', 'errors', | ||
'warnings' | ||
).all() | ||
return query_util.fix_ids(query) | ||
|
||
|
||
@api.route('/<int:task_id>') | ||
class TaskId(Resource): | ||
@login_required | ||
def delete(self, task_id): | ||
""" Deletes task """ | ||
task = TaskModel.objects(id=task_id).first() | ||
|
||
if task is None: | ||
return {"message": "Invalid task id"}, 400 | ||
|
||
if not task.completed: | ||
return {"message": "Task is not completed"}, 400 | ||
|
||
task.delete() | ||
return {"success": True} | ||
|
||
|
||
@api.route('/<int:task_id>/logs') | ||
class TaskId(Resource): | ||
@login_required | ||
def get(self, task_id): | ||
""" Deletes task """ | ||
task = TaskModel.objects(id=task_id).first() | ||
if task is None: | ||
return {"message": "Invalid task id"}, 400 | ||
|
||
return {'logs': task.logs} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.