1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

New DB UI

This commit is contained in:
Eldad Fux 2020-03-08 21:27:21 +02:00
parent dc4ee8757f
commit fe34086ac6
14 changed files with 289 additions and 394 deletions

View file

@ -187,20 +187,9 @@ $utopia->get('/console/database/collection')
->desc('Platform console project settings')
->label('permission', 'public')
->label('scope', 'console')
->param('id', '', function () { return new UID(); }, 'Collection unique ID.')
->action(function ($id) use ($layout, $projectDB) {
$collection = $projectDB->getDocument($id, false);
if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) {
throw new Exception('Collection not found', 404);
}
->action(function () use ($layout, $projectDB) {
$page = new View(__DIR__.'/../../views/console/database/collection.phtml');
$page
->setParam('collection', $collection->getArrayCopy())
;
$layout
->setParam('title', APP_NAME.' - Database')
->setParam('body', $page);

View file

@ -1,160 +1,195 @@
<?php
$collection = $this->getParam('collection', []);
?>
<div class="cover margin-bottom-large"
<div
data-service="database.getCollection"
data-param-collection-id="{{router.params.id}}"
data-scope="sdk" data-event="load"
data-scope="sdk"
data-event="load,database.updateCollection"
data-name="project-collection">
<h1 class="zone xxl margin-bottom-large">
<a data-ls-attrs="href=/console/database?project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> Database</a>
<br />
<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"><i class="icon-left-open"></i> Database</a>
<span data-ls-bind="{{project-collection.name}}">&nbsp;&nbsp;</span>
</h1>
</div>
<br />
<div class="zone xxl">
<div data-ui-modal class="box modal close" data-button-text="" data-button-class="fly round" data-button-icon="icon-plus">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h1>Create Document</h1>
<form
data-service="database.createCollection"
data-event="submit"
data-scope="sdk"
data-success="alert,trigger,reset"
data-success-param-alert-text="Created document successfully"
data-success-param-trigger-events="database.createCollection"
data-failure="alert"
data-failure-param-alert-text="Failed to create document"
data-failure-param-alert-classname="error">
<hr />
<button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</form>
<span data-ls-bind="{{project-collection.name}}" data-debug="1">&nbsp;&nbsp;</span>
</h1>
</div>
<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 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">
<button class="fill">Search</button>
</div>
</div>
</form>
<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>
</li>
<li data-state="/console/database/collection/settings?id={{router.params.id}}&project={{router.params.project}}">
<h2>Settings</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 class="row responsive margin-top-negative">
<div class="col span-8 margin-bottom">
<form
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"
data-success-param-alert-text="Updated collection successfully"
data-success-param-trigger-events="database.updateCollection"
data-failure="alert"
data-failure-param-alert-text="Failed to update collection"
data-failure-param-alert-classname="error">
<div data-ls-if="0 == {{project-documents.sum}}" class="box margin-bottom">
<h3 class="margin-bottom">No Documents Found</h3>
<label>&nbsp;</label>
<div class="box margin-bottom">
<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" />
<h3 class="margin-bottom-small">Rules</h3>
<p class="margin-bottom-no">Create your first document to get started</p>
</div>
<div data-ls-if="(!{{project-collection.rules.length}})">
<div class="margin-bottom-xl margin-top-large margin-end margin-start text-align-center">
<h4 class="text-fade text-size-small">No rules added yet.</h4>
</div>
</div>
<div data-ls-if="0 != {{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 data-ls-if="({{project-collection.rules.length}})">
<ul data-ls-loop="project-collection.rules" data-ls-as="rule">
<li>
<hr class="margin-bottom-small margin-top-small" />
<div class="row">
<div class="col span-4 text-bold text-one-liner">
<span data-ls-bind="{{rule.label}}"></span>
<br />
<span data-ls-bind="{{rule.key}}" class="text-size-small text-fade"></span>
</div>
<div class="col span-4 text-one-liner">
<span class="tag blue" data-ls-bind=" &nbsp; {{rule.type}} &nbsp; "></span>
<span data-ls-if="({{rule.array}})">
&nbsp;&nbsp;&nbsp;&nbsp;<span class="text-fade text-size-small">array</span>
</span>
</div>
<div class="col span-2 text-align-center">
<span data-ls-if="({{rule.required}})">
&nbsp;<span class="text-danger text-size-small">required</span>
</span>
</div>
<div class="box y-scroll margin-bottom">
<table class="vertical">
<thead>
<tr>
<?php foreach ($collection['rules'] as $rule): ?>
<th width="220">
<?php echo $rule['label']; ?>
<div class="col span-2 text-align-end">
<div class="margin-top-small"><i class="icon-cancel"></i></div> &nbsp;
</div>
</div>
<?php if (!empty($rule['description'])): ?>
<span class="tooltip large" data-tooltip="<?php echo $rule['description']; ?>"><i class="icon-question"></i></span>
<?php endif; ?>
</th>
<fieldset name="rules" data-cast-to="array">
<input name="$id" type="hidden" data-ls-bind="{{rule.$id}}" />
<input name="$collection" type="hidden" data-ls-bind="{{rule.$collection}}" />
<input name="label" type="hidden" data-ls-bind="{{rule.label}}" />
<input name="key" type="hidden" data-ls-bind="{{rule.key}}" />
<input name="type" type="hidden" data-ls-bind="{{rule.type}}" />
<input name="array" type="hidden" data-ls-bind="{{rule.array}}" data-cast-to="boolean" />
<input name="required" type="hidden" data-ls-bind="{{rule.required}}" data-cast-to="boolean" />
</fieldset>
</li>
</ul>
</div>
<?php endforeach; ?>
</tr>
</thead>
<tbody data-ls-loop="project-documents.documents" data-ls-as="document">
<tr>
<?php foreach ($collection['rules'] as $rule): ?>
<td>
<?php switch ($rule['type']):
case 'numeric':?>
<span class="tag" data-ls-bind="{{document.<?php echo $rule['key']; ?>|emptyDash}}" data-ls-attrs="title={{document.<?php echo $rule['key']; ?>}}"></span>
<?php break;?>
<hr class="margin-bottom-small margin-top-small" />
<?php case 'uuid':?>
$
<?php break;?>
<?php default:?>
<span class="text-one-liner" data-ls-bind="{{document.<?php echo $rule['key']; ?>|emptyDash}}" data-ls-attrs="title={{document.<?php echo $rule['key']; ?>}}"></span>
<?php break;?>
<?php endswitch;?>
<button class="link margin-top-tiny"><i class="icon-plus"></i>Add Rule</button>
</td>
<?php endforeach; ?>
</tr>
</tbody>
</table>
</div>
</div>
<div class="toggle margin-bottom margin-top" data-ls-ui-open>
<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 Permissions <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank">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" />
<label for="collection-write">Write Permissions <span class="text-size-small">(<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank">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>
<div class="clear 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>
<button>Update</button>
</form>
</div>
<!--
<div data-ui-modal class="box modal close" data-button-text="Add Rule" data-button-class="" data-button-icon="icon-plus">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-documents.sum|pageTotal}}"></span>
<h1>Add Rule</h1>
<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>
<form
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">
<label for="user-name">Name</label>
<input type="text" class="full-width" id="collection-name" name="name" required autocomplete="off" />
<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([])); ?>" />
<hr />
<button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</form>
</div> -->
<!-- <p>text / string / numeric / integer / float / boolean / email / url / ip / wildcard / document / key</p> -->
</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> Created: <span data-ls-bind="{{project-collection.dateCreated|date-text}}"></span></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|date-text}}"></span></li>
</ul>
<form name="database.deleteCollection" class="margin-bottom"
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>
<!-- <li data-state="/console/database/collection/docs?id={{router.params.id}}&project={{router.params.project}}">
<h2>Docs</h2>
<div class="box line"></div>
</li> -->
</ul>
</div>
</div>

