1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00
appwrite/app/views/console/storage/index.phtml

215 lines
11 KiB
PHTML
Raw Normal View History

2019-05-09 18:54:39 +12:00
<?php
use Utopia\Locale\Locale;
?>
<div class="cover margin-bottom-large">
<h1 class="zone xl margin-bottom-large margin-top">
<?php echo Locale::getText('console.storage.title'); ?>
</h1>
</div>
<div class="zone xl">
2019-08-15 01:50:40 +12:00
<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>Upload File</h1>
<form data-debug="1"
data-service="storage.createFile"
data-event="submit"
data-scope="sdk"
data-success="alert,trigger,reset"
data-success-param-alert-text="Created user successfully"
data-success-param-trigger-events="user-create,modal-close"
data-failure="alert"
data-failure-param-alert-text="Failed to create user"
data-failure-param-alert-classname="error">
<input type="hidden" name="folderId" id="files-folderId" data-cast-to="int" value="1">
<label for="file-read">Files</label>
<input type="file" name="files" id="file-files" require>
<label for="file-read">Read Permissions</label>
<input type="text" class="full-width" id="file-read" name="read" required autocomplete="off" data-cast-to="array" value="*" />
<label for="file-write">Write Permissions</label>
<input type="text" class="full-width" id="file-write" name="write" required autocomplete="off" data-cast-to="array" value="*" />
2019-05-09 18:54:39 +12:00
2019-08-15 01:50:40 +12:00
<hr />
<button type="submit">Create</button> &nbsp; <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
</form>
</div>
<form class="box padding-small margin-bottom search"
data-service="storage.listFiles"
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-files"
data-success="state"
data-success-param-state-keys="search,offset">
<div class="row responsive">
<div class="col span-10">
<input name="search" id="searchFiles" 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
data-service="storage.listFiles"
data-event="load,user-create,user-update,user-delete"
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-files">
<div data-ls-if="0 == {{project-files.sum}}" class="box margin-bottom">
<h3 class="margin-bottom">No Files Found</h3>
<p class="margin-bottom-no">Upload your first file to get started</p>
</div>
<div data-ls-if="0 != {{project-files.sum}}" style="display: none;">
<div class="note margin-bottom-small margin-end-small text-align-end text-size-small"><span data-ls-bind="{{project-files.sum}}"></span> results found</div>
<div class="box margin-bottom">
<table class="vertical">
<thead>
<tr>
<th width="60"></th>
<th width="220">Name</th>
<th width="180">Type</th>
<th>Size</th>
<th width="100">Created</th>
</tr>
</thead>
<tbody data-ls-loop="project-files.files" data-ls-as="file">
<tr>
<td class="hide">
<img src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$uid}}/preview?width=100&height=100&project={{router.params.project}}&mode=admin" class="pull-start avatar" />
</td>
<td data-title="Name: ">
<span data-ls-bind="{{file.name}}" class="note"></span>
</td>
<td data-title="Type: ">
<span data-ls-bind="{{file.mimeType}}" class="note tag"></span>
</td>
<td data-title="Status: ">
<span data-ls-bind="{{file.sizeOriginal|humanFileSize}}" class="note"></span>
</td>
<td data-title="Created: ">
<span data-ls-bind="{{file.dateCreated|date-text}}" class="note"></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="clear text-align-center paging">
<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 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 round small" aria-label="Next"><i class="icon-right-open"></i></button>
</form>
</div>
</div>
<!--
<div>
2019-05-09 18:54:39 +12:00
<form class="row clear margin-bottom-tiny" data-forms-filter="filter-files" data-event="init">
<div class="col span-4">
<div class="margin-bottom-small">
<input type="hidden" name="offset" value="0">
<input type="hidden" name="limit" value="15">
<input name="search" id="search" type="search" autocomplete="off" placeholder="Search" class="strip">
</div>
</div>
<div class="col span-4"></div>
<div class="col span-4"></div>
</form>
2019-08-08 06:10:53 +12:00
<div
data-service="storage.files.list"
data-param-search="{{filter-files.keys.search}}"
data-param-limit="{{filter-files.keys.limit}}"
data-param-offset="{{filter-files.keys.offset}}"
data-param-order-type="DESC"
data-scope="sdk"
data-name="project-files"
data-event="filter-files-changed,user-update"
data-success="trigger"
data-success-param-trigger-events="users-load">
2019-05-09 18:54:39 +12:00
<div data-ls-if="0 == {{project-files.sum}}" class="box margin-bottom" style="display: none;">
<h3 class="margin-bottom">No Files Found</h3>
<p class="margin-bottom-no">Upload your first file to get started</p>
</div>
<div data-ls-if="0 != {{project-files.sum}}" style="display: none;">
<ul data-ls-loop="project-files.files" data-ls-as="file" class="tiles cell-3">
<li>
<div class="box padding-small margin-bottom">
2019-05-10 04:15:51 +12:00
<img data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$uid}}/preview?width=100&height=100&project={{router.params.project}}&mode=admin" class="pull-start avatar margin-end" />
2019-05-09 18:54:39 +12:00
<button class="pull-end strip margin-top-tiny"><i class="icon icon-dot-3"></i></button>
2019-05-10 08:29:23 +12:00
<div data-ls-bind="{{file.name}}" data-ls-attrs="title={{file.name}}" class="text-one-liner margin-bottom-tiny">&nbsp;</div>
2019-05-10 04:15:51 +12:00
<div data-ls-bind="{{file.sizeOriginal|humanFileSize}}" class="note text-one-liner">&nbsp;</div>
2019-05-09 18:54:39 +12:00
</div>
</li>
</ul>
<div class="clear">
<span class="pull-end paging" data-ls-ui-paging="" data-sum="{{project-files.sum}}" data-offset="{{filter-files.keys.offset}}" data-limit="{{filter-files.keys.limit}}"></span>
<span data-ls-if="{{filter-files.backward}} >= 0" style="display: none;">
<button type="button" class="margin-end round" data-forms-filter="filter-files" data-params="<?php echo $this->escape(json_encode(['offset' => '{{filter-files.backward}}'])); ?>" aria-label="Back"><i class="icon-left-open"></i></button>
</span>
<span data-ls-if="{{filter-files.backward}} < 0" style="display: none;">
<button type="button" class="disabled margin-end round" disabled aria-label="Back"><i class="icon-left-open"></i></button>
</span>
<span data-ls-if="{{filter-files.forward}} < {{project-files.sum}}" style="display: none;">
<button type="button" class="margin-end round" data-forms-filter="filter-files" data-params="<?php echo $this->escape(json_encode(['offset' => '{{filter-files.forward}}'])); ?>" aria-label="Next"><i class="icon-right-open"></i></button>
</span>
<span data-ls-if="{{filter-files.forward}} >= {{project-files.sum}}" style="display: none;">
<button type="button" class="disabled margin-end round" disabled aria-label="Next"><i class="icon-right-open"></i></button>
</span>
</div>
</div>
</div>
2019-08-15 01:50:40 +12:00
</div> -->
2019-05-09 18:54:39 +12:00
</div>