Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fsignorini committed Aug 20, 2018
1 parent 4970814 commit e2fc8e4
Show file tree
Hide file tree
Showing 4 changed files with 601 additions and 511 deletions.
82 changes: 41 additions & 41 deletions app/graph/applications/persistenceGraph.js
@@ -1,41 +1,41 @@
'use strict';

const _ = require('lodash');

const DPersistenceServices = require('core/services/PersistenceServices');
const UploadHTML = require('graph/services/uploadHTML');


const ApplicationAnalytics = (Entity, PersistenceServices = DPersistenceServices) => {


return {
create(req, res, next) {
const port = process.env.MAESTRO_PORT;
const hostname = `${req.protocol}://${req.hostname}:${port}`;

const data = Object.assign({}, req.body, req.user, {hostname});

if (_.has(data, 'graph_id') && _.has(data, 'owner_id')) {
res.render('index', data, (err, out) => {
if (err)
next(err);

const post = {'status': 'finished', 'msg': 'Finish'};
const owner = {'_id': _.get(data, 'owner_id')};
const _id = _.get(data, 'graph_id')

UploadHTML(Entity)(out, req.user)()
.then(() => {
return PersistenceServices(Entity)
.patch(_id, post, owner);
})
.then(e => res.json(e))
.catch(next);
});
}
}
};
};

module.exports = _.curry(ApplicationAnalytics);
'use strict';

const _ = require('lodash');

const DPersistenceServices = require('core/services/PersistenceServices');
const UploadHTML = require('graph/services/uploadHTML');


const ApplicationAnalytics = (Entity, PersistenceServices = DPersistenceServices) => {


return {
create(req, res, next) {
const port = process.env.MAESTRO_PORT;
const hostname = `${req.protocol}://${req.hostname}:${port}`;

const data = Object.assign({}, req.body, req.user, {hostname});

if (_.has(data, 'graph_id') && _.has(data, 'owner_id')) {
res.render('index', data, (err, out) => {
if (err)
next(err);

const post = {'status': 'finished', 'msg': 'Finish'};
const owner = {'_id': _.get(data, 'owner_id')};
const _id = _.get(data, 'graph_id')

UploadHTML(Entity)(out, req.user)()
.then(() => {
return PersistenceServices(Entity)
.patch(_id, post, owner);
})
.then(e => res.json(e))
.catch(next);
});
}
}
};
};

module.exports = _.curry(ApplicationAnalytics);
152 changes: 86 additions & 66 deletions app/templates/index.dust
@@ -1,67 +1,87 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Maestro Server - Cloud Inventory</title>
<meta name="Description" content="Graph viewer - Maestro Server">

<link rel="icon" type="image/png" sizes="16x16" href="/static/imgs/favicon.ico">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" type="text/css" href="{hostname}/css/main.css"></link>

</head>
<body>
<div id="viewer">
{payload|s}
</div>

<div id="info">
<ul>
<li>
<h1>MyTitle</h1>
</li>

<li>
<h2>Histograms</h2>
</li>

<li>
<h2>Density</h2>
</li>

<li>
<h2>Systems (21)</h2>
<ul>
<li>System1</li>
</ul>
</li>

<li>
<h2>Clients (21)</h2>
<ul>
<li>Clients</li>
</ul>
</li>
</ul>

<a href="http://maestroserver.io" target="_blank" class="footer">Maestro Server</a>
</div>

<div id="conn-tooltip" class="minitlp noshow"></div>

<div id="app-tooltip" class="apptlp noshow">
<ul></ul>
<div class="tb-btn">
<a href="#more">></a>
</div>
</div>

<script src="{hostname}/js/components/jquery/dist/jquery.slim.min.js"></script>
<script src="{hostname}/js/components/svg.js/dist/svg.min.js"></script>
<script src="{hostname}/js/components/svg-pan-zoom/dist/svg-pan-zoom.min.js"></script>
<script src="{hostname}/js/main.js"></script>

</body>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Maestro Server - Cloud Inventory</title>
<meta name="Description" content="Graph viewer - Maestro Server">

<link rel="icon" type="image/png" sizes="16x16" href="/static/imgs/favicon.ico">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" type="text/css" href="{hostname}/css/main.css"></link>

</head>
<body>
<svg>
<filter id="glow" height="300%" width="300%" x="-75%" y="-75%">
<feMorphology operator="dilate" radius="4" in="SourceAlpha" result="thicken" />
<feGaussianBlur in="thicken" stdDeviation="10" result="blurred" />
<feFlood flood-color="rgb(234,25,25)" result="glowColor" />
<feComposite in="glowColor" in2="blurred" operator="in" result="softGlow_colored" />
<feMerge>
<feMergeNode in="softGlow_colored"/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</svg>

<div id="viewer">
{payload|s}
</div>

<div id="info">
<ul class="menu">
<li>
<h1>MyTitle</h1>
</li>

<li>
<h2>Histograms</h2>
</li>

<li>
<h2>Density <p class="number">(0.3)</p></h2>

</li>

<li>
<h2>Servers <p class="number">(245)</p></h2>

</li>

<li>
<h2>Systems <p class="number">(2)</p></h2>
<ul>
<li><a href="#">- System1</a></li>
<li><a href="#">- System2</a></li>
</ul>
</li>

<li>
<h2>Clients <p class="number">(1)</p></h2>
<ul>
<li><a href="#">- Clients</a></li>
</ul>
</li>
</ul>

<a href="http://maestroserver.io" target="_blank" class="footer">Powered by<br/> Maestro Server</a>
</div>

<div id="conn-tooltip" class="minitlp noshow"></div>

<div id="app-tooltip" class="apptlp noshow">
<ul></ul>
<div class="tb-btn">
<a href="#more">></a>
</div>
</div>

<script src="{hostname}/js/components/jquery/dist/jquery.min.js"></script>
<script src="{hostname}/js/components/svg.js/dist/svg.min.js"></script>
<script src="{hostname}/js/components/svg-pan-zoom/dist/svg-pan-zoom.min.js"></script>
<script src="{hostname}/js/main.js"></script>

</body>
</html>

0 comments on commit e2fc8e4

Please sign in to comment.