609 lines
No EOL
35 KiB
PHTML
609 lines
No EOL
35 KiB
PHTML
<div
|
|
data-service="database.getCollection"
|
|
data-param-collection-id="{{router.params.id}}"
|
|
data-scope="sdk"
|
|
data-event="load,database.updateCollection,database.createAttribute,database.deleteAttribute,database.createIndex,database.deleteIndex"
|
|
data-name="project-collection">
|
|
|
|
<div class="cover">
|
|
<h1 class="zone xl margin-bottom-large">
|
|
<a data-ls-attrs="href=/console/database?project={{router.params.project}}" class="back text-size-small link-return-animation--start"><i class="icon-left-open"></i> Database</a>
|
|
|
|
<br />
|
|
|
|
<span data-ls-bind="{{project-collection.name}}"> </span>
|
|
</h1>
|
|
</div>
|
|
|
|
<div data-ui-modal class="modal width-large box close" data-button-hide="on" data-open-event="open-json">
|
|
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
|
|
|
<h2>JSON View</h2>
|
|
|
|
<div class="margin-bottom">
|
|
<input type="hidden" data-ls-bind="{{project-collection}}" data-forms-code />
|
|
</div>
|
|
|
|
<button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
|
|
</div>
|
|
|
|
<div class="zone xl">
|
|
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
|
|
<li data-state="/console/database/collection?id={{router.params.id}}&project={{router.params.project}}">
|
|
|
|
<h2>Documents</h2>
|
|
|
|
<div
|
|
data-service="database.listDocuments"
|
|
data-event="load,database.createDocument,database.updateDocument,database.deleteDocument"
|
|
data-param-collection-id="{{router.params.id}}"
|
|
data-param-search="{{router.params.search}}"
|
|
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
|
|
data-param-offset="{{router.params.offset}}"
|
|
data-param-order-type="DESC"
|
|
data-scope="sdk"
|
|
data-name="project-documents">
|
|
|
|
<div data-ls-if="0 == {{project-documents.sum}}" class="box margin-bottom">
|
|
<h3 class="margin-bottom-small text-bold">No Documents Found</h3>
|
|
|
|
<p class="margin-bottom-no">Add your first document to get started</p>
|
|
</div>
|
|
|
|
<div data-ls-if="({{project-documents.sum}})">
|
|
<div class="margin-bottom-small margin-end-small text-align-end text-size-small"><span data-ls-bind="{{project-documents.sum}}"></span> documents found</div>
|
|
|
|
<div class="box margin-bottom y-scroll">
|
|
<table class="vertical">
|
|
<thead>
|
|
<tr>
|
|
<td>UID</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody data-ls-loop="project-documents.documents" data-ls-as="node">
|
|
<tr>
|
|
<td>42343</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pull-end text-align-center paging">
|
|
<form
|
|
data-service="database.listDocuments"
|
|
data-event="submit"
|
|
data-param-collection-id="{{router.params.id}}"
|
|
data-param-search="{{router.params.search}}"
|
|
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
|
|
data-param-order-type="DESC"
|
|
data-scope="sdk"
|
|
data-name="project-documents"
|
|
data-success="state"
|
|
data-success-param-state-keys="search,offset">
|
|
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-documents.sum}}" class="margin-end round small" aria-label="Back"><i class="icon-left-open"></i></button>
|
|
</form>
|
|
|
|
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-documents.sum|pageTotal}}"></span>
|
|
|
|
<form
|
|
data-service="database.listDocuments"
|
|
data-event="submit"
|
|
data-param-collection-id="{{router.params.id}}"
|
|
data-param-search="{{router.params.search}}"
|
|
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
|
|
data-param-order-type="DESC"
|
|
data-scope="sdk"
|
|
data-name="project-documents"
|
|
data-success="state"
|
|
data-success-param-state-keys="search,offset">
|
|
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-documents.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
|
</form>
|
|
</div>
|
|
|
|
<a data-ls-attrs="href=/console/database/document?collection={{router.params.id}}&project={{router.params.project}}&buster={{project-collection.dateUpdated}}" class="button">
|
|
Add Document
|
|
</a>
|
|
</div>
|
|
</li>
|
|
<li data-state="/console/database/collection/attributes?id={{router.params.id}}&project={{router.params.project}}">
|
|
<h2>Attributes</h2>
|
|
|
|
<div class="clear box margin-bottom">
|
|
<div data-ls-if="0 == {{project-collection.attributes.length}} && 0 == {{project-collection.attributesInQueue.length}}">
|
|
<h3 class="margin-bottom-small text-bold">No Attributes Found</h3>
|
|
|
|
<p class="margin-bottom-no">Add your first attribute to get started</p>
|
|
</div>
|
|
|
|
<table class="vertical" data-ls-if="0 < {{project-collection.attributes.length}} || 0 < {{project-collection.attributesInQueue.length}}">
|
|
<thead>
|
|
<tr>
|
|
<th width="120"></th>
|
|
<th width="140">Attribute ID</th>
|
|
<th width="100">Type</th>
|
|
<th width="180">Default</th>
|
|
<th></th>
|
|
<th width="80"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody data-ls-loop="project-collection.attributes" data-ls-as="attribute">
|
|
<tr>
|
|
<td data-title="Status">
|
|
<span class="text-size-small text-success"><i class="icon-ok-circled"></i> Available </span>
|
|
</td>
|
|
|
|
<td data-title="Attribute ID: ">
|
|
<span class="text-size-small" data-ls-bind="{{attribute.$id}}"></span><span class="text-size-small" data-ls-if="{{attribute.size}}" data-ls-bind=" ({{attribute.size}})"></span>
|
|
</td>
|
|
|
|
<td data-title="Type:">
|
|
<span class="text-size-small" data-ls-bind="{{attribute.type}}"></span>
|
|
<span class="text-size-small" data-ls-if="{{attribute.array}}">[]</span>
|
|
</td>
|
|
|
|
<td data-title="Default:">
|
|
<span class="text-size-small" data-ls-bind="{{attribute.default}}" data-ls-attr="title={{attribute.default}}"></span>
|
|
<span class="text-fade text-size-small" data-ls-if="!({{attribute.default}})">n/a</span>
|
|
</td>
|
|
|
|
<td data-title="">
|
|
<span class="text-size-small text-danger" data-ls-if="{{attribute.required}}">Required *</span>
|
|
</td>
|
|
|
|
<td data-title="">
|
|
<form class="pull-end"
|
|
data-analytics
|
|
data-analytics-activity
|
|
data-analytics-event="submit"
|
|
data-analytics-category="console"
|
|
data-analytics-label="Delete Collection Attribute"
|
|
data-service="database.deleteAttribute"
|
|
data-scope="sdk"
|
|
data-event="submit"
|
|
data-confirm="Are you sure you want to delete this attribute?"
|
|
data-success="alert,trigger"
|
|
data-success-param-alert-text="Deleted attribute successfully"
|
|
data-success-param-trigger-events="database.deleteAttribute"
|
|
data-failure="alert"
|
|
data-failure-param-alert-text="Failed to delete attribute"
|
|
data-failure-param-alert-classname="error">
|
|
|
|
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
|
|
<input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
|
|
<input type="hidden" name="attributeId" data-ls-bind="{{attribute.$id}}" />
|
|
|
|
<button class="danger small">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<hr data-ls-if="0 < {{project-collection.attributesInQueue.length}}" />
|
|
|
|
<table class="vertical" data-ls-if="0 < {{project-collection.attributesInQueue.length}}">
|
|
<tbody data-ls-loop="project-collection.attributesInQueue" data-ls-as="attribute">
|
|
<tr>
|
|
<td width="120" data-title="Status">
|
|
<span class="text-size-small text-info"><i class="icon-dot-circled"></i> Creating </span>
|
|
</td>
|
|
|
|
<td width="140" data-title="Attribute ID: ">
|
|
<span class="text-size-small" data-ls-bind="{{attribute.$id}}"></span><span class="text-size-small" data-ls-if="{{attribute.size}}" data-ls-bind=" ({{attribute.size}})"></span>
|
|
</td>
|
|
|
|
<td width="100" data-title="Type:">
|
|
<span class="text-size-small" data-ls-bind="{{attribute.type}}"></span>
|
|
<span class="text-size-small" data-ls-if="{{attribute.array}}">[]</span>
|
|
</td>
|
|
|
|
<td width="180" data-title="Default:">
|
|
<span class="text-size-small" data-ls-bind="{{attribute.default}}" data-ls-attr="title={{attribute.default}}"></span>
|
|
<span class="text-fade text-size-small" data-ls-if="!({{attribute.default}})">n/a</span>
|
|
</td>
|
|
|
|
<td data-title="">
|
|
<span class="text-size-small text-danger" data-ls-if="{{attribute.required}}">Required *</span>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="drop-list pull-start" data-ls-ui-open="" data-button-aria="Choose Platform" data-button-text="Add Attribute" data-button-class="button" data-blur="1">
|
|
<ul>
|
|
<li>
|
|
<div class="link new-attribute-string"><img src="/images/clients/web.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="String Attribute Logo" class="avatar xxs margin-end-small" loading="lazy" /> New String Attribute</div>
|
|
</li>
|
|
<li>
|
|
<div class="link new-attribute-integer"><img src="/images/clients/web.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="String Attribute Logo" class="avatar xxs margin-end-small" loading="lazy" /> New Integer Attribute</div>
|
|
</li>
|
|
<li>
|
|
<div class="link new-attribute-float"><img src="/images/clients/web.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="String Attribute Logo" class="avatar xxs margin-end-small" loading="lazy" /> New Float Attribute</div>
|
|
</li>
|
|
<li>
|
|
<div class="link new-attribute-boolean"><img src="/images/clients/web.png?v=<?php echo APP_CACHE_BUSTER; ?>" alt="String Attribute Logo" class="avatar xxs margin-end-small" loading="lazy" /> New Boolean Attribute</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</li>
|
|
<li data-state="/console/database/collection/indexes?id={{router.params.id}}&project={{router.params.project}}">
|
|
<h2>Indexes</h2>
|
|
|
|
<div class="clear box margin-bottom">
|
|
<div data-ls-if="0 == {{project-collection.indexes.length}} && 0 == {{project-collection.indexesInQueue.length}}">
|
|
<h3 class="margin-bottom-small text-bold">No Indexes Found</h3>
|
|
|
|
<p class="margin-bottom-no">Add your first index to get started</p>
|
|
</div>
|
|
|
|
<table class="vertical" data-ls-if="0 < {{project-collection.indexes.length}} || 0 < {{project-collection.indexesInQueue.length}}">
|
|
<thead>
|
|
<tr>
|
|
<th width="120"></th>
|
|
<th width="140">Index ID</th>
|
|
<th width="100">Type</th>
|
|
<th width="180">Attributes</th>
|
|
<th></th>
|
|
<th width="80"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody data-ls-loop="project-collection.indexes" data-ls-as="index">
|
|
<tr>
|
|
<td data-title="Status">
|
|
<span class="text-size-small text-success"><i class="icon-ok-circled"></i> Available </span>
|
|
</td>
|
|
|
|
<td data-title="Index ID: ">
|
|
<span class="text-size-small" data-ls-bind="{{index.$id}}"></span><span class="text-size-small" data-ls-if="{{index.size}}" data-ls-bind="({{index.size}})"></span>
|
|
</td>
|
|
|
|
<td data-title="Type:">
|
|
<span class="text-size-small" data-ls-bind="{{index.type}}"></span>
|
|
<span class="text-size-small" data-ls-if="{{index.array}}">[]</span>
|
|
</td>
|
|
|
|
<td data-title="Attributes:">
|
|
<span class="text-size-small" data-ls-bind="{{index.attributes}}"></span>
|
|
</td>
|
|
|
|
<td data-title="">
|
|
<span class="text-size-small text-danger" data-ls-if="{{index.required}}">Required *</span>
|
|
</td>
|
|
|
|
<td data-title="">
|
|
<form class="pull-end"
|
|
data-analytics
|
|
data-analytics-activity
|
|
data-analytics-event="submit"
|
|
data-analytics-category="console"
|
|
data-analytics-label="Delete Collection Index"
|
|
data-service="database.deleteIndex"
|
|
data-scope="sdk"
|
|
data-event="submit"
|
|
data-confirm="Are you sure you want to delete this index?"
|
|
data-success="alert,trigger"
|
|
data-success-param-alert-text="Deleted index successfully"
|
|
data-success-param-trigger-events="database.deleteIndex"
|
|
data-failure="alert"
|
|
data-failure-param-alert-text="Failed to delete index"
|
|
data-failure-param-alert-classname="error">
|
|
|
|
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
|
|
<input type="hidden" name="collectionId" data-ls-bind="{{project-collection.$id}}" />
|
|
<input type="hidden" name="attributeId" data-ls-bind="{{attribute.$id}}" />
|
|
|
|
<button class="danger small">Delete</button>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<hr data-ls-if="0 < {{project-collection.indexesInQueue.length}}" />
|
|
|
|
<table class="vertical" data-ls-if="0 < {{project-collection.indexesInQueue.length}}">
|
|
<tbody data-ls-loop="project-collection.indexesInQueue" data-ls-as="index">
|
|
<tr>
|
|
<td width="120" data-title="Status">
|
|
<span class="text-size-small text-info"><i class="icon-dot-circled"></i> Creating </span>
|
|
</td>
|
|
|
|
<td width="140" data-title="Index ID: ">
|
|
<span class="text-size-small" data-ls-bind="{{index.$id}}"></span><span class="text-size-small" data-ls-if="{{index.size}}" data-ls-bind="({{index.size}})"></span>
|
|
</td>
|
|
|
|
<td width="100" data-title="Type:">
|
|
<span class="text-size-small" data-ls-bind="{{index.type}}"></span>
|
|
<span class="text-size-small" data-ls-if="{{index.array}}">[]</span>
|
|
</td>
|
|
|
|
<td width="180" data-title="Attributes:">
|
|
<span class="text-size-small" data-ls-bind="{{index.attributes}}"></span>
|
|
</td>
|
|
|
|
<td data-title="">
|
|
<span class="text-size-small text-danger" data-ls-if="{{index.required}}">Required *</span>
|
|
</td>
|
|
|
|
<td width="80" data-title="">
|
|
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<button class="new-index">Add Index</button>
|
|
</li>
|
|
<li data-state="/console/database/collection/settings?id={{router.params.id}}&project={{router.params.project}}">
|
|
<h2>Settings</h2>
|
|
|
|
<div class="row responsive margin-top-negative">
|
|
<div class="col span-8 margin-bottom">
|
|
<form
|
|
data-analytics
|
|
data-analytics-activity
|
|
data-analytics-event="submit"
|
|
data-analytics-category="console"
|
|
data-analytics-label="Update Database Collection"
|
|
data-service="database.updateCollection"
|
|
data-scope="sdk"
|
|
data-event="submit"
|
|
data-param-collection-id="{{router.params.id}}"
|
|
data-success="alert,trigger,redirect"
|
|
data-success-param-alert-text="Updated collection successfully"
|
|
data-success-param-trigger-events="database.updateCollection"
|
|
data-success-param-redirect-url="/console/database/collection/settings?id={{serviceData.$id}}&project={{router.params.project}}"
|
|
data-failure="alert"
|
|
data-failure-param-alert-text="Failed to update collection"
|
|
data-failure-param-alert-classname="error">
|
|
|
|
<label> </label>
|
|
|
|
<div class="box">
|
|
<label for="collection-name">Name</label>
|
|
<input name="name" id="collection-name" type="text" autocomplete="off" data-ls-bind="{{project-collection.name}}" data-forms-text-direction required placeholder="Collection Name" maxlength="128" />
|
|
|
|
<div class="toggle margin-bottom margin-top" data-ls-ui-open data-button-aria="Open Permissions">
|
|
<i class="icon-plus pull-end margin-top-tiny"></i>
|
|
<i class="icon-minus pull-end margin-top-tiny"></i>
|
|
|
|
<h3 class="margin-bottom-large">Permissions</h3>
|
|
|
|
<label for="collection-read">Read Access <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</span></label>
|
|
<input type="hidden" id="collection-read" name="read" data-forms-tags data-cast-to="json" data-ls-bind="{{project-collection.$permissions.read}}" placeholder="User ID, Team ID or Role" />
|
|
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div>
|
|
|
|
<label for="collection-write">Write Access <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank" rel="noopener">Learn more</a>)</label>
|
|
<input type="hidden" id="collection-write" name="write" data-forms-tags data-cast-to="json" data-ls-bind="{{project-collection.$permissions.write}}" placeholder="User ID, Team ID or Role" />
|
|
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div>
|
|
</div>
|
|
|
|
<button>Update</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="col span-4 sticky-top">
|
|
<label>Collection ID</label>
|
|
<div class="input-copy margin-bottom">
|
|
<input id="id" type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-collection.$id}}" disabled data-forms-copy class="margin-bottom-no" />
|
|
</div>
|
|
|
|
<ul class="margin-bottom-large text-fade text-size-small">
|
|
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> <button data-ls-ui-trigger="open-json" class="link text-size-small">View as JSON</button></li>
|
|
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Last Updated: <span data-ls-bind="{{project-collection.dateUpdated|dateText}}"></span></li>
|
|
<li class="margin-bottom-small"><i class="icon-angle-circled-right margin-start-tiny margin-end-tiny"></i> Created: <span data-ls-bind="{{project-collection.dateCreated|dateText}}"></span></li>
|
|
</ul>
|
|
|
|
<form name="database.deleteCollection" class="margin-bottom"
|
|
data-analytics
|
|
data-analytics-activity
|
|
data-analytics-event="submit"
|
|
data-analytics-category="console"
|
|
data-analytics-label="Delete Database Collection"
|
|
data-service="database.deleteCollection"
|
|
data-event="submit"
|
|
data-param-collection-id="{{router.params.id}}"
|
|
data-confirm="Are you sure you want to delete this collection?"
|
|
data-success="alert,trigger,redirect"
|
|
data-success-param-alert-text="Collection deleted successfully"
|
|
data-success-param-trigger-events="database.deleteCollection"
|
|
data-success-param-redirect-url="/console/database?project={{router.params.project}}"
|
|
data-failure="alert"
|
|
data-failure-param-alert-text="Failed to delete collection"
|
|
data-failure-param-alert-classname="error">
|
|
|
|
<button type="submit" class="danger fill">Delete Collection</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div data-ui-modal class="modal box close sticky-footer" data-button-alias=".new-attribute-string">
|
|
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
|
|
|
<h1>Add String Attribute</h1>
|
|
|
|
<form
|
|
data-analytics
|
|
data-analytics-activity
|
|
data-analytics-event="submit"
|
|
data-analytics-category="console"
|
|
data-analytics-label="Create Collection Attribute (string)"
|
|
data-service="database.createStringAttribute"
|
|
data-scope="sdk"
|
|
data-event="submit"
|
|
data-success="alert,trigger,reset"
|
|
data-success-param-alert-text="Created new attribute successfully"
|
|
data-success-param-trigger-events="database.createAttribute"
|
|
data-failure="alert"
|
|
data-failure-param-alert-text="Failed to create attribute"
|
|
data-failure-param-alert-classname="error">
|
|
|
|
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
|
|
<input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />
|
|
|
|
<label for="string-attributeId">Attribute ID</label>
|
|
<input type="text" class="full-width" name="attributeId" required autocomplete="off" maxlength="128" />
|
|
|
|
<label for="string-length">Size</label>
|
|
<input id="string-length" name="size" type="number" class="margin-bottom" autocomplete="off" required value="255" data-cast-to="integer" />
|
|
|
|
<div class="margin-bottom">
|
|
<input name="required" type="hidden" data-forms-switch data-cast-to="boolean" /> Required <span class="tooltip" data-tooltip="Mark whether this is a required attribute"><i class="icon-info-circled"></i></span>
|
|
</div>
|
|
|
|
<div class="margin-bottom">
|
|
<input name="array" type="hidden" data-forms-switch data-cast-to="boolean" /> Array <span class="tooltip" data-tooltip="Mark whether this attribute should act as an array"><i class="icon-info-circled"></i></span>
|
|
</div>
|
|
|
|
<label for="string-default">Default Value</label>
|
|
<input id="string-default" name="default" type="text" class="margin-bottom-large" autocomplete="off">
|
|
|
|
<footer>
|
|
<button type="submit">Create</button> <button data-ui-modal-close="" type="button" class="reverse">Back</button>
|
|
</footer>
|
|
</form>
|
|
</div>
|
|
|
|
<div data-ui-modal class="modal box close sticky-footer" data-button-alias=".new-attribute-integer">
|
|
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
|
|
|
<h1>Add Integer Attribute</h1>
|
|
|
|
<form
|
|
data-analytics
|
|
data-analytics-activity
|
|
data-analytics-event="submit"
|
|
data-analytics-category="console"
|
|
data-analytics-label="Create Collection Attribute (integer)"
|
|
data-service="database.createIntegerAttribute"
|
|
data-scope="sdk"
|
|
data-event="submit"
|
|
data-success="alert,trigger,reset"
|
|
data-success-param-alert-text="Created new attribute successfully"
|
|
data-success-param-trigger-events="database.createAttribute"
|
|
data-failure="alert"
|
|
data-failure-param-alert-text="Failed to create attribute"
|
|
data-failure-param-alert-classname="error">
|
|
|
|
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
|
|
<input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />
|
|
|
|
<label for="integer-attributeId">Attribute ID</label>
|
|
<input type="text" class="full-width" name="attributeId" required autocomplete="off" maxlength="128" />
|
|
|
|
<div class="margin-bottom">
|
|
<input name="required" type="hidden" data-forms-switch data-cast-to="boolean" /> Required <span class="tooltip" data-tooltip="Mark whether this is a required attribute"><i class="icon-info-circled"></i></span>
|
|
</div>
|
|
|
|
<div class="margin-bottom">
|
|
<input name="array" type="hidden" data-forms-switch data-cast-to="boolean" /> Array <span class="tooltip" data-tooltip="Mark whether this attribute should act as an array"><i class="icon-info-circled"></i></span>
|
|
</div>
|
|
|
|
<div class="row responsive thin">
|
|
<div class="col span-6 margin-bottom-small">
|
|
<label for="integer-min">Min</label>
|
|
<input type="text" class="full-width" name="number" value="0" required autocomplete="off" />
|
|
</div>
|
|
<div class="col span-6 margin-bottom-small">
|
|
<label for="integer-min">Max</label>
|
|
<input type="text" class="full-width" name="number" value="0" required autocomplete="off" />
|
|
</div>
|
|
</div>
|
|
|
|
<label for="integer-default">Default Value</label>
|
|
<input id="integer-default" name="default" type="number" value="0" class="margin-bottom-large" autocomplete="off">
|
|
|
|
<footer>
|
|
<button type="submit">Create</button> <button data-ui-modal-close="" type="button" class="reverse">Back</button>
|
|
</footer>
|
|
</form>
|
|
</div>
|
|
|
|
<div data-ui-modal class="modal box close sticky-footer" data-button-alias=".new-index">
|
|
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
|
|
|
<h1>Add Index</h1>
|
|
|
|
<div data-ls-if="0 == {{project-collection.attributes.length}}">
|
|
<div class="info margin-top margin-bottom">
|
|
<h2>No Attributes Found</h2>
|
|
|
|
<p>Please add your first attribute before adding your first index.</p>
|
|
</div>
|
|
|
|
<button data-ui-modal-close="" type="button" class="reverse">Back</button>
|
|
</div>
|
|
|
|
<form data-ls-if="0 < {{project-collection.attributes.length}}"
|
|
data-analytics
|
|
data-analytics-activity
|
|
data-analytics-event="submit"
|
|
data-analytics-category="console"
|
|
data-analytics-label="Create Collection Index"
|
|
data-service="database.createIndex"
|
|
data-scope="sdk"
|
|
data-event="submit"
|
|
data-success="alert,trigger,reset"
|
|
data-success-param-alert-text="Created new index successfully"
|
|
data-success-param-trigger-events="database.createIndex"
|
|
data-failure="alert"
|
|
data-failure-param-alert-text="Failed to create index"
|
|
data-failure-param-alert-classname="error">
|
|
|
|
<input type="hidden" name="projectId" data-ls-bind="{{router.params.project}}" />
|
|
<input type="hidden" name="collectionId" data-ls-bind="{{router.params.id}}" />
|
|
|
|
<label for="index-indexId">Index ID</label>
|
|
<input id="index-indexId" type="text" class="full-width" name="indexId" required autocomplete="off" maxlength="128" />
|
|
|
|
<label for="index-type">Type</label>
|
|
<select id="index-type" name="type">
|
|
<option value="key">Key</option>
|
|
<option value="unique">Unique</option>
|
|
<option value="fulltext">Fulltext</option>
|
|
</select>
|
|
|
|
<label>Attributes</label>
|
|
|
|
<div id="attributes-section"></div>
|
|
|
|
<div class="margin-bottom">
|
|
<div data-forms-clone="" data-label="Add Attribute" data-target="attributes-section" data-first="1">
|
|
<div class="row responsive thin margin-bottom-tiny">
|
|
<div class="col span-7 margin-bottom-small">
|
|
<select data-duplications data-ls-attrs="name=attributes" data-ls-loop="project-collection.attributes" data-ls-as="option" data-cast-to="array" class="margin-bottom-no">
|
|
<option data-ls-attrs="value={{option.$id}}" data-ls-bind="{{option.$id}}"></option>
|
|
</select>
|
|
</div>
|
|
<div class="col span-4 margin-bottom-small">
|
|
<select name="orders" data-cast-to="array" class="margin-bottom-no">
|
|
<option value="ASC">ASC</option>
|
|
<option value="DESC">DESC</option>
|
|
</select>
|
|
</div>
|
|
<div class="col span-1 margin-bottom-small">
|
|
<button type="button" data-remove class="dark danger small round pull-end" style="margin-top: 10px;"><i class="icon-cancel"></i></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<footer>
|
|
<button type="submit">Create</button> <button data-ui-modal-close="" type="button" class="reverse">Back</button>
|
|
</footer>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="margin-top"
|
|
data-service="database.listCollections"
|
|
data-event="load,database.createCollection,database.updateCollection,database.deleteCollection"
|
|
data-scope="sdk"
|
|
data-name="project-collections">
|
|
</div>
|