OpenDroneMap-WebODM/coreplugins/cloudimport/templates/load_buttons.js

31 wiersze
820 B
JavaScript
Czysty Zwykły widok Historia

2019-08-29 02:16:39 +00:00
PluginsAPI.Dashboard.addNewTaskButton(
["cloudimport/build/ImportView.js"],
function(args, ImportView) {
2019-09-07 14:00:26 +00:00
return React.createElement(ImportView, {
onNewTaskAdded: args.onNewTaskAdded,
projectId: args.projectId,
apiURL: "{{ api_url }}",
});
2019-08-29 02:16:39 +00:00
}
);
PluginsAPI.Dashboard.addTaskActionButton(
["cloudimport/build/TaskView.js", "cloudimport/build/TaskView.css"],
2019-09-08 21:36:07 +00:00
function(args, TaskView) {
var reactElement;
$.ajax({
url: "{{ api_url }}/projects/" + args.task.project + "/tasks/" + args.task.id + "/checkforurl",
dataType: 'json',
async: false,
success: function(data) {
if (data.folder_url) {
2019-09-08 21:36:07 +00:00
reactElement = React.createElement(TaskView, {
folderUrl: data.folder_url,
});
}
}
});
2019-09-08 21:36:07 +00:00
return reactElement;
}
);