1
0
Fork 0
mirror of synced 2024-06-02 10:54:44 +12:00
appwrite/app/views/console/database/index.phtml

228 lines
13 KiB
PHTML
Raw Normal View History

2019-08-22 11:08:22 +12:00
<div class="cover">
2020-03-09 08:27:21 +13:00
<h1 class="zone xl margin-bottom-large">
2020-06-10 02:43:24 +12:00
<a data-ls-attrs="href=/console/home?project={{router.params.project}}" class="back text-size-small link-return-animation--start"><i class="icon-left-open"></i> Home</a>
2020-02-28 06:44:03 +13:00
<br />
<span>Database</span>
2019-05-09 18:54:39 +12:00
</h1>
</div>
2020-03-09 08:27:21 +13:00
<div class="zone xl">
2019-08-22 11:08:22 +12:00
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
2020-03-09 08:27:21 +13:00
<li data-state="/console/database?project={{router.params.project}}">
<h2>Collections</h2>
<div class="margin-top"
data-service="database.listCollections"
data-event="load,database.createCollection,database.updateCollection,database.deleteCollection"
data-param-search="{{router.params.search}}"
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset="{{router.params.offset}}"
data-param-order-type="ASC"
data-scope="sdk"
data-name="project-collections">
<div data-ls-if="(!{{project-collections.sum}})" class="box dashboard margin-bottom">
<div class="margin-bottom-small margin-top-small margin-end margin-start">
<h3 class="margin-bottom-small text-bold">No Collections Found</h3>
<p class="margin-bottom-no">You haven't created any collections for your project yet.</p>
2019-08-18 17:25:32 +12:00
</div>
</div>
2020-03-09 08:27:21 +13:00
<div data-ls-if="0 != {{project-collections.sum}}">
2020-10-30 09:11:16 +13:00
<ul data-ls-loop="project-collections.collections" data-ls-as="collection" data-ls-append="" class="tiles cell-3 margin-bottom-small">
2020-03-09 08:27:21 +13:00
<li class="margin-bottom">
<a data-ls-attrs="href=/console/database/collection?id={{collection.$id}}&project={{router.params.project}}" class="box">
2021-07-29 20:09:24 +12:00
<div data-ls-bind="{{collection.name}}" class="text-one-liner margin-bottom text-bold">&nbsp;</div>
2020-03-09 08:27:21 +13:00
<i class="icon-right-open"></i>
</a>
</li>
</ul>
</div>
2021-04-03 19:29:13 +13:00
<div class="pull-end text-align-center paging">
2020-03-09 08:27:21 +13:00
<form
data-service="database.listCollections"
data-event="submit"
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-collections"
data-success="state"
data-success-param-state-keys="search,offset">
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-collections.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-collections.sum|pageTotal}}"></span>
<form
data-service="database.listCollections"
data-event="submit"
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-collections"
data-success="state"
data-success-param-state-keys="search,offset">
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-collections.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
</form>
</div>
2021-04-03 19:29:13 +13:00
<div data-ui-modal class="modal close box sticky-footer" data-button-text="Add Collection">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h1>New Collection</h1>
<form
data-analytics
data-analytics-activity
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Create Database Collection"
data-service="database.createCollection"
data-event="submit"
data-scope="sdk"
data-success="alert,reset,redirect,trigger"
data-success-param-alert-text="Collection created successfully"
data-success-param-redirect-url="/console/database/collection/settings?id={{serviceData.$id}}&project={{router.params.project}}"
data-success-param-trigger-events="database.createCollection"
data-failure="alert"
data-failure-param-alert-text="Failed to create collection"
data-failure-param-alert-classname="error">
2021-07-27 18:41:48 +12:00
<label for="collection-id">Collection ID</label>
<input
type="hidden"
data-custom-id
data-id-type="auto"
data-validator="database.getCollection"
2021-07-27 18:41:48 +12:00
required
maxlength="36"
name="collectionId" />
2021-08-03 22:12:26 +12:00
<label for="collection-name">Name</label>
<input type="text" class="full-width" id="collection-name" name="name" required autocomplete="off" maxlength="128" />
2021-07-20 23:36:27 +12:00
2021-08-20 00:50:10 +12:00
<input type="hidden" id="collection-permission" name="permission" required value="document" />
2021-04-03 19:29:13 +13:00
<input type="hidden" id="collection-read" name="read" required data-cast-to="json" value="<?php echo htmlentities(json_encode([])); ?>" />
<input type="hidden" id="collection-write" name="write" required data-cast-to="json" value="<?php echo htmlentities(json_encode([])); ?>" />
2021-04-03 19:29:13 +13:00
<hr />
<button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</form>
</div>
2020-03-09 08:27:21 +13:00
</li>
2021-10-27 02:19:28 +13:00
<li data-state="/console/database/usage?project={{router.params.project}}">
<form class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '90d'"
data-service="database.getUsage"
data-event="submit"
data-name="usage"
data-param-range="90d">
<button class="tick">90d</button>
</form>
<button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '90d'" disabled>90d</button>
<form class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '30d'"
data-service="database.getUsage"
data-event="submit"
data-name="usage">
<button class="tick">30d</button>
</form>
<button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '30d'" disabled>30d</button>
<form class="pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} !== '24h'"
data-service="database.getUsage"
data-event="submit"
data-name="usage"
data-param-range="24h">
<button class="tick">24h</button>
</form>
<button class="tick pull-end margin-start-small margin-top-small" data-ls-if="{{usage.range}} === '24h'" disabled>24h</button>
2020-03-09 08:27:21 +13:00
<h2>Usage</h2>
2021-10-27 02:19:28 +13:00
<div
data-service="database.getUsage"
data-event="load"
data-name="usage">
2021-11-18 23:33:42 +13:00
<h3 class="margin-bottom-tiny">Objects</h3>
<p class="text-fade">Count of collections and documents over time</p>
2021-10-27 02:19:28 +13:00
<div class="box margin-bottom-small">
<div class="margin-start-negative-small margin-end-negative-small margin-top-negative-small margin-bottom-negative-small">
<div class="chart margin-bottom-no">
2021-11-18 23:33:42 +13:00
<input
type="hidden"
data-ls-bind="{{usage}}"
data-forms-chart="Collections=collectionsCount,Documents=documentsCount"
data-show-y-axis="true"
data-height="140" />
2021-10-27 02:19:28 +13:00
</div>
</div>
</div>
<ul class="chart-notes margin-bottom-large">
<li>Total Collections <span data-ls-bind="({{usage.collectionsCount|statsGetLast|statsTotal}})"></span></li>
2021-11-18 23:33:42 +13:00
<li>Total Documents <span data-ls-bind="({{usage.documentsCount|statsGetLast|statsTotal}})"></span></li>
2021-10-27 02:19:28 +13:00
</ul>
2021-11-18 23:33:42 +13:00
<h3 class="margin-bottom-tiny">Collections</h3>
<p class="text-fade">Count of collections create, read, update and delete operations over time</p>
2021-10-27 02:19:28 +13:00
<div class="box margin-bottom-small">
<div class="margin-start-negative-small margin-end-negative-small margin-top-negative-small margin-bottom-negative-small">
<div class="chart margin-bottom-no">
2021-11-18 23:33:42 +13:00
<input
type="hidden"
data-ls-bind="{{usage}}"
data-forms-chart="Created=collectionsCreate,Read=collectionsRead,Updated=collectionsUpdate,Deleted=collectionsDelete"
data-show-y-axis="true"
data-colors="create,read,update,delete"
data-height="140" />
2021-10-27 02:19:28 +13:00
</div>
</div>
</div>
2021-11-18 23:33:42 +13:00
<ul class="chart-notes margin-bottom-large crud">
<li>Created <span data-ls-bind="({{usage.collectionsCreate|statsGetLast|statsTotal}})"></span></li>
<li>Read <span data-ls-bind="({{usage.collectionsRead|statsGetLast|statsTotal}})"></span></li>
<li>Updated <span data-ls-bind="({{usage.collectionsUpdate|statsGetLast|statsTotal}})"></span></li>
<li>Deleted <span data-ls-bind="({{usage.collectionsDelete|statsGetLast|statsTotal}})"></span></li>
2021-10-27 02:19:28 +13:00
</ul>
2021-11-18 23:33:42 +13:00
<h3 class="margin-bottom-tiny">Documents</h3>
<p class="text-fade">Count of documents create, read, update and delete operations over time</p>
2021-10-27 02:19:28 +13:00
<div class="box margin-bottom-small">
<div class="margin-start-negative-small margin-end-negative-small margin-top-negative-small margin-bottom-negative-small">
<div class="chart margin-bottom-no">
2021-11-18 23:33:42 +13:00
<input
type="hidden"
data-ls-bind="{{usage}}"
data-forms-chart="Created=documentsCreate,Read=documentsRead,Updated=documentsUpdate,Deleted=documentsDelete"
data-show-y-axis="true"
data-colors="create,read,update,delete"
data-height="140" />
2021-10-27 02:19:28 +13:00
</div>
</div>
</div>
2021-11-18 23:33:42 +13:00
<ul class="chart-notes margin-bottom-large crud">
<li>Created <span data-ls-bind="({{usage.documentsCreate|statsGetLast|statsTotal}})"></span></li>
<li>Read <span data-ls-bind="({{usage.documentsRead|statsGetLast|statsTotal}})"></span></li>
<li>Updated <span data-ls-bind="({{usage.documentsUpdate|statsGetLast|statsTotal}})"></span></li>
<li>Deleted <span data-ls-bind="({{usage.documentsDelete|statsGetLast|statsTotal}})"></span></li>
2021-10-27 02:19:28 +13:00
</ul>
</div>
</li>
2020-03-09 08:27:21 +13:00
</ul>
</div>
2020-06-10 02:43:24 +12:00
</div>