@girder/core 3.2.2 → 5.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/dist-lib/Girder_Favicon.png +0 -0
- package/dist-lib/girder-core.js +48623 -0
- package/dist-lib/girder-core.js.map +1 -0
- package/dist-lib/girder-core.umd.cjs +633 -0
- package/dist-lib/girder-core.umd.cjs.map +1 -0
- package/dist-lib/girder-swagger.js +64 -0
- package/dist-lib/index.d.ts +1 -0
- package/{auth.js → dist-lib/src/auth.js} +7 -9
- package/dist-lib/src/index.d.ts +22 -0
- package/dist-lib/src/index.ts +80 -0
- package/dist-lib/src/main.ts +37 -0
- package/{models → dist-lib/src/models}/FolderModel.js +1 -1
- package/{rest.js → dist-lib/src/rest.js} +2 -11
- package/{routes.js → dist-lib/src/routes.js} +65 -67
- package/{stylesheets → dist-lib/src/stylesheets}/layout/global.styl +1 -1
- package/{stylesheets → dist-lib/src/stylesheets}/widgets/userOtpManagementWidget.styl +2 -2
- package/{templates → dist-lib/src/templates}/body/frontPage.pug +1 -1
- package/dist-lib/src/version.js +8 -0
- package/{views → dist-lib/src/views}/View.js +2 -1
- package/{views → dist-lib/src/views}/layout/LoginView.js +1 -1
- package/{views → dist-lib/src/views}/layout/RegisterView.js +5 -2
- package/{views → dist-lib/src/views}/widgets/ApiKeyListWidget.js +1 -1
- package/{views → dist-lib/src/views}/widgets/DateTimeRangeWidget.js +2 -1
- package/{views → dist-lib/src/views}/widgets/DateTimeWidget.js +2 -1
- package/{views → dist-lib/src/views}/widgets/ItemListWidget.js +1 -1
- package/{views → dist-lib/src/views}/widgets/MetadataWidget.js +7 -3
- package/{views → dist-lib/src/views}/widgets/PaginateWidget.js +2 -2
- package/{views → dist-lib/src/views}/widgets/RootSelectorWidget.js +1 -1
- package/{views → dist-lib/src/views}/widgets/SearchPaginateWidget.js +2 -2
- package/{views → dist-lib/src/views}/widgets/SortCollectionWidget.js +1 -1
- package/dist-lib/src/vite-env.d.ts +5 -0
- package/dist-lib/style.css +16 -0
- package/package.json +79 -31
- package/index.js +0 -31
- package/main.js +0 -21
- package/version.js +0 -10
- /package/{assets → dist-lib}/Girder_Mark.png +0 -0
- /package/{collections → dist-lib/src/collections}/ApiKeyCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/AssetstoreCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/Collection.js +0 -0
- /package/{collections → dist-lib/src/collections}/CollectionCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/FileCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/FolderCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/GroupCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/ItemCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/UserCollection.js +0 -0
- /package/{collections → dist-lib/src/collections}/index.js +0 -0
- /package/{constants.js → dist-lib/src/constants.js} +0 -0
- /package/{dialog.js → dist-lib/src/dialog.js} +0 -0
- /package/{events.js → dist-lib/src/events.js} +0 -0
- /package/{misc.js → dist-lib/src/misc.js} +0 -0
- /package/{models → dist-lib/src/models}/AccessControlledModel.js +0 -0
- /package/{models → dist-lib/src/models}/ApiKeyModel.js +0 -0
- /package/{models → dist-lib/src/models}/AssetstoreModel.js +0 -0
- /package/{models → dist-lib/src/models}/CollectionCreationPolicyModel.js +0 -0
- /package/{models → dist-lib/src/models}/CollectionModel.js +0 -0
- /package/{models → dist-lib/src/models}/FileModel.js +0 -0
- /package/{models → dist-lib/src/models}/GroupModel.js +0 -0
- /package/{models → dist-lib/src/models}/ItemModel.js +0 -0
- /package/{models → dist-lib/src/models}/MetadataMixin.js +0 -0
- /package/{models → dist-lib/src/models}/Model.js +0 -0
- /package/{models → dist-lib/src/models}/UserModel.js +0 -0
- /package/{models → dist-lib/src/models}/index.js +0 -0
- /package/{pluginUtils.js → dist-lib/src/pluginUtils.js} +0 -0
- /package/{router.js → dist-lib/src/router.js} +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/apidocs/apidocs.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/adminConsole.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/assetstores.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/collectionList.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/collectionPage.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/frontPage.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/groupList.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/groupPage.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/itemPage.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/plugins.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/searchResultsList.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/systemConfig.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/userAccount.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/userList.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/body/userPage.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/footer.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/globalNav.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/header.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/headerUser.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/layout.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/layoutVars.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/loading.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/layout/progressArea.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/accessWidget.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/browserWidget.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/hierarchyWidget.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/markdownWidget.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/metadataWidget.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/searchFieldWidget.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/taskProgress.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/timelineWidget.styl +0 -0
- /package/{stylesheets → dist-lib/src/stylesheets}/widgets/uploadWidget.styl +0 -0
- /package/{templates → dist-lib/src/templates}/body/adminConsole.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/assetstores.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/collectionList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/collectionPage.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/filesystemImport.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/groupList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/groupPage.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/itemPage.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/plugins.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/s3Import.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/searchResults.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/searchResultsType.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/systemConfiguration.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/userAccount.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/userList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/body/userPage.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/alert.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/layout.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/layoutFooter.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/layoutGlobalNav.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/layoutHeader.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/layoutHeaderUser.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/layoutProgressArea.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/loginDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/registerDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/layout/resetPasswordDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/accessEditor.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/accessEditorMixins.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/accessEditorNonModal.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/accessEntry.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/apiKeyList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/browserWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/checkedActionsMenu.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/collectionInfoDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/confirmDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/dateTimeRangeWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/dateTimeWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/editApiKeyWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/editAssetstoreWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/editCollectionWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/editFileWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/editFolderWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/editGroupWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/editItemWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/fileInfoDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/fileList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/folderInfoDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/folderList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/groupAdminList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/groupInviteDialog.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/groupInviteList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/groupMemberList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/groupModList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/hierarchyBreadcrumb.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/hierarchyPaginated.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/hierarchyWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/itemBreadcrumb.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/itemList.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/jsonMetadatumEditWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/jsonMetadatumView.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/loadingAnimation.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/markdownWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/metadataWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/metadatumEditWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/metadatumView.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/newAssetstore.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/paginateWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/pluginConfigBreadcrumb.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/rootSelectorWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/searchField.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/searchHelp.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/searchModeSelect.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/searchResults.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/sortCollectionWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/taskProgress.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/timeline.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/uploadWidget.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/uploadWidgetMixins.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/uploadWidgetNonModal.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/userOtpBegin.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/userOtpDisable.pug +0 -0
- /package/{templates → dist-lib/src/templates}/widgets/userOtpEnable.pug +0 -0
- /package/{utilities → dist-lib/src/utilities}/EventStream.js +0 -0
- /package/{utilities → dist-lib/src/utilities}/PluginUtils.js +0 -0
- /package/{utilities → dist-lib/src/utilities}/S3UploadHandler.js +0 -0
- /package/{utilities → dist-lib/src/utilities}/index.js +0 -0
- /package/{utilities → dist-lib/src/utilities}/jquery/girderEnable.js +0 -0
- /package/{utilities → dist-lib/src/utilities}/jquery/girderModal.js +0 -0
- /package/{views → dist-lib/src/views}/App.js +0 -0
- /package/{views → dist-lib/src/views}/body/AdminView.js +0 -0
- /package/{views → dist-lib/src/views}/body/AssetstoresView.js +0 -0
- /package/{views → dist-lib/src/views}/body/CollectionView.js +0 -0
- /package/{views → dist-lib/src/views}/body/CollectionsView.js +0 -0
- /package/{views → dist-lib/src/views}/body/FilesystemImportView.js +0 -0
- /package/{views → dist-lib/src/views}/body/FolderView.js +0 -0
- /package/{views → dist-lib/src/views}/body/FrontPageView.js +0 -0
- /package/{views → dist-lib/src/views}/body/GroupView.js +0 -0
- /package/{views → dist-lib/src/views}/body/GroupsView.js +0 -0
- /package/{views → dist-lib/src/views}/body/ItemView.js +0 -0
- /package/{views → dist-lib/src/views}/body/PluginsView.js +0 -0
- /package/{views → dist-lib/src/views}/body/S3ImportView.js +0 -0
- /package/{views → dist-lib/src/views}/body/SearchResultsView.js +0 -0
- /package/{views → dist-lib/src/views}/body/SystemConfigurationView.js +0 -0
- /package/{views → dist-lib/src/views}/body/UserAccountView.js +0 -0
- /package/{views → dist-lib/src/views}/body/UserView.js +0 -0
- /package/{views → dist-lib/src/views}/body/UsersView.js +0 -0
- /package/{views → dist-lib/src/views}/body/index.js +0 -0
- /package/{views → dist-lib/src/views}/index.js +0 -0
- /package/{views → dist-lib/src/views}/layout/FooterView.js +0 -0
- /package/{views → dist-lib/src/views}/layout/GlobalNavView.js +0 -0
- /package/{views → dist-lib/src/views}/layout/HeaderUserView.js +0 -0
- /package/{views → dist-lib/src/views}/layout/HeaderView.js +0 -0
- /package/{views → dist-lib/src/views}/layout/ProgressListView.js +0 -0
- /package/{views → dist-lib/src/views}/layout/ResetPasswordView.js +0 -0
- /package/{views → dist-lib/src/views}/layout/index.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/AccessWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/BrowserWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/CheckedMenuWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/CollectionInfoWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/EditApiKeyWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/EditAssetstoreWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/EditCollectionWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/EditFileWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/EditFolderWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/EditGroupWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/EditItemWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/FileInfoWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/FileListWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/FolderInfoWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/FolderListWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/GroupAdminsWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/GroupInvitesWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/GroupMembersWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/GroupModsWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/HierarchyWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/ItemBreadcrumbWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/LoadingAnimation.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/MarkdownWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/NewAssetstoreWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/PluginConfigBreadcrumbWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/SearchFieldWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/TaskProgressWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/TimelineWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/UploadWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/UserOtpManagementWidget.js +0 -0
- /package/{views → dist-lib/src/views}/widgets/index.js +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-env jquery */
|
|
2
|
+
$(function () {
|
|
3
|
+
var apiRoot = $('#g-global-info-apiroot').text().replace(
|
|
4
|
+
'%HOST%', window.location.origin);
|
|
5
|
+
if (!apiRoot) {
|
|
6
|
+
apiRoot = window.location.origin + window.location.pathname;
|
|
7
|
+
}
|
|
8
|
+
var swaggerUi = new window.SwaggerUIBundle({
|
|
9
|
+
url: apiRoot + '/describe',
|
|
10
|
+
dom_id: '#swagger-ui-container',
|
|
11
|
+
supportHeaderParams: false,
|
|
12
|
+
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
|
|
13
|
+
onComplete: function () {
|
|
14
|
+
addApiKeyAuthorization();
|
|
15
|
+
},
|
|
16
|
+
onFailure: function (data) {
|
|
17
|
+
if (console) {
|
|
18
|
+
console.log('Unable to Load SwaggerUI');
|
|
19
|
+
console.log(data);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
docExpansion: 'none',
|
|
23
|
+
jsonEditor: false,
|
|
24
|
+
apisSorter: 'alpha',
|
|
25
|
+
operationsSorter: sortOperations,
|
|
26
|
+
defaultModelRendering: 'model',
|
|
27
|
+
showRequestHeaders: false,
|
|
28
|
+
validatorUrl: null,
|
|
29
|
+
tryItOutEnabled: true,
|
|
30
|
+
defaultModelsExpandDepth: -1,
|
|
31
|
+
deepLinking: true
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
var methodOrder = ['get', 'put', 'post', 'patch', 'delete'];
|
|
35
|
+
|
|
36
|
+
// Comparator to sort operations by path and method.
|
|
37
|
+
// Methods not in the pre-defined ordered list are placed at the end and
|
|
38
|
+
// sorted alphabetically.
|
|
39
|
+
function sortOperations(op1, op2) {
|
|
40
|
+
var pathCmp = op1.get('path').localeCompare(op2.get('path'));
|
|
41
|
+
if (pathCmp !== 0) {
|
|
42
|
+
return pathCmp;
|
|
43
|
+
}
|
|
44
|
+
var index1 = methodOrder.indexOf(op1.get('method'));
|
|
45
|
+
var index2 = methodOrder.indexOf(op2.get('method'));
|
|
46
|
+
if (index1 > -1 && index2 > -1) {
|
|
47
|
+
return index1 > index2 ? 1 : (index1 < index2 ? -1 : 0);
|
|
48
|
+
}
|
|
49
|
+
if (index1 > -1) {
|
|
50
|
+
return -1;
|
|
51
|
+
}
|
|
52
|
+
if (index2 > -1) {
|
|
53
|
+
return 1;
|
|
54
|
+
}
|
|
55
|
+
return op1.get('method').localeCompare(op2.get('method'));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function addApiKeyAuthorization() {
|
|
59
|
+
const girderToken = localStorage.getItem('girderToken');
|
|
60
|
+
if (girderToken) {
|
|
61
|
+
swaggerUi.preauthorizeApiKey('Girder-Token', girderToken);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/index'
|
|
@@ -8,7 +8,6 @@ import { restRequest } from '@girder/core/rest';
|
|
|
8
8
|
// girder.corsAuth could be an override. See login doc below.
|
|
9
9
|
var corsAuth = false;
|
|
10
10
|
|
|
11
|
-
// TODO delete in next major version
|
|
12
11
|
var cookie = {
|
|
13
12
|
findAll: function () {
|
|
14
13
|
var cookies = {};
|
|
@@ -44,7 +43,7 @@ var cookie = {
|
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
var currentUser = null;
|
|
47
|
-
var currentToken =
|
|
46
|
+
var currentToken = cookie.find('girderToken');
|
|
48
47
|
|
|
49
48
|
function getCurrentUser() {
|
|
50
49
|
return currentUser;
|
|
@@ -85,12 +84,9 @@ function basicAuthEncode(username, password) {
|
|
|
85
84
|
*
|
|
86
85
|
* @param username The username or email to login as.
|
|
87
86
|
* @param password The password to use.
|
|
88
|
-
* @param cors If the girder server is on a different origin, set this
|
|
89
|
-
* to "true" to save the auth cookie on the current domain. Alternatively,
|
|
90
|
-
* you may set the global option "girder.corsAuth = true".
|
|
91
87
|
* @param otpToken An optional one-time password to include with the login.
|
|
92
88
|
*/
|
|
93
|
-
function login(username, password,
|
|
89
|
+
function login(username, password, otpToken = null) {
|
|
94
90
|
var auth = basicAuthEncode(username, password);
|
|
95
91
|
|
|
96
92
|
const headers = {
|
|
@@ -111,7 +107,11 @@ function login(username, password, cors = corsAuth, otpToken = null) {
|
|
|
111
107
|
setCurrentUser(new UserModel(response.user));
|
|
112
108
|
setCurrentToken(response.user.token.token);
|
|
113
109
|
|
|
114
|
-
|
|
110
|
+
if (!cookie.find('girderToken')) {
|
|
111
|
+
// For cross-origin requests, we should write the token into
|
|
112
|
+
// this document's cookie also.
|
|
113
|
+
document.cookie = 'girderToken=' + getCurrentToken();
|
|
114
|
+
}
|
|
115
115
|
|
|
116
116
|
events.trigger('g:login.success', response.user);
|
|
117
117
|
events.trigger('g:login', response);
|
|
@@ -130,8 +130,6 @@ function logout() {
|
|
|
130
130
|
setCurrentUser(null);
|
|
131
131
|
setCurrentToken(null);
|
|
132
132
|
|
|
133
|
-
window.localStorage.removeItem('girderToken');
|
|
134
|
-
|
|
135
133
|
events.trigger('g:login', null);
|
|
136
134
|
events.trigger('g:logout.success');
|
|
137
135
|
}).fail(function (jqxhr) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const girder: {
|
|
2
|
+
$: any;
|
|
3
|
+
_: any;
|
|
4
|
+
moment: any;
|
|
5
|
+
initializeDefaultApp: (apiRoot: string, el?: string | HTMLElement) => Promise<unknown>;
|
|
6
|
+
auth: any;
|
|
7
|
+
collections: any;
|
|
8
|
+
constants: any;
|
|
9
|
+
dialog: any;
|
|
10
|
+
events: any;
|
|
11
|
+
misc: any;
|
|
12
|
+
models: any;
|
|
13
|
+
plugins: {};
|
|
14
|
+
pluginUtils: any;
|
|
15
|
+
rest: any;
|
|
16
|
+
router: any;
|
|
17
|
+
utilities: any;
|
|
18
|
+
version: any;
|
|
19
|
+
views: any;
|
|
20
|
+
};
|
|
21
|
+
export type Girder = typeof girder;
|
|
22
|
+
export { girder, };
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import $ from 'jquery';
|
|
2
|
+
|
|
3
|
+
import _ from 'underscore';
|
|
4
|
+
|
|
5
|
+
import Backbone from 'backbone';
|
|
6
|
+
|
|
7
|
+
import moment from 'moment';
|
|
8
|
+
|
|
9
|
+
import * as auth from './auth';
|
|
10
|
+
import * as collections from './collections';
|
|
11
|
+
import * as constants from './constants';
|
|
12
|
+
import * as dialog from './dialog';
|
|
13
|
+
import * as misc from './misc';
|
|
14
|
+
import * as models from './models';
|
|
15
|
+
import * as pluginUtils from './pluginUtils';
|
|
16
|
+
import * as rest from './rest';
|
|
17
|
+
import * as utilities from './utilities';
|
|
18
|
+
import * as views from './views';
|
|
19
|
+
import events from './events';
|
|
20
|
+
import router from './router';
|
|
21
|
+
import version from './version';
|
|
22
|
+
|
|
23
|
+
const initializeDefaultApp = async (apiRoot: string, el: string | HTMLElement = 'body') => {
|
|
24
|
+
return new Promise((resolve, reject) => {
|
|
25
|
+
$(() => {
|
|
26
|
+
rest.setApiRoot(apiRoot);
|
|
27
|
+
events.trigger('g:appload.before');
|
|
28
|
+
rest.restRequest({
|
|
29
|
+
url: `system/public_settings`,
|
|
30
|
+
method: 'GET',
|
|
31
|
+
}).done((resp: any) => {
|
|
32
|
+
const app = new views.App({
|
|
33
|
+
el,
|
|
34
|
+
parentView: null,
|
|
35
|
+
contactEmail: resp['core.contact_email_address'],
|
|
36
|
+
privacyNoticeHref: resp['core.privacy_notice'],
|
|
37
|
+
brandName: resp['core.brand_name'],
|
|
38
|
+
bannerColor: resp['core.banner_color'],
|
|
39
|
+
registrationPolicy: resp['core.registration_policy'],
|
|
40
|
+
enablePasswordLogin: resp['core.enable_password_login'],
|
|
41
|
+
});
|
|
42
|
+
app.render();
|
|
43
|
+
document.title = resp['core.brand_name'];
|
|
44
|
+
events.trigger('g:appload.after', app);
|
|
45
|
+
resolve(app);
|
|
46
|
+
}).fail((resp: any) => {
|
|
47
|
+
events.trigger('g:error', resp);
|
|
48
|
+
reject(new Error("Could not retrieve public settings from server."));
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const girder = {
|
|
55
|
+
$,
|
|
56
|
+
_,
|
|
57
|
+
Backbone,
|
|
58
|
+
moment,
|
|
59
|
+
initializeDefaultApp,
|
|
60
|
+
auth,
|
|
61
|
+
collections,
|
|
62
|
+
constants,
|
|
63
|
+
dialog,
|
|
64
|
+
events,
|
|
65
|
+
misc,
|
|
66
|
+
models,
|
|
67
|
+
plugins: {},
|
|
68
|
+
pluginUtils,
|
|
69
|
+
rest,
|
|
70
|
+
router,
|
|
71
|
+
utilities,
|
|
72
|
+
version,
|
|
73
|
+
views
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type Girder = typeof girder;
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
girder,
|
|
80
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { girder } from '.';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
girder: typeof girder;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
window.girder = girder;
|
|
9
|
+
|
|
10
|
+
interface StaticFilesSpec {
|
|
11
|
+
css: string[],
|
|
12
|
+
js: string[],
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const apiRoot = import.meta.env.VITE_API_ROOT ?? '/api/v1';
|
|
16
|
+
|
|
17
|
+
(async () => {
|
|
18
|
+
const staticFilesResp = await fetch(`${apiRoot}/system/plugin_static_files`);
|
|
19
|
+
const staticFiles: StaticFilesSpec = await staticFilesResp.json();
|
|
20
|
+
|
|
21
|
+
staticFiles.css.forEach((href) => {
|
|
22
|
+
const link = document.createElement('link');
|
|
23
|
+
link.rel = 'stylesheet';
|
|
24
|
+
link.type = 'text/css';
|
|
25
|
+
link.href = href;
|
|
26
|
+
document.head.appendChild(link);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
staticFiles.js.forEach((src) => {
|
|
30
|
+
const script = document.createElement('script');
|
|
31
|
+
script.type = 'text/javascript';
|
|
32
|
+
script.src = src;
|
|
33
|
+
document.head.appendChild(script);
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
await girder.initializeDefaultApp(apiRoot);
|
|
37
|
+
})();
|
|
@@ -20,7 +20,7 @@ var FolderModel = AccessControlledModel.extend({
|
|
|
20
20
|
return restRequest({
|
|
21
21
|
url: `${this.resourceName}/${this.id}/contents`,
|
|
22
22
|
method: 'DELETE'
|
|
23
|
-
}).done((
|
|
23
|
+
}).done(() => {
|
|
24
24
|
this.trigger('g:success');
|
|
25
25
|
}).fail((err) => {
|
|
26
26
|
this.trigger('g:error', err);
|
|
@@ -3,7 +3,7 @@ import _ from 'underscore';
|
|
|
3
3
|
import Backbone from 'backbone';
|
|
4
4
|
|
|
5
5
|
import events from '@girder/core/events';
|
|
6
|
-
import { getCurrentToken,
|
|
6
|
+
import { getCurrentToken, cookie } from '@girder/core/auth';
|
|
7
7
|
|
|
8
8
|
let apiRoot;
|
|
9
9
|
var uploadHandlers = {};
|
|
@@ -31,13 +31,6 @@ function setApiRoot(root) {
|
|
|
31
31
|
apiRoot = root.replace(/\/$/, '');
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
// Initialize the API root (at JS load time)
|
|
35
|
-
// This could be overridden when the App is started, but we need sensible defaults so models, etc.
|
|
36
|
-
// can be easily used without having to start an App or explicitly set these values
|
|
37
|
-
setApiRoot(
|
|
38
|
-
$('#g-global-info-apiroot').text().replace('%HOST%', window.location.origin) || '/api/v1'
|
|
39
|
-
);
|
|
40
|
-
|
|
41
34
|
/**
|
|
42
35
|
* Make a request to the REST API.
|
|
43
36
|
*
|
|
@@ -70,13 +63,11 @@ const restRequest = function (opts) {
|
|
|
70
63
|
const defaults = {
|
|
71
64
|
// the default 'method' is 'GET', as set by 'jquery.ajax'
|
|
72
65
|
|
|
73
|
-
girderToken: getCurrentToken() ||
|
|
66
|
+
girderToken: getCurrentToken() || cookie.find('girderToken'),
|
|
74
67
|
|
|
75
68
|
error: (error, status) => {
|
|
76
69
|
let info;
|
|
77
70
|
if (error.status === 401) {
|
|
78
|
-
setCurrentUser(null);
|
|
79
|
-
setCurrentToken(null);
|
|
80
71
|
events.trigger('g:loginUi');
|
|
81
72
|
info = {
|
|
82
73
|
text: 'You must log in to view this resource',
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable import/first */
|
|
2
|
-
|
|
3
1
|
import router from '@girder/core/router';
|
|
4
2
|
import events from '@girder/core/events';
|
|
5
3
|
import eventStream from '@girder/core/utilities/EventStream';
|
|
@@ -10,14 +8,76 @@ import { restRequest } from '@girder/core/rest';
|
|
|
10
8
|
* Admin
|
|
11
9
|
*/
|
|
12
10
|
import AdminView from '@girder/core/views/body/AdminView';
|
|
13
|
-
router.route('admin', 'admin', function () {
|
|
14
|
-
events.trigger('g:navigateTo', AdminView);
|
|
15
|
-
});
|
|
16
11
|
|
|
17
12
|
/**
|
|
18
13
|
* Assetstores
|
|
19
14
|
*/
|
|
20
15
|
import AssetstoresView from '@girder/core/views/body/AssetstoresView';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Collections
|
|
19
|
+
*/
|
|
20
|
+
import CollectionsView from '@girder/core/views/body/CollectionsView';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Collection
|
|
24
|
+
*/
|
|
25
|
+
import CollectionView from '@girder/core/views/body/CollectionView';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Folder
|
|
29
|
+
*/
|
|
30
|
+
import FolderView from '@girder/core/views/body/FolderView';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* FrontPage
|
|
34
|
+
*/
|
|
35
|
+
import FrontPageView from '@girder/core/views/body/FrontPageView';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Groups
|
|
39
|
+
*/
|
|
40
|
+
import GroupsView from '@girder/core/views/body/GroupsView';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Group
|
|
44
|
+
*/
|
|
45
|
+
import GroupView from '@girder/core/views/body/GroupView';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Item
|
|
49
|
+
*/
|
|
50
|
+
import ItemView from '@girder/core/views/body/ItemView';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Plugins
|
|
54
|
+
*/
|
|
55
|
+
import PluginsView from '@girder/core/views/body/PluginsView';
|
|
56
|
+
import UsersView from '@girder/core/views/body/UsersView';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* SystemConfiguration
|
|
60
|
+
*/
|
|
61
|
+
import SystemConfigurationView from '@girder/core/views/body/SystemConfigurationView';
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* UserAccount
|
|
65
|
+
*/
|
|
66
|
+
import UserAccountView from '@girder/core/views/body/UserAccountView';
|
|
67
|
+
import UserModel from '@girder/core/models/UserModel';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* User
|
|
71
|
+
*/
|
|
72
|
+
import UserView from '@girder/core/views/body/UserView';
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* SearchResults
|
|
76
|
+
*/
|
|
77
|
+
import SearchResultsView from '@girder/core/views/body/SearchResultsView';
|
|
78
|
+
router.route('admin', 'admin', function () {
|
|
79
|
+
events.trigger('g:navigateTo', AdminView);
|
|
80
|
+
});
|
|
21
81
|
router.route('assetstores', 'assetstores', function (params) {
|
|
22
82
|
events.trigger('g:navigateTo', AssetstoresView, {
|
|
23
83
|
assetstoreEdit: params.dialog === 'assetstoreedit' ? params.dialogid : false
|
|
@@ -26,20 +86,10 @@ router.route('assetstores', 'assetstores', function (params) {
|
|
|
26
86
|
router.route('assetstore/:id/import', 'assetstoreImport', function (assetstoreId) {
|
|
27
87
|
AssetstoresView.import(assetstoreId);
|
|
28
88
|
});
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Collections
|
|
32
|
-
*/
|
|
33
|
-
import CollectionsView from '@girder/core/views/body/CollectionsView';
|
|
34
89
|
router.route('collections', 'collections', function (params) {
|
|
35
90
|
events.trigger('g:navigateTo', CollectionsView, params || {});
|
|
36
91
|
events.trigger('g:highlightItem', 'CollectionsView');
|
|
37
92
|
});
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Collection
|
|
41
|
-
*/
|
|
42
|
-
import CollectionView from '@girder/core/views/body/CollectionView';
|
|
43
93
|
router.route('collection/:id', 'collectionAccess', function (cid, params) {
|
|
44
94
|
CollectionView.fetchAndInit(cid, {
|
|
45
95
|
access: params.dialog === 'access',
|
|
@@ -60,11 +110,6 @@ router.route('collection/:id/folder/:id', 'collectionFolder', function (cid, fol
|
|
|
60
110
|
itemCreate: params.dialog === 'itemcreate'
|
|
61
111
|
});
|
|
62
112
|
});
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Folder
|
|
66
|
-
*/
|
|
67
|
-
import FolderView from '@girder/core/views/body/FolderView';
|
|
68
113
|
router.route('folder/:id', 'folder', function (id, params) {
|
|
69
114
|
FolderView.fetchAndInit(id, {
|
|
70
115
|
upload: params.dialog === 'upload',
|
|
@@ -74,28 +119,13 @@ router.route('folder/:id', 'folder', function (id, params) {
|
|
|
74
119
|
itemCreate: params.dialog === 'itemcreate'
|
|
75
120
|
});
|
|
76
121
|
});
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* FrontPage
|
|
80
|
-
*/
|
|
81
|
-
import FrontPageView from '@girder/core/views/body/FrontPageView';
|
|
82
122
|
router.route('', 'index', function () {
|
|
83
123
|
events.trigger('g:navigateTo', FrontPageView);
|
|
84
124
|
});
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Groups
|
|
88
|
-
*/
|
|
89
|
-
import GroupsView from '@girder/core/views/body/GroupsView';
|
|
90
125
|
router.route('groups', 'groups', function (params) {
|
|
91
126
|
events.trigger('g:navigateTo', GroupsView, params || {});
|
|
92
127
|
events.trigger('g:highlightItem', 'GroupsView');
|
|
93
128
|
});
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Group
|
|
97
|
-
*/
|
|
98
|
-
import GroupView from '@girder/core/views/body/GroupView';
|
|
99
129
|
router.route('group/:id', 'groupView', function (groupId, params) {
|
|
100
130
|
GroupView.fetchAndInit(groupId, {
|
|
101
131
|
edit: params.dialog === 'edit'
|
|
@@ -107,11 +137,6 @@ router.route('group/:id/:tab', 'groupView', function (groupId, tab, params) {
|
|
|
107
137
|
tab: tab
|
|
108
138
|
});
|
|
109
139
|
});
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Item
|
|
113
|
-
*/
|
|
114
|
-
import ItemView from '@girder/core/views/body/ItemView';
|
|
115
140
|
router.route('item/:id', 'item', function (itemId, params) {
|
|
116
141
|
ItemView.fetchAndInit(itemId, {
|
|
117
142
|
edit: params.dialog === 'itemedit',
|
|
@@ -119,29 +144,12 @@ router.route('item/:id', 'item', function (itemId, params) {
|
|
|
119
144
|
upload: params.dialog === 'upload' ? params.dialogid : false
|
|
120
145
|
});
|
|
121
146
|
});
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Plugins
|
|
125
|
-
*/
|
|
126
|
-
import PluginsView from '@girder/core/views/body/PluginsView';
|
|
127
|
-
import UsersView from '@girder/core/views/body/UsersView';
|
|
128
147
|
router.route('plugins', 'plugins', function () {
|
|
129
148
|
events.trigger('g:navigateTo', PluginsView);
|
|
130
149
|
});
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* SystemConfiguration
|
|
134
|
-
*/
|
|
135
|
-
import SystemConfigurationView from '@girder/core/views/body/SystemConfigurationView';
|
|
136
150
|
router.route('settings', 'settings', function () {
|
|
137
151
|
events.trigger('g:navigateTo', SystemConfigurationView);
|
|
138
152
|
});
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* UserAccount
|
|
142
|
-
*/
|
|
143
|
-
import UserAccountView from '@girder/core/views/body/UserAccountView';
|
|
144
|
-
import UserModel from '@girder/core/models/UserModel';
|
|
145
153
|
router.route('useraccount/:id/:tab', 'accountTab', function (id, tab) {
|
|
146
154
|
UserAccountView.fetchAndInit(id, tab);
|
|
147
155
|
});
|
|
@@ -197,11 +205,6 @@ router.route('users', 'users', function (params) {
|
|
|
197
205
|
events.trigger('g:navigateTo', UsersView, params || {});
|
|
198
206
|
events.trigger('g:highlightItem', 'UsersView');
|
|
199
207
|
});
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* User
|
|
203
|
-
*/
|
|
204
|
-
import UserView from '@girder/core/views/body/UserView';
|
|
205
208
|
router.route('user/:id', 'user', function (userId, params) {
|
|
206
209
|
UserView.fetchAndInit(userId, {
|
|
207
210
|
folderCreate: params.dialog === 'foldercreate',
|
|
@@ -218,11 +221,6 @@ router.route('user/:id/folder/:id', 'userFolder', function (userId, folderId, pa
|
|
|
218
221
|
itemCreate: params.dialog === 'itemcreate'
|
|
219
222
|
});
|
|
220
223
|
});
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* SearchResults
|
|
224
|
-
*/
|
|
225
|
-
import SearchResultsView from '@girder/core/views/body/SearchResultsView';
|
|
226
224
|
router.route('search/results', 'SearchResults', function (params) {
|
|
227
225
|
events.trigger('g:navigateTo', SearchResultsView, {
|
|
228
226
|
query: params.query,
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
font-size 20px
|
|
137
137
|
|
|
138
138
|
// Responsive Goodness
|
|
139
|
-
@media screen and (max-
|
|
139
|
+
@media screen and (max-width1156px)
|
|
140
140
|
.g-account-otp-container
|
|
141
141
|
.g-account-otp-steps
|
|
142
142
|
.g-account-otp-step
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
&:before
|
|
147
147
|
display none
|
|
148
148
|
|
|
149
|
-
@media screen and (max-
|
|
149
|
+
@media screen and (max-width960px)
|
|
150
150
|
.g-account-otp-container
|
|
151
151
|
.g-account-otp-steps
|
|
152
152
|
.g-account-otp-step
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.g-frontpage-header
|
|
2
2
|
.g-frontpage-logo-container
|
|
3
|
-
img.g-frontpage-logo(src=
|
|
3
|
+
img.g-frontpage-logo(src='/Girder_Mark.png')
|
|
4
4
|
.g-frontpage-title-container
|
|
5
5
|
.g-frontpage-title #{brandName}
|
|
6
6
|
.g-frontpage-subtitle Data management platform
|
|
@@ -5,7 +5,8 @@ import events from '@girder/core/events';
|
|
|
5
5
|
import eventStream from '@girder/core/utilities/EventStream';
|
|
6
6
|
|
|
7
7
|
var View = Backbone.View.extend({
|
|
8
|
-
|
|
8
|
+
// eslint-disable-next-line backbone/no-constructor
|
|
9
|
+
constructor: function (opts) {
|
|
9
10
|
if (opts && _.has(opts, 'parentView')) {
|
|
10
11
|
if (opts.parentView) {
|
|
11
12
|
opts.parentView.registerChildView(this);
|
|
@@ -26,7 +26,7 @@ var LoginView = View.extend({
|
|
|
26
26
|
const loginName = this.$('#g-login').val();
|
|
27
27
|
const password = this.$('#g-password').val();
|
|
28
28
|
const otpToken = this.$('#g-login-otp-group').hasClass('hidden') ? null : this.$('#g-login-otp').val();
|
|
29
|
-
login(loginName, password,
|
|
29
|
+
login(loginName, password, otpToken)
|
|
30
30
|
.done(() => {
|
|
31
31
|
this.$el.modal('hide');
|
|
32
32
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import UserModel from '@girder/core/models/UserModel';
|
|
2
2
|
import View from '@girder/core/views/View';
|
|
3
3
|
import events from '@girder/core/events';
|
|
4
|
-
import { getCurrentUser, setCurrentUser, getCurrentToken, setCurrentToken } from '@girder/core/auth';
|
|
4
|
+
import { getCurrentUser, setCurrentUser, getCurrentToken, setCurrentToken, corsAuth } from '@girder/core/auth';
|
|
5
5
|
import { handleClose, handleOpen } from '@girder/core/dialog';
|
|
6
6
|
|
|
7
7
|
import RegisterDialogTemplate from '@girder/core/templates/layout/registerDialog.pug';
|
|
@@ -44,7 +44,10 @@ var RegisterView = View.extend({
|
|
|
44
44
|
if (authToken.token) {
|
|
45
45
|
setCurrentUser(user);
|
|
46
46
|
setCurrentToken(authToken.token);
|
|
47
|
-
|
|
47
|
+
|
|
48
|
+
if (corsAuth) {
|
|
49
|
+
document.cookie = 'girderToken=' + getCurrentToken();
|
|
50
|
+
}
|
|
48
51
|
|
|
49
52
|
events.trigger('g:login');
|
|
50
53
|
} else {
|
|
@@ -5,7 +5,8 @@ import View from '@girder/core/views/View';
|
|
|
5
5
|
|
|
6
6
|
import dateTimeRangeWidgetTemplate from '@girder/core/templates/widgets/dateTimeRangeWidget.pug';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Momentjs is not require()'d in the way this library expects
|
|
9
|
+
// import 'eonasdan-bootstrap-datetimepicker'; // /src/js/bootstrap-datetimepicker.js'
|
|
9
10
|
import 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -5,7 +5,8 @@ import View from '@girder/core/views/View';
|
|
|
5
5
|
|
|
6
6
|
import dateTimeWidgetTemplate from '@girder/core/templates/widgets/dateTimeWidget.pug';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Momentjs is not require()'d in the way this library expects
|
|
9
|
+
// import 'eonasdan-bootstrap-datetimepicker'; // /src/js/bootstrap-datetimepicker.js'
|
|
9
10
|
import 'eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.css';
|
|
10
11
|
|
|
11
12
|
/**
|