1
0
Fork 0
mirror of synced 2024-06-13 16:24:47 +12:00
appwrite/app/views/console/database/collection.phtml

317 lines
19 KiB
PHTML
Raw Normal View History

2020-03-09 08:27:21 +13:00
<div
2019-08-08 06:10:53 +12:00
data-service="database.getCollection"
data-param-collection-id="{{router.params.id}}"
2020-03-09 08:27:21 +13:00
data-scope="sdk"
data-event="load,database.updateCollection"
2019-08-08 06:10:53 +12:00
data-name="project-collection">
2019-08-17 18:06:56 +12:00
2020-03-09 08:27:21 +13:00
<div class="cover">
<h1 class="zone xl margin-bottom-large">
2020-06-10 02:43:24 +12:00
<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>
2019-08-17 18:06:56 +12:00
2020-03-09 08:27:21 +13:00
<br />
2019-08-17 18:06:56 +12:00
2021-07-29 20:09:24 +12:00
<span data-ls-bind="{{project-collection.name}}">&nbsp;&nbsp;</span>
2020-03-09 08:27:21 +13:00
</h1>
2019-08-17 18:06:56 +12:00
</div>
2020-04-21 20:12:06 +12:00
<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>
2020-04-21 20:29:09 +12:00
<h2>JSON View</h2>
2020-04-21 20:12:06 +12:00
<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>
2020-03-09 08:27:21 +13:00
<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}}">
2020-04-02 10:41:29 +13:00
2020-03-09 08:27:21 +13:00
<h2>Documents</h2>
2020-03-15 17:54:55 +13:00
2020-03-16 06:16:42 +13:00
<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>
2020-03-15 17:54:55 +13:00
<div
data-service="database.listDocuments"
data-event="load,database.createDocument,database.updateDocument,database.deleteDocument"
2020-03-16 06:16:42 +13:00
data-param-collection-id="{{router.params.id}}"
2020-03-15 17:54:55 +13:00
data-param-search="{{router.params.search}}"
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset="{{router.params.offset}}"
2020-04-02 10:41:29 +13:00
data-param-order-type="DESC"
2020-03-15 17:54:55 +13:00
data-scope="sdk"
data-name="project-documents">
<div data-ls-if="0 == {{project-documents.sum}}" class="box margin-bottom">
2020-05-22 13:39:00 +12:00
<h3 class="margin-bottom-small text-bold">No Documents Found</h3>
2020-03-15 17:54:55 +13:00
<p class="margin-bottom-no">Create your first document to get started</p>
</div>
2020-03-16 06:16:42 +13:00
<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>
2020-03-17 07:41:56 +13:00
<div class="box margin-bottom y-scroll">
<table class="vertical">
2020-03-16 06:16:42 +13:00
<thead>
2020-05-03 07:57:52 +12:00
<tr>
2021-08-08 00:45:44 +12:00
<td>UID</td>
2020-03-16 06:16:42 +13:00
</tr>
</thead>
<tbody data-ls-loop="project-documents.documents" data-ls-as="node">
2020-05-03 07:57:52 +12:00
<tr>
2021-08-08 00:45:44 +12:00
<td>42343</td>
2020-03-16 06:16:42 +13:00
</tr>
</tbody>
</table>
</div>
</div>
2021-04-03 19:29:13 +13:00
<div class="pull-end text-align-center paging">
2020-03-16 06:16:42 +13:00
<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>
2020-03-15 17:54:55 +13:00
</div>
2021-04-03 19:29:13 +13:00
2021-08-08 00:45:44 +12:00
<a data-ls-attrs="href=/console/database/document?collection={{router.params.id}}&project={{router.params.project}}&buster={{project-collection.dateUpdated}}" class="button">
2021-04-03 19:29:13 +13:00
Add Document
</a>
2020-03-15 17:54:55 +13:00
</div>
2020-03-09 08:27:21 +13:00
</li>
2021-08-08 00:45:44 +12:00
<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>
2020-04-25 07:58:40 +12:00
<li data-state="/console/database/collection/settings?id={{router.params.id}}&project={{router.params.project}}">
<h2>Settings</h2>
2020-03-09 08:27:21 +13:00
<div class="row responsive margin-top-negative">
<div class="col span-8 margin-bottom">
2020-03-17 07:41:56 +13:00
<form
2021-01-18 19:29:26 +13:00
data-analytics
data-analytics-activity
2020-03-09 08:27:21 +13:00
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}}"
2020-05-31 17:56:13 +12:00
data-success="alert,trigger,redirect"
2020-03-09 08:27:21 +13:00
data-success-param-alert-text="Updated collection successfully"
data-success-param-trigger-events="database.updateCollection"
2020-05-31 17:56:13 +12:00
data-success-param-redirect-url="/console/database/collection/settings?id={{serviceData.$id}}&project={{router.params.project}}"
2020-03-09 08:27:21 +13:00
data-failure="alert"
data-failure-param-alert-text="Failed to update collection"
data-failure-param-alert-classname="error">
<label>&nbsp;</label>
2020-03-16 06:16:42 +13:00
2020-04-28 06:36:21 +12:00
<div class="box">
2021-07-29 20:09:24 +12:00
<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">
2020-03-09 08:27:21 +13:00
<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>
2020-03-09 08:27:21 +13:00
<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" />
2020-05-30 22:21:36 +12:00
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div>
2020-03-09 08:27:21 +13:00
<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>
2020-03-09 08:27:21 +13:00
<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" />
2020-05-30 22:21:36 +12:00
<div class="text-fade text-size-xs margin-top-negative-small margin-bottom">Add * for wildcard access</div>
2020-03-09 08:27:21 +13:00
</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">
2020-04-21 20:12:06 +12:00
<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>
2020-07-15 23:22:38 +12:00
<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>
2020-03-09 08:27:21 +13:00
</ul>
<form name="database.deleteCollection" class="margin-bottom"
2021-01-18 19:29:26 +13:00
data-analytics
data-analytics-activity
2020-03-09 08:27:21 +13:00
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>
2020-03-15 17:54:55 +13:00
</li>
2020-03-09 08:27:21 +13:00
</ul>
2019-08-07 02:28:42 +12:00
</div>
2020-04-04 08:27:18 +13:00
</div>
2021-08-08 00:45:44 +12:00
<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>
2020-04-04 08:27:18 +13:00
2021-08-08 00:45:44 +12:00
<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>
2020-04-04 08:27:18 +13:00
2021-08-08 00:45:44 +12:00
<h1>Create a String Attribute</h1>
2020-05-03 07:57:52 +12:00
2021-08-08 00:45:44 +12:00
<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">
2020-05-03 07:57:52 +12:00
2021-08-08 00:45:44 +12:00
<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" />
2020-04-21 20:12:06 +12:00
2021-08-08 00:45:44 +12:00
<label for="string-attributeId">Attribute ID</label>
<input type="text" class="full-width" name="attributeId" required autocomplete="off" maxlength="128" />
2020-04-21 20:12:06 +12:00
2021-08-08 00:45:44 +12:00
<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" />
2020-04-04 08:27:18 +13:00
2021-08-08 00:45:44 +12:00
<div class="margin-bottom">
<input name="required" type="hidden" data-forms-switch data-cast-to="boolean" /> &nbsp; Required <span class="tooltip" data-tooltip="Mark whether this is a required attribute"><i class="icon-info-circled"></i></span>
2020-04-04 08:27:18 +13:00
</div>
2021-08-08 00:45:44 +12:00
<div class="margin-bottom">
<input name="array" type="hidden" data-forms-switch data-cast-to="boolean" /> &nbsp; Array <span class="tooltip" data-tooltip="Mark whether this attribute should act as an array"><i class="icon-info-circled"></i></span>
2020-04-21 20:12:06 +12:00
</div>
2021-08-08 00:45:44 +12:00
<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> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Back</button>
</footer>
</form>
</div>