1
0
Fork 0
mirror of synced 2024-05-21 05:02:37 +12:00

Added document search

This commit is contained in:
Eldad Fux 2020-05-02 22:57:52 +03:00
parent fcfb0bea70
commit be2030931b
17 changed files with 522 additions and 316 deletions

View file

@ -11,11 +11,8 @@ use Appwrite\Database\Database;
use Appwrite\Database\Validator\Authorization;
use Appwrite\Database\Validator\UID;
use Appwrite\Storage\Storage;
use Utopia\Validator\Numeric;
use Utopia\Validator\Range;
use Utopia\Validator\Text;
$utopia->init(function () use ($layout, $utopia) {
$utopia->init(function () use ($layout) {
$layout
->setParam('analytics', 'UA-26264668-5')
;
@ -185,9 +182,22 @@ $utopia->get('/console/database/collection')
->desc('Platform console project database collection')
->label('permission', 'public')
->label('scope', 'console')
->action(function () use ($layout, $projectDB) {
->param('id', '', function () { return new UID(); }, 'Collection unique ID.')
->action(function ($id) use ($layout, $projectDB) {
Authorization::disable();
$collection = $projectDB->getDocument($id, false);
Authorization::reset();
if (empty($collection->getId()) || Database::SYSTEM_COLLECTION_COLLECTIONS != $collection->getCollection()) {
throw new Exception('Collection not found', 404);
}
$page = new View(__DIR__.'/../../views/console/database/collection.phtml');
$page
->setParam('collection', $collection)
;
$layout
->setParam('title', APP_NAME.' - Database Collection')
->setParam('body', $page);
@ -208,10 +218,14 @@ $utopia->get('/console/database/document')
}
$page = new View(__DIR__.'/../../views/console/database/document.phtml');
$searchFiles = new View(__DIR__.'/../../views/console/database/search/files.phtml');
$searchDocuments = new View(__DIR__.'/../../views/console/database/search/documents.phtml');
$page
->setParam('db', $projectDB)
->setParam('collection', $collection)
->setParam('searchFiles', $searchFiles)
->setParam('searchDocuments', $searchDocuments)
;
$layout

View file

@ -32,7 +32,7 @@ const APP_EMAIL_SECURITY = 'security@localhost.test'; // Default security email
const APP_USERAGENT = APP_NAME.'-Server v%s. Please report abuse at %s';
const APP_MODE_ADMIN = 'admin';
const APP_PAGING_LIMIT = 15;
const APP_CACHE_BUSTER = 117;
const APP_CACHE_BUSTER = 119;
const APP_VERSION_STABLE = '0.5.3';
const APP_STORAGE_UPLOADS = '/storage/uploads';
const APP_STORAGE_CACHE = '/storage/cache';

View file

@ -1,3 +1,7 @@
<?php
$collection = $this->getParam('collection', []);
$rules = $collection->getAttribute('rules', []);
?>
<div
data-service="database.getCollection"
@ -31,7 +35,7 @@
<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}}">
<a xdata-ls-if="{{project-collection.rules.length}} > 0" data-ls-attrs="href=/console/database/document?collection={{router.params.id}}&project={{router.params.project}}" class="button fly round text-align-center">
<a data-ls-if="{{project-collection.rules.length}} > 0" data-ls-attrs="href=/console/database/document?collection={{router.params.id}}&project={{router.params.project}}" class="button fly round text-align-center">
<i class="icon-plus"></i>
</a>
@ -82,20 +86,42 @@
<div class="box margin-bottom y-scroll">
<table class="vertical">
<thead>
<tr data-ls-loop="project-collection.rules" data-ls-as="rule">
<th width="120" data-ls-bind="{{rule.label}}"></th>
<tr>
<?php foreach($rules as $rule):
$label = (isset($rule['label'])) ? $rule['label'] : '';
?>
<th width="120"><?php echo $this->escape($label); ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody data-ls-loop="project-documents.documents" data-ls-as="node">
<tr data-ls-loop="project-collection.rules" data-ls-as="rule">
<td data-ls-attrs="data-title={{rule.label}}:" class="text-size-small text-height-small">
<a data-ls-attrs="href=/console/database/document?id={{node.$id}}&collection={{router.params.id}}&project={{router.params.project}}">
<span data-ls-if="{{rule.type}} !== 'document' && {{rule.type}} !== 'fileId'" data-ls-bind="{{node|documentLabel}}" data-ls-attrs="title={{node|documentLabel}}"></span>
<span data-ls-if="{{rule.type}} == 'document' && {{rule.array}}">[...]</span>
<span data-ls-if="{{rule.type}} == 'document' && !{{rule.array}}">{...}</span>
<img data-ls-if="{{rule.type}} == 'fileId' && !{{rule.array}} && {{node|documentLabel|isEmpty}}" src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{node|documentLabel}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="avatar" width="30" height="30" loading="lazy" />
</a>
</th>
<tr>
<?php foreach($rules as $rule):
$label = (isset($rule['label'])) ? $rule['label'] : '';
$key = (isset($rule['key'])) ? $rule['key'] : '';
$type = (isset($rule['type'])) ? $rule['type'] : '';
$array = (isset($rule['array'])) ? $rule['array'] : '';
?>
<td title="<?php echo $this->escape($label); ?>" class="text-size-small text-height-small">
<a data-ls-attrs="href=/console/database/document?id={{node.$id}}&collection={{router.params.id}}&project={{router.params.project}}">
<?php if(!$array): ?>
<?php switch($type):
case 'fileId': ?>
<img data-ls-if="{{node.<?php echo $this->escape($key); ?>}} != ''" src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{node.<?php echo $this->escape($key); ?>}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="avatar" width="30" height="30" loading="lazy" />
<?php break; ?>
<?php case 'document': ?>
{...}
<?php break; ?>
<?php default: ?>
<span data-ls-bind="{{node.<?php echo $this->escape($key); ?>}}" data-ls-attrs="title={{node.<?php echo $this->escape($key); ?>}}"></span>
<?php break; ?>
<?php endswitch; ?>
<?php else: ?>
[...]
<?php endif; ?>
</a>
</td>
<?php endforeach; ?>
</tr>
</tbody>
</table>
@ -238,16 +264,16 @@
<option value="boolean">Boolean</option>
<option value="wildcard">Wildcard (*)</option>
</optgroup>
<optgroup label="Links">
<option value="fileId">File ID</option>
<option value="documentId">Document ID</option>
</optgroup>
<optgroup label="Advanced">
<option value="email">Email</option>
<option value="url">URL</option>
<option value="ip">IP</option>
<option value="markdown">Markdown</option>
<option value="document">Document</option>
</optgroup>
<optgroup label="Links">
<option value="fileId">File ID</option>
<option value="documentId">Document ID</option>
<option value="document">Document (Embeded)</option>
</optgroup>
</select>
@ -389,16 +415,16 @@
<option value="boolean">Boolean</option>
<option value="wildcard">Wildcard (*)</option>
</optgroup>
<optgroup label="Links">
<option value="fileId">File ID</option>
<option value="documentId">Document ID</option>
</optgroup>
<optgroup label="Advanced">
<option value="email">Email</option>
<option value="url">URL</option>
<option value="ip">IP</option>
<option value="markdown">Markdown</option>
<option value="document">Document</option>
</optgroup>
<optgroup label="Links">
<option value="fileId">File ID</option>
<option value="documentId">Document ID</option>
<option value="document">Document (Embeded)</option>
</optgroup>
</select>
@ -406,20 +432,6 @@
<input name="required" type="hidden" value="false" data-cast-to="boolean" />
<input name="array" type="hidden" value="false" data-cast-to="boolean" />
<!--
<div class="margin-bottom">
<label data-ls-attrs="for=rule-default-new">Default</label>
<input name="default" type="text" />
</div>
<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> -->
</fieldset>
<hr class="margin-top-no" />
@ -460,6 +472,14 @@
</div>
</script>
<script type="text/html" id="template-validation-documentId">
<div data-ls-template="template-validation-document-array-{{rule.array}}" data-type="script"></div>
<div class="margin-bottom text-align-center margin-top-xl margin-bottom-large" data-ls-if="{{project-collections.sum}} == 1">
No Collections Found.
</div>
</script>
<script type="text/html" id="template-validation-document">
<div data-ls-template="template-validation-document-array-{{rule.array}}" data-type="script"></div>
@ -483,7 +503,7 @@
<div data-ls-loop="project-collections.collections" data-ls-as="project" data-ls-key="$index2" class="tiles cell-3 margin-bottom-negative" style="visibility: hidden">
<div class="margin-bottom" data-ls-if="{{project.$id}} != {{router.params.id}}">
<input type="radio" name="list" data-ls-attrs="value={{project.$id}}" data-ls-bind="{{rule.list|firstElement}}" data-cast-to="array" /> <span data-ls-bind="{{project.name}}"></span>
<input type="radio" name="list" data-ls-attrs="value={{project.$id}}" data-ls-bind="{{rule.list|firstElement}}" data-cast-to="array" required /> <span data-ls-bind="{{project.name}}"></span>
</div>
</div>
</script>

View file

@ -4,13 +4,16 @@ use Utopia\View;
use Appwrite\Database\Validator\Authorization;
$collection = $this->getParam('collection', null);
$searchFiles = $this->getParam('searchFiles', null);
$searchDocuments = $this->getParam('searchDocuments', null);
$name = $collection->getAttribute('name', '');
$db = $this->getParam('db', null);
$rules = $collection->getAttribute('rules', []);
$namespace = 'project-document';
$collections = [];
?>
<?php foreach($rules as $rule):
<?php foreach($rules as $rule): // Form to append child document
$key = (isset($rule['key'])) ? $rule['key'] : '';
$label = (isset($rule['label'])) ? $rule['label'] : '';
$type = (isset($rule['type'])) ? $rule['type'] : '';
@ -86,7 +89,7 @@ $collections = [];
<?php endforeach; ?>
<?php endforeach; ?>
<?php foreach($rules as $rule):
<?php foreach($rules as $rule): // Form to remove array $index key
$key = (isset($rule['key'])) ? $rule['key'] : '';
$label = (isset($rule['label'])) ? $rule['label'] : '';
$type = (isset($rule['type'])) ? $rule['type'] : '';
@ -112,288 +115,155 @@ $collections = [];
</li>
</ul>
<?php endforeach; ?>
<div
data-service="database.getCollection"
data-service="database.getDocument"
data-param-collection-id="{{router.params.collection}}"
data-param-document-id="{{router.params.id}}"
data-scope="sdk"
data-event="load,database.updateCollection"
data-name="project-collection">
data-event="load,database.updateDocument"
data-name="project-document"
data-success="default">
<div
data-service="database.getDocument"
data-param-collection-id="{{router.params.collection}}"
data-param-document-id="{{router.params.id}}"
data-scope="sdk"
data-event="load,database.updateDocument"
data-name="project-document"
data-success="default">
<div class="cover">
<h1 class="zone xl margin-bottom-large">
<a data-ls-attrs="href=/console/database/collection?id={{router.params.collection}}&project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> <?php echo $this->escape($name); ?></a>
<div class="cover">
<h1 class="zone xl margin-bottom-large">
<a data-ls-attrs="href=/console/database/collection?id={{router.params.collection}}&project={{router.params.project}}" class="back text-size-small"><i class="icon-left-open"></i> <span data-ls-bind="{{project-collection.name}}">Collection</span></a>
<br />
<br />
<span data-ls-if="({{project-document.$id}})" data-ls-bind="Document">&nbsp;&nbsp;</span>
<span data-ls-if="(!{{project-document.$id}})" data-ls-bind="Document">&nbsp;&nbsp;</span>
</h1>
</div>
<span data-ls-if="({{project-document.$id}})" data-ls-bind="Document">&nbsp;&nbsp;</span>
<span data-ls-if="(!{{project-document.$id}})" data-ls-bind="Document">&nbsp;&nbsp;</span>
</h1>
<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-document}}" data-forms-code />
</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>
<button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</div>
<div class="margin-bottom">
<input type="hidden" data-ls-bind="{{project-document}}" data-forms-code />
</div>
<div class="zone xl margin-bottom-no">
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
<li data-state="/console/database/document?id={{router.params.id}}&collection={{router.params.collection}}&project={{router.params.project}}">
<h2>Update</h2>
<button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</div>
<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 Document"
data-service="{{|documentAction}}"
data-name="project-document"
data-scope="sdk"
data-event="submit"
data-success="alert,trigger{{|documentSuccess}}"
data-success-param-alert-text="Updated document successfully"
data-success-param-trigger-events="database.updateDocument"
data-success-param-redirect-url="/console/database/document?id={{serviceData.$id}}&collection={{router.params.collection}}&project={{router.params.project}}"
data-failure="alert"
data-failure-param-alert-text="Failed to update document"
data-failure-param-alert-classname="error">
<div class="zone xl margin-bottom-no">
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
<li data-state="/console/database/document?id={{router.params.id}}&collection={{router.params.collection}}&project={{router.params.project}}">
<h2>Update</h2>
<label>&nbsp;</label>
<div class="row responsive margin-top-negative">
<div class="col span-8 margin-bottom">
<form
<div class="box">
<?php if(empty($rules)): ?>
<div class="margin-bottom-xl margin-top-xl margin-end margin-start text-align-center">
<h4 class="text-fade text-size-small">No attribute rules added yet.<br /><br /><a data-ls-attrs="href=/console/database/collection/settings?id={{router.params.collection}}&project={{router.params.project}}">Update Collection</a></h4>
</div>
<?php else: ?>
<?php
$comp = new View(__DIR__.'/form.phtml');
$comp
->setParam('collection', $collection)
->setParam('collections', $collections)
->setParam('namespace', $namespace)
->setParam('key', 'data')
->setParam('parent', 1)
;
echo $comp->render();
?>
<div class="toggle margin-bottom" 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 Access <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-document.$permissions.read}}" placeholder="User ID, Team ID or Role" />
<label for="collection-write">Write Access <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-document.$permissions.write}}" placeholder="User ID, Team ID or Role" />
</div>
<button data-ls-if="({{project-document.$id}})">Update</button>
<button data-ls-if="(!{{project-document.$id}})">Create</button>
<?php endif; ?>
</div>
</form>
</div>
<div class="col span-4 sticky-top">
<div data-ls-if="({{project-document.$id}})">
<label>Document ID</label>
<div class="input-copy margin-bottom">
<input type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-document.$id}}" disabled data-forms-copy class="margin-bottom-no" />
</div>
</div>
<label>Collection ID</label>
<div class="input-copy margin-bottom">
<input type="text" autocomplete="off" placeholder="" data-ls-bind="{{router.params.collection}}" disabled data-forms-copy class="margin-bottom-no" />
</div>
<ul class="margin-bottom-large text-fade text-size-small" data-ls-if="({{project-document.$id}})">
<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>
</ul>
<div data-ls-if="({{project-document.$id}})">
<form name="database.deleteDocument" class="margin-bottom"
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Update Database Document"
data-service="{{|documentAction}}"
data-name="project-document"
data-scope="sdk"
data-analytics-label="Delete Collection Document"
data-service="database.deleteDocument"
data-event="submit"
data-success="alert,trigger{{|documentSuccess}}"
data-success-param-alert-text="Updated document successfully"
data-success-param-trigger-events="database.updateDocument"
data-success-param-redirect-url="/console/database/document?id={{serviceData.$id}}&collection={{router.params.collection}}&project={{router.params.project}}"
data-param-collection-id="{{router.params.collection}}"
data-param-document-id="{{project-document.$id}}"
data-confirm="Are you sure you want to delete this document?"
data-success="alert,trigger,redirect"
data-success-param-alert-text="Document deleted successfully"
data-success-param-trigger-events="database.deleteDocument"
data-success-param-redirect-url="/console/database/collection?id={{router.params.collection}}&project={{router.params.project}}"
data-failure="alert"
data-failure-param-alert-text="Failed to update document"
data-failure-param-alert-text="Failed to delete collection"
data-failure-param-alert-classname="error">
<label>&nbsp;</label>
<div class="box">
<?php if(empty($rules)): ?>
<div class="margin-bottom-xl margin-top-xl margin-end margin-start text-align-center">
<h4 class="text-fade text-size-small">No attribute rules added yet.<br /><br /><a data-ls-attrs="href=/console/database/collection/settings?id={{router.params.collection}}&project={{router.params.project}}">Update Collection</a></h4>
</div>
<?php else: ?>
<?php
$comp = new View(__DIR__.'/form.phtml');
$comp
->setParam('collection', $collection)
->setParam('collections', $collections)
->setParam('namespace', $namespace)
->setParam('key', 'data')
->setParam('parent', 1)
;
echo $comp->render();
?>
<div class="toggle margin-bottom" 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 Access <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-document.$permissions.read}}" placeholder="User ID, Team ID or Role" />
<label for="collection-write">Write Access <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>
<button data-ls-if="({{project-document.$id}})">Update</button>
<button data-ls-if="(!{{project-document.$id}})">Create</button>
<?php endif; ?>
</div>
<button type="submit" class="danger fill">Delete Document</button>
</form>
</div>
<div class="col span-4 sticky-top">
<div data-ls-if="({{project-document.$id}})">
<label>Document ID</label>
<div class="input-copy margin-bottom">
<input type="text" autocomplete="off" placeholder="" data-ls-bind="{{project-document.$id}}" disabled data-forms-copy class="margin-bottom-no" />
</div>
</div>
<label>Collection ID</label>
<div class="input-copy margin-bottom">
<input 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" data-ls-if="({{project-document.$id}})">
<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>
</ul>
<div data-ls-if="({{project-document.$id}})">
<form name="database.deleteDocument" class="margin-bottom"
data-analytics-event="submit"
data-analytics-category="console"
data-analytics-label="Delete Collection Document"
data-service="database.deleteDocument"
data-event="submit"
data-param-collection-id="{{router.params.collection}}"
data-param-document-id="{{project-document.$id}}"
data-confirm="Are you sure you want to delete this document?"
data-success="alert,trigger,redirect"
data-success-param-alert-text="Document deleted successfully"
data-success-param-trigger-events="database.deleteDocument"
data-success-param-redirect-url="/console/database/collection?id={{router.params.collection}}&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 Document</button>
</form>
</div>
</div>
</div>
</li>
<li data-ls-if="{{project-document.$id}}" data-state="/console/database/document/activity?id={{router.params.id}}&collection={{router.params.collection}}&project={{router.params.project}}">
<h2>Activity</h2>
</li>
</ul>
</div>
</div>
</li>
<li data-ls-if="{{project-document.$id}}" data-state="/console/database/document/activity?id={{router.params.id}}&collection={{router.params.collection}}&project={{router.params.project}}">
<h2>Activity</h2>
</li>
</ul>
</div>
</div>
<div data-ui-modal class="modal sticky-footer width-large box close" data-button-hide="on" data-open-event="open-file-serach" data-close-event="none">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h2>File Search</h2>
<form class="search margin-bottom"
data-service="storage.listFiles"
data-event="submit"
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset=""
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-files"
data-success="state"
data-success-param-state-keys="search,offset">
<input name="search" id="searchFiles" type="search" autocomplete="off" placeholder="Search" class="margin-bottom-no" data-ls-bind="{{router.params.search}}">
</form>
<div
data-service="storage.listFiles"
data-event="open-file-serach"
data-param-search=""
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset="0"
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-files"
data-success="state"
data-success-param-state-keys="search,offset">
<div data-ls-if="0 == {{project-files.sum}}" class="margin-bottom">
<h3 class="margin-bottom-small text-bold">No Files Found</h3>
<p class="margin-bottom-no">Try a different search term.</p>
</div>
<div data-ls-if="0 != {{project-files.sum}}">
<div class="scroll">
<table class="margin-top-no margin-bottom-no">
<thead>
<tr>
<th width="40">&nbsp;</th>
<th width="40">&nbsp;</th>
<th width="100">Filename</th>
<th width="100">Type</th>
<th width="100">Size</th>
<th width="80">Created</th>
<!-- <th width="30"></th> -->
</tr>
</thead>
<tbody data-ls-loop="project-files.files" data-ls-as="file">
<tr>
<td data-title="x" class="">
<input type="radio" name="selected" data-ls-attrs="value={{file.$id}}" data-ls-bind="{{search.selected}}" />
</td>
<td data-title="x" class="">
<img src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$id}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="pull-start avatar" width="30" height="30" loading="lazy" />
</td>
<td data-title="Name: " class="text-one-liner">
<span data-ls-bind="{{file.name}}" data-ls-attrs="title={{file.name}}" class="text-fade text-size-small"></span>
</td>
<td data-title="Type: ">
<span data-ls-bind="{{file.mimeType}}" class="text-fade text-size-small"></span>
</td>
<td data-title="Size: ">
<span class="text-fade text-size-small" data-ls-bind="{{file.sizeOriginal|humanFileSize}}"></span>
</td>
<td data-title="Created: ">
<span class="text-fade text-size-small" data-ls-bind="{{file.dateCreated|date-text}}"></span>
</td>
<!-- <td class="hide">
<a target="_blank" data-ls-attrs="href="><i class="icon-link-ext"></i></a>
</td> -->
</tr>
</tbody>
</table>
</div>
</div>
</div>
<footer>
<div class="clear text-align-center paging pull-end">
<form
data-service="storage.listFiles"
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-files"
data-success="state"
data-success-param-state-keys="search,offset">
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-end-small round small" aria-label="Back"><i class="icon-left-open"></i></button>
</form>
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-files.sum|pageTotal}}"></span>
<form
data-service="storage.listFiles"
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-files"
data-success="state"
data-success-param-state-keys="search,offset">
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-start-small round small" aria-label="Next"><i class="icon-right-open"></i></button>
</form>
</div>
<form data-service="container.path"
data-param-path="search.selected"
data-param-type="assign"
data-param-value="{{file.$id}}"
data-success="trigger"
data-success-param-trigger-events="modal-close"
data-event="click"
data-scope="window.ls">
<input type="hidden" name="path" data-ls-bind="{{search.path}}" />
<input type="hidden" name="type" value="assign" />
<input type="hidden" name="value" data-ls-bind="{{search.selected}}" />
<button data-ls-if="({{search.selected}})" type="button" class="">Select</button> &nbsp;
<button data-ls-if="(!{{search.selected}})" type="button" class="" disabled>Select</button> &nbsp;
</form>
<button data-ui-modal-close="" type="button" class="reverse desktops-only-inline">Cancel</button>
</footer>
</div>
<?php
echo $searchFiles->render();
echo $searchDocuments->render();
?>

