-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3595 from apinf/feature/mqtt-dashboard
Feature/mqtt dashboard
- Loading branch information
Showing
93 changed files
with
5,363 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
apinf_packages/apis/client/profile/settings/analytics/analytics.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!-- Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 --> | ||
|
||
<template name="apiSettingsAnalytics"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading"> | ||
<h2 class="panel-title"> | ||
<i class="fa fa-bar-chart" aria-hidden="true"></i> | ||
API Analytics | ||
</h2> | ||
</div> | ||
<div class="panel-body"> | ||
{{# autoForm id="updateApiAnalytics" type="normal" schema=updateAnalyitcsSchema }} | ||
<fieldset> | ||
{{> afQuickField type="hidden" name='proxyBackendId' value=proxyBackend._id }} | ||
{{> afQuickField type="hidden" name='lastDay' value='today' }} | ||
{{> afQuickField name='daysCount' }} | ||
</fieldset> | ||
<button type="submit" class="btn btn-success"> | ||
Update | ||
</button> | ||
{{/ autoForm }} | ||
</div> | ||
</div> | ||
</template> |
31 changes: 31 additions & 0 deletions
31
apinf_packages/apis/client/profile/settings/analytics/analytics.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
import { Template } from 'meteor/templating'; | ||
|
||
// Meteor contributed packages imports | ||
import { SimpleSchema } from 'meteor/aldeed:simple-schema'; | ||
|
||
Template.apiSettingsAnalytics.helpers({ | ||
// Schema for SDK Code Generator form | ||
updateAnalyitcsSchema () { | ||
// Create simple schema for sdk modal | ||
return new SimpleSchema({ | ||
proxyBackendId: { | ||
type: String, | ||
optional: false, | ||
}, | ||
lastDay: { | ||
type: String, | ||
optional: false, | ||
}, | ||
daysCount: { | ||
label: 'Days Count', | ||
type: Number, | ||
optional: false, | ||
}, | ||
}); | ||
}, | ||
}); |
53 changes: 53 additions & 0 deletions
53
apinf_packages/apis/client/profile/settings/analytics/autoform.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
import { Meteor } from 'meteor/meteor'; | ||
// Meteor packages imports | ||
import { AutoForm } from 'meteor/aldeed:autoform'; | ||
import { TAPi18n } from 'meteor/tap:i18n'; | ||
import { sAlert } from 'meteor/juliancwirko:s-alert'; | ||
|
||
AutoForm.addHooks('updateApiAnalytics', { | ||
onSubmit (formValues) { | ||
// Get reference to form | ||
const form = this; | ||
|
||
// Prevent form from submitting | ||
form.event.preventDefault(); | ||
|
||
if (formValues.daysCount < 1) { | ||
// The value has to be more than 0. Display error | ||
// Get error message translation | ||
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost'); | ||
|
||
// Alert user of error | ||
sAlert.error(message, { timeout: 'none' }); | ||
|
||
form.done(new Error(message)); | ||
} else { | ||
Meteor.call('proxyBackendAnalyticsData', | ||
formValues.proxyBackendId, formValues.daysCount, formValues.lastDay, (error) => { | ||
if (error) { | ||
// The value has to be more than 0. Display error | ||
// Get error message translation | ||
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost'); | ||
|
||
// Alert user of error | ||
sAlert.error(message, { timeout: 'none' }); | ||
|
||
form.done(new Error(message)); | ||
} | ||
// The value has to be more than 0. Display error | ||
// Get error message translation | ||
const message = TAPi18n.__('sdkCodeGeneratorModal_errorTextInvalidHost'); | ||
|
||
// Alert user of error | ||
sAlert.success(message); | ||
|
||
form.done(); | ||
}); | ||
} | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Copyright 2017 Apinf Oy | ||
This file is covered by the EUPL license. | ||
You may obtain a copy of the licence at | ||
https://joinup.ec.europa.eu/community/eupl/og_page/european-union-public-licence-eupl-v11 */ | ||
|
||
// Meteor packages imports | ||
import { Template } from 'meteor/templating'; | ||
|
||
// Collections import | ||
import Settings from '/apinf_packages/settings/collection'; | ||
|
||
|
||
Template.apiSettings.helpers({ | ||
displayAnalyticsSettings () { | ||
const proxyBackend = Template.currentData().proxyBackend; | ||
const settings = Settings.findOne(); | ||
|
||
// Display block if "Development Features" is enablemd and API is connected to Proxy | ||
return settings && settings.developmentFeatures && proxyBackend; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.