kritbit

kritbit Commit Details


Date:2015-11-22 10:58:53 (9 years 29 days ago)
Author:Natalie Adams
Branch:master
Commit:8a032e1f54dbdb4c9b9d5e35ab0a647beb25ed65
Parents: a1222a55ee727e2dade12ed74eee1d89d9be6362
Message:Adding status css on success runs Fixing runcommand

Changes:

File differences

scripts/runcommand.py
106106
107107
108108
109
109
110110
111111
112112
nonce = ''.join(random.SystemRandom().choice(string.hexdigits + string.digits) for _ in range(10))
message = {}
message["nonce"] = nonce
message["message"] = json.dumps({"output":out, "time_taken": total, "result": 1})
message["message"] = json.dumps({"output":out, "time_taken": total, "result": exitcode})
message["signature"] = hashlib.sha256(message["message"] + nonce + HASH).hexdigest()
message["message"] = encrypt(SHARED_KEY, message["message"])
print curl_post(URL, {"data": json.dumps(message)}).getvalue()
web/application/models/Histories.php
77
88
99
10
10
1111
12
13
14
15
16
17
18
19
20
21
22
23
1224
public $jobs_id;
public $run_date;
public $time_taken;
public $result;
public $result = null;
public $nonce;
public $h2o_safe = true;
public function getTRClass() {
if ($this->result == null) {
return "";
} elseif ($this->result == 0) {
return "success";
} else {
return "danger";
}
}
}
web/application/models/Jobs.php
99
1010
1111
12
12
1313
1414
1515
......
3939
4040
4141
42
43
44
45
46
47
48
49
50
51
4252
public $cron;
public $failScript;
public $last_run;
public $last_result;
public $last_result = null;
public $user_id;
public $hash;
public $sharedkey;
}
}
public function getTRClass() {
if ($this->last_run == "" || $this->last_result == null) {
return "";
} elseif ($this->last_result == 0) {
return "success";
} else {
return "danger";
}
}
}
web/application/views/history.html
4747
4848
4949
50
51
52
53
54
50
5551
5652
5753
</tr>
{% endif %}
{% for history in histories %}
{% if history.result != 0 %}
<tr class="danger">
{% else %}
<tr>
{% endif %}
<tr class="{{history.getTRClass}}">
<td><a class="btn btn-default" href="/history/log/{{job.id}}/{{history.id}}/" role="button">View</a></td>
<td>{{history.run_date}}</td>
<td>{{history.time_taken}}</td>
web/application/views/main.html
2222
2323
2424
25
26
27
28
29
25
3026
3127
3228
</thead>
<tbody>
{% for job in jobs %}
{% if job.last_result != 0 %}
<tr class="danger">
{% else %}
<tr>
{% endif %}
<tr class="{{job.getTRClass}}">
<td><a class="btn btn-default" href="/job/edit/{{job.id}}" role="button">Edit</a></td>
<td>{{job.jobName}}</td>
<td>{{job.getRunType}}</td>

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.06701s using 14 queries.