diff options
Diffstat (limited to 'ui/imports/ui/components/new-scanning')
3 files changed, 133 insertions, 0 deletions
diff --git a/ui/imports/ui/components/new-scanning/new-scanning.html b/ui/imports/ui/components/new-scanning/new-scanning.html new file mode 100644 index 0000000..acd65bc --- /dev/null +++ b/ui/imports/ui/components/new-scanning/new-scanning.html @@ -0,0 +1,53 @@ +<!-- +######################################################################################## +# Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others # +# # +# All rights reserved. This program and the accompanying materials # +# are made available under the terms of the Apache License, Version 2.0 # +# which accompanies this distribution, and is available at # +# http://www.apache.org/licenses/LICENSE-2.0 # +######################################################################################## + --> +<template name="NewScanning"> +<div class="os-new-scanning"> + <div class="sm-content cards white"> + <ul class="nav nav-tabs" role="tablist"> + <li role="presentation" + class="active"> + <a href="#newImmediateScan" + aria-controls="" + role="tab" + data-toggle="tab" + id="" + data-is-disabled="" + class="sm-tab-link" + >Run a Scan Now</a> + </li> + <li role="presentation"> + <a href="#newScheduledScan" + aria-controls="#newScheduledScan" + role="tab" + data-toggle="tab" + id="link-scheduled-schen" + data-is-disabled="false" + class="sm-tab-link" + >Schedule a Scan</a> + </li> + </ul> + + <!-- Tab panes --> + <div class="tab-content"> + <div role="tabpanel" + class="tab-pane fade active in" + id="newImmediateScan"> + {{>ScanningRequest (argsScanningRequest env) }} + </div> + <div role="tabpanel" + class="tab-pane fade" + id="newScheduledScan"> + {{>ScheduledScan (argsScheduledScan env) }} + </div> + </div> + </div> +</div> +</template> diff --git a/ui/imports/ui/components/new-scanning/new-scanning.js b/ui/imports/ui/components/new-scanning/new-scanning.js new file mode 100644 index 0000000..1995ded --- /dev/null +++ b/ui/imports/ui/components/new-scanning/new-scanning.js @@ -0,0 +1,73 @@ +///////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2017 Koren Lev (Cisco Systems), Yaron Yogev (Cisco Systems) and others / +// / +// All rights reserved. This program and the accompanying materials / +// are made available under the terms of the Apache License, Version 2.0 / +// which accompanies this distribution, and is available at / +// http://www.apache.org/licenses/LICENSE-2.0 / +///////////////////////////////////////////////////////////////////////////////////////// +/* + * Template Component: NewScanning + */ + +//import { Meteor } from 'meteor/meteor'; +import { Template } from 'meteor/templating'; +import { SimpleSchema } from 'meteor/aldeed:simple-schema'; +import { ReactiveDict } from 'meteor/reactive-dict'; + +import './new-scanning.html'; + +/* + * Lifecycles + */ + +Template.NewScanning.onCreated(function() { + let instance = this; + instance.state = new ReactiveDict(); + instance.state.setDefault({ + env: null, + }); + + instance.autorun(function (env) { + let data = Template.currentData(); + new SimpleSchema({ + env: { type: String, optional: true }, + }).validate(data); + + instance.state.set('env', env); + }); +}); + +/* +Template.NewScanning.rendered = function() { +}; +*/ + +/* + * Events + */ + +Template.NewScanning.events({ +}); + +/* + * Helpers + */ + +Template.NewScanning.helpers({ + argsScanningRequest: function (env) { + return { + action: 'insert', + env: env, + }; + }, + + argsScheduledScan: function (env) { + return { + action: 'insert', + env: env, + }; + }, +}); // end: helpers + + diff --git a/ui/imports/ui/components/new-scanning/new-scanning.styl b/ui/imports/ui/components/new-scanning/new-scanning.styl new file mode 100644 index 0000000..e7c83fe --- /dev/null +++ b/ui/imports/ui/components/new-scanning/new-scanning.styl @@ -0,0 +1,7 @@ +.os-new-scanning + display: flex; + flex-flow: row nowrap; + padding: 20px; + + .sm-content + flex: 1; |