Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d3c27ec30 | ||
|
|
b6d3c18944 | ||
|
|
31282af701 | ||
|
|
45c8b83d54 | ||
|
|
29d23c9dcc |
@@ -1594,13 +1594,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.createTicket = function (type, subject, description, appId /* optional */, altEmail /* optional */, callback) {
|
||||
Client.prototype.createTicket = function (ticket, callback) {
|
||||
// just to be eplicit here
|
||||
var data = {
|
||||
type: type,
|
||||
subject: subject,
|
||||
description: description,
|
||||
appId: appId || undefined,
|
||||
altEmail: altEmail || undefined
|
||||
enableSshSupport: !!ticket.enableSshSupport,
|
||||
type: ticket.type,
|
||||
subject: ticket.subject,
|
||||
description: ticket.description,
|
||||
appId: ticket.appId || undefined,
|
||||
altEmail: ticket.altEmail || undefined
|
||||
};
|
||||
|
||||
post('/api/v1/support/ticket', data, null, function (error, data, status) {
|
||||
|
||||
@@ -186,8 +186,9 @@ app.filter('selectedStateFilter', function () {
|
||||
if (!selectedState || !selectedState.state) return true;
|
||||
|
||||
if (selectedState.state === 'running') return app.runState === 'running' && app.health === 'healthy' && app.installationState === 'installed';
|
||||
if (selectedState.state === 'stopped') return app.runState === 'stopped';
|
||||
|
||||
return app.runState !== 'running' || app.health !== 'healthy' || app.installationState !== 'installed';
|
||||
return app.runState === 'running' && (app.health !== 'healthy' || app.installationState !== 'installed'); // not responding
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
@@ -815,9 +815,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<hr ng-hide="true"/>
|
||||
|
||||
<div class="form-group binds">
|
||||
<!-- hidden for now until we find good use cases -->
|
||||
<div class="form-group binds" ng-hide="true">
|
||||
<label class="control-label">Binds <sup><a ng-href="https://docs.cloudron.io/apps/#volumes" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup></label>
|
||||
<div class="has-error" ng-show="resources.error.binds">{{ resources.error.binds }}</div>
|
||||
|
||||
@@ -848,7 +849,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- hidden for now until we find good use cases -->
|
||||
<div class="row" ng-hide="true">
|
||||
<div class="col-md-12 text-right">
|
||||
<button class="btn btn-outline btn-primary pull-right" ng-click="resources.submitBinds()" ng-disabled="resources.busyBinds || app.error || app.taskId" tooltip-enable="app.error || app.taskId" uib-tooltip="{{ app.error ? 'App is in error state' : 'App is busy' }}">
|
||||
<i class="fa fa-circle-notch fa-spin" ng-show="resources.busyBinds"></i> Save
|
||||
@@ -928,7 +930,7 @@
|
||||
<fieldset>
|
||||
<div class="form-group">
|
||||
<label class="control-label" style="width: 100%">Robots.txt <sup><a ng-href="https://docs.cloudron.io/apps/#robotstxt" class="help" target="_blank"><i class="fa fa-question-circle"></i></a></sup> <a href="" class="pull-right" style="font-weight: normal;" ng-click="security.robotsTxt = ROBOTS_DISABLE_INDEXING_TEMPLATE">Disable indexing</a></label>
|
||||
<textarea ng-model="security.robotsTxt" placeholder="Leave empty to allow all bots to index this app" class="form-control" rows="4"></textarea>
|
||||
<textarea ng-trim="false" style="white-space: pre-wrap" ng-model="security.robotsTxt" placeholder="Leave empty to allow all bots to index this app" class="form-control" rows="4"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -11,7 +11,8 @@ angular.module('Application').controller('AppsController', ['$scope', '$timeout'
|
||||
$scope.states = [
|
||||
{ state: '', label: 'All States' },
|
||||
{ state: 'running', label: 'Running' },
|
||||
{ state: 'not_running', label: 'Not Running' }
|
||||
{ state: 'stopped', label: 'Stopped' },
|
||||
{ state: 'not_responding', label: 'Not Responding' }
|
||||
];
|
||||
$scope.selectedState = $scope.states[0];
|
||||
$scope.selectedTags = [];
|
||||
|
||||
@@ -44,6 +44,11 @@
|
||||
<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>
|
||||
<div class="form-group">
|
||||
<label class="control-label">
|
||||
<input type="checkbox" ng-model="feedback.enableSshSupport"> Allow support engineers to connect to this server via SSH
|
||||
</label>
|
||||
</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>
|
||||
|
||||
@@ -15,6 +15,7 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
|
||||
error: null,
|
||||
result: null,
|
||||
busy: false,
|
||||
enableSshSupport: false,
|
||||
subject: '',
|
||||
type: 'app_error',
|
||||
description: '',
|
||||
@@ -26,6 +27,7 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
|
||||
$scope.subscription = null;
|
||||
|
||||
function resetFeedback() {
|
||||
$scope.feedback.enableSshSupport = false;
|
||||
$scope.feedback.subject = '';
|
||||
$scope.feedback.description = '';
|
||||
$scope.feedback.type = 'app_error';
|
||||
@@ -41,7 +43,16 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
|
||||
$scope.feedback.result = null;
|
||||
$scope.feedback.error = null;
|
||||
|
||||
Client.createTicket($scope.feedback.type, $scope.feedback.subject, $scope.feedback.description, $scope.feedback.appId, $scope.feedback.altEmail, function (error, result) {
|
||||
var data = {
|
||||
enableSshSupport: $scope.feedback.enableSshSupport,
|
||||
subject: $scope.feedback.subject,
|
||||
description: $scope.feedback.description,
|
||||
type: $scope.feedback.type,
|
||||
appId: $scope.feedback.appId,
|
||||
altEmail: $scope.feedback.altEmail
|
||||
};
|
||||
|
||||
Client.createTicket(data, function (error, result) {
|
||||
if (error) {
|
||||
$scope.feedback.error = error.message;
|
||||
} else {
|
||||
@@ -50,6 +61,13 @@ angular.module('Application').controller('SupportController', ['$scope', '$locat
|
||||
}
|
||||
|
||||
$scope.feedback.busy = false;
|
||||
|
||||
// refresh state
|
||||
Client.getRemoteSupport(function (error, enabled) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.sshSupportEnabled = enabled;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user