1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00
appwrite/app/views/console/storage/index.phtml

148 lines
6.7 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"
2019-08-15 06:11:09 +12:00
data-success-param-alert-text="File uploaded successfully"
data-success-param-trigger-events="file-create,modal-close"
2019-08-15 01:50:40 +12:00
data-failure="alert"
2019-08-15 06:11:09 +12:00
data-failure-param-alert-text="Failed to upload file"
2019-08-15 01:50:40 +12:00
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>
2019-08-22 22:44:55 +12:00
<input type="file" name="files" id="file-files" required>
2019-08-15 01:50:40 +12:00
<label for="file-read">Read Permissions</label>
2019-08-22 22:44:55 +12:00
<input type="hidden" id="file-read" name="read" required data-forms-tags data-cast-to="json" value="<?php echo htmlentities(json_encode(['*'])); ?>" />
2019-08-15 01:50:40 +12:00
<label for="file-write">Write Permissions</label>
2019-08-22 22:44:55 +12:00
<input type="hidden" id="file-write" name="write" required data-forms-tags data-cast-to="json" value="<?php echo htmlentities(json_encode(['*'])); ?>" />
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">
2019-08-23 08:37:34 +12:00
<div class="row thin responsive">
2019-08-15 01:50:40 +12:00
<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">
2019-08-23 22:10:38 +12:00
<button class="fill" title="Search" aria-label="Search"><i class="icon-search"></i></button>
2019-08-15 01:50:40 +12:00
</div>
</div>
</form>
<div
data-service="storage.listFiles"
2019-08-15 06:11:09 +12:00
data-event="load,file-create,file-update,file-delete"
2019-08-15 01:50:40 +12:00
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="margin-bottom-small margin-end-small text-align-end text-size-small"><span data-ls-bind="{{project-files.sum}}"></span> files found</div>
2019-08-15 01:50:40 +12:00
<div class="box margin-bottom">
<table class="vertical">
<thead>
<tr>
<th width="60"></th>
2019-08-15 06:11:09 +12:00
<th width="220">Filename</th>
2019-08-15 01:50:40 +12:00
<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">
2019-08-15 18:03:10 +12:00
<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" loading="lazy" />
2019-08-15 01:50:40 +12:00
</td>
<td data-title="Name: ">
2019-08-24 07:07:17 +12:00
<small data-ls-bind="{{file.name}}"></small>
2019-08-15 01:50:40 +12:00
</td>
<td data-title="Type: ">
2019-08-24 07:07:17 +12:00
<span data-ls-bind="{{file.mimeType}}" class="tag"></span>
2019-08-15 01:50:40 +12:00
</td>
2019-08-24 07:07:17 +12:00
<td data-title="Size: ">
<small data-ls-bind="{{file.sizeOriginal|humanFileSize}}"></small>
2019-08-15 01:50:40 +12:00
</td>
<td data-title="Created: ">
2019-08-24 07:07:17 +12:00
<small data-ls-bind="{{file.dateCreated|date-text}}"></small>
2019-08-15 01:50:40 +12:00
</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>
2019-05-09 18:54:39 +12:00
</div>