Only show support ticket and remote support UI for paid plans

This commit is contained in:
Johannes Zellner
2020-02-19 14:19:35 +01:00
parent 932de7dba7
commit 1ef5fd1a0f
2 changed files with 58 additions and 51 deletions

View File

@@ -9,44 +9,48 @@
</div>
<div class="card">
<div class="grid-item-top">
<div class="row animateMeOpacity">
<div class="col-lg-12">
<div ng-bind-html="supportConfig.ticketFormBody | markdown2html"></div>
<form ng-show="supportConfig.submitTickets" name="feedbackForm" ng-submit="submitFeedback()">
<div class="form-group">
<label>Type</label>
<select class="form-control" name="type" style="width: 50%;" ng-model="feedback.type" required>
<option value="app_error">App Error</option>
<option value="ticket">Bug Report</option>
<option value="email_error">Email Error</option>
</select>
</div>
<div class="form-group" ng-show="feedback.type === 'app_error'">
<label>Select App</label>
<select class="form-control" name="type" style="width: 50%;" ng-model="feedback.appId" ng-required="feedback.type === 'app_error'">
<option ng-repeat="app in apps" value="{{ app.id }}">{{ app.fqdn }}</option>
</select>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.subject.$dirty && feedbackForm.subject.$invalid) }">
<label>Topic</label>
<input type="text" class="form-control" name="subject" placeholder="Topic" ng-model="feedback.subject" ng-maxlength="512" ng-minlength="1" required>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.description.$dirty && feedbackForm.description.$invalid) }">
<label>Report</label>
<textarea class="form-control" name="description" rows="3" placeholder="Describe your issue" ng-model="feedback.description" ng-minlength="1" required></textarea>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.email.$dirty && feedbackForm.email.$invalid) }">
<label>Email</label> <small> (Subscription email is {{ subscription.email }}) </small>
<input type="text" class="form-control" name="email" placeholder="If needed, provide an email address different from above to reach you" ng-model="feedback.altEmail" ng-maxlength="512" ng-minlength="1" ng-required="feedback.type === 'email_error'">
</div>
<button type="submit" class="btn btn-primary pull-right" ng-disabled="feedbackForm.$invalid || feedback.busy"><i class="fa fa-circle-notch fa-spin" ng-show="feedback.busy"></i> Submit</button>
<span ng-show="feedback.error" class="text-danger text-bold">{{feedback.error}}</span>
<span ng-show="feedback.result" class="text-success text-bold">{{feedback.result.message}}</span>
</form>
</div>
</div>
<div class="grid-item-top">
<div class="row animateMeOpacity" ng-show="subscription.plan.id === 'free'">
<p class="text-bold">Support tickets are only available in the paid plans.</p>
<p>You may find answers in our <a href="https://cloudron.io/documentation/apps/?support_view" target="_blank">documentation</a> or ask on the <a href="https://forum.cloudron.io/" target="_blank">Forum</a>.</p>
</div>
<div class="row animateMeOpacity" ng-hide="subscription.plan.id === 'free'">
<div class="col-lg-12">
<div ng-bind-html="supportConfig.ticketFormBody | markdown2html"></div>
<form ng-show="supportConfig.submitTickets" name="feedbackForm" ng-submit="submitFeedback()">
<div class="form-group">
<label>Type</label>
<select class="form-control" name="type" style="width: 50%;" ng-model="feedback.type" required>
<option value="app_error">App Error</option>
<option value="ticket">Bug Report</option>
<option value="email_error">Email Error</option>
</select>
</div>
<div class="form-group" ng-show="feedback.type === 'app_error'">
<label>Select App</label>
<select class="form-control" name="type" style="width: 50%;" ng-model="feedback.appId" ng-required="feedback.type === 'app_error'">
<option ng-repeat="app in apps" value="{{ app.id }}">{{ app.fqdn }}</option>
</select>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.subject.$dirty && feedbackForm.subject.$invalid) }">
<label>Topic</label>
<input type="text" class="form-control" name="subject" placeholder="Topic" ng-model="feedback.subject" ng-maxlength="512" ng-minlength="1" required>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.description.$dirty && feedbackForm.description.$invalid) }">
<label>Report</label>
<textarea class="form-control" name="description" rows="3" placeholder="Describe your issue" ng-model="feedback.description" ng-minlength="1" required></textarea>
</div>
<div class="form-group" ng-class="{ 'has-error': (feedbackForm.email.$dirty && feedbackForm.email.$invalid) }">
<label>Email</label> <small> (Subscription email is {{ subscription.email }}) </small>
<input type="text" class="form-control" name="email" placeholder="If needed, provide an email address different from above to reach you" ng-model="feedback.altEmail" ng-maxlength="512" ng-minlength="1" ng-required="feedback.type === 'email_error'">
</div>
<button type="submit" class="btn btn-primary pull-right" ng-disabled="feedbackForm.$invalid || feedback.busy"><i class="fa fa-circle-notch fa-spin" ng-show="feedback.busy"></i> Submit</button>
<span ng-show="feedback.error" class="text-danger text-bold">{{feedback.error}}</span>
<span ng-show="feedback.result" class="text-success text-bold">{{feedback.result.message}}</span>
</form>
</div>
</div>
</div>
</div>
<div class="text-left" ng-show="supportConfig.remoteSupport">
@@ -54,18 +58,21 @@
</div>
<div class="card" ng-show="supportConfig.remoteSupport">
<div class="grid-item-top">
<div class="row animateMeOpacity">
<div class="col-lg-12">
Enable this option to allow support engineers to connect to this server via SSH.
<br/>
<br/>
<b>Do not enable this option unless requested by the Cloudron support team.</b>
<br/>
<br/>
<button class="btn" ng-class="!sshSupportEnabled ? 'btn-danger pull-right' : 'btn-primary pull-right'" ng-click="toggleSshSupport()">{{ sshSupportEnabled ? 'Disable SSH support access' : 'Enable SSH support access' }}</button>
</div>
</div>
<div class="grid-item-top">
<div class="row animateMeOpacity" ng-show="subscription.plan.id === 'free'">
<b>This features is only available in the paid plans.</b>
</div>
<div class="row animateMeOpacity" ng-hide="subscription.plan.id === 'free'">
<div class="col-lg-12">
Enable this option to allow support engineers to connect to this server via SSH.
<br/>
<br/>
<b>Do not enable this option unless requested by the Cloudron support team.</b>
<br/>
<br/>
<button class="btn" ng-class="!sshSupportEnabled ? 'btn-danger pull-right' : 'btn-primary pull-right'" ng-click="toggleSshSupport()">{{ sshSupportEnabled ? 'Disable SSH support access' : 'Enable SSH support access' }}</button>
</div>
</div>
</div>
</div>
</div>

View File

@@ -71,6 +71,8 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
}
Client.onReady(function () {
getSubscription();
Client.getSupportConfig(function (error, supportConfig) {
if (error) return console.error(error);
@@ -80,8 +82,6 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
if (error) return console.error(error);
$scope.sshSupportEnabled = enabled;
getSubscription();
});
});
});