Skip to content

Commit

Permalink
Merge pull request #11 from faultline/v1.0.0-release-branch
Browse files Browse the repository at this point in the history
v1.0.0 Release
  • Loading branch information
k1LoW authored Jan 31, 2018
2 parents af59ca8 + b37a208 commit b70dd16
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 58 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# faultline-webui
# faultline-webui [![GitHub release](https://img.shields.io/github/release/faultline/faultline-webui.svg)]()

> Sample web UI for faultline
Expand Down
47 changes: 24 additions & 23 deletions dist/index.bundle.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "faultline-webui",
"version": "0.6.1",
"version": "1.0.0",
"description": "Sample web UI for faultline",
"main": "src/index.js",
"scripts": {
Expand All @@ -15,19 +15,19 @@
"license": "MIT",
"dependencies": {
"axios": "^0.14.0",
"c3": "^0.4.11",
"c3": "^0.4.18",
"jquery": "^3.1.1",
"lodash": "^4.16.2",
"micro-location": "^0.1.5",
"moment": "^2.15.1",
"moment": "^2.20.1",
"native-promise-only": "^0.8.1",
"riot": "^2.6.2",
"riot-route": "^2.5.0",
"webpack": "^1.13.2",
"woothee": "^1.5.0"
"woothee": "^1.7.0"
},
"devDependencies": {
"babel-core": "^6.14.0",
"babel-core": "^6.26.0",
"babel-loader": "^6.2.5",
"babel-preset-es2015": "^6.14.0",
"babel-preset-es2015-riot": "^1.1.0",
Expand Down
35 changes: 18 additions & 17 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ riot.route('/projects', () => {
req.get('/projects')
.then((res) => {
riot.mount('app', 'projects', {
projects: res.data.projects,
projects: res.data.data.projects,
req: req
});
})
Expand All @@ -43,7 +43,7 @@ riot.route('/projects/*', (project) => {
params: params
})
.then((res) => {
const sorted = _.sortBy(res.data.errors, (error) => {
const sorted = _.sortBy(res.data.data.errors, (error) => {
return -1 * moment(error.lastUpdated).valueOf();
});
riot.mount('app', 'errors', {
Expand Down Expand Up @@ -84,9 +84,10 @@ riot.route('/projects/*/errors/*', (project, message) => {
})
])
.then((res) => {
const error = res[0];
const occurrences = res[1].data.occurrences;
const omitted = _.omit(error.data.meta, [
const error = res[0].data.data.error;
const timeline = res[0].data.data.timeline;
const occurrences = res[1].data.data.errors;
const omitted = _.omit(error, [
'project',
'message',
'type',
Expand All @@ -99,16 +100,16 @@ riot.route('/projects/*/errors/*', (project, message) => {

riot.mount('app', 'overview', {
req: req,
project: error.data.meta.project,
message: error.data.meta.message,
project: error.project,
message: error.message,
truncatedMessage: message,
type: error.data.meta.type,
type: error.type,
meta: omitted,
backtrace: error.data.meta.backtrace,
timestamp: error.data.meta.timestamp,
backtrace: error.backtrace,
timestamp: error.timestamp,
occurrences: occurrences,
woothee: woothee,
items: error.data.timeline.errors,
items: timeline.errors,
c3: c3,
_: _,
moment: moment,
Expand All @@ -125,8 +126,8 @@ riot.route('/projects/*/errors/*/occurrences/*', (project, message, reversedUnix
req.get('/projects/' + project + '/errors/' + message + '/occurrences/' + reversedUnixtime, {
})
.then((res) => {
const error = res;
const omitted = _.omit(error.data.meta, [
const error = res.data.data.error;
const omitted = _.omit(error, [
'project',
'message',
'type',
Expand All @@ -138,12 +139,12 @@ riot.route('/projects/*/errors/*/occurrences/*', (project, message, reversedUnix
]);

riot.mount('app', 'occurrence', {
project: error.data.meta.project,
message: error.data.meta.message,
project: error.project,
message: error.message,
truncatedMessage: message,
type: error.data.meta.type,
type: error.type,
meta: omitted,
backtrace: error.data.meta.backtrace,
backtrace: error.backtrace,
_: _,
moment: moment
});
Expand Down
5 changes: 4 additions & 1 deletion src/tags/errors.tag
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<table class="table projects-errors">
<tbody>
<tr each="{ error, i in opts.errors }">
<td><a href="#/projects/{ encodeURIComponent(error.project) }/errors/{ encodeURIComponent(error.message) }">{ error.message }</a></td>
<td class="projects-errors-message"><a href="#/projects/{ encodeURIComponent(error.project) }/errors/{ encodeURIComponent(error.message) }">{ error.message }</a></td>
<td>{ error.type }</td>
<td><span class="tag is-danger is-small">{ error.count }</span></td>
<td>{ moment(error.lastUpdated).fromNow() }</td>
Expand Down Expand Up @@ -53,6 +53,9 @@
</section>

<style scoped>
.projects-errors-message {
word-break: break-all;
}
.tag.is-danger {
background-color: #EA513C;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tags/occurrence.tag
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<section class="section">
<nav class="level">
<p class="level-item">
- <a class="link is-info" href="?status=unresolved#/projects/{ encodeURIComponent(opts.project) }">{ opts.project }</a>
- <a class="link is-info" href="#/projects/{ encodeURIComponent(opts.project) }/errors/{ encodeURIComponent(opts.truncatedMessage) }">{ opts.message }</a>
- <a class="link is-info" href="?status=unresolved#/projects/{ opts.project }">{ opts.project }</a>
- <a class="link is-info" href="#/projects/{ opts.project }/errors/{ opts.truncatedMessage }">{ opts.message }</a>
- { opts.moment(opts.timestamp).format('YYYY-MM-DDTHH:mm:ssZZ') }
</p>
</nav>
Expand Down
18 changes: 9 additions & 9 deletions src/tags/overview.tag
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
</tr>
<tr each="{ occurrence, k in occurrences }">
<td>
<a href="#/projects/{ encodeURIComponent(occurrence.project) }/errors/{ encodeURIComponent(truncatedMessage) }/occurrences/{ occurrence.reversedUnixtime }">
<a href="#/projects/{ occurrence.project }/errors/{ truncatedMessage }/occurrences/{ occurrence.reversedUnixtime }">
{ occurrence.timestamp }
</a>
</td>
Expand Down Expand Up @@ -168,19 +168,19 @@
// more
self.more = (e) => {
const after = self.occurrences[self.occurrences.length - 1].reversedUnixtime;
opts.req.get('/projects/' + encodeURIComponent(opts.project) + '/errors/' + encodeURIComponent(opts.truncatedMessage) + '/occurrences', {
opts.req.get('/projects/' + opts.project + '/errors/' + opts.truncatedMessage + '/occurrences', {
params: {
after: after,
limit: 10
}
})
.then((res) => {
opts.occurrences = opts.occurrences.concat(res.data.occurrences);
riot.mount('overview', opts);
})
.catch((err) => {
throw new Error(err);
});
.then((res) => {
opts.occurrences = opts.occurrences.concat(res.data.data.errors);
riot.mount('overview', opts);
})
.catch((err) => {
throw new Error(err);
});
};

// timeline
Expand Down

0 comments on commit b70dd16

Please sign in to comment.