This commit is contained in:
sdras 2018-07-25 21:06:01 -06:00
Родитель c282ac8c2b
Коммит 127885dd70
3 изменённых файлов: 496 добавлений и 45 удалений

Просмотреть файл

@ -23,17 +23,6 @@
<menu v-for="(options, filter) in filters" class="filters"
v-show="menus[filter]" ref="menu" :key="filter">
<li v-if="filter === 'rating'" class="filters__rating">
<output>
<label>Minimum rating:&nbsp;</label>
{{ parseFloat(filters.rating).toFixed(1) }}
</output>
<input v-model="filters.rating" class="filters__range" type="range"
:min="rating.min" :max="rating.max" step="0.1"/>
</li>
<template v-else>
<li @click="setFilter(filter, option)"
v-for="(active, option) in options"
:key="option"
@ -42,7 +31,6 @@
>
{{ option }}
</li>
</template>
</menu>
</transition-group>
@ -64,7 +52,7 @@
<li class="company__data">
<label class="company__label">Rating</label>
<p class="company__rating">{{ company.rating.toFixed(1) }}</p>
<p class="company__rating">rating</p>
</li>
</ul>
</li>
@ -88,13 +76,16 @@ export default {
return {
companies: [],
dropdown: { height: 0 },
rating: { min: 10, max: 0 },
filters: { countries: {}, categories: {}, rating: 0 },
menus: { countries: false, categories: false, rating: false }
filters: { countries: {}, categories: {} },
menus: { countries: false, categories: false }
}
},
computed: {
samples() {
return this.$store.state.samples
},
activeMenu() {
return Object.keys(this.menus).reduce(
($$, set, i) => (this.menus[set] ? i : $$),
@ -105,8 +96,7 @@ export default {
list() {
let { countries, categories } = this.activeFilters
return this.companies.filter(({ country, keywords, rating }) => {
if (rating < this.filters.rating) return false
return this.companies.filter(({ country, keywords }) => {
if (countries.length && !~countries.indexOf(country)) return false
return (
!categories.length || categories.every(cat => ~keywords.indexOf(cat))
@ -119,9 +109,7 @@ export default {
return {
countries: Object.keys(countries).filter(c => countries[c]),
categories: Object.keys(categories).filter(c => categories[c]),
rating:
this.filters.rating > this.rating.min ? [this.filters.rating] : []
categories: Object.keys(categories).filter(c => categories[c])
}
}
},
@ -152,13 +140,9 @@ export default {
},
clearFilter(filter, except, active) {
if (filter === 'rating') {
this.filters[filter] = this.rating.min
} else {
Object.keys(this.filters[filter]).forEach(option => {
this.filters[filter][option] = except === option && !active
})
}
Object.keys(this.filters[filter]).forEach(option => {
this.filters[filter][option] = except === option && !active
})
},
clearAllFilters() {
@ -178,17 +162,11 @@ export default {
.then(companies => {
this.companies = companies
companies.forEach(({ country, keywords, rating }) => {
this.$set(this.filters.countries, country, false)
if (this.rating.max < rating) this.rating.max = rating
if (this.rating.min > rating) {
this.rating.min = rating
this.filters.rating = rating
}
companies.forEach(({ country, keywords }) => {
this.$set(this.filters.countries, country)
keywords.forEach(category => {
this.$set(this.filters.categories, category, false)
this.$set(this.filters.categories, category)
})
})
})

Просмотреть файл

@ -11,11 +11,20 @@
<span>Call To Action</span>
</a>
</div>
<ul>
<li v-for="sample in samples" :key="sample.title">{{ sample.title }}</li>
</ul>
</div>
</template>
<script>
export default {}
export default {
computed: {
samples() {
return this.$store.state.samples
}
}
}
</script>
<style scoped>

Просмотреть файл

@ -5,12 +5,476 @@ Vue.use(Vuex)
export default new Vuex.Store({
state: {
samples: [
{
title: 'OpenALPR License Plate Reader',
template:
'https://raw.githubusercontent.com/anthonychu/azure-functions-openalpr/master/azuredeploy.json',
repository: 'https://github.com/anthonychu/azure-functions-openalpr',
description: 'App for reading license plate info from a photo.',
language: 'csharp',
type: 'function'
},
{
title: 'Stripe Payment Service',
template:
'https://raw.githubusercontent.com/toolboc/stripe-function/master/azuredeploy.json',
repository: 'https://github.com/toolboc/stripe-function',
description:
'Allows for incorporating Stripe payment functionality as a callable web service.',
language: 'javascript',
type: 'function',
blog:
'http://pjdecarlo.com/2017/06/super-cheap-subscription-and-payment-services-with-stripe-on-microsoft-azure-using-serverless-code-via-azure-functions-node-js.html'
},
{
title: 'LIFX Light Bulb color changer',
template:
'https://raw.githubusercontent.com/jefking/weather-bulb/master/azuredeploy.json',
repository: 'https://github.com/burkeholland/weather-bulb',
description:
'Timers that set the color of an LIFX bulb based on the outside temperature.',
language: 'javascript',
type: 'function'
},
{
title: 'Deploy Git Hosted Azure Function',
template:
'https://raw.githubusercontent.com/jefking/FunctionLibrary/master/azuredeploy.any.json',
repository: 'https://github.com/jefking/FunctionLibrary',
description: 'Deploys an Azure Function(s) via a git Repository URL.',
language: 'csharp',
type: 'function'
},
{
title: 'HTTP CRUD on CosmoDB',
template:
'https://raw.githubusercontent.com/nastassiar/crudfunctions/master/azure-deploy.json',
repository: 'https://github.com/nastassiar/crudfunctions',
description:
'An HTTP API for CRUD operations against CosmosDB. (So boring, why would you write it yourself?!!)',
language: 'javascript',
type: 'function'
},
{
title: 'What to Bring',
template:
'https://raw.githubusercontent.com/ricardodsanchez/WhatToBring/master/azuredeploy.json',
repository: 'https://github.com/ricardodsanchez/WhatToBring',
description:
'Returns a list of what items you should bring when traveling to certain cities.',
language: 'javascript',
type: 'function',
blog:
'https://ricardodsanchez.com/what-can-you-do-with-azure-functions-heres-one-example/'
},
{
title: 'Tug of War',
template:
'https://raw.githubusercontent.com/joescars/TugOfWar-FunctionsDemo/master/azuredeploy.json',
repository: 'https://github.com/joescars/TugOfWar-FunctionsDemo',
description:
'This simple demo game is used to teach basic concepts around building Azure Functions with node.js.',
blog: 'https://aka.ms/aztugofwar',
language: 'javascript',
type: 'function'
},
{
title: 'Purolator Package Tracker',
template:
'https://raw.githubusercontent.com/akos-sebestyen/purolator-tracker/master/azuredeploy.json',
repository: 'https://github.com/akos-sebestyen/purolator-tracker',
description: 'App for tracking Purolator shipments.',
language: 'javascript',
type: 'function'
},
{
title: 'Raffle',
template:
'https://raw.githubusercontent.com/anthonychu/azure-functions-raffle/master/azuredeploy.portal.json',
repository: 'https://github.com/anthonychu/azure-functions-raffle',
description: 'A simple raffle application.',
language: 'csharp',
type: 'function'
},
{
title: 'Cognitive Services: Smart Thumbnails',
template:
'https://raw.githubusercontent.com/jefking/fn-smart-thumbnail/master/azuredeploy.json',
repository: 'https://github.com/jefking/fn-smart-thumbnail',
description:
'Test your own images in bulk against Microsoft Cognitive Services: Smart Thumbnail API.',
language: 'csharp',
type: 'function'
},
{
title: 'Cognitive Services: Computer Vision',
template:
'https://raw.githubusercontent.com/jefking/fn-computer-vision/master/azuredeploy.json',
repository: 'https://github.com/jefking/fn-computer-vision',
description:
'Test your own images in bulk against Microsoft Cognitive Services: Computer Vision API.',
language: 'csharp',
type: 'function'
},
{
title: 'Cognitive Services: OCR',
template:
'https://raw.githubusercontent.com/nastassiar/CognitiveServicesOCRFunction/master/azuredeploy.json',
repository: 'https://github.com/nastassiar/RecognizeTextFunction',
description:
'Test your own images in bulk against Microsoft Cognitive Services: OCR.',
language: 'csharp',
type: 'function'
},
{
title: 'Timer: Azure EA Billing',
template:
'https://raw.githubusercontent.com/jefking/refreshusagedata/master/deploy.json',
repository: 'https://github.com/jefking/refreshusagedata',
description:
'This project uses the Azure EA Billing API to download detailed usage information in CSV to Blob Storage so that it can be used with tools like PowerBI.',
language: 'csharp',
type: 'function'
},
{
title: 'HTTP: Generate SAS Token',
template:
'https://raw.githubusercontent.com/Azure-Samples/functions-node-sas-token/master/azuredeploy.json',
repository: 'https://github.com/Azure-Samples/functions-node-sas-token',
description:
'This is a sample HTTP trigger Azure Function that returns a SAS token for Azure Storage for the specified container, blob, and permissions.',
language: 'javascript',
type: 'function'
},
{
title: 'Blob: PDF Extraction to Search',
template:
'https://raw.githubusercontent.com/m-gagne/PDF2AzSearch/master/azuredeploy.json',
repository: 'https://github.com/m-gagne/PDF2AzSearch',
description:
'This Azure Function binds to an Azure Storage container to process PDF files, extract metadata (using Regular Expressions), stores the result in DocumentDB (extracted text + captured metadata) which can then be used by Azure Search',
language: 'javascript',
type: 'function'
},
{
title: 'HTTP: Entity to SQL',
template:
'https://raw.githubusercontent.com/AzureBytes/functionsstorsql/master/deploy/azuredeploy.json',
repository:
'https://github.com/AzureBytes/functionsstorsql/src/WebToDatabase',
description:
'Stores a queue message in SQL Database; uses Entity Framework.',
language: 'csharp',
type: 'function'
},
{
title: 'Blob: Image Resize',
template:
'https://raw.githubusercontent.com/jefking/fl-image-resize/master/azuredeploy.json',
repository: 'https://github.com/jefking/fl-image-resize',
description:
'The easiest way to resize images stored in Blob Storage (on Azure); uses ImageProcessor.',
language: 'csharp',
type: 'function'
},
{
title: 'Slack: User Change Alerts',
template:
'https://raw.githubusercontent.com/anthonychu/slack-user-change-alerts/master/azuredeploy.portal.json',
repository:
'https://github.com/anthonychu/slack-user-change-alerts/src/SlackUserChangeAlerts.Function',
description:
'Sends a Slackbot notification to specified users or channels when users are added or removed from Slack.',
language: 'javascript',
blog: 'https://github.com/cfe84/slack-users-change-alerts',
type: 'function'
},
{
title: 'EventHub: Closed Loop for IoT Hub',
template:
'https://raw.githubusercontent.com/khilscher/AzureFunctions/master/ClosedLoopFunction/deploy/azuredeploy.json',
repository: 'https://github.com/khilscher/AzureFunctions',
description:
'The Closed-Loop function binds to the Event Hub compatible name of an IoT Hub. Each message into the IoT Hub will trigger the function. The sample function reads the JSON message payload, deserializes it, adds the two integer values (DataPoint1 and DataPoint2), and sends the sum back to the device, via IoT Hub, using a C2D message.',
addTemplate:
'https://raw.githubusercontent.com/fashaikh/AzureFunctions/master/ClosedLoopFunction/deploy/addfunction.json',
language: 'csharp',
type: 'function'
},
{
title: 'HTTP: Static Web Server',
template:
'https://raw.githubusercontent.com/anthonychu/azure-functions-static-file-server/master/azuredeploy.portal.json',
repository:
'https://github.com/anthonychu/azure-functions-static-file-server',
description:
'Serves a static website from a www root with a default index.html page.',
blog: 'http://anthonychu.ca/post/azure-functions-static-file-server',
language: 'csharp',
type: 'function'
},
{
title: 'Blob: Static Web Server',
template:
'https://raw.githubusercontent.com/jefking/fl-default-static/master/azuredeploy.json',
repository: 'https://github.com/jefking/fl-default-static',
description:
'Defaults page (index.htm) for containers. No need for compute on top of raw storage; if you are running static sites.',
language: 'csharp',
type: 'function'
},
{
title: 'Blob: Static Server with CDN',
template:
'https://raw.githubusercontent.com/jefking/fl-default-static/master/azuredeploy.cdn.json',
repository: 'https://github.com/jefking/fl-default-static',
description:
"Defaults page (index.htm) for containers. No need for compute on top of raw storage; if you are running static sites. This deployment contains a CDN layered 'over top' of the function.",
language: 'javascript',
type: 'function'
},
{
title: 'On-demand calculation of Azure consumption cost',
template:
'https://raw.githubusercontent.com/Azure-Samples/consumption-cost-node/master/azuredeploy.json',
repository: 'https://github.com/Azure-Samples/consumption-cost-node',
description:
'This sample demonstrates how to use the Azure billing commerce APIs to find consumption cost per subscription and resource-groups.',
language: 'javascript',
type: 'function'
},
{
title: 'HTTP: Azure Function Library (this)',
template:
'https://raw.githubusercontent.com/jefking/FunctionLibrary/master/azuredeploy.json',
repository: 'https://github.com/jefking/FunctionLibrary',
description:
'An open source set of common use cases for Azure Functions & Logic Apps that are ready to deploy!',
language: 'javascript',
type: 'function'
},
{
title: 'SQL Stored Procedure on a schedule',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-logic-app-sql-proc/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/101-logic-app-sql-proc',
description:
'This template allows you to create a Logic App that will run a SQL stored procedure on schedule. Any arguments for the procedure can be put into the body section of the template.',
language: 'na',
type: 'logicapp'
},
{
title: 'Send email with Logic app',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-logic-app-sendgrid/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/101-logic-app-sendgrid',
description:
'This template allows you to create a Logic app that sends an email. You can add an additional triggers or actions to customize it to your needs.',
language: 'na',
type: 'logicapp'
},
{
title: 'Copy FTP files to Blob',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-logic-app-ftp-to-blob/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/101-logic-app-ftp-to-blob',
description:
'This template allows you to create a Logic app that listens to a folder on an FTP server and will copy it to an Azure Blob container. You can add an additional triggers or actions to customize it to your needs.',
language: 'na',
type: 'logicapp'
},
{
title: 'HTTP: to Storage Queue',
template:
'https://raw.githubusercontent.com/jefking/fn-http-queue-s/master/azuredeploy.json',
repository: 'https://github.com/jefking/fn-http-queue-s',
description: 'Posted messages get added to Azure Storage Queue.',
language: 'javascript',
type: 'function'
},
{
title: 'HTTP: to Service Bus Queue',
template:
'https://raw.githubusercontent.com/jefking/fn-http-queue-sb/master/azuredeploy.json',
repository: 'https://github.com/jefking/fn-http-queue-sb',
description: 'Posted messages get added to Azure Service Bus Queue.',
language: 'javascript',
type: 'function'
},
{
title: 'HTTP: to Service Bus Topic',
template:
'https://raw.githubusercontent.com/jefking/fn-http-topic/master/azuredeploy.json',
repository: 'https://github.com/jefking/fn-http-topic',
description: 'Posted messages get added to Azure Service Bus Topic.',
language: 'javascript',
type: 'function'
},
{
title: 'Webhook: to Service Bus Queue',
template:
'https://raw.githubusercontent.com/jefking/fn-webhook-queue/master/azuredeploy.json',
repository: 'https://github.com/jefking/fn-webhook-queue',
description: 'Posted Body gets added to Azure Service Bus Queue.',
language: 'javascript',
type: 'function'
},
{
title: 'Reddit Poller',
template:
'https://raw.githubusercontent.com/jefking/RedditPoller/master/azuredeploy.json',
repository: 'https://github.com/isaac2004/RedditPoller',
description: 'Scheduled email notifications of Reddit Posts',
language: 'csharp',
type: 'function'
},
{
title: 'Media Services: Integrating Azure Media Services',
template:
'https://raw.githubusercontent.com/jefking/media-services-dotnet-functions-integration/master/azuredeploy.json',
repository:
'https://github.com/Azure-Samples/media-services-dotnet-functions-integration',
description:
'Sample for use with Azure Media Services. Ingest from Azure Blobs, encode and output to Azure Blobs, monitor encoding progress, and use WebHooks or Queues to hook into the workflow.',
language: 'csharp',
type: 'function'
},
{
title: 'CoderCards: trading card generator',
template:
'https://raw.githubusercontent.com/Azure-Samples/functions-dotnet-codercards/master/AzureDeploy/azuredeploy.json',
repository:
'https://github.com/Azure-Samples/functions-dotnet-codercards',
description:
'CoderCards is a geek trading card generator. It uses Microsoft Cognitive Services to detect the predominant emotion in a face, which is used to choose a card back.',
language: 'csharp',
type: 'function'
},
{
title: 'Call an Azure Function from a Logic App',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-logic-app-and-function-app/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/101-logic-app-and-function-app',
description:
'This template creates a Serverless app in Azure with Logic Apps and Functions. The Logic App triggers on an HTTP POST, calls the Azure Function, and returns the response.',
language: 'na',
type: 'logicapp'
},
{
title: 'Create a Logic App',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-logic-app-create/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/101-logic-app-create',
description: 'Create a Logic App from a template',
language: 'na',
type: 'logicapp'
},
{
title: 'XSLT with parameters',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-logic-app-xslt-with-params/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-xslt-with-params',
description:
'This template creates a request-response Logic App which performs XSLT based transformation. The XSLT map takes primitives (integer, string etc.) as input parameters as uses them during XML transformation.',
language: 'na',
type: 'logicapp'
},
{
title: 'VETER Pipeline',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-logic-app-veter-pipeline/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-veter-pipeline',
description: 'This template creates a VETER pipeline using Logic Apps.',
language: 'na',
type: 'logicapp'
},
{
title: 'Webhook with transform capabilities',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-logic-app-transform-function/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-transform-function',
description:
'This template creates a webhook based C# azure function with transform capabilites to use in logic apps integration scenarios.',
language: 'csharp',
type: 'logicapp'
},
{
title: 'Call an API protected by AAD',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-logic-app-custom-api/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-custom-api',
description:
'Call into your own custom API that can run your own code.',
language: 'na',
type: 'logicapp'
},
{
title: 'B2B Disaster Recovery replication',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-logic-app-b2b-disaster-recovery-replication/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-b2b-disaster-recovery-replication',
description:
'This template demonstrates B2B Disaster Recovery replication using Logic Apps.',
language: 'na',
type: 'logicapp'
},
{
title: 'AS2 Send Receive',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-logic-app-as2-send-receive/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-logic-app-as2-send-receive',
description:
'This template demonstrates AS2 Send Receive using Logic Apps.',
language: 'na',
type: 'logicapp'
},
{
title: 'Adds item to queue when alert fires',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-alert-to-queue-with-logic-app/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-alert-to-queue-with-logic-app',
description:
'Add the alert payload you pass to an Azure Storage queue that you specify.',
language: 'na',
type: 'logicapp'
},
{
title: 'Posts on Slack when alert fires',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-alert-to-slack-with-logic-app/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-alert-to-slack-with-logic-app',
description:
'When the Alert is triggered, it will post a message to a slack channel that you specify',
language: 'na',
type: 'logicapp'
},
{
title: 'Send SMS when alert fires',
template:
'https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-alert-to-text-message-with-logic-app/azuredeploy.json',
repository:
'https://github.com/Azure/azure-quickstart-templates/tree/master/201-alert-to-text-message-with-logic-app',
description:
'When the Alert is triggered, it will send you a text message with the details of the alert.',
language: 'na',
type: 'logicapp'
}
]
},
mutations: {
},
actions: {
}
mutations: {},
actions: {}
})