Merge pull request #82 from charithag/IoTS-1.0.0-M1

Add custom operation icons
Ruwan 9 years ago
commit 09edb1420f

@ -19,7 +19,11 @@
</style> </style>
{{#each control_operations}} {{#each control_operations}}
<a href="javascript:operationSelect('{{operation}}')"> <a href="javascript:operationSelect('{{operation}}')">
<i class="fw fw-service"></i> {{#if icon}}
<img src="{{@app.context}}/{{icon}}" style="width: 48px;"/>
{{else}}
<i class="fw fw-service"></i>
{{/if}}
<span>{{name}}</span> <span>{{name}}</span>
</a> </a>

@ -17,10 +17,9 @@
*/ */
function onRequest(context) { function onRequest(context) {
var log = new Log("operation.js"); //var log = new Log("operation.js");
var operationModule = require("/app/modules/operation.js").operationModule; var operationModule = require("/app/modules/operation.js").operationModule;
var device = context.unit.params.device; var device = context.unit.params.device;
log.info(device);
var control_operations = operationModule.getControlOperations(device.type); var control_operations = operationModule.getControlOperations(device.type);
return {"control_operations": control_operations, "device": device}; return {"control_operations": control_operations, "device": device};
} }
Loading…
Cancel
Save