Skip to content

Commit 2562fe1

Browse files
committed
wip
0 parents  commit 2562fe1

34 files changed

+685
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
build/*

appinfo/app.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
$c = \OC::$server;
4+
5+
\OC::$server->getNavigationManager()->add(function () {
6+
return [
7+
'id' => 'logreader',
8+
'order' => 22,
9+
'name' => 'Log reader',
10+
'href' => \OC::$server->getURLGenerator()->linkToRoute('logreader.page.index'),
11+
'icon' => \OC::$server->getURLGenerator()->imagePath('audios', 'app.svg'),//TODO
12+
];
13+
});

appinfo/info.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<info>
3+
<id>logreader</id>
4+
<name>Log Reader</name>
5+
<description>Easier reading of logs</description>
6+
<licence>AGPL</licence>
7+
<author>Robin Appelman</author>
8+
9+
<dependencies>
10+
<owncloud min-version="8.1"/>
11+
</dependencies>
12+
</info>

appinfo/routes.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
/**
3+
* Copyright (c) 2015 Robin Appelman <[email protected]>
4+
* This file is licensed under the Affero General Public License version 3 or
5+
* later.
6+
* See the COPYING-README file.
7+
*/
8+
9+
/** @var $this OC\Route\Router */
10+
11+
return ['routes' => [
12+
// page
13+
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
14+
]];

build/.gitkeep

Whitespace-only changes.

controller/pagecontroller.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
/**
3+
* ownCloud - Notes
4+
*
5+
* This file is licensed under the Affero General Public License version 3 or
6+
* later. See the COPYING file.
7+
*
8+
* @author Bernhard Posselt <[email protected]>
9+
* @copyright Bernhard Posselt 2012, 2014
10+
*/
11+
12+
namespace OCA\LogReader\Controller;
13+
14+
use OCP\AppFramework\Controller;
15+
use OCP\AppFramework\Http\TemplateResponse;
16+
17+
/**
18+
* Class PageController
19+
*
20+
* @package OCA\LogReader\Controller
21+
*/
22+
class PageController extends Controller {
23+
/**
24+
* @NoAdminRequired
25+
* @NoCSRFRequired
26+
*
27+
* @return TemplateResponse
28+
*/
29+
public function index() {
30+
31+
$response = new TemplateResponse(
32+
$this->appName,
33+
'index',
34+
[]
35+
);
36+
37+
return $response;
38+
}
39+
40+
41+
}

css/app.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
table.logs {
2+
width: 100%;
3+
white-space: normal;
4+
margin-bottom: 14px;
5+
}
6+
7+
table.logs td, table.logs th {
8+
vertical-align: top;
9+
border-bottom: 1px solid #ddd;
10+
padding: .8em;
11+
text-align: left;
12+
font-weight: normal;
13+
}
14+
15+
/*levels = ['Debug', 'Info', 'Warning', 'Error', 'Fatal'];*/
16+
17+
/*info*/
18+
table.logs tr.level_1 {
19+
background-color: #BDE5F8;
20+
}
21+
22+
/* warning*/
23+
table.logs tr.level_2 {
24+
background-color: #FEEFB3;
25+
}
26+
27+
/*error*/
28+
table.logs tr.level_3 {
29+
background-color: #FFBABA;
30+
}
31+
32+
/*fatal*/
33+
table.logs tr.level_4 {
34+
background-color: #ff8080;
35+
}
36+
37+
span.exception {
38+
font-weight: bold;
39+
}
40+
41+
span.exceptionRow {
42+
display: inline-block;
43+
width: 100%;
44+
}
45+
46+
ol.trace {
47+
padding-top: 0.5em;
48+
}
49+
50+
ol.trace > li {
51+
padding: 0.3em;
52+
}
53+
54+
ol.trace .file, ol.trace .line {
55+
font-style: italic;
56+
}

gulp/config.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
'use strict';
2+
3+
module.exports = {
4+
'scripts': {
5+
'src': './js/**/*.js',
6+
'dest': './build/js/'
7+
},
8+
9+
'images': {
10+
'src': './images/**/*.{jpeg,jpg,png}',
11+
'dest': './build/images/'
12+
},
13+
14+
'styles': {
15+
'src': './css/**/*.css',
16+
'dest': './build/css/'
17+
},
18+
19+
'sourceDir': './',
20+
21+
'buildDir': './build/'
22+
};

gulp/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
var fs = require('fs');
4+
var onlyScripts = require('./util/script-filter');
5+
var tasks = fs.readdirSync('./gulp/tasks/').filter(onlyScripts);
6+
7+
tasks.forEach(function(task) {
8+
require('./tasks/' + task);
9+
});

gulp/tasks/browserify.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
'use strict';
2+
3+
var gulp = require('gulp');
4+
var gulpif = require('gulp-if');
5+
var gutil = require('gulp-util');
6+
var source = require('vinyl-source-stream');
7+
var streamify = require('gulp-streamify');
8+
var sourcemaps = require('gulp-sourcemaps');
9+
var rename = require('gulp-rename');
10+
var watchify = require('watchify');
11+
var browserify = require('browserify');
12+
var babelify = require('babelify');
13+
var uglify = require('gulp-uglify');
14+
var debowerify = require('debowerify');
15+
var handleErrors = require('../util/handle-errors');
16+
var config = require('../config');
17+
18+
// Based on: http://blog.avisi.nl/2014/04/25/how-to-keep-a-fast-build-with-browserify-and-reactjs/
19+
function buildScript(file, watch) {
20+
21+
var bundler = browserify({
22+
entries : [config.sourceDir + 'js/' + file],
23+
debug : !global.isProd,
24+
cache : {},
25+
packageCache: {},
26+
fullPaths : true
27+
});
28+
29+
if (watch) {
30+
bundler = watchify(bundler);
31+
bundler.on('update', function () {
32+
rebundle();
33+
});
34+
}
35+
36+
bundler.transform(babelify.configure({
37+
optional: ['runtime', 'es7.asyncFunctions', 'es7.classProperties', 'es7.objectRestSpread', 'es7.decorators']
38+
}));
39+
bundler.transform(debowerify);
40+
41+
function rebundle() {
42+
var stream = bundler.bundle();
43+
44+
gutil.log('Rebundle...');
45+
46+
return stream.on('error', handleErrors)
47+
.pipe(source(file))
48+
.pipe(gulpif(global.isProd, streamify(uglify())))
49+
.pipe(streamify(rename({
50+
basename: 'main'
51+
})))
52+
.pipe(gulpif(!global.isProd, sourcemaps.write('./')))
53+
.pipe(gulp.dest(config.scripts.dest));
54+
}
55+
56+
return rebundle();
57+
}
58+
59+
gulp.task('browserify', function () {
60+
61+
// Only run watchify if NOT production
62+
return buildScript('index.js', !global.isProd);
63+
64+
});

0 commit comments

Comments
 (0)