1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-30 00:00:13 +01:00

Create static layout with just one table

The whole layout and data is hardcoded as first mockup. Mirage
server mockup is added but not used yet.
This commit is contained in:
Markus Grigull 2015-09-26 16:34:31 +02:00
parent a539bc2b23
commit 63a27d294c
11 changed files with 259 additions and 6 deletions

View file

@ -1,5 +1,6 @@
{
"predef": [
"server",
"document",
"window",
"-Promise"

82
app/mirage/config.js Normal file
View file

@ -0,0 +1,82 @@
export default function() {
// These comments are here to help you get started. Feel free to delete them.
/*
Config (with defaults).
Note: these only affect routes defined *after* them!
*/
// this.urlPrefix = ''; // make this `http://localhost:8080`, for example, if your API is on a different server
// this.namespace = ''; // make this `api`, for example, if your API is namespaced
// this.timing = 400; // delay for each request, automatically set to 0 during testing
/*
Route shorthand cheatsheet
*/
/*
GET shorthands
// Collections
this.get('/contacts');
this.get('/contacts', 'users');
this.get('/contacts', ['contacts', 'addresses']);
// Single objects
this.get('/contacts/:id');
this.get('/contacts/:id', 'user');
this.get('/contacts/:id', ['contact', 'addresses']);
*/
/*
POST shorthands
this.post('/contacts');
this.post('/contacts', 'user'); // specify the type of resource to be created
*/
/*
PUT shorthands
this.put('/contacts/:id');
this.put('/contacts/:id', 'user'); // specify the type of resource to be updated
*/
/*
DELETE shorthands
this.del('/contacts/:id');
this.del('/contacts/:id', 'user'); // specify the type of resource to be deleted
// Single object + related resources. Make sure parent resource is first.
this.del('/contacts/:id', ['contact', 'addresses']);
*/
/*
Function fallback. Manipulate data in the db via
- db.{collection}
- db.{collection}.find(id)
- db.{collection}.where(query)
- db.{collection}.update(target, attrs)
- db.{collection}.remove(target)
// Example: return a single object with related models
this.get('/contacts/:id', function(db, request) {
var contactId = +request.params.id;
return {
contact: db.contacts.find(contactId),
addresses: db.addresses.where({contact_id: contactId});
};
});
*/
}
/*
You can optionally export a config that is only loaded during tests
export function testConfig() {
}
*/

View file

@ -0,0 +1,7 @@
export default function(/* server */) {
// Seed your development database using your factories. This
// data will not be loaded in your tests.
// server.createList('contact', 10);
}

View file

@ -6,6 +6,7 @@ var Router = Ember.Router.extend({
});
Router.map(function() {
this.route('lab-mashup', { path: '/' }, function() {});
});
export default Router;

20
app/routes/lab-mashup.js Normal file
View file

@ -0,0 +1,20 @@
import Ember from 'ember';
export default Ember.Route.extend({
model() {
//return this.store.findAll('property');
let properties = [
{
name: "voltage",
value: 2.3
},
{
nane: "current",
value: 1.6
}
];
return properties;
}
});

View file

@ -0,0 +1,112 @@
html, body {
margin: 0;
padding: 0;
}
body {
background: #ccc;
color: #4d4d4d;
min-width: 300px;
max-width: 1500px;
margin: 0 auto;
font: 14px 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-weight: 300;
font-smoothing: antialiased;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
}
.hidden {
display: none;
}
#lapMashupApp {
background: #fff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
0 25px 50px 0 rgba(0, 0, 0, 0.1);
margin: 150px 0 40px 0;
position: relative;
}
#lapMashupApp h1 {
color: rgba(95, 95, 95, 0.7);
position: absolute;
top: -175px;
width: 100%;
font-size: 70px;
font-weight: 100;
text-align: center;
text-rendering: optimizeLegibility;
-webkit-text-rendering: optimizeLegiblity;
-moz-text-rendering: optimizeLegibitliy;
}
#main {
border-top: 1px solid #e6e6e6;
padding: 20px;
position: relative;
z-index: 2;
}
#footer {
color: #777;
border-top: 1px solid #e6e6e6;
padding: 10px 15px;
height: 20px;
text-align: center;
}
#info {
color: #777;
margin: 65px auto 0;
font-size: 12px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
text-align: center;
}
#last-update-info {
margin: 30px auto auto 0;
font-size: 12px;
text-align: center;
}
#properties-table {
background: #eee;
border: 1px solid #999;
border-collapse: collapse;
width: 50%;
margin: 0 auto;
}
#properties-table th {
background: #ddd;
border: 1px solid #999;
border-collapse: collapse;
padding: 5px;
font-size: 16px;
}
#properties-table td {
border: 1px solid #999;
border-collapse: collapse;
padding: 5px;
font-size: 14px;
}

View file

@ -1,3 +1,11 @@
<h2 id="title">Welcome to Ember</h2>
<section id="lapMashupApp">
<header id="header">
<h1>Lab Mashup Visualization</h1>
</header>
{{outlet}}
</section>
{{outlet}}
<footer id="info">
<p>&copy; 2015 - Institute for Automation of Complex Power Systems</p>
</footer>

View file

@ -0,0 +1,16 @@
<section id="main">
<table id="properties-table">
<tr>
<th>Name</th>
<th>Value</th>
</tr>
<tr>
<td>Voltage</td>
<td>2.34 kV</td>
</tr>
<tr>
<td>Current</td>
<td>7.6 A</td>
</tr>
</table>
</section>

View file

@ -1,16 +1,19 @@
{
"name": "lab-mashup",
"dependencies": {
"ember": "1.13.7",
"ember": "2.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "1.13.8",
"ember-data": "2.0",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5",
"ember-qunit": "0.4.9",
"ember-qunit-notifications": "0.0.7",
"ember-resolver": "~0.1.18",
"jquery": "^1.11.3",
"loader.js": "ember-cli/loader.js#3.2.1",
"qunit": "~1.18.0"
"qunit": "~1.18.0",
"pretender": "~0.9.0",
"lodash": "~3.7.0",
"Faker": "~3.0.0"
}
}

View file

@ -29,12 +29,14 @@
"ember-cli-htmlbars-inline-precompile": "^0.2.0",
"ember-cli-ic-ajax": "0.2.1",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-mirage": "0.1.8",
"ember-cli-qunit": "^1.0.0",
"ember-cli-release": "0.2.3",
"ember-cli-sri": "^1.0.3",
"ember-cli-uglify": "^1.2.0",
"ember-data": "1.13.8",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3"
"ember-export-application-global": "^1.0.3",
"mirage": "0.0.5"
}
}

View file

@ -1,5 +1,6 @@
{
"predef": [
"server",
"document",
"window",
"location",