CockpitCMS-Drone/views/settings/index.php
2019-03-06 12:26:09 +01:00

106 lines
4.0 KiB
PHP

<div>
<ul class="uk-breadcrumb">
<li><a href="@route('/settings')">@lang('Settings')</a></li>
<li class="uk-active"><span>@lang('Drone Deploys')</span></li>
</ul>
</div>
<div class="uk-margin-top" riot-view>
<form class="uk-form" onsubmit="{ submit }">
<div class="uk-grid">
<div class="uk-grid-margin uk-width-medium-2-3">
<div class="uk-form-row">
<label class="uk-text-small">@lang('URL')</label>
<input class="uk-width-1-1 uk-form-large" type="text" bind="drone.url" required>
</div>
<div class="uk-form-row">
<label class="uk-text-small">@lang('Token')</label>
<input class="uk-width-1-1 uk-form-large" type="text" bind="drone.token" required>
</div>
<div class="uk-form-row">
<label class="uk-text-small">@lang('Owner')</label>
<input class="uk-width-1-1 uk-form-large" type="text" bind="drone.owner" required>
</div>
<div class="uk-form-row">
<label class="uk-text-small">@lang('Project')</label>
<input class="uk-width-1-1 uk-form-large" type="text" bind="drone.project" required>
</div>
<div class="uk-form-row">
<label class="uk-text-small">@lang('Branch')</label>
<input class="uk-width-1-1 uk-form-large" type="text" bind="drone.branch" placeholder="@lang('Default'): master">
</div>
<div class="uk-form-row">
<label class="uk-text-small">@lang('Target')</label>
<input class="uk-width-1-1 uk-form-large" type="text" bind="drone.target" required>
</div>
<div class="uk-form-row">
<label class="uk-text-small">@lang('Build')</label>
<input class="uk-width-1-1 uk-form-large" type="text" bind="drone.build" placeholder="@lang('Default'): @lang('empty for last successfull build')">
</div>
<cp-actionbar>
<div class="uk-container uk-container-center">
<button class="uk-button uk-button-large uk-button-primary">@lang('Save')</button>
<a class="uk-button uk-button-large uk-button-link" href="@route('/settings')">@lang('Cancel')</a>
</div>
</cp-actionbar>
</div>
<div class="uk-grid-margin uk-width-medium-1-3">
<div class="uk-panel">
<div class="uk-margin">
<label class="uk-text-small">@lang('Status')</label>
<div class="uk-margin-small-top">
<field-boolean bind="drone.active" label="false"></field-boolean>
</div>
</div>
<div class="uk-margin" if="{drone._id}">
<label class="uk-text-small">@lang('Last Modified')</label>
<div class="uk-margin-small-top uk-text-muted"><i class="uk-icon-calendar uk-margin-small-right"></i> { App.Utils.dateformat( new Date( 1000 * drone._modified )) }</div>
</div>
</div>
</div>
</div>
</form>
<script type="view/script">
var $this = this;
this.mixin(RiotBindMixin);
this.drone = {{ json_encode($drone) }};
submit(e) {
if(e) e.preventDefault();
App.request('/drone/settings/save', {drone: this.drone}).then(function(data) {
if (data) {
App.ui.notify("Saving successful", "success");
$this.drone = data;
$this.update();
} else {
App.ui.notify("Saving failed.", "danger");
}
});
}
</script>
</div>