1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

feat: metadata gallery view (#6727)

* feat: metadata gallery view

* feat: update code

* feat: update code

* feat: update code

---------

Co-authored-by: 杨国璇 <ygx@192.168.1.4>
This commit is contained in:
杨国璇
2024-09-08 12:16:33 +08:00
committed by GitHub
parent 4c295bc38c
commit 4ccd0f3477
19 changed files with 412 additions and 153 deletions

View File

@@ -1,6 +1,7 @@
import axios from 'axios';
import cookie from 'react-cookies';
import { siteRoot } from '../utils/constants';
import { VIEW_TYPE_DEFAULT_BASIC_FILTER, VIEW_TYPE_DEFAULT_SORTS } from './metadata-view/_basic';
class MetadataManagerAPI {
init({ server, username, password, token }) {
@@ -114,7 +115,14 @@ class MetadataManagerAPI {
addView = (repoID, name, type = 'table') => {
const url = this.server + '/api/v2.1/repos/' + repoID + '/metadata/views/';
const params = { name, type };
let params = {
name,
type,
data: {
basic_filters: VIEW_TYPE_DEFAULT_BASIC_FILTER[type],
sorts: VIEW_TYPE_DEFAULT_SORTS[type],
}
};
return this._sendPostRequest(url, params, { headers: { 'Content-type': 'application/json' } });
};