View file

@ -1,253 +1,112 @@
<div class="cover">
<h1 class="zone xxl margin-bottom-large">
<a data-ls-attrs="href=/console/home?project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> Home</a>
<h1 class="zone xl margin-bottom-large">
<a data-ls-attrs="href=/console" class="back text-size-small"><i class="icon-left-open"></i> Home</a>
<br />
<span>Database</span>
</h1>
</div>
<div data-ui-modal class="box modal close" data-open-event="create-collection" data-button-alias="create-collection">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h1>Create Collection</h1>
<p>Currently this feature is only available using the Appwrite API. To learn more about how to use it, visit our <a href="" data-ls-attrs="href={{env.HOME}}/docs/database" target="_blank">documentation</a>.</p>
</div>
<div data-ui-modal class="box modal close" data-open-event="create-document" data-button-alias="create-documnet">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h1>Create Document</h1>
<p>Currently this feature is only available using the Appwrite API. To learn more about how to use it, visit our <a href="" data-ls-attrs="href={{env.HOME}}/docs/database" target="_blank">documentation</a>.</p>
</div>
<div class="zone xxl">
<div class="zone xl">
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
<li data-state="/console/users?project={{router.params.project}}">
<h2 style="display: none;">Explore</h2>
<li data-state="/console/database?project={{router.params.project}}">
<h2>Collections</h2>
<div class="box dashboard database margin-bottom-xl">
<div class="row responsive">
<div class="col span-3">
<h3>
<b data-ls-if="({{project-collections.sum}})" data-ls-bind="Collections ({{project-collections.sum|localeString}})"></b>
</h3>
<div data-ui-modal class="box modal close" data-button-text="" data-button-class="fly round" data-button-icon="icon-plus">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<form class="search"
data-service="database.listCollections"
data-event="submit"
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-collections"
data-success="state"
data-success-param-state-keys="search,offset">
<input name="search" id="searchCollection" type="search" autocomplete="off" placeholder="Search" class="margin-bottom-no" data-ls-bind="{{router.params.search}}">
</form>
<hr />
<button data-ls-ui-trigger="create-collection" class="button link"><i class="icon-plus"></i> Add collection</button>
<h1>New Collection</h1>
<div class="wrapper"
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="DESC"
data-scope="sdk"
data-name="project-collections">
<form
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">
<div data-ls-if="0 == {{project-collections.sum}}" class="empty">
<h4>No Collections Found</h4>
</div>
<label for="user-name">Name</label>
<input type="text" class="full-width" id="collection-name" name="name" required autocomplete="off" />
<div data-ls-if="0 != {{project-collections.sum}}">
<ul data-ls-loop="project-collections.collections" data-ls-as="collection" class="items">
<li data-ls-attrs="class={{collection.$id|selectedCollection}},data-uid={{router.params.collectionId}}">
<form
data-service="database.listDocuments"
data-event="submit"
data-param-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="collectionId=collectionId,search=dsearch,offset=doffset">
<input name="collectionId" data-ls-bind="{{collection.$id}}" type="hidden" />
<button><span data-ls-bind="{{collection.$id}}"></span></button>
</form>
<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([])); ?>" />
<i class="icon-right-open pull-end"></i>
<span class="name text-one-liner" data-ls-bind="{{collection.name}}"></span>
</li>
</ul>
</div>
<hr />
<hr />
<button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</form>
</div>
<div class="clear text-align-center paging">
<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>
<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">
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-collections.sum|pageTotal}}"></span>
<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>
<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>
</div>
</div>
<div class="col span-3">
<h3>
<b data-ls-if="(({{router.params.collectionId}}) && ({{project-documents.sum}} >= 0))" data-ls-bind="{{project-documents.name}} ({{project-documents.sum|localeString}})"></b>
</h3>
<div data-ls-if="({{router.params.collectionId}})" style="display: none">
<form class="search"
data-service="database.listDocuments"
data-event="submit"
data-param-collection-id="{{router.params.collectionId}}"
data-param-search="{{router.params.dsearch}}"
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="dsearch,doffset">
<input name="dsearch" id="searchDocuments" type="search" autocomplete="off" placeholder="Search" class="margin-bottom-no" data-ls-bind="{{router.params.dsearch}}">
</form>
<hr />
<button data-ls-ui-trigger="create-document" class="button link"><i class="icon-plus"></i> Add document</button>
<div class="wrapper"
data-service="database.listDocuments"
data-event="load,database.createDocument,database.updateDocument,database.deleteDocument"
data-param-collection-id="{{router.params.collectionId}}"
data-param-search="{{router.params.dsearch}}"
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset="{{router.params.doffset}}"
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-documents">
<div data-ls-if="0 == {{project-documents.sum}}" class="empty">
<h4>No Documents Found</h4>
</div>
<div data-ls-if="0 != {{project-documents.sum}}">
<ul data-ls-loop="project-documents.documents" data-ls-as="node" class="items">
<li data-ls-attrs="class={{node.$id|selectedDocument}},data-uid={{router.params.documentId}}">
<form
data-service="database.getDocument"
data-event="submit"
data-scope="sdk"
data-name="project-document"
data-success="state"
data-success-param-state-keys="documentId=documentId">
<input name="collectionId" data-ls-bind="{{router.params.collectionId}}" type="hidden" />
<input name="documentId" data-ls-bind="{{node.$id}}" type="hidden" />
<button><span data-ls-bind="{{node.$id}}"></span></button>
</form>
<i class="icon-right-open pull-end"></i>
<span data-ls-bind="{{node.$id}}"></span>
</li>
</ul>
</div>
<hr />
<div class="clear text-align-center paging">
<form
data-service="database.listDocuments"
data-event="submit"
data-param-collection-id="{{router.params.collectionId}}"
data-param-search="{{router.params.dsearch}}"
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=dsearch,offset=doffset">
<button name="offset" data-paging-back data-offset="{{router.params.doffset}}" 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.doffset|pageCurrent}} / {{project-documents.sum|pageTotal}}"></span>
<form
data-service="database.listDocuments"
data-event="submit"
data-param-collection-id="{{router.params.collectionId}}"
data-param-search="{{router.params.dsearch}}"
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=dsearch,offset=doffset">
<button name="offset" data-paging-next data-offset="{{router.params.doffset}}" data-sum="{{project-documents.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
</form>
</div>
</div>
</div>
</div>
<div class="col span-6">
<h3>
<b data-ls-if="({{project-document.$id}})">Preview</b>
</h3>
<div
data-service="database.getDocument"
data-event="load"
data-scope="sdk"
data-name="project-document"
data-param-collection-id="{{router.params.collectionId}}"
data-param-document-id="{{router.params.documentId}}"
data-success="state"
data-success-param-state-keys="documentId=documentId">
</div>
<div data-ls-if="({{project-document.$id}})" style="display: none">
<div class="code">
<input type="hidden" data-forms-code data-ls-bind="{{project-document}}" />
</div>
</div>
<p class="margin-bottom-no">You haven't created any collections for your project yet.</p>
</div>
</div>
</div>
</li>
</ul>
<div data-ls-if="0 != {{project-collections.sum}}">
<ul data-ls-loop="project-collections.collections" data-ls-as="collection" data-ls-append="" class="tiles cell-3 margin-bottom-small" style="visibility: hidden">
<li class="margin-bottom">
<a data-ls-attrs="href=/console/database/collection?id={{collection.$id}}&project={{router.params.project}}" class="box">
<div data-ls-bind="{{collection.name}}" class="text-one-liner margin-bottom text-bold">&nbsp;</div>
<i class="icon-right-open"></i>
</a>
</li>
</ul>
</div>
<div class="clear text-align-center paging">
<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>
</li>
<li data-state="/console/database/usage?project={{router.params.project}}">
<h2>Usage</h2>
</li>
</ul>
</div>
</div>