View file

@ -50,6 +50,7 @@ $array = $this->getParam('array', false);
->setParam('required', $required)
->setParam('list', $list)
->setParam('namespace', $namespace.'.'.$key)
->setParam('collections', $collections)
;
$loop

View file

@ -0,0 +1,19 @@
<?php
$key = $this->getParam('key', '');
$required = $this->getParam('required', '');
$namespace = $this->getParam('namespace', '');
$collections = $this->getParam('collections', []);
$array = $this->getParam('array', false);
$list = $this->getParam('list', []);
$list = (is_array($list)) ? $list : [];
var_dump($collections);
?>
<input
type="text"
name="<?php echo $this->escape($key); ?>"
data-ls-bind="{{<?php echo $this->escape($namespace); ?>}}"
data-forms-document=""
data-search="<?php echo $this->escape($namespace); ?>"
class="margin-bottom-no">

View file

@ -0,0 +1,114 @@
<div data-ui-modal class="modal sticky-footer width-large box close" data-button-hide="on" data-open-event="open-document-serach" data-close-event="none">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h2>Document Search</h2>
<form class="search margin-bottom"
data-service="database.listDocuments"
data-event="submit"
data-param-collection-id="5e63e2dca1d10"
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset="0"
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-documents"
data-success="state"
data-success-param-state-keys="search,offset">
<input name="search" id="searchDocuments" type="search" autocomplete="off" placeholder="Search" class="margin-bottom-no" data-ls-bind="{{router.params.search}}">
</form>
<div
data-service="database.listDocuments"
data-event="open-document-serach"
data-param-collection-id="5e63e2dca1d10"
data-param-search="{{router.params.search}}"
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset="0"
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-documents">
<div data-ls-if="0 == {{project-documents.sum}}" class="margin-bottom">
<h3 class="margin-bottom-small text-bold">No Documents Found</h3>
<p class="margin-bottom-no">Try a different search term.</p>
</div>
<div data-ls-if="({{project-documents.sum}})">
<div class="scroll">
<table class="margin-top-no margin-bottom-no">
<thead>
<tr data-ls-loop="project-collection.rules" data-ls-as="rule">
<th width="120" data-ls-bind="{{rule.label}}"></th>
</tr>
</thead>
<tbody data-ls-loop="project-documents.documents" data-ls-as="node">
<tr data-ls-loop="project-collection.rules" data-ls-as="rule">
<td data-ls-attrs="data-title={{rule.label}}:" class="text-size-small text-height-small">
<a data-ls-attrs="href=/console/database/document?id={{node.$id}}&collection={{router.params.id}}&project={{router.params.project}}">
<span data-ls-if="{{rule.type}} !== 'document' && {{rule.type}} !== 'fileId'" data-ls-bind="{{node|documentLabel}}" data-ls-attrs="title={{node|documentLabel}}"></span>
<span data-ls-if="{{rule.type}} == 'document' && {{rule.array}}">[...]</span>
<span data-ls-if="{{rule.type}} == 'document' && !{{rule.array}}">{...}</span>
<img data-ls-if="{{rule.type}} == 'fileId' && !{{rule.array}} && {{node|documentLabel|isEmpty}}" src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{node|documentLabel}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="avatar" width="30" height="30" loading="lazy" />
</a>
</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<footer>
<div class="clear text-align-center paging pull-end">
<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>
<form data-service="container.path"
data-param-path="search.selected"
data-param-type="assign"
data-param-value="{{file.$id}}"
data-success="trigger"
data-success-param-trigger-events="modal-close"
data-event="click"
data-scope="window.ls">
<input type="hidden" name="path" data-ls-bind="{{search.path}}" />
<input type="hidden" name="type" value="assign" />
<input type="hidden" name="value" data-ls-bind="{{search.selected}}" />
<button data-ls-if="({{search.selected}})" type="button" class="">Select</button> &nbsp;
<button data-ls-if="(!{{search.selected}})" type="button" class="" disabled>Select</button> &nbsp;
</form>
<button data-ui-modal-close="" type="button" class="reverse desktops-only-inline">Cancel</button>
</footer>
</div>

