Link to sepecific commit id on github

This commit is contained in:
Latif Khalifa
2013-10-16 13:58:32 +02:00
parent 687a1fb227
commit 3616866206
2 changed files with 19 additions and 3 deletions

View File

@@ -27,9 +27,9 @@ class CrashReport
public static $all_signatures;
function htmlFrame($f)
function htmlFrame($f, $chan, $version)
{
static $urlBase = "https://github.com/singularity-viewer/SingularityViewer/blob/master";
$urlBase = "https://github.com/singularity-viewer/SingularityViewer/blob/" . self::getHash($chan, $version);
$ret = "";
$link = "";
@@ -403,4 +403,20 @@ class CrashReport
Memc::setq($q, $ret);
return $ret;
}
static $builds_map = null;
static function getHash($chan, $version)
{
if (null == self::$builds_map)
{
self::$builds_map = self::getBuildsMap();
}
if (!self::$builds_map[$chan]) $chan = "SingularityAlpha";
if (!self::$builds_map[$chan][$version]) return "master";
return self::$builds_map[$chan][$version];
}
}

View File

@@ -62,7 +62,7 @@ $(function() {
<tr>
<td width="5%" style="text-align: right;"><?php echo $frameID ?></td>
<td width="20%"><?php echo htmlentities($f->module) ?></td>
<td width="75%"><?php echo CrashReport::htmlFrame($f) ?></td>
<td width="75%"><?php echo CrashReport::htmlFrame($f, $report->client_channel, $report->client_version) ?></td>
</tr>
<?php endfor ?>
</table>