コード例 #1
0
ファイル: header.php プロジェクト: nleskiw/Graphite-Tattle
if (!$this->get('full_screen')) {
    ?>
   <div class="topbar">
      <div class="topbar-inner">
        <div class="container-fluid">
          <a class="brand" href="index.php">Tattle </a>
          <ul class="nav">
            <?
              
              $current_url = fURL::getWithQueryString();
              echo '<li' . ($current_url == '' ? ' class="active"' : '') . '><a href="index.php">Alerts</a></li>'. "\n";                
              $check_list = Check::makeURL('list');
              echo '<li' . ($current_url == $check_list ? ' class="active"' : '') . '><a href="' . $check_list . '" >Checks</a></li>' . "\n";
              $subscription_list = Subscription::makeURL('list');
              echo '<li' . ($current_url == $subscription_list ? ' class="active"' : '') .'><a href="' . $subscription_list . '" >Subscriptions</a></li>' . "\n";
              $dashboard_list = Dashboard::makeURL('list');
              echo '<li' . ($current_url == $dashboard_list ? ' class="active"' : '') . '><a href="' . $dashboard_list . '">Dashboards</a></li>';
              $setting_list = Setting::makeURL('list');
              echo '<li' . ($current_url == $setting_list ? ' class="active"' : '') . '><a href="' . $setting_list . '" >Settings</a></li>' . "\n";
if (fAuthorization::checkAuthLevel('admin')) {
              $user_list = User::makeURL('list'); 
              echo '<li><a href="' . User::makeURL('list') . '" >Users</a></li>';
}              
?>
          </ul>
 <?php 
    if (is_numeric(fSession::get('user_id'))) {
        ?>
 <p class="pull-right">
     Logged in as <a href="<?php 
        echo User::makeUrl('edit', fSession::get('user_id'));
コード例 #2
0
</td>
                    <td>
                        <a href="<?php 
        echo Dashboard::makeURL('view', $dashboard);
        ?>
">View</a> |
                        <a href="<?php 
        echo Dashboard::makeURL('edit', $dashboard);
        ?>
">Edit</a> |
                        <a href="<?php 
        echo Dashboard::makeURL('delete', $dashboard);
        ?>
">Delete</a> |
                        <a href="<?php 
        echo Dashboard::makeURL('export', $dashboard);
        ?>
" target="_blank">Export</a>
                    </td>
                    <td class="last"><input type="checkbox" name="id_mass_export[]" class="no-margin input-dashboard" value="<?php 
        echo $dashboard->getDashboardId();
        ?>
" /></td>
                </tr>
                <?php 
    }
    ?>
            <?php 
}
?>
        </tbody>
コード例 #3
0
<?
$page_title = ($action == 'add' ? 'Add a Line' : 'Edit Line');
$tmpl->set('title', $page_title);
$breadcrumbs[] = array('name' => 'Dashboard', 'url' => Dashboard::makeURL('list'),'active' => false);
//$breadcrumbs[] = array('name' => 'Edit Dashboard', 'url' => Dashboard::makeURL('edit',$graph),'active' => false);
$breadcrumbs[] = array('name' => $graph->prepareName(), 'url' => Graph::makeURL('edit',$graph),'active'=> false);
$breadcrumbs[] = array('name' => $page_title, 'url' => fURL::getWithQueryString(),'active'=> true);
$tmpl->set('breadcrumbs',$breadcrumbs);
$tmpl->place('header');
if (isset($line_id)) {
  $query_string = "&line_id=$line_id";
} elseif (isset($graph_id)) {
  $query_string = "&graph_id=$graph_id";  
} else {
  $query_string = '';
}
?>
  <div class="row">
    <div class="span6">
      <form action="<?php 
echo fURL::get();
?>
?action=<? echo $action.$query_string; ?>" method="post">
        <div class="main" id="main">
          <fieldset>
                <div class="clearfix">
	      <label for="line-alias">Alias<em>*</em></label>
              <div class="input">
	        <input id="line-alias" class="span3" type="text" size="30" name="alias" value="<?php 
