317 lines
No EOL
19 KiB
PHTML
317 lines
No EOL
19 KiB
PHTML
<div
|
|
data-service="database.getCollection"
|
|
data-param-collection-id="{{router.params.id}}"
|
|
data-scope="sdk"
|
|
data-event="load,database.updateCollection"
|
|
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>
|
|
|
|
<form class="box padding-small margin-bottom search"
|
|
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-offset=""
|
|
data-param-order-type="DESC"
|
|
data-scope="sdk"
|
|
data-name="project-documents"
|
|
data-success="state"
|
|
data-success-param-state-keys="search,offset">
|
|
<div class="row thin responsive">
|
|
<div class="col span-10">
|
|
<input name="search" id="searchDocuments" type="search" autocomplete="off" placeholder="Search" class="margin-bottom-no" data-ls-bind="{{router.params.search}}">
|
|
</div>
|
|
<div class="col span-2 desktops-only">
|
|
<button class="fill" title="Search" aria-label="Search"><i class="icon-search"></i></button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<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">Create 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 x</h2>
|
|
|
|
<span data-ls-bind="{{project-collection.attributes.length}}"></span>
|
|
<span data-ls-bind="{{project-collection.attributes}}"></span>
|
|
<span data-ls-bind="{{project-collection}}"></span>
|
|
<span data-ls-bind="{{project-collection}}">xxx</span>
|
|
|
|
<div class="clear">
|
|
<div data-ls-if="0 == {{project-collection.attributes.length}}" class="box margin-bottom">
|
|
<h3 class="margin-bottom-small text-bold">No Attributes Found</h3>
|
|
|
|
<p class="margin-bottom-no">Create your first attribute to get started</p>
|
|
</div>
|
|
|
|
<div class="drop-list pull-start" data-ls-ui-open="" data-button-aria="Choose Platform" data-button-text="Create 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>
|
|
</div>
|
|
</li>
|
|
<li data-state="/console/database/collection/indexes?id={{router.params.id}}&project={{router.params.project}}">
|
|
<h2>Indexes</h2>
|
|
</li>
|
|
<li data-state="/console/database/collection/indexes?id={{router.params.id}}&project={{router.params.project}}">
|
|
<h2>Queue</h2>
|
|
|
|
<div data-ls-if="0 == {{project-documents.sum}}" class="box margin-bottom">
|
|
<h3 class="margin-bottom-small text-bold">No Attributes Found in the Queue</h3>
|
|
|
|
<p class="margin-bottom-no">Create your first attribute to get started</p>
|
|
</div>
|
|
</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>
|
|
|
|
<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>
|
|
|
|
|
|
<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>Create a 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.createStringAttribute"
|
|
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}}" />
|
|
<input type="hidden" name="type" data-ls-bind="web" />
|
|
|
|
<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="number" 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>
|