View file

@ -9,7 +9,7 @@ $home = $this->getParam('home', '');
<p class="margin-bottom margin-top-negative-small">Take advantage of the Appwrite APIs and tools.</p>
<ul class="margin-bottom-xl clear">
<li class="pull-start margin-end margin-bottom-small"><a href="<?php echo $home; ?>/" target="_blank"><i class="icon-lamp"></i> &nbsp;Learn More</a></li>
<li class="pull-start margin-end margin-bottom-small"><a href="<?php echo $home; ?>/" target="_blank"><i class="icon-lamp"></i> &nbsp;Learn more</a></li>
<li class="pull-start margin-end margin-bottom-small"><a href="<?php echo $home; ?>/docs" target="_blank"><i class="icon-book-open"></i> &nbsp;Docs</a></li>
<li class="pull-start margin-end margin-bottom-small"><a href="<?php echo $home; ?>/support" target="_blank"><i class="icon-lifebuoy"></i> &nbsp;Support</a></li>
</ul>

View file

@ -52,7 +52,7 @@ $scopes = $this->getParam('scopes', []);
<label data-ls-attrs="for=name-{{key.$id}}">Name</label>
<input type="text" class="full-width" data-ls-attrs="id=name-{{key.$id}}" name="name" required autocomplete="off" data-ls-bind="{{key.name}}" />
<label data-ls-attrs="for=scopes-{{key.$id}}">Scopes (<a data-ls-attrs="href={{env.HOME}}/docs/keys" target="_blank">Learn More</a>)</label>
<label data-ls-attrs="for=scopes-{{key.$id}}">Scopes (<a data-ls-attrs="href={{env.HOME}}/docs/keys" target="_blank">Learn more</a>)</label>
<div class="row responsive thin">
<?php foreach ($scopes as $i => $scope) : ?>
<div class="col span-6 text-one-liner margin-bottom text-height-large">
@ -147,7 +147,7 @@ $scopes = $this->getParam('scopes', []);
<label for="name">Name</label>
<input type="text" class="full-width" id="name" name="name" required autocomplete="off" />
<label for="scopes">Scopes (<a data-ls-attrs="href={{env.HOME}}/docs/keys" target="_blank">Learn More</a>)</label>
<label for="scopes">Scopes (<a data-ls-attrs="href={{env.HOME}}/docs/keys" target="_blank">Learn more</a>)</label>
<div class="row responsive thin">
<?php foreach ($scopes as $i => $scope) : ?>
<div class="col span-6 text-one-liner margin-bottom text-height-large">

View file

@ -13,6 +13,9 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
</div>
<div class="zone xl">
<h2 class="margin-bottom">Files</h2>
<div data-ui-modal class="box modal close" data-button-text="" data-button-class="fly round" data-button-icon="icon-plus">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
@ -39,10 +42,10 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
<div class="text-fade text-size-small margin-top-negative-small margin-bottom">(Max file size allowed: <?php echo $fileLimitHuman; ?>)</div>
<label for="file-read">Read Permissions (<a href="<?php echo $home; ?>/docs/permissions" target="_blank">Learn more</a>)</label>
<label for="file-read">Read Permissions (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank">Learn more</a>)</label>
<input type="hidden" id="file-read" name="read" required data-forms-tags data-cast-to="json" value="<?php echo htmlentities(json_encode(['*'])); ?>" />
<label for="file-write">Write Permissions (<a href="<?php echo $home; ?>/docs/permissions" target="_blank">Learn more</a>)</label>
<label for="file-write">Write Permissions (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank">Learn more</a>)</label>
<input type="hidden" id="file-write" name="write" required data-forms-tags data-cast-to="json" value="<?php echo htmlentities(json_encode(['*'])); ?>" />
<hr />
@ -137,10 +140,10 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
</div>
<input type="hidden" name="folderId" id="files-folderId" data-cast-to="int" value="1">
<label for="file-read">Read Permissions (<a href="<?php echo $home; ?>/docs/permissions" target="_blank">Learn more</a>)</label>
<label for="file-read">Read Permissions (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank">Learn more</a>)</label>
<input type="hidden" id="file-read" name="read" required data-forms-tags data-cast-to="json" data-ls-bind="{{file.$permissions.read}}" />
<label for="file-write">Write Permissions (<a href="<?php echo $home; ?>/docs/permissions" target="_blank">Learn more</a>)</label>
<label for="file-write">Write Permissions (<a data-ls-attrs="href={{env.HOME}}/docs/permissions" target="_blank">Learn more</a>)</label>
<input type="hidden" id="file-write" name="write" required data-forms-tags data-cast-to="json" data-ls-bind="{{file.$permissions.write}}" />
</form>

View file

@ -129,7 +129,7 @@ if(!empty($platforms)) {
<span data-ls-bind="{{alert.text}}"></span>
<span data-ls-if="undefined !== {{alert.link}}">
<a data-ls-attrs="href={{alert.link}}" data-ls-ui-alerts-delete data-message="{{alert.id}}">Learn More</a>
<a data-ls-attrs="href={{alert.link}}" data-ls-ui-alerts-delete data-message="{{alert.id}}">Learn more</a>
</span>
</div>
</li>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -106,6 +106,11 @@ window.ls.router
scope: "console",
project: true
})
.add("/console/database/collection/:tab", {
template: "/console/database/collection?version=" + APP_ENV.VERSION,
scope: "console",
project: true
})
.add("/console/storage", {
template: "/console/storage?version=" + APP_ENV.VERSION,
scope: "console",

View file

@ -15,6 +15,7 @@
add.type = "text";
add.className = "add";
add.placeholder = element.placeholder;
//add.required = element.required;

View file

@ -260,6 +260,7 @@
if (confirm) {
if (window.confirm(confirm) !== true) {
element.classList.add("load-service-end");
return false;
}
}

View file

@ -64,7 +64,7 @@
hr {
height: 1px;
background: var(--config-border-color);
background: var(--config-console-background);
border: none;
margin: 30px -30px;
}
@ -81,8 +81,8 @@
.toggle {
position: relative;
border-top: 2px solid var(--config-color-background);
border-bottom: 2px solid var(--config-color-background);
border-top: 1px solid var(--config-console-background);
border-bottom: 1px solid var(--config-console-background);
margin: 0 -30px;
padding: 30px 30px 0 30px;
height: 65px;

View file

@ -1141,6 +1141,7 @@ ol {
background: var(--config-color-background-input);
min-height: 42px;
height: auto;
cursor: text;
.add {
display: inline-block!important;
@ -1149,6 +1150,7 @@ ol {
width: auto;
margin: 0;
max-width: 100%;
min-width: 200px;
}
ul.tags-list {