echo $line->encodeAlias();
?>
コード例 #4
0
ファイル: dashboard.php プロジェクト: nagyist/Tattle
        fURL::redirect(Dashboard::makeUrl('list'));
    } catch (fExpectedException $e) {
        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/add_edit_dashboard.php';
    // --------------------------------- //
} elseif ('add' == $action) {
    $dashboard = new Dashboard();
    if (fRequest::isPost()) {
        try {
            $dashboard->populate();
            fRequest::validateCSRFToken(fRequest::get('token'));
            $dashboard->store();
            fMessaging::create('affected', fURL::get(), $dashboard->getName());
            fMessaging::create('success', fURL::get(), 'The Dashboard ' . $dashboard->getName() . ' was successfully created');
            fURL::redirect(Dashboard::makeURL('edit', $dashboard));
        } catch (fExpectedException $e) {
            fMessaging::create('error', fURL::get(), $e->getMessage());
        }
    }
    include VIEW_PATH . '/add_edit_dashboard.php';
} elseif ('view' == $action) {
    $url_parts = explode('/', $_SERVER['REQUEST_URI']);
    $clean_url = false;
    foreach ($url_parts as $url_part) {
        if ($url_part == 'dash') {
            $clean_url = true;
            break;
        } else {
            array_shift($url_parts);
        }
コード例 #5
0
ファイル: graphs.php プロジェクト: nagyist/Tattle
        $array_of_weights = explode(",", $drag_order);
        $graphs_in_dashboard = array();
        foreach ($array_of_weights as $new_weight) {
            $expl = explode(":", $new_weight);
            $current_graph = new Graph($expl[0]);
            if (!isset($dashboard_id)) {
                $dashboard_id = $current_graph->getDashboardId();
            } else {
                // Check if all the graphs are in the same dashboard
                if ($dashboard_id != $current_graph->getDashboardId()) {
                    $error = true;
                    break;
                }
            }
            $current_graph->setWeight($expl[1]);
            $graphs_in_dashboard[] = $current_graph;
        }
    }
    if (!$error) {
        foreach ($graphs_in_dashboard as $graph_to_store) {
            $graph_to_store->store();
        }
        $dashboard = new Dashboard($dashboard_id);
        $url_redirect = Dashboard::makeURL('edit', $dashboard);
        fMessaging::create("success", "/dashboard.php", "The graphs have been successfully reordered");
    } else {
        $url_redirect = Dashboard::makeURL('list');
        fMessaging::create("success", "/dashboard.php", "An error occured and the graphs couldn't be reordered");
    }
    fURL::redirect($url_redirect);
}
コード例 #6
0
          <th>Background Color</th>
          <th>Action</th>
          </tr>    
          </thead>
          <tbody>
	<?php
	$first = TRUE;
	foreach ($dashboards as $dashboard) {
		?>
    	<tr>
        <td><?php echo $dashboard->prepareName() ?></td>
        <td><?php echo $dashboard->prepareDescription() ?></td>
        <td><?php echo $dashboard->prepareColumns() ?></td>
        <td><?php echo $dashboard->prepareBackgroundColor() ?></td>
        <td>
        <a href="<?php echo Dashboard::makeURL('view', $dashboard) ?>">View</a> |
        <a href="<?php echo Dashboard::makeURL('edit', $dashboard) ?>">Edit</a> |
        <a href="<?php echo Dashboard::makeURL('delete', $dashboard) ?>">Delete</a></td>
        </tr>
    <?php } ?>
    </tbody></table>
    <?
} catch (fEmptySetException $e) {
	?>
	<p class="info">There are currently no Tattle Dashboards available for your account. <a href="<?php echo Dashboard::makeURL('add') ?>">Add one now</a></p>
	<?php
}
?>
</div>
<?php $tmpl->place('footer') ?>
コード例 #7
0
ファイル: view_dashboard.php プロジェクト: nagyist/Tattle
<?php

$tmpl->set('title', 'Tattle : Self Service Alerts based on Graphite metrics');
$tmpl->set('full_screen', $full_screen);
//  $tmpl->set('refresh',$dashboard->getRefreshRate());
$tmpl->place('header');
?>
<nav class="navbar navbar-inverse navbar-fixed-top">
	<div class="navbar-inner">
		<div class="container-fluid text-center navbar-form">
			<a href="<?php 
echo Dashboard::makeURL('list', $dashboard->getGroupId());
?>
" class="btn btn-primary">Return to list</a>
			<a href="<?php 
echo Dashboard::makeURL('edit', $dashboard);
?>
" class="btn btn-default">Edit this dashboard</a>
			<?php 
if ($dashboard->getRefreshRate() > 0) {
    ?>
				<a href="#" class="btn btn-default" id="disable_refresh_btn" onclick="disable_refresh();return false;">Disable refresh</a>
		    	<a href="#" class="btn btn-default" id="enable_refresh_btn" onclick="enable_refresh();return false;" style="display:none;">Enable refresh</a>
		    <?php 
} else {
    ?>
		    	<a href="#" class="btn btn-default" id="enable_refresh_btn" onclick="window.location.reload(true);">Refresh now</a>
		    <?php 
}
?>
		
コード例 #8
0
ファイル: list_dashboards.php プロジェクト: nagyist/Tattle
				this one :
				<input type="file" name="uploadedfile" id="fileInput" />
			</p>
		</form>
		<p class="pull-right">
			Filter group :
			<select id="list_of_filters">
					<option value="<?php 
    echo Dashboard::makeURL('list', -1);
    ?>
">All dashboards</option>
				<?php 
    foreach (Group::findAll() as $group) {
        ?>
						<option value="<?php 
        echo Dashboard::makeURL('list', $group->getGroupId());
        ?>
" <?php 
        echo $filter_group_id == $group->getGroupId() ? 'selected="selected"' : '';
        ?>
><?php 
        echo $group->getName();
        ?>
</option>
				<?php 
    }
    ?>
			</select>
		</p>
	</div>
	<?php