Skip to content

Commit

Permalink
React & Antd UI: Model manager (cvat-ai#856)
Browse files Browse the repository at this point in the history
* Supported git to create and sync
* Updated antd
* Updated icons
* Improved header
* Top bar for models & empty models list
* Removed one extra reducer and actions
* Removed one extra reducer and actions
* Crossplatform css
* Models reducers, some models actions, base for model list, imrovements
* Models list, ability to delete models
* Added ability to upload models
* Improved form, reinit models after create
* Removed some importants in css
* Model running dialog window, a lot of fixes
  • Loading branch information
bsekachev authored and Chris Lee-Messer committed Mar 5, 2020
1 parent 31232b8 commit 1c93b58
Show file tree
Hide file tree
Showing 69 changed files with 3,051 additions and 766 deletions.
5 changes: 5 additions & 0 deletions cvat-core/src/api-implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@
return result;
};

cvat.server.request.implementation = async (url, data) => {
const result = await serverProxy.server.request(url, data);
return result;
};

cvat.users.get.implementation = async (filter) => {
checkFilter(filter, {
self: isBoolean,
Expand Down
16 changes: 16 additions & 0 deletions cvat-core/src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,22 @@ function build() {
.apiWrapper(cvat.server.authorized);
return result;
},
/**
* Method allows to do requests via cvat-core with authorization headers
* @method request
* @async
* @memberof module:API.cvat.server
* @param {string} url
* @param {Object} data request parameters: method, headers, data, etc.
* @returns {Object | undefined} response data if exist
* @throws {module:API.cvat.exceptions.PluginError}
* @throws {module:API.cvat.exceptions.ServerError}
*/
async request(url, data) {
const result = await PluginRegistry
.apiWrapper(cvat.server.request, url, data);
return result;
},
},
/**
* Namespace is used for getting tasks
Expand Down
12 changes: 12 additions & 0 deletions cvat-core/src/server-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@
return true;
}

async function serverRequest(url, data) {
try {
return (await Axios({
url,
...data,
})).data;
} catch (errorData) {
throw generateError(errorData, 'Could not have done the request');
}
}

async function getTasks(filter = '') {
const { backendAPI } = config;

Expand Down Expand Up @@ -560,6 +571,7 @@
logout,
authorized,
register,
request: serverRequest,
}),
writable: false,
},
Expand Down
94 changes: 30 additions & 64 deletions cvat-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/react-router": "^5.0.5",
"@types/react-router-dom": "^5.1.0",
"@types/react-share": "^3.0.1",
"antd": "^3.24.2",
"antd": "^3.25.2",
"dotenv-webpack": "^1.7.0",
"moment": "^2.24.0",
"prop-types": "^15.7.2",
Expand Down
Loading

0 comments on commit 1c93b58

Please sign in to comment.