View file

@ -0,0 +1,130 @@
<div data-ui-modal class="modal sticky-footer width-large box close" data-button-hide="on" data-open-event="open-file-serach" data-close-event="none">
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
<h2>File Search</h2>
<form class="search margin-bottom"
data-service="storage.listFiles"
data-event="submit"
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset=""
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-files"
data-success="state"
data-success-param-state-keys="search,offset">
<input name="search" id="searchFiles" type="search" autocomplete="off" placeholder="Search" class="margin-bottom-no" data-ls-bind="{{router.params.search}}">
</form>
<div
data-service="storage.listFiles"
data-event="open-file-serach"
data-param-search=""
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
data-param-offset="0"
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-files"
data-success="state"
data-success-param-state-keys="search,offset">
<div data-ls-if="0 == {{project-files.sum}}" class="margin-bottom">
<h3 class="margin-bottom-small text-bold">No Files Found</h3>
<p class="margin-bottom-no">Try a different search term.</p>
</div>
<div data-ls-if="0 != {{project-files.sum}}">
<div class="scroll">
<table class="margin-top-no margin-bottom-no">
<thead>
<tr>
<th width="40">&nbsp;</th>
<th width="40">&nbsp;</th>
<th width="100">Filename</th>
<th width="100">Type</th>
<th width="100">Size</th>
<th width="80">Created</th>
<!-- <th width="30"></th> -->
</tr>
</thead>
<tbody data-ls-loop="project-files.files" data-ls-as="file">
<tr>
<td data-title="x" class="">
<input type="radio" name="selected" data-ls-attrs="value={{file.$id}}" data-ls-bind="{{search.selected}}" />
</td>
<td data-title="x" class="">
<img src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$id}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="pull-start avatar" width="30" height="30" loading="lazy" />
</td>
<td data-title="Name: " class="text-one-liner">
<span data-ls-bind="{{file.name}}" data-ls-attrs="title={{file.name}}" class="text-fade text-size-small"></span>
</td>
<td data-title="Type: ">
<span data-ls-bind="{{file.mimeType}}" class="text-fade text-size-small"></span>
</td>
<td data-title="Size: ">
<span class="text-fade text-size-small" data-ls-bind="{{file.sizeOriginal|humanFileSize}}"></span>
</td>
<td data-title="Created: ">
<span class="text-fade text-size-small" data-ls-bind="{{file.dateCreated|date-text}}"></span>
</td>
<!-- <td class="hide">
<a target="_blank" data-ls-attrs="href="><i class="icon-link-ext"></i></a>
</td> -->
</tr>
</tbody>
</table>
</div>
</div>
</div>
<footer>
<div class="clear text-align-center paging pull-end">
<form
data-service="storage.listFiles"
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-files"
data-success="state"
data-success-param-state-keys="search,offset">
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-end-small round small" aria-label="Back"><i class="icon-left-open"></i></button>
</form>
<span data-ls-bind="{{router.params.offset|pageCurrent}} / {{project-files.sum|pageTotal}}"></span>
<form
data-service="storage.listFiles"
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-files"
data-success="state"
data-success-param-state-keys="search,offset">
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-files.sum}}" class="margin-start-small round small" aria-label="Next"><i class="icon-right-open"></i></button>
</form>
</div>
<form data-service="container.path"
data-param-path="search.selected"
data-param-type="assign"
data-param-value="{{file.$id}}"
data-success="trigger"
data-success-param-trigger-events="modal-close"
data-event="click"
data-scope="window.ls">
<input type="hidden" name="path" data-ls-bind="{{search.path}}" />
<input type="hidden" name="type" value="assign" />
<input type="hidden" name="value" data-ls-bind="{{search.selected}}" />
<button data-ls-if="({{search.selected}})" type="button" class="">Select</button> &nbsp;
<button data-ls-if="(!{{search.selected}})" type="button" class="" disabled>Select</button> &nbsp;
</form>
<button data-ui-modal-close="" type="button" class="reverse desktops-only-inline">Cancel</button>
</footer>
</div>

