Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/lib/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,13 @@
"proxies_pageHeader": "Proxies",
"proxies_addProxy": "Add proxy",
"proxies_noProxiesFound": "No proxies found.",
"proxyBackendForm_advancedSettings_title": "Advanced settings",
"proxyBackendForm_apiBasePath_helpText": "Base path added to all API requests. Example:",
"proxyBackendForm_apiPort_helpText": "Port number on API server",
"proxyBackendForm_disableApiKey_helpText": "Optionally you can allow users to use your API without API key.",
"proxyBackendForm_proxyBasePath_helpText": "Base path added to all Proxy requests. Example:",
"proxyBackendForm_successMessage": "Settings saved.",
"proxyBackendForm_saveButton": "Save proxy settings",
"proxyItem_editProxy": "Edit",
"proxyItem_removeProxy": "Remove",
"publishApiBackendOnApiUmbrella_successMessage": "API Backend successfully published.",
Expand Down
24 changes: 23 additions & 1 deletion proxy_backends/client/form/form.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,31 @@
{{_ "proxyBackendForm_apiPort_helpText" }}
</p>
</div>

<!-- Advanced settings -->
<div class="form-group col-md-12 advanced-settings">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the only 'advanced-settings' element on the page, use id instead of class.


<!-- Advanced settings block title -->
<h3>
{{_ "proxyBackendForm_advancedSettings_title" }}
</h3>

<!-- field input -->
{{> afQuickField
name="apiUmbrella.settings.disable_api_key"
type="boolean-checkbox"
}}

<!-- help text -->
<p class="help-block">
{{_ "proxyBackendForm_disableApiKey_helpText" }}
</p>
</div>
</div>

<!-- submit button -->
<button type="submit" class="btn btn-primary pull-right">Save proxy settings</button>
<button type="submit" class="btn btn-success pull-left save-proxy-button">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the only 'save-proxy-button' element on the page, use id rather than class.

{{_ "proxyBackendForm_saveButton" }}
</button>
{{/ autoForm }}
</template>
24 changes: 24 additions & 0 deletions proxy_backends/client/form/form.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.advanced-settings {
margin-bottom: 0;

.form-group {
margin-bottom: 0;

.checkbox {
margin-bottom: 0.3em;
}
}

.help-block {
margin-bottom: 0;
margin-top: 0;

label {
margin-bottom: 0;
}
}
}

.save-proxy-button {
margin-top: 1em;
}
14 changes: 14 additions & 0 deletions proxy_backends/collection/apiUmbrellaSchema.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
// Utility import
import { proxyBasePathRegEx, apiBasePathRegEx } from './regex';


const Settings = new SimpleSchema({
'disable_api_key': {
type: Boolean,
optional: true,
label: 'Disable API Key',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to internationalize this label.

defaultValue: false
}
});

const ApiUmbrellaSchema = new SimpleSchema({
id: {
type: String,
Expand Down Expand Up @@ -64,6 +74,10 @@ const ApiUmbrellaSchema = new SimpleSchema({
optional: true,
label: 'API port',
},
settings: {
type: Settings,
optional: true,
},
});

export { ApiUmbrellaSchema };