Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IA7 v1.5.550 - fix for dynamic load, closed color, remove modal gear #711

Merged
merged 1 commit into from
Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/ia7/house/main.shtml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<div class='col-sm-12 col-sm-offset-0 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2'>
<div class='col-sm-12'>
<p class="text-muted"><small> MisterHouse was created by Bruce Winter. Ron Klinkien developed the v2.3 web interface. Kevin Robert Keegan
designed the IA7 web prototype, updates by H.Plato. IA7 v1.5.530 Font Awesome by Dave Gandy - http://fontawesome.io</small></p>
designed the IA7 web prototype, updates by H.Plato. IA7 v1.5.550 Font Awesome by Dave Gandy - http://fontawesome.io</small></p>
</div>
</div>
</div>
Expand Down
16 changes: 11 additions & 5 deletions web/ia7/include/javascript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// v1.5.530
// v1.5.550

var entity_store = {}; //global storage of entities
var json_store = {};
Expand Down Expand Up @@ -785,7 +785,7 @@ var getButtonColor = function (state) {
if (state !== undefined) state = state.toLowerCase();
if (state == "on" || state == "open" || state == "disarmed" || state == "unarmed" || state == "ready" || state == "dry" || state == "up" || state == "100%" || state == "online" || state == "unlocked") {
color = "success";
} else if (state == "motion" || state == "closed" || state == "armed" || state == "wet" || state == "fault" || state == "down" || state == "offline" || state == "locked") {
} else if (state == "motion" || state == "armed" || state == "wet" || state == "fault" || state == "down" || state == "offline" || state == "locked") {
color = "danger";
} else if (state == undefined || state == "unknown" ) {
color = "purple";
Expand Down Expand Up @@ -1397,11 +1397,11 @@ var get_stats = function(tagline) {
success: function( json, statusText, jqXHR ) {
if (jqXHR.status == 200) {
$('.tagline').text(json.data.tagline);
var load_avg = "";;
var load_avg = "";
if (json.data.cores !== undefined && json.data.cores !== null) {
var loads = json.data.load.split(" ");
for (var i = 0; i < loads.length; i++) {
var load = loads[i] / json.data.cores;
var load = parseFloat(loads[i]) / json.data.cores;
if (load < 1) {
load_avg += "<span class='text-success'>";
} else if (load < 2) {
Expand Down Expand Up @@ -3012,7 +3012,13 @@ var create_state_modal = function(entity) {
var slog = json_store.objects[entity].state_log[i].split("set_by=");
$('#control').find('.obj_log').append(slog[0]+"<span class='mh_set_by hidden'>set_by="+slog[1]+"</span><br>");
}
}
}

if (developer)
$('.mhstatemode').show();
else
$('.mhstatemode').hide();

$('.mhstatemode').on('click', function(){
$('#control').find('.states').find('.btn').removeClass('hidden');
$('#control').find('.mh_set_by').removeClass('hidden');
Expand Down