View file

@ -48,9 +48,6 @@ $graph = $this->getParam('graph', false);
<div class="value margin-bottom-small"><span class="sum" data-ls-bind="{{usage.network.total|humanFileSize}}" data-default="0">0</span></div>
<div class="metric margin-bottom-small">Bandwidth</div>
<div class="range">Current Month</div>
<!-- <div class="margin-top dev-feature">
<a href="">Full Usage Report <i class="icon-right-open"></i></a>
</div> -->
</div>
</div>

View file

@ -41,6 +41,7 @@ const configApp = {
'public/scripts/views/forms/code.js',
'public/scripts/views/forms/color.js',
'public/scripts/views/forms/copy.js',
'public/scripts/views/forms/document.js',
'public/scripts/views/forms/filter.js',
'public/scripts/views/forms/move-down.js',
'public/scripts/views/forms/move-up.js',

View file

@ -2532,7 +2532,7 @@ return slf.renderToken(tokens,idx,opts);}
md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('rtl',function(){var rtlStock="^ا^ب^ت^ث^ج^ح^خ^د^ذ^ر^ز^س^ش^ص^ض^ط^ظ^ع^غ^ف^ق^ك^ل^م^ن^ه^و^ي^א^ב^ג^ד^ה^ו^ז^ח^ט^י^כ^ך^ל^מ^ם^נ^ן^ס^ע^פ^ף^צ^ץ^ק^ר^ש^ת^";var special=["\n"," "," ","״",'"',"_","'","!","@","#","$","^","&","%","*","(",")","+","=","-","[","]","\\","/","{","}","|",":","<",">","?",",",".","0","1","2","3","4","5","6","7","8","9"];var isRTL=function(value){for(var i=0;i<value.length;i++){if(/\s/g.test(value[i])){continue;}
if(-1===special.indexOf(value[i])){var firstChar=value[i];break;}}
if(-1<rtlStock.indexOf("^"+firstChar+"^")){return true;}
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:"/console/database/collection?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection/:tab",{template:"/console/database/collection?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view/:tab",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("gravatar",function($value,element){if(!$value){return"";}
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/collection/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view/:tab",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("gravatar",function($value,element){if(!$value){return"";}
let MD5=function(s){function L(k,d){return(k<<d)|(k>>>(32-d));}
function K(G,k){let I,d,F,H,x;F=G&2147483648;H=k&2147483648;I=G&1073741824;d=k&1073741824;x=(G&1073741823)+(k&1073741823);if(I&d){return x^2147483648^F^H;}
if(I|d){if(x&1073741824){return x^3221225472^F^H;}else{return x^1073741824^F^H;}}else{return x^F^H;}}
@ -2629,7 +2629,7 @@ code.innerHTML=value;Prism.highlightElement(code);div.scrollTop=0;};element.addE
function syncA(){element.value=picker.value;update();}
function syncB(){picker.value=element.value;}
element.parentNode.insertBefore(preview,element);update();syncB();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-copy",controller:function(element,alerts,document,window){var button=window.document.createElement("i");button.type="button";button.className="icon-docs note copy";button.style.cursor="pointer";element.parentNode.insertBefore(button,element.nextSibling);var copy=function(event){let disabled=element.disabled;element.disabled=false;element.focus();element.select();document.execCommand("Copy");if(document.selection){document.selection.empty();}else if(window.getSelection){window.getSelection().removeAllRanges();}
element.disabled=disabled;element.blur();alerts.add({text:"Copied to clipboard",class:""},3000);};button.addEventListener("click",copy);}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-filter",controller:function(document,container,expression,element,form,di){let name=element.dataset["formsFilter"]||"";let events=element.dataset["event"]||"";let serialize=function(obj,prefix){let str=[],p;for(p in obj){if(obj.hasOwnProperty(p)){let k=prefix?prefix+"["+p+"]":p,v=obj[p];if(v===""){continue;}
element.disabled=disabled;element.blur();alerts.add({text:"Copied to clipboard",class:""},3000);};button.addEventListener("click",copy);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-document",controller:function(element,container,search){var searchButton=(element.dataset["search"]||0);if(searchButton){let searchOpen=document.createElement("button");searchOpen.type='button';searchOpen.innerHTML='<i class="icon icon-search"></i> Search';searchOpen.classList.add('reverse');searchOpen.classList.add('small');let path=container.scope(searchButton);searchOpen.addEventListener('click',function(){search.selected=element.value;search.path=path;document.dispatchEvent(new CustomEvent("open-document-serach",{bubbles:false,cancelable:true}));});element.parentNode.insertBefore(searchOpen,element.nextSibling)}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-filter",controller:function(document,container,expression,element,form,di){let name=element.dataset["formsFilter"]||"";let events=element.dataset["event"]||"";let serialize=function(obj,prefix){let str=[],p;for(p in obj){if(obj.hasOwnProperty(p)){let k=prefix?prefix+"["+p+"]":p,v=obj[p];if(v===""){continue;}
str.push(v!==null&&typeof v==="object"?serialize(v,k):encodeURIComponent(k)+"="+encodeURIComponent(v));}}
return str.join("&");};let parse=function(filter){if(filter===""){return null;}
let operatorsMap=["!=",">=","<=","=",">","<"];let operator=null;for(let key=0;key<operatorsMap.length;key++){if(filter.indexOf(operatorsMap[key])>-1){operator=operatorsMap[key];}}

View file

@ -248,7 +248,7 @@ return slf.renderToken(tokens,idx,opts);}
md.renderer.rules.strong_open=renderEm;md.renderer.rules.strong_close=renderEm;return md;},true);})(window);(function(window){"use strict";window.ls.container.set('rtl',function(){var rtlStock="^ا^ب^ت^ث^ج^ح^خ^د^ذ^ر^ز^س^ش^ص^ض^ط^ظ^ع^غ^ف^ق^ك^ل^م^ن^ه^و^ي^א^ב^ג^ד^ה^ו^ז^ח^ט^י^כ^ך^ל^מ^ם^נ^ן^ס^ע^פ^ף^צ^ץ^ק^ר^ש^ת^";var special=["\n"," "," ","״",'"',"_","'","!","@","#","$","^","&","%","*","(",")","+","=","-","[","]","\\","/","{","}","|",":","<",">","?",",",".","0","1","2","3","4","5","6","7","8","9"];var isRTL=function(value){for(var i=0;i<value.length;i++){if(/\s/g.test(value[i])){continue;}
if(-1===special.indexOf(value[i])){var firstChar=value[i];break;}}
if(-1<rtlStock.indexOf("^"+firstChar+"^")){return true;}
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:"/console/database/collection?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection/:tab",{template:"/console/database/collection?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view/:tab",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("gravatar",function($value,element){if(!$value){return"";}
return false;};return{isRTL:isRTL,};},true);})(window);(function(window){"use strict";window.ls.container.set('sdk',function(window,router){var sdk=new window.Appwrite();sdk.setEndpoint(APP_ENV.API).setProject(router.params.project||'').setLocale(APP_ENV.LOCALE).setMode('admin');return sdk;},false);})(window);(function(window){"use strict";window.ls.container.set('search',function(window){return{params:{},path:'',pointer:'',selected:'',};},true,true);})(window);(function(window){"use strict";window.ls.container.set('timezone',function(){return{convert:function(unixTime){var timezoneMinutes=new Date().getTimezoneOffset();timezoneMinutes=(timezoneMinutes===0)?0:-timezoneMinutes;return parseInt(unixTime)+(timezoneMinutes*60);}};},true);})(window);window.ls.router.add("/auth/signin",{template:"/auth/signin?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/signup",{template:"/auth/signup?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery",{template:"/auth/recovery?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/recovery/reset",{template:"/auth/recovery/reset?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/confirm",{template:"/auth/confirm?version="+APP_ENV.VERSION,scope:"home"}).add("/auth/join",{template:"/auth/join?version="+APP_ENV.VERSION,scope:"home"}).add("/console",{template:"/console?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/account/:tab",{template:"/console/account?version="+APP_ENV.VERSION,scope:"console"}).add("/console/home",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/home/:tab",{template:"/console/home?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/platforms/:platform",{template:function(window){return window.location.pathname+"?version="+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/notifications",{template:"/console/notifications?version="+APP_ENV.VERSION,scope:"console"}).add("/console/settings",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/settings/:tab",{template:"/console/settings?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/webhooks/:tab",{template:"/console/webhooks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/keys/:tab",{template:"/console/keys?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/tasks/:tab",{template:"/console/tasks?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database",{template:"/console/database?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/database/collection",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/collection/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/database/document/:tab",{template:function(window){return window.location.pathname+window.location.search+'&version='+APP_ENV.VERSION;},scope:"console",project:true}).add("/console/storage",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/storage/:tab",{template:"/console/storage?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/view/:tab",{template:"/console/users/view?version="+APP_ENV.VERSION,scope:"console",project:true}).add("/console/users/:tab",{template:"/console/users?version="+APP_ENV.VERSION,scope:"console",project:true});window.ls.filter.add("gravatar",function($value,element){if(!$value){return"";}
let MD5=function(s){function L(k,d){return(k<<d)|(k>>>(32-d));}
function K(G,k){let I,d,F,H,x;F=G&2147483648;H=k&2147483648;I=G&1073741824;d=k&1073741824;x=(G&1073741823)+(k&1073741823);if(I&d){return x^2147483648^F^H;}
if(I|d){if(x&1073741824){return x^3221225472^F^H;}else{return x^1073741824^F^H;}}else{return x^F^H;}}
@ -345,7 +345,7 @@ code.innerHTML=value;Prism.highlightElement(code);div.scrollTop=0;};element.addE
function syncA(){element.value=picker.value;update();}
function syncB(){picker.value=element.value;}
element.parentNode.insertBefore(preview,element);update();syncB();}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-copy",controller:function(element,alerts,document,window){var button=window.document.createElement("i");button.type="button";button.className="icon-docs note copy";button.style.cursor="pointer";element.parentNode.insertBefore(button,element.nextSibling);var copy=function(event){let disabled=element.disabled;element.disabled=false;element.focus();element.select();document.execCommand("Copy");if(document.selection){document.selection.empty();}else if(window.getSelection){window.getSelection().removeAllRanges();}
element.disabled=disabled;element.blur();alerts.add({text:"Copied to clipboard",class:""},3000);};button.addEventListener("click",copy);}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-filter",controller:function(document,container,expression,element,form,di){let name=element.dataset["formsFilter"]||"";let events=element.dataset["event"]||"";let serialize=function(obj,prefix){let str=[],p;for(p in obj){if(obj.hasOwnProperty(p)){let k=prefix?prefix+"["+p+"]":p,v=obj[p];if(v===""){continue;}
element.disabled=disabled;element.blur();alerts.add({text:"Copied to clipboard",class:""},3000);};button.addEventListener("click",copy);}});})(window);(function(window){"use strict";window.ls.container.get("view").add({selector:"data-forms-document",controller:function(element,container,search){var searchButton=(element.dataset["search"]||0);if(searchButton){let searchOpen=document.createElement("button");searchOpen.type='button';searchOpen.innerHTML='<i class="icon icon-search"></i> Search';searchOpen.classList.add('reverse');searchOpen.classList.add('small');let path=container.scope(searchButton);searchOpen.addEventListener('click',function(){search.selected=element.value;search.path=path;document.dispatchEvent(new CustomEvent("open-document-serach",{bubbles:false,cancelable:true}));});element.parentNode.insertBefore(searchOpen,element.nextSibling)}}});})(window);(function(window){window.ls.container.get("view").add({selector:"data-forms-filter",controller:function(document,container,expression,element,form,di){let name=element.dataset["formsFilter"]||"";let events=element.dataset["event"]||"";let serialize=function(obj,prefix){let str=[],p;for(p in obj){if(obj.hasOwnProperty(p)){let k=prefix?prefix+"["+p+"]":p,v=obj[p];if(v===""){continue;}
str.push(v!==null&&typeof v==="object"?serialize(v,k):encodeURIComponent(k)+"="+encodeURIComponent(v));}}
return str.join("&");};let parse=function(filter){if(filter===""){return null;}
let operatorsMap=["!=",">=","<=","=",">","<"];let operator=null;for(let key=0;key<operatorsMap.length;key++){if(filter.indexOf(operatorsMap[key])>-1){operator=operatorsMap[key];}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -102,12 +102,16 @@ window.ls.router
project: true
})
.add("/console/database/collection", {
template: "/console/database/collection?version=" + APP_ENV.VERSION,
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.VERSION;
},
scope: "console",
project: true
})
.add("/console/database/collection/:tab", {
template: "/console/database/collection?version=" + APP_ENV.VERSION,
template: function(window) {
return window.location.pathname + window.location.search + '&version=' + APP_ENV.VERSION;
},
scope: "console",
project: true
})

View file

@ -0,0 +1,35 @@
(function(window) {
"use strict";
window.ls.container.get("view").add({
selector: "data-forms-document",
controller: function(element, container, search) {
var searchButton = (element.dataset["search"] || 0);
if(searchButton) {
let searchOpen = document.createElement("button");
searchOpen.type = 'button';
searchOpen.innerHTML = '<i class="icon icon-search"></i> Search';
searchOpen.classList.add('reverse');
searchOpen.classList.add('small');
let path = container.scope(searchButton);
searchOpen.addEventListener('click', function() {
search.selected = element.value;
search.path = path;
document.dispatchEvent(
new CustomEvent("open-document-serach", {
bubbles: false,
cancelable: true
}));
});
element.parentNode.insertBefore(searchOpen, element.nextSibling)
}
}
});
})(window);

View file

@ -102,6 +102,7 @@ https://prismjs.com/download.html#themes=prism-okaidia&languages=markup+css+clik
opacity: 0;
transition: bottom .3s, opacity .3s;
line-height: normal;
font-family: 'Poppins', sans-serif;
&::before {
.func-padding-end(5px);