2020-07-15 04:13:18 +12:00
|
|
|
<?php
|
|
|
|
$environments = $this->getParam('environments', []);
|
|
|
|
?>
|
2020-05-05 01:34:31 +12:00
|
|
|
<div class="cover">
|
|
|
|
<h1 class="zone xl margin-bottom-large">
|
2020-06-14 10:57:34 +12:00
|
|
|
<a data-ls-attrs="href=/console/home?project={{router.params.project}}" class="back text-size-small link-return-animation--start"><i class="icon-left-open"></i> Home</a>
|
2020-05-05 01:34:31 +12:00
|
|
|
<br />
|
|
|
|
|
|
|
|
<span>Functions</span>
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="zone xl">
|
|
|
|
<ul class="phases clear" data-ui-phases data-selected="{{router.params.tab}}">
|
|
|
|
<li data-state="/console/functions?project={{router.params.project}}">
|
|
|
|
<h2>Functions</h2>
|
2020-05-11 08:44:28 +12:00
|
|
|
|
|
|
|
<div class="zone xl"
|
|
|
|
data-service="functions.list"
|
|
|
|
data-scope="sdk"
|
|
|
|
data-event="load,functions.create,functions.update,functions.delete"
|
|
|
|
data-name="project-functions"
|
|
|
|
data-param-project-id="{{router.params.project}}"
|
2020-07-19 09:15:02 +12:00
|
|
|
data-param-limit="<?php echo APP_PAGING_LIMIT; ?>"
|
|
|
|
data-param-offset=""
|
|
|
|
data-param-order-type="DESC"
|
2020-05-11 08:44:28 +12:00
|
|
|
data-success="trigger"
|
|
|
|
data-success-param-trigger-events="functions.list">
|
|
|
|
|
|
|
|
<div data-ls-if="0 == {{project-functions.functions.length}} || undefined == {{project-functions.functions.length}}" class="box margin-top margin-bottom">
|
|
|
|
<h3 class="margin-bottom-small text-bold">No Functions Found</h3>
|
|
|
|
|
|
|
|
<p class="margin-bottom-no">You haven't created any functions for your project yet.</p>
|
|
|
|
</div>
|
|
|
|
|
2020-07-19 09:15:02 +12:00
|
|
|
<div data-ls-if="0 != {{project-functions.functions.length}}">
|
|
|
|
<div class="margin-bottom-small margin-end-small text-align-end text-size-small margin-top-negative"><span data-ls-bind="{{project-functions.sum}}"></span> functions found</div>
|
|
|
|
|
|
|
|
<div class="box margin-bottom">
|
|
|
|
<ul data-ls-loop="project-functions.functions" data-ls-as="function" class="list">
|
|
|
|
<li class="clear">
|
|
|
|
<div class="pull-start margin-end avatar-container">
|
|
|
|
<img src="" data-ls-attrs="src=/images/environments/{{function.env|envLogo}}?v=<?php echo APP_CACHE_BUSTER; ?>" alt="Function Env." class="avatar" loading="lazy" width="60" height="60" />
|
|
|
|
</div>
|
2020-05-11 08:44:28 +12:00
|
|
|
|
2020-07-19 09:15:02 +12:00
|
|
|
<a data-ls-attrs="href=/console/functions/function?id={{function.$id}}&project={{router.params.project}}" class="button pull-end">Settings</a>
|
2020-05-11 08:44:28 +12:00
|
|
|
|
2020-07-19 09:15:02 +12:00
|
|
|
<span data-ls-bind="{{function.name}}"></span>
|
|
|
|
|
2020-10-31 08:53:27 +13:00
|
|
|
<p class="text-fade margin-bottom-no" data-ls-bind="{{function.env|envName}} {{function.env|envVersion}}"></p>
|
2020-07-19 09:15:02 +12:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="pull-end text-align-center paging">
|
|
|
|
<form
|
|
|
|
data-service="functions.list"
|
|
|
|
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-functions"
|
|
|
|
data-success="state"
|
|
|
|
data-success-param-state-keys="search,offset">
|
|
|
|
<button name="offset" data-paging-back data-offset="{{router.params.offset}}" data-sum="{{project-users.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-functions.sum|pageTotal}}"></span>
|
|
|
|
|
|
|
|
<form
|
|
|
|
data-service="functions.list"
|
|
|
|
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-functions"
|
|
|
|
data-success="state"
|
|
|
|
data-success-param-state-keys="search,offset">
|
|
|
|
<button name="offset" data-paging-next data-offset="{{router.params.offset}}" data-sum="{{project-functions.sum}}" class="margin-start round small" aria-label="Next"><i class="icon-right-open"></i></button>
|
|
|
|
</form>
|
2020-05-11 08:44:28 +12:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="clear">
|
|
|
|
<div data-ui-modal class="modal close box sticky-footer" data-button-text="Add Function">
|
|
|
|
<button type="button" class="close pull-end" data-ui-modal-close=""><i class="icon-cancel"></i></button>
|
|
|
|
|
|
|
|
<h1>Add Function</h1>
|
|
|
|
|
|
|
|
<form
|
2021-01-18 19:29:26 +13:00
|
|
|
data-analytics
|
|
|
|
data-analytics-activity
|
2020-05-11 08:44:28 +12:00
|
|
|
data-analytics-event="submit"
|
|
|
|
data-analytics-category="console"
|
|
|
|
data-analytics-label="Create Project Function"
|
2020-05-11 16:39:00 +12:00
|
|
|
data-service="functions.create"
|
|
|
|
data-scope="sdk"
|
2020-05-11 08:44:28 +12:00
|
|
|
data-event="submit"
|
2020-06-14 08:26:45 +12:00
|
|
|
data-success="alert,trigger,reset,redirect"
|
2020-05-11 08:44:28 +12:00
|
|
|
data-success-param-alert-text="Created function successfully"
|
2020-05-11 16:39:00 +12:00
|
|
|
data-success-param-trigger-events="functions.create"
|
2020-06-14 08:26:45 +12:00
|
|
|
data-success-param-redirect-url="/console/functions/function?id={{serviceData.$id}}&project={{router.params.project}}"
|
2020-05-11 08:44:28 +12:00
|
|
|
data-failure="alert"
|
|
|
|
data-failure-param-alert-text="Failed to create function"
|
|
|
|
data-failure-param-alert-classname="error">
|
|
|
|
|
|
|
|
<label for="name">Name</label>
|
2020-09-08 09:28:40 +12:00
|
|
|
<input type="text" id="name" name="name" required autocomplete="off" class="margin-bottom" maxlength="128" />
|
2020-07-15 04:13:18 +12:00
|
|
|
|
|
|
|
<label for="env">Environment</label>
|
|
|
|
<select name="env" id="env" required class="margin-bottom-xl">
|
|
|
|
<?php foreach($environments as $key => $environment): ?>
|
|
|
|
<option value="<?php echo $this->escape($key); ?>"><?php echo $this->escape($environment['name']); ?> <?php echo $this->escape($environment['version']); ?></option>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
2020-05-11 08:44:28 +12:00
|
|
|
|
|
|
|
<footer>
|
|
|
|
<button type="submit">Create</button> <button data-ui-modal-close="" type="button" class="reverse">Cancel</button>
|
|
|
|
</footer>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-05 01:34:31 +12:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|