Showing preview only (479K chars total). Download the full file or copy to clipboard to get everything.
Repository: ACRA/acralyzer
Branch: master
Commit: 51800b534227
Files: 66
Total size: 456.8 KB
Directory structure:
gitextract_3rawgk_a/
├── .bowerrc
├── .couchappignore
├── .couchapprc
├── .editorconfig
├── .ericaignore
├── .gitignore
├── .jshintignore
├── .jshintrc
├── .travis.yml
├── Gruntfile.js
├── LICENSE
├── README.md
├── _attachments/
│ ├── banner
│ ├── index.html
│ ├── partials/
│ │ ├── admin.html
│ │ ├── bug-details.html
│ │ ├── bugs-browser.html
│ │ ├── bugs-table.html
│ │ ├── change-password.html
│ │ ├── dashboard.html
│ │ ├── login-dialog.html
│ │ ├── paginator.html
│ │ ├── report-details.html
│ │ ├── reports-browser.html
│ │ └── reports-table.html
│ ├── script/
│ │ ├── AccountControllers.js
│ │ ├── AcralyzerControllers.js
│ │ ├── AcralyzerEvents.js
│ │ ├── AdminControllers.js
│ │ ├── AlertController.js
│ │ ├── BugsBrowserControllers.js
│ │ ├── DashboardControllers.js
│ │ ├── NavigationController.js
│ │ ├── ReportDetailsController.js
│ │ ├── ReportsBrowserControllers.js
│ │ ├── app.js
│ │ ├── clipboard.js
│ │ ├── config.js
│ │ ├── service.monsterid.js
│ │ ├── service.reportsstore.js
│ │ ├── service.user.js
│ │ └── services.js
│ ├── style/
│ │ ├── animations.css
│ │ ├── graph.css
│ │ └── main.css
│ └── vendor/
│ ├── bootstrap/
│ │ ├── css/
│ │ │ ├── bootstrap-responsive.css
│ │ │ └── bootstrap.css
│ │ └── js/
│ │ └── bootstrap.js
│ ├── jshash/
│ │ ├── md5-min.js
│ │ └── sha1.js
│ ├── padolsey/
│ │ └── prettyprint.js
│ ├── showdown/
│ │ ├── extensions/
│ │ │ ├── github.js
│ │ │ ├── prettify.js
│ │ │ ├── table.js
│ │ │ └── twitter.js
│ │ └── showdown.js
│ └── zeroclipboard/
│ └── ZeroClipboard.swf
├── _id
├── component.json
├── couchapp.json
├── imgsrc/
│ ├── bug.psd
│ └── bugdroid-wait.psd
├── language
├── package.json
└── usertemplates/
├── reader.json
└── reporter.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .bowerrc
================================================
{
"directory": "app/components"
}
================================================
FILE: .couchappignore
================================================
[
"^dist$",
"^node_modules$",
".couchapp_deploy",
"testacular.conf",
"component.json",
"Gruntfile.js",
"package.json",
"^imgsrc$",
"^usertemplates$",
"LICENSE",
"README.md",
".idea",
"travis.yml",
".jshintrc",
".bowerrc",
".jshintignore",
".editorconfig",
".ericaignore"
]
================================================
FILE: .couchapprc
================================================
{}
================================================
FILE: .editorconfig
================================================
; EditorConfig is awesome: http://EditorConfig.org
root = true ; top-most EditorConfig file
; Unix-style newlines with a newline ending every file
[*.js]
end_of_line = lf
insert_final_newline = true
indent_stype = space
indent_size = 4
[.jshintrc]
end_of_line = lf
insert_final_newline = true
indent_stype = space
indent_size = 4
[*.html]
end_of_line = lf
insert_final_newline = true
indent_stype = space
indent_size = 4
================================================
FILE: .ericaignore
================================================
[
"^dist$",
"^node_modules$",
".couchapp_deploy",
"testacular.conf",
"component.json",
"Gruntfile.js",
"package.json",
"^imgsrc$",
"^usertemplates$",
"LICENSE",
"README.md",
".idea",
"travis.yml",
".jshintrc",
".bowerrc",
".jshintignore",
".editorconfig",
".couchappignore"
]
================================================
FILE: .gitignore
================================================
.idea
node_modules/
dist
.couchapp_deploy
================================================
FILE: .jshintignore
================================================
_attachments/vendor
================================================
FILE: .jshintrc
================================================
{
"predef": [
"angular",
"moment",
"d3",
"prettyPrint"
],
"indent": 4,
"trailing": true,
"strict": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"boss": true,
"eqnull": true,
"jquery": true,
"devel": true,
"browser": true
}
================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
- 0.8
before_script:
- npm install -g grunt-cli
- npm install
script:
- grunt jshint
================================================
FILE: Gruntfile.js
================================================
/*jshint node:true*/
'use strict';
var url = require('url');
var util = require('util');
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// configurable paths
var yeomanConfig = {
app: '_attachments',
dist: 'dist/_attachments'
};
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
yeoman: yeomanConfig,
clean: {
dist: ['.tmp', '<%= yeoman.dist %>/*'],
server: '.tmp'
},
watch: {
js: {
files: ['Gruntfile.js', '.jshintrc', '<%= yeoman.app %>/script/*.js'],
tasks: ['jshint', 'couchapp'],
spawn: true
},
html: {
files: ['<%= yeoman.app %>/partials/*.html', '<%= yeoman.app %>/index.html'],
tasks: ['couchapp'],
spawn: true
},
css: {
files: '<%= yeoman.app %>/style/*.css',
tasks: ['couchapp'],
spawn: true
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'<%= yeoman.app %>/script/{,*/}*.js',
'!<%= yeoman.app %>/vendor/*',
'!<%= yeoman.app %>/script/vendor/*',
'test/spec/{,*/}*.js'
]
},
compass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
cssDir: '.tmp/styles',
imagesDir: '<%= yeoman.app %>/img',
javascriptsDir: '<%= yeoman.app %>/script',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: '<%= yeoman.app %>/components',
relativeAssets: true
},
dist: {},
server: {
options: {
debugInfo: true
}
}
},
// not used since Uglify task does concat,
// but still available if needed
/*concat: {
dist: {}
},*/
uglify: {
options: {
banner: grunt.file.read(yeomanConfig.app + '/banner')
}
},
useminPrepare: {
html: '<%= yeoman.app %>/index.html',
options: {
dest: '<%= yeoman.dist %>'
}
},
usemin: {
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
options: {
dirs: ['<%= yeoman.dist %>']
}
},
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/img',
src: '{,*/}*.{png,jpg,jpeg}',
dest: '<%= yeoman.dist %>/img'
}]
}
},
cssmin: {
dist: {
files: {
'<%= yeoman.dist %>/styles/main.css': [
'.tmp/styles/{,*/}*.css',
'<%= yeoman.app %>/styles/{,*/}*.css'
]
}
}
},
copy: {
dist: {
files: [
{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'index.html',
'partials/*.html',
/* At least until a solution that does't require editing config.js is found */
'script/config.js',
'*.{ico,txt}',
'img/*.gif',
'vendor/bootstrap/img/*.png',
'.htaccess'
]
},
{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>/../',
dest: '<%= yeoman.dist %>/../',
src: [
'*.{ico,txt}',
'.couchappignore',
'couchapp.json',
'.couchapprc',
'.ericaignore',
'_id',
'language',
'LICENSE',
'README.md'
]
}
]
}
},
compress: {
dist: {
options: {
archive: '<%= pkg.name %>-<%= pkg.version %>.tar.gz'
},
files: [
{expand: true, cwd: 'dist/', src: ['**', '.*'], dest: ''}
]
}
}
});
grunt.renameTask('regarde', 'watch');
/* Push up to couchdb server for dev test */
grunt.registerTask('couchapp', 'deploy couchapp', function (targetEnv, sourcePath) {
var done = this.async();
var spawnOpts = {
cmd: 'couchapp',
args: ['push']
};
if(sourcePath) {
spawnOpts.args.push(sourcePath);
}
if(targetEnv) {
spawnOpts.args.push(targetEnv);
}
grunt.verbose.writeln('Now Running' + util.inspect(spawnOpts).cyan);
grunt.util.spawn(spawnOpts, function (err, res/*, code*/) {
grunt.log.ok();
grunt.log.write(res.stderr);
done();
});
});
grunt.registerTask('test', [
'clean:server'
// 'compass',
]);
grunt.registerTask('build', [
'clean:dist',
// 'compass:dist',
'useminPrepare',
'imagemin',
'concat',
'cssmin',
'uglify',
'copy',
'usemin'
]);
grunt.registerTask('deploy', [
'build',
'couchapp:prod:dist'
]);
grunt.registerTask('default', [
'jshint',
'test'
]);
};
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: README.md
================================================
[](https://flattr.com/submit/auto?user_id=kevingaudin&url=http://acra.ch&title=ACRA%20-%20Application%20Crash%20Reports%20for%20Android&language=&tags=opensource%2Candroid&category=software&description=ACRA%20%28Application%20Crash%20Reports%20for%20Android%29%20is%20an%20open%20source%20android%20library%20for%20developers%2C%20enabling%20their%20apps%20to%20send%20detailed%20reports%20when%20they%20crash.)
[](https://travis-ci.org/ACRA/acralyzer)
ACRALYZER
=========
Acralyzer is a frontend web application enabling [ACRA](http://acra.ch) users to analyze reports sent by their applications.
Acralyzer is Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com) and licensed under the terms of the [GNU General Public License version 3](COPYING).
Acralyzer is without a maintainer right now. If you'd like to be that maintainer, see [#140](https://github.com/ACRA/acralyzer/issues/140).
Components
==========
Acralyzer is the frontend analysis tools. It needs to be connected to a backend storage server.
The default storage endpoint for Acralyzer is [acra-storage](http://github.com/ACRA/acra-storage).
Both Acralyzer and acra-storage are [CouchApps](http://couchapp.org).
CouchApps are web applications made of HTML/Javascript files and served directly by a [CouchDB](http://couchdb.apache.org).
Acralyzer uses other open source software:
* [CouchDB](http://couchdb.apache.org)
* [AngularJS](http://angularjs.org)
* [Twitter Bootstrap](http://twitter.github.com/bootstrap/)
* [Bootstrap-Notify](http://nijikokun.github.com/bootstrap-notify/)
* [d3.js](http://d3js.org)
* [JQuery](http://jquery.com/)
* [prettyprint.js](http://james.padolsey.com/javascript/prettyprint-for-javascript/),
* [moment.js](http://momentjs.com/)
Documentation
=============
Full setup instructions are available in [the Acralyzer Wiki on Github](https://github.com/ACRA/acralyzer/wiki).
================================================
FILE: _attachments/banner
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
================================================
FILE: _attachments/index.html
================================================
<!DOCTYPE html>
<html ng-app="Acralyzer" ng-controller="AcralyzerCtrl">
<head>
<!--
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
-->
<title>Acralyzer / {{acralyzer.app}}</title>
<meta charset="utf-8">
<link rel="icon" type="image/png" href="img/logo.png" />
<link rel="alternate" type="application/rss+xml" href="{{rsslink}}" title="Latest Crash Reports">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- build:css vendor/bootstrap/css/bootstrap.min.css -->
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-responsive.min.css" type="text/css">
<!-- endbuild -->
<!-- build:css styles/main.min.css -->
<link rel="stylesheet" href="style/main.css" type="text/css">
<link rel="stylesheet" href="style/graph.css" type="text/css">
<link rel="stylesheet" href="style/animations.css" type="text/css">
<!-- endbuild -->
</head>
<body>
<div class="navbar navbar-fixed-top" ng-controller="NavigationCtrl">
<div class="navbar-inner">
<a class="brand" href="#">Acralyzer</a>
<ul class="nav">
<li ng-cloak><img title="Background polling is OFF." class="polling-indicator" src="img/not-polling.gif" ng-hide="acralyzer.isPolling" ng-click="acralyzer.startPolling()"><img title="Background polling is ON." class="polling-indicator" ng-click="acralyzer.stopPolling()" src="img/polling.gif" ng-show="acralyzer.isPolling"></li>
<li class="dropdown" ng-cloak>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
{{acralyzer.app}}
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li ng-repeat="app in acralyzer.apps"><a href="#/{{$route.current.activetab}}/{{app}}">{{app}}</a></li>
</ul>
</li>
<li ng-class="{active: $route.current.activetab == 'dashboard'}"><a href="#/dashboard/{{acralyzer.app}}">Dashboard</a></li>
<li ng-class="{active: $route.current.activetab == 'bugs-browser'}"><a href="#/bugs-browser/{{acralyzer.app}}">Bugs</a></li>
<li ng-class="{active: $route.current.activetab == 'reports-browser'}"><a href="#/reports-browser/{{acralyzer.app}}">Reports</a></li>
<li ng-class="{active: $route.current.activetab == 'admin'}"><a href="#/admin/{{acralyzer.app}}">Admin</a></li>
</ul>
<div id="usermenu" class="btn-group pull-right" data-ng-controller="AccountCtrl">
<button style="min-width: 150px" class="btn dropdown-toggle" data-toggle="dropdown" ng-cloak>
<i class="icon-user"></i> {{username || "Anonymous"}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li ng-class="{ hide: username }"><a ng-click="showLogin()" title="Login"><strong>Login</strong></a></li>
<li notifications-support><a href="#">Enable Notifications</a></li>
<li ng-class="{ hide: !username }"><a ng-click="showChangePassword()" title="Change Password">Change Password</a></li>
<li ng-class="{ hide: !username }"><a ng-click="logout()" title="Logout"><i class="icon-off" alt="logout"></i> Logout</a></li>
</ul>
</div>
</div>
</div>
<div class='notifications top-right' ng-controller="AlertCtrl" ng-cloak>
<alert ng-repeat="alert in alerts" type="alert.type" close="close($index)">{{alert.msg}}</alert>
</div>
<div ng-view ng-animate=""></div>
<footer class="footer">
<div class="container">
<p><a href="http://acra.ch/acralyzer" target="_blank">Acralyzer</a> is crafted by <a href="https://plus.google.com/105599514712357912650" target="_blank">Kevin Gaudin</a>.</p>
<p><a href="http://github.com/ACRA/acralyzer" target="_blank">Code</a> licensed under <a href="http://www.gnu.org/licenses/gpl.html" target="_blank">GNU General Public License v3</a>.</p>
<ul class="footer-links">
<li><a href="https://plus.google.com/118444843928759726538" target="_blank">Follow +ACRA on Google+</a></li>
<li class="muted">·</li>
<li><a href="https://github.com/ACRA/acralyzer/issues?state=open" target="_blank">Issues</a></li>
<li class="muted">·</li>
<li><a href="https://github.com/ACRA/acralyzer/wiki" target="_blank">Documentation</a></li>
</ul>
</div>
<p>Acralyzer uses other open source software:</p>
<p>
<a href="http://couchdb.apache.org" target="_blank">CouchDB</a>
· <a href="http://angularjs.org" target="_blank">AngularJS</a>
· <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a>
· <a href="http://angular-ui.github.com/bootstrap/" target="_blank">Angular-UI Bootstrap</a>
<br/>
<a href="http://d3js.org" target="_blank">d3.js</a>
· <a href="http://jquery.com/" target="_blank">JQuery</a>
· <a href="http://james.padolsey.com/javascript/prettyprint-for-javascript/" target="_blank">prettyprint.js</a>
· <a href="http://momentjs.com/" target="_blank">moment.js</a>
· <a href="https://github.com/coreyti/showdown" target="_blank">Showdown</a>
<br/>
<a href="http://kevingaudin.github.io/monsterid.js" target="_blank">MonsterID.js</a>
· <a href="https://github.com/zeroclipboard/ZeroClipboard" target="_blank">ZeroClipboard</a>
</p>
<p>Most icons by <a href="http://glyphicons.com/">Glyphicons</a>.</p>
</footer>
<!-- build:js script/vendors.js -->
<script src="vendor/jquery/jquery-1.8.3.min.js"></script>
<script src="vendor/angular/angular.min.js"></script>
<script src="vendor/angular/angular-resource.min.js"></script>
<script src="vendor/d3/d3.v3.min.js"></script>
<!-- endbuild -->
<!-- build:js script/libs.js -->
<script src="vendor/angular-ui-bootstrap/ui-bootstrap-tpls-0.3.0.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="vendor/padolsey/prettyprint.js"></script>
<script src="vendor/timrwood/moment.min.js"></script>
<script src="vendor/jshash/md5-min.js"></script>
<script src="vendor/jshash/sha1.js"></script>
<script src="vendor/showdown/showdown.js"></script>
<script src="vendor/showdown/extensions/table.js"></script>
<script src="vendor/showdown/extensions/github.js"></script>
<script src="vendor/zeroclipboard/ZeroClipboard.min.js"></script>
<script src="vendor/monsterid/monsterid.min.js"></script>
<!-- endbuild -->
<!-- Config file has user changes in it, so for now don't minify it -->
<script src="script/config.js"></script>
<!-- build:js script/app.js -->
<script src="script/AcralyzerEvents.js"></script>
<script src="script/app.js"></script>
<script src="script/service.user.js"></script>
<script src="script/AlertController.js"></script>
<script src="script/AccountControllers.js"></script>
<script src="script/AcralyzerControllers.js"></script>
<script src="script/DashboardControllers.js"></script>
<script src="script/NavigationController.js"></script>
<script src="script/ReportDetailsController.js"></script>
<script src="script/ReportsBrowserControllers.js"></script>
<script src="script/BugsBrowserControllers.js"></script>
<script src="script/AdminControllers.js"></script>
<script src="script/services.js"></script>
<script src="script/service.reportsstore.js"></script>
<script src="script/clipboard.js"></script>
<script src="script/service.monsterid.js"></script>
<!-- endbuild -->
</body>
</html>
================================================
FILE: _attachments/partials/admin.html
================================================
<div class="container-fluid">
<h2>
Administration
</h2>
<div id="content">
<tabs>
<pane heading="Reports">
<div>
<button class="btn" ng-click="purgeDays(daysToKeep)" ng-disabled="purgingByDays || purgingByAppVersionCode">
<span ng-hide="purgingByDays">Purge</span>
<span ng-show="purgingByDays"><img src="img/polling.gif"/> Purging</span>
</button>
{{nbReportsByDaysToPurge}} reports older than <input ng-model="daysToKeep" class="input-mini"/> days.
</div>
<div>
<button class="btn" ng-click="purgeVersion(selectedVersion)" ng-disabled="purgingByDays || purgingByAppVersionCode">
<span ng-hide="purgingByAppVersionCode">Purge</span>
<span ng-show="purgingByAppVersionCode"><img src="img/polling.gif"/> Purging</span>
</button>
{{nbReportsByAppVersionCodeToPurge}} reports from apps older than version <select ng-model="selectedVersion" class="input-mini" ng-options="code.value as code.label for code in appVersionCodes"></select>.
</div>
</pane>
<pane heading="Preferences">
<p>Your default reports database is <select ng-model="acralyzerConfig.defaultApp" ng-options="app for app in apps" ng-change="storeDefaultApp()"></select></p>
</pane>
<pane heading="Users">
<div ng-show='acralyzer.cloudant'>
<p>
This Acralyzer instance is hosted on Cloudant. To create a new reporter user for {{acralyzer.app}}:
</p>
<ul>
<li>
go to <a href="https://cloudant.com/dashboard/">your Cloudant dashboard</a>
</li><li>
select the 'acra-{{acralyzer.app}}' database
</li><li>
click on the 'Permissions' button
</li><li>
click on the 'Generate API Key' button
</li><li>
uncheck the 'Read' checkbox for the generated API Key
</li><li>
check the 'Write' checkbox for the generated API Key
</li><li>
copy the username and password and paste them in your ACRA configuration (formUriBasicAuthLogin and
formUriBasicAuthPassword)
</li>
</ul>
</div>
<div ng-hide='acralyzer.cloudant || newReporterCreated'>
<form novalidate name='formNewReporter'>
<legend>Create a new Reporter user</legend>
<label>User name</label>
<input type="text" ng-model="userToCreate" placeholder="new user name" required/>
<span class="help-block">Type the name for your new reporter user.</span>
<label>Password</label>
<input type="text" ng-model="passwordForUserToCreate" placeholder="password" required/>
<span class="help-block">Type the password for your new reporter user.</span>
<button ng-click="createReporterUser(userToCreate,passwordForUserToCreate)" class="btn" ng-disabled="formNewReporter.$invalid">Create user</button>
</form>
</div>
<div ng-show='newReporterCreated'>
You can now use this new user as a reporter in your ACRA configuration:
<pre>
httpMethod = Method.PUT,
reportType = Type.JSON,
formUri = "{{formUri}}",
formUriBasicAuthLogin = "{{userToCreate}}",
formUriBasicAuthPassword = "{{passwordForUserToCreate}}"
</pre>
<button ng-click="newReporterCreated = false">Create another user</button>
</div>
</pane>
</tabs>
</div>
</div>
================================================
FILE: _attachments/partials/bug-details.html
================================================
<div ng-show="bug.id">
<div class="bug-details-header">
<div class="direct-link"><a href="#/reports-browser/{{acralyzer.app}}/bug/{{bug.id}}"><i class="icon-share"></i>direct link</a></div>
<h3>Bug Summary</h3>
<table>
<tr>
<th>Application version code:</th>
<td>{{bug.key[0]}}</td>
</tr>
<tr>
<th>Exception:</th>
<td>{{bug.key[1]}}</td>
</tr>
<tr>
<th>Root Exception:</th>
<td>{{bug.key[2]}}</td>
</tr>
<tr>
<th>Solved:</th>
<td>
<a title="Change status" ng-click="bug.toggleSolved()" ng-hide="bug.solvedPending">{{bug.value.solved}}</a>
<span title="Updating state" ng-show="bug.solvedPending"><img src="img/polling.gif"/></span>
</td>
</tr>
<tr>
<th>Description</th>
<td>
<div class="description" ng-bind-html-unsafe="bug.descriptionHtml"></div>
<div ng-click="bug.toggleEditMode()" ng-hide="bug.updating">
<i class="icon-edit"></i>
<small ng-show="bug.editMode">Save changes</small>
<small ng-hide="bug.editMode">Edit description</small>
</div>
<div ng-show="bug.updating">
<img src="img/polling.gif"/>
<small class="action">Updating...</small>
</div>
<div ng-animate="{show:'grow', hide:'shrink'}" ng-show="bug.editMode">
<div ng-click="bug.revertDescription()">
<i class="icon-remove"></i>
<small ng-show="bug.editMode">Revert changes</small>
</div>
<textarea ng-model="bug.value.description"></textarea>
<br/>
<small>You can use <a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a> syntax.</small>
</div>
</td>
</tr>
</table>
</div>
<h3>{{nbUsersToDisplay}}<i class="icon-plus-sign" ng-click="incNbUsersToDisplay(10)" ng-show="nbUsersToDisplay < users.length"></i> most affected users (total: {{users.length}})</h3>
<div ng-repeat="user in users | orderBy:'reportsCount':true | limitTo: nbUsersToDisplay" class="affected-user label" ng-class="{ 'label-important': user.installationId == selectedUser.installationId, 'label-inverse': user.installationId !== selectedUser.installationId}" ng-click="selectUser(user)">
<img class="avatar" monsterid="{{user.installationId}}" title="{{user.installationId}}" />
x {{user.reportsCount}}
</div>
<h3>Reports list</h3>
</div>
================================================
FILE: _attachments/partials/bugs-browser.html
================================================
<div class="container-fluid">
<h2>Browse bugs</h2>
<div id="content">
<div id="filters" class="row-fluid">
<form ng-submit="getData()" class="form-inline">
<input type="text" class="search-query" placeholder="Search in bugs" ng-model="search">
</form>
</div>
<div class="row-fluid tab-content">
<span ng-bind-template="Bugs {{firstItemIndex()}} to {{lastItemIndex()}} (out of {{bugsList.length}}):">Loading...</span>
<button class="btn btn-small" ng-click="hideSolvedBugs = !hideSolvedBugs">
<span ng-hide="hideSolvedBugs">Hide solved bugs</span>
<span ng-show="hideSolvedBugs">Show solved bugs</span>
</button>
<div class="loader" ng-show="loading"><img src="img/loader.gif"/></div>
<ng-include src="'partials/bugs-table.html'"></ng-include>
<span paginator items="bugsList | filter:shouldBeDisplayed | filter:search | orderBy:orderField:orderDescending" pageSize="bugsCount"></span>
<bug-details bug="selectedBug" acralyzer="acralyzer"></bug-details>
</div>
</div>
</div>
================================================
FILE: _attachments/partials/bugs-table.html
================================================
<div ng-hide="loading" class="div-table table table-condensed bugs">
<div class="div-table-row header">
<div class="div-table-cell"></div>
<div class="div-table-cell">
<i class="icon-th-list" ng-click="$parent.orderField = 'value.count'"></i>
<span ng-click="$parent.orderDescending = !$parent.orderDescending">
<i class="icon-chevron-down" ng-show="$parent.orderField === 'value.count' && $parent.orderDescending"></i>
<i class="icon-chevron-up" ng-show="$parent.orderField === 'value.count' && !$parent.orderDescending"></i>
</span>
</div>
<div class="div-table-cell">
<i class="icon-time" ng-click="$parent.orderField = 'value.latest'"></i>
<span ng-click="$parent.orderDescending = !$parent.orderDescending">
<i class="icon-chevron-down" ng-show="$parent.orderField === 'value.latest' && $parent.orderDescending"ng-click=""></i>
<i class="icon-chevron-up" ng-show="$parent.orderField === 'value.latest' && !$parent.orderDescending"></i>
</span>
</div>
<div class="div-table-cell">
<i class="icon-gift" ng-click="$parent.orderField = 'key[0]'"></i>
<span ng-click="$parent.orderDescending = !$parent.orderDescending">
<i class="icon-chevron-down" ng-show="$parent.orderField === 'key[0]' && $parent.orderDescending"ng-click=""></i>
<i class="icon-chevron-up" ng-show="$parent.orderField === 'key[0]' && !$parent.orderDescending"></i>
</span>
</div>
<div class="div-table-cell exceptions"><i class="icon-fire"></i></div>
</div>
<div class="div-table-row"
ng-repeat="bug in pageItems()">
<div class="div-table-cell actions">
<a href="#/reports-browser/{{acralyzer.app}}/bug/{{bug.id}}"
tooltip-html-unsafe="{{bug.descriptionHtml}}" tooltip-placement="right">
<i class="icon-search" ng-hide="bug.value.description"></i>
<i class="icon-zoom-in" ng-show="bug.value.description"></i>
</a>
<a ng-click="bug.toggleSolved()">
<span title="Unsolved bug" ng-hide="bug.value.solved || bug.solvedPending"><i class="icon-bug-unsolved"></i></span>
<span title="Solved bug" ng-show="bug.value.solved && !bug.solvedPending"><i class="icon-bug-solved"></i></span>
<span title="Updating state" ng-show="bug.solvedPending"><img src="img/polling.gif"/></span>
</a>
</div>
<div title="Number of reports" class="div-table-cell label">{{bug.value.count}}</div>
<div title="Latest report" class="div-table-cell label label-info">{{bug.latest}}</div>
<div title="Application version code" class="div-table-cell label label-warning">{{bug.key[0]}}</div>
<div class="div-table-cell exceptions">
<span title="Exception" class="label label-important">{{bug.key[1]}}</span><br/>
<span title="Root exception" class="label label-inverse" ng-show="bug.key[2]">Caused by: {{bug.key[2]}}</span>
</div>
</div>
</div>
================================================
FILE: _attachments/partials/change-password.html
================================================
<form name="changePasswordForm" class="form-horizontal">
<div class="modal-header">
<h3>Change Password</h3>
</div>
<div class="modal-body">
<div class="alert alert-danger">
<i class="icon-exclamation-sign"></i>
Changing password will log you out.
</div>
<div ng-class="{ 'control-group': true, 'error': changePasswordForm.password.$invalid || errmessage }">
<label class="control-label" for="password">New Password</label>
<div class="controls">
<input ng-model="password" name="password" type="password" required init-focus/>
<span class='help-inline' ng-show='errmessage'>
{{errmessage}}
</span>
</div>
</div>
<div ng-class="{ 'control-group': true, 'error': changePasswordForm.confirm_password.$invalid }">
<label class="control-label" for="confirm_password">Confirm Password</label>
<div class="controls">
<input ng-model="confirm_password" name="confirm_password" type="password" required same-as="password">
<span class='help-inline' ng-show='changePasswordForm.confirm_password.$valid'>
<i class='icon-ok'></i>
</span>
<span class='help-inline' ng-show='changePasswordForm.confirm_password.$error.MATCH'>
Passwords must match
</span>
</div>
</div>
</div>
<div class="modal-footer">
<img src="img/not-polling.gif" ng-show="pending" alt="pending transaction" />
<button class="btn btn-primary" ng-click="close()" data-my-disabled="!changePasswordForm.$valid" ng-disabled='!changePasswordForm.$valid' >Change Password</button>
</div>
</form>
================================================
FILE: _attachments/partials/dashboard.html
================================================
<div class="container-fluid">
<div id="charts" class="row-fluid">
<div id="graph-container" ng-controller="ReportsPerDayCtrl" class="span8">
<div class="chooser">Reports per
<select class="input-small" ng-model="period" ng-change="getData()" ng-options="p.name for p in periods">
</select>
</div>
</div>
<div id="pie-charts" ng-controller="PieChartsCtrl" class="span4">
<div class="chooser">Reports per
<select ng-model="fieldName" ng-change="getData()" ng-options="f.label for f in fieldNames">
</select>
</div>
</div>
</div>
<div class="row-fluid">
<div id="content" class="span12">
<tabs>
<pane heading="Bugs">
<div ng-controller="BugsCtrl">
<span>{{bugsLimit}} latest bugs (out of <a href="#/bugs-browser/{{acralyzer.app}}">{{bugs.length}}</a>):</span>
<button class="btn btn-small" ng-click="hideSolvedBugs = !hideSolvedBugs">
<span ng-hide="hideSolvedBugs">Hide solved bugs</span>
<span ng-show="hideSolvedBugs">Show solved bugs</span>
</button>
<ng-include src="'partials/bugs-table.html'"></ng-include>
</div>
</pane>
<pane heading="Reports">
<div ng-controller="CrashReportsCtrl">
<div class="rss"><a href="/acra-{{acralyzer.app}}/_design/acra-storage/_list/rss/recent-items?descending=true"><img src="img/rss.png"></a></div>
<span>{{reports.length}} latest reports (out of <a href="#/reports-browser/{{acralyzer.app}}">{{totalReports}}</a>):</span>
<ng-include src="'partials/reports-table.html'"></ng-include>
<report-details report="selectedReport" acralyzer="acralyzer"></report-details>
</div>
</pane>
</tabs>
</div>
</div>
</div>
================================================
FILE: _attachments/partials/login-dialog.html
================================================
<form name="loginForm" class="form-horizontal">
<div class="modal-header">
<h3>Login</h3>
</div>
<div class="modal-body">
<div ng-class="{ 'control-group': true, 'error': loginForm.username.$invalid || badUsername }">
<label class="control-label" for="username">Username</label>
<div class="controls">
<input ng-model="username" name="username" type="text" required init-focus/>
<span class="help-inline" ng-show="loginForm.username.$error.required">Required!</span><br>
<span class="help-inline" ng-show="badUsername">Bad username or password</span><br>
</div>
</div>
<div ng-class="{ 'control-group': true, 'error': loginForm.password.$invalid }">
<label class="control-label" for="password">Password</label>
<div class="controls">
<input ng-model="password" name="password" type="password" required />
<span class="help-inline" ng-show="loginForm.password.$error.required">Required!</span><br>
</div>
</div>
</div>
<div class="modal-footer">
<img src="img/not-polling.gif" ng-show="pending" alt="pending transaction" />
<button class="btn btn-primary" ng-click="close()" data-my-disabled="!loginForm.$valid" ng-disabled='!loginForm.$valid' >Login</button>
</div>
</form>
================================================
FILE: _attachments/partials/paginator.html
================================================
<div class="form-inline paginator">
<button ng-disabled="isFirstPage()" ng-click="decPage()" class="btn"><i class="icon-chevron-left"></i> newer</button>
<span ng-show="paginator">items per page: <select ng-model="paginator.pageSize" ng-options="size for size in pageSizeList" class="input-small"></select></span>
<button ng-disabled="isLastPage()" ng-click="incPage()" class="btn">older <i class="icon-chevron-right"></i></button>
</div>
================================================
FILE: _attachments/partials/report-details.html
================================================
<div ng-show="report._id">
<hr/>
<div class="report-details-header">
<div class="direct-link"><a href="#/report-details/{{acralyzer.app}}/{{report._id}}"><i class="icon-share"></i>direct link</a></div>
<h3>Summary</h3>
<table>
<tr>
<th><i class="icon-gift"></i></th>
<th>Package name</th>
<td>{{report.PACKAGE_NAME}}</td>
<th>Application version code</th>
<td>{{report.APP_VERSION_CODE}}</td>
<th>Application version name</th>
<td>{{report.APP_VERSION_NAME}}</td>
</tr>
<tr>
<th><i class="icon-time"></i></th>
<th>Uptime</th>
<td class="nobr">{{report.readableUptime}}</td>
<th>Crashed</th>
<td>{{report.formatedCrashDate}}</td>
<th>Reported</th>
<td>{{report.formatedTimestamp}}</td>
</tr>
<tr>
<th><i class="icon-user"></i></th>
<th>Installation ID</th>
<td>
<a class="label label-inverse" href="#/reports-browser/{{acralyzer.app}}/user/{{report.INSTALLATION_ID}}" ng-show="report.INSTALLATION_ID">
<img class="avatar" monsterid="{{report.INSTALLATION_ID}}" title="{{report.INSTALLATION_ID}}"/>
{{report.INSTALLATION_ID}}
</a>
</td>
<th>E-mail</th>
<td><a href="mailto:{{report.USER_EMAIL}}">{{report.USER_EMAIL}}</a></td>
<th>Comment</th>
<td>{{report.USER_COMMENT}}</td>
</tr>
<tr>
<th rowspan="2"><i class="icon-fire"></i></th>
<th>Stack Trace</th>
<td colspan="5" class="stacktrace">
<div ng-repeat="stackline in report.STACK_TRACE" class="pre">{{stackline}}</div>
</td>
</tr>
<tr>
<th>Custom Data</th>
<td colspan="5">
<div prettyprint="report.CUSTOM_DATA"/>
</td>
</tr>
</table>
</div>
<h3>Full report</h3>
<div class="report-details" prettyprint="report" />
</div>
================================================
FILE: _attachments/partials/reports-browser.html
================================================
<div class="container-fluid">
<h2>Browse reports</h2>
<div id="content">
<bug-details bug="bug" acralyzer="acralyzer" ng-show="bug"></bug-details>
<div id="filters" class="row-fluid">
<form ng-submit="getData()" class="form-inline">
<select ng-model="filterName" ng-change="changeFilterValues()" ng-options="f.label for f in availableFilters" ng-hide="bug || selectedUser">
</select>
<select ng-model="filterValue" ng-disabled="filterName == noFilter" ng-change="filterValueSelected()" ng-options="v.label for v in filterValues" ng-hide="bug || selectedUser">
</select>
<input type="text" class="search-query" placeholder="Search in this page" ng-model="search">
<label class="checkbox">
<input type="checkbox" ng-model="fullSearch" ng-change="getData()"> All report attributes
</label>
</form>
</div>
<div id="reports-list" class="row-fluid tab-content">
<span ng-show="selectedUser && !bug">
For user
<span class="label label-inverse">
<img class="avatar" monsterid="{{selectedUser.installationId}}" />
{{selectedUser.installationId}}
</span>
</span>
<span ng-bind-template="reports {{startNumber}} to {{startNumber + reports.length - 1}} (out of {{totalReports}}):" ng-hide="bug">Loading...</span>
<span ng-bind-template="reports {{startNumber}} to {{startNumber + reports.length - 1}} (out of {{bug.value.count}}/{{totalReports}}):" ng-show="bug">Loading...</span>
<div class="loader" ng-show="loading"><img src="img/loader.gif"/></div>
<ng-include src="'partials/reports-table.html'"></ng-include>
<ng-include src="'partials/paginator.html'"></ng-include>
</div>
<report-details report="selectedReport" acralyzer="acralyzer"></report-details>
</div>
</div>
================================================
FILE: _attachments/partials/reports-table.html
================================================
<div class="div-table reports-table" ng-hide="loading">
<div class="div-table-row">
<div class="div-table-cell"></div>
<div class="div-table-cell"><i class="icon-user"></i></div>
<div class="div-table-cell"><i class="icon-time"></i></div>
<div class="div-table-cell"><i class="icon-gift"></i></div>
<div class="div-table-cell"><i class="icon-bugdroid"></i></div>
<div class="div-table-cell"><i class="icon-phone"></i></div>
<div class="div-table-cell exceptions"><i class="icon-fire"></i></div>
</div>
<div class="div-table-row" ng-repeat="report in reports | filter:search" ng-class-odd="'odd'" ng-class-even="'even'" ng-cloak>
<div class="div-table-cell actions">
<a ng-click="loadReport(report)">
<i class="icon-search" ng-hide="report.id == selectedReport._id" title="Display details"></i>
<i class="icon-asterisk" ng-show="report.id == selectedReport._id" title="Current selection"></i>
</a>
<a ng-click="deleteReport(report)">
<i class="icon-trash" title="Delete permanently"></i>
</a>
</div>
<span title="User" class="div-table-cell label label-inverse"><img class="avatar" monsterid="{{report.value.installation_id}}" ng-show="report.value.installation_id"/></span>
<span title="Crash date" class="div-table-cell label label-info">{{report.displayDate}}</span>
<span title="Application version name" class="div-table-cell label label-warning">{{report.value.application_version_name}}</span>
<span title="Android verion" class="div-table-cell label label-success">{{report.value.android_version}}</span>
<span title="Device" class="div-table-cell label">{{report.value.device}}</span>
<div class="div-table-cell exceptions">
<span title="Exception" class="label label-important">{{report.value.signature.digest}}</span>
<span title="Root exception" class="label label-inverse" ng-show="report.value.signature.rootCause">Caused by: {{report.value.signature.rootCause}}</span>
</div>
</div>
</div>
================================================
FILE: _attachments/script/AccountControllers.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer,acralyzerEvents) {
"use strict";
function AccountCtrl($scope, $user, $dialog) {
$scope.$on(acralyzerEvents.LOGIN_CHANGE, function(event, $user) {
$scope.username = $user.username;
$scope.isAdmin = $user.isAdmin;
});
$scope.showLogin = function() {
var d = $dialog.dialog({
templateUrl: 'partials/login-dialog.html',
controller: 'LoginDialogCtrl'
});
d.open().then(function(result){
});
};
$scope.showChangePassword = function() {
if ($user.canChangePassword() === false) {
alert("Sorry, your couchdb setup does not allow you to change an admins password");
return;
}
var d = $dialog.dialog({
templateUrl: 'partials/change-password.html',
controller: 'ChangePasswordDialogCtrl'
});
d.open().then(function(result){
});
};
$scope.logout = function() {
$user.logout();
};
}
function LoginDialogCtrl($scope, $user, dialog) {
$scope.username = "";
$scope.password = "";
$scope.pending = false;
$scope.badUsername = false;
$scope.close = function(result) {
if (this.disabled) { return; }
$scope.pending = true;
$scope.badUsername = false;
$user.login($scope.username, $scope.password).then(
function(data) {
$scope.pending = false;
dialog.close();
},
function(data) {
$scope.badUsername = true;
$scope.pending = false;
}
);
};
}
function ChangePasswordDialogCtrl($scope, $user, dialog) {
$scope.isAdmin = $user.isAdmin;
$scope.username = $user.username;
$scope.password = "";
$scope.confirm_password = "";
$scope.pending = false;
$scope.close = function(password) {
if (this.disabled) { return; }
$scope.pending = true;
$scope.errmessage = null;
$user.changePassword($scope.password).then(
function() {
/* success */
$scope.pending = false;
dialog.close();
},
function(result) {
/* error */
$scope.pending = false;
$scope.errmessage = result;
}
);
};
}
acralyzer.controller('AccountCtrl', ['$scope','$user','$dialog', AccountCtrl]);
acralyzer.controller('LoginDialogCtrl', ['$scope','$user','dialog', LoginDialogCtrl]);
acralyzer.controller('ChangePasswordDialogCtrl', ['$scope', '$user', 'dialog', ChangePasswordDialogCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer, window.acralyzerEvents);
================================================
FILE: _attachments/script/AcralyzerControllers.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer,acralyzerEvents,$) {
"use strict";
/**
* @class AcralyzerCtrl
*
* Application root controller, handles global behavior such as login logout and reports store change.
*
*/
function AcralyzerCtrl($user, $scope, ReportsStore, $rootScope, $notify, $routeParams, $http) {
/**
* Application scope, visible to children scopes with $scope.acralyzer.
* @type {Object}
*/
$scope.acralyzer = {
apps: []
};
$scope.acralyzer.app = null;
$scope.acralyzer.isPolling = acralyzerConfig.backgroundPollingOnStartup;
ReportsStore.listApps(function(data) {
console.log("Storage list retrieved.");
$scope.acralyzer.apps.length = 0;
$scope.acralyzer.apps = data;
console.log($scope.acralyzer.apps);
}, function() {
});
var onUserLogin = function() {
if(!($routeParams.app)){
$scope.acralyzer.setApp(acralyzerConfig.defaultApp);
}
if(acralyzerConfig.backgroundPollingOnStartup) {
$scope.acralyzer.startPolling();
}
};
/**
* Switch to another reports store.
* @param {String} appName The name of the chosen android application (reports store database without database
* prefix)
*/
$scope.acralyzer.setApp = function(appName) {
console.log("Setting app to ", appName);
if(!appName) {
appName = $scope.acralyzer.apps[0];
console.log("Override setting undefined app to ", appName);
}
if(appName !== $scope.acralyzer.app) {
$scope.acralyzer.app = appName;
ReportsStore.setApp($scope.acralyzer.app,
function() {
console.log("broadcasting APP_CHANGED");
$rootScope.$broadcast(acralyzerEvents.APP_CHANGED);
}
);
if($scope.acralyzer.isPolling) {
console.log("Start polling in AcralyzerControllers.setApp");
$scope.acralyzer.startPolling();
}
}
};
$scope.acralyzer.startPolling = function() {
$scope.acralyzer.isPolling = true;
ReportsStore.startPolling(function(data){
if($scope.acralyzer.isPolling) {
// Determine what kind of change occurred in the database.
var reportsUpdated = false;
var reportsDeleted = false;
var bugsUpdated = false;
if (data.results && data.results.length > 0) {
for (var i = 0; i< data.results.length; i++) {
if (data.results[i].doc && data.results[i].doc.type === "solved_signature"){
bugsUpdated = true;
} else if (data.results[i].doc && data.results[i].deleted) {
reportsDeleted = true;
} else if (data.results[i].doc && data.results[i].doc.REPORT_ID) {
reportsUpdated = true;
}
}
}
if (reportsUpdated) {
$rootScope.$broadcast(acralyzerEvents.NEW_DATA);
} else if (reportsDeleted) {
$rootScope.$broadcast(acralyzerEvents.REPORTS_DELETED);
}
if (bugsUpdated) {
$rootScope.$broadcast(acralyzerEvents.BUGS_UPDATED);
}
} // Do not refresh if a late response is received after the user asked to stop polling.
});
};
$scope.acralyzer.stopPolling = function() {
console.log("Ok, let's stop polling...");
$scope.acralyzer.isPolling = false;
ReportsStore.stopPolling();
};
var notifyNewData = function() {
$notify.warning({
desktop: true,
timeout: 10000,
title: "Acralyzer - " + $scope.acralyzer.app,
body: "Received new report(s)",
icon: "img/loader.gif"
});
};
// Check if hosting is Cloudant or older CouchDB version
$http({method : 'GET', url: '/'}).success(function(data){
if(data.cloudant_build) {
$scope.acralyzer.cloudant = true;
acralyzer.cloudant = true;
}
if(data.version) {
var splittedVersion = data.version.split('.');
var major = splittedVersion[0];
var minor = splittedVersion[1];
if(major <= 1 || ( major === 1 && minor < 2)) {
$scope.acralyzer.createUsersWithHash = true;
acralyzer.createUsersWithHash = true;
}
}
console.log($scope.acralyzer);
});
$scope.$on(acralyzerEvents.NEW_DATA, notifyNewData);
$scope.$on(acralyzerEvents.POLLING_FAILED, $scope.acralyzer.stopPolling);
$scope.$on(acralyzerEvents.LOGGED_OUT, $scope.acralyzer.stopPolling);
$scope.$on(acralyzerEvents.LOGGED_IN, onUserLogin);
/**
* Try to log user and execute initialization when done. onUserLogin() will be triggered by LOGGED_IN broadcast
* event.
*/
$user.init();
}
acralyzer.controller('AcralyzerCtrl', ["$user", "$scope", "ReportsStore", "$rootScope", "$notify", "$routeParams", "$http", AcralyzerCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer,window.acralyzerEvents,window.jQuery);
================================================
FILE: _attachments/script/AcralyzerEvents.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerEvents) {
"use strict";
acralyzerEvents.NEW_DATA = "new_data";
acralyzerEvents.REPORTS_DELETED = "reports_deleted";
acralyzerEvents.BUGS_UPDATED = "bugs_updated";
acralyzerEvents.LOGIN_CHANGE = "login_change";
acralyzerEvents.LOGGED_IN = "logged_in";
acralyzerEvents.LOGGED_OUT = "logged_out";
acralyzerEvents.POLLING_FAILED = "polling failed";
acralyzerEvents.APP_CHANGED = "app changed";
acralyzerEvents.USER_PASSWORD_CHANGE = "password_change";
}( window.acralyzerEvents = window.acralyzerEvents || {}));
================================================
FILE: _attachments/script/AdminControllers.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer,acralyzerEvents,location,moment) {
"use strict";
function AdminCtrl($scope, ReportsStore, $routeParams, $notify, $user, $http) {
if($routeParams.app) {
console.log("ReportsBrowser: Direct access to app " + $routeParams.app);
$scope.acralyzer.setApp($routeParams.app);
} else {
console.log("ReportsBorwser: Access to default app " + acralyzerConfig.defaultApp);
$scope.acralyzer.setApp(acralyzerConfig.defaultApp);
}
// REPORTS PURGES
$scope.daysToKeep = 90;
$scope.selectedVersion = "";
$scope.appVersionCodes = [];
$scope.purgingByDays = false;
$scope.purgingByAppVersionCode = false;
$scope.nbReportsByDaysToPurge = "";
$scope.nbReportsByAppVersionCodeToPurge = "";
ReportsStore.appVersionCodesList(function(data){
$scope.appVersionCodes.length = 0;
for(var row = 0; row < data.rows.length; row++) {
$scope.appVersionCodes.push({value:data.rows[row].key[0], label:data.rows[row].key[0]});
}
});
$scope.purgeDays = function(daysToKeep) {
$scope.purgingByDays = true;
var deadline = moment().subtract('days', daysToKeep);
console.log("Purge reports older than " + daysToKeep);
console.log("key will be: " + deadline.format("[[]YYYY,M,d[]]"));
ReportsStore.purgeReportsOlderThan(deadline.year(), deadline.month(), deadline.date(),
function(nbReports) {
// Intermediate callback
$scope.nbReportsByDaysToPurge = nbReports;
},
function(data) {
// Success callback
$scope.purgingByDays = false;
$scope.nbReportsByDaysToPurge = "";
$notify.success({
desktop: true,
timeout: 10000,
title: "Acralyzer - " + $scope.acralyzer.app,
body: "Purge of " + data.length + " reports succeeded, keeping the last " + daysToKeep + " days.",
icon: "img/loader.gif"
});
},
function(){
// Failure callback
$scope.purgingByDays = false;
$scope.nbReportsByDaysToPurge = "";
$notify.success({
desktop: true,
timeout: 10000,
title: "Acralyzer - " + $scope.acralyzer.app,
body: "Purge failed.",
icon: "img/loader.gif"
});
}
);
};
$scope.purgeVersion = function(selectedVersion) {
$scope.purgingByAppVersionCode = true;
console.log("Purge reports from version " + selectedVersion + " and older.");
console.log(selectedVersion);
ReportsStore.purgeReportsFromAppVersionCodeAndBelow(selectedVersion,
function(nbReports) {
// Intermediate callback
$scope.nbReportsByAppVersionCodeToPurge = nbReports;
},
function(data) {
// Success callback
ReportsStore.appVersionCodesList();
$scope.purgingByAppVersionCode = false;
$scope.nbReportsByAppVersionCodeToPurge = "";
$notify.success({
desktop: true,
timeout: 10000,
title: "Acralyzer - " + $scope.acralyzer.app,
body: "Purge of " + data.length + " reports succeeded, from " + selectedVersion + " and below.",
icon: "img/loader.gif"
});
},
function(){
// Failure callback
$scope.purgingByAppVersionCode = false;
$scope.nbReportsByAppVersionCodeToPurge = "";
$notify.success({
desktop: true,
timeout: 10000,
title: "Acralyzer - " + $scope.acralyzer.app,
body: "Purge failed.",
icon: "img/loader.gif"
});
}
);
};
// USER PREFERENCES
$scope.acralyzerConfig = acralyzerConfig;
$scope.apps = [];
ReportsStore.listApps(function(appsList) {
$scope.apps = appsList;
});
$scope.storeDefaultApp = function() {
$user.updatePreferences({
defaultApp: acralyzerConfig.defaultApp
});
};
// USERS MANAGEMENT
$scope.formUri = 'http://' + location.host + '/' + acralyzerConfig.appDBPrefix + $scope.acralyzer.app + '/_design/acra-storage/_update/report';
$scope.createReporterUser = function(login, password) {
console.log("Transfer user creation to $user ", login, password);
$user.addReporterUser(login, password, function(){
$scope.newReporterCreated = true;
});
};
}
acralyzer.controller('AdminCtrl', ["$scope", "ReportsStore", "$routeParams", "$notify", "$user", "$http", AdminCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer,window.acralyzerEvents,window.location,window.moment);
================================================
FILE: _attachments/script/AlertController.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,acralyzer) {
"use strict";
function AlertCtrl($scope, $notify) {
$scope.alerts = $notify._alerts;
$scope.close = function(index) {
$notify.remove(index);
};
}
acralyzer.controller('AlertCtrl', ['$scope','$notify', AlertCtrl]);
})(window.acralyzerConfig,window.acralyzer);
================================================
FILE: _attachments/script/BugsBrowserControllers.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer,acralyzerEvents) {
"use strict";
function BugsBrowserCtrl($scope, ReportsStore, $routeParams) {
if($routeParams.app) {
console.log("BugsBrowser: Direct access to app " + $routeParams.app);
$scope.acralyzer.setApp($routeParams.app);
} else {
console.log("BugsBorwser: Access to default app " + acralyzerConfig.defaultApp);
$scope.acralyzer.setApp(acralyzerConfig.defaultApp);
}
console.log("Init BugsBrowserCtrl");
$scope.bugsList = [];
$scope.bugsCount = 15;
$scope.hideSolvedBugs = true;
$scope.previousStartKeys = [];
$scope.startKey = null;
$scope.nextKey = null;
$scope.startNumber = 1;
$scope.endNumber = $scope.bugsCount;
$scope.fullSearch = false;
$scope.loading = true;
$scope.noFilter = { value: "false", label: "Select filter"};
$scope.noFilterValue = { value: "false", label: "All values"};
$scope.availableFilters = [
{value: "appvercode", label: "Application version code"}
];
$scope.filterName = $scope.noFilter;
$scope.filterValue = $scope.noFilterValue;
$scope.filterValues = [];
$scope.orderField = 'value.count';
$scope.orderDescending = true;
// List animations
$scope.animationFade = {
enter: 'fade-enter',
leave: 'fade-leave'
};
$scope.animationNextPage = {
enter: 'nextpage-enter',
leave: 'nextpage-leave'
};
$scope.animationPreviousPage = {
enter: 'previouspage-enter',
leave: 'previouspage-leave'
};
$scope.listAnimation = $scope.animationFade;
$scope.setNextPageAnimation = function() {
$scope.listAnimation = $scope.animationNextPage;
console.log("setNextPageAnimation");
};
$scope.setPreviousPageAnimation = function() {
$scope.listAnimation = $scope.animationPreviousPage;
console.log("setPreviousPageAnimation");
};
$scope.getListAnimation = function() {
return $scope.listAnimation;
};
/**
* Takes two lists of bugs and merges the second one into the first one.
* New bugs are added, bugs absent from list2 are removed from list1, and updated bugs are examined to update
* the values from list1 with those from list2.
* This is necessary to allow to animate only changes.
* @param list1 Original list.
* @param list2 New list.
*/
var mergeBugsLists = function(list1, list2) {
var bugslist = {};
for(var i1 = 0; i1 < list1.length; i1++) {
bugslist[list1[i1].id] = {idxlist1: i1};
}
for(var i2 = 0; i2 < list2.length; i2++) {
if(!bugslist[list2[i2].id]){
// Mark bug as not found in list1
bugslist[list2[i2].id] = {idxlist1: -1};
}
bugslist[list2[i2].id].idxlist2 = i2;
}
for(var iBugs in bugslist) {
if(bugslist[iBugs].idxlist1 < 0 && bugslist[iBugs].idxlist2 >= 0) {
// New bug
list1.push(list2[bugslist[iBugs].idxlist2]);
} else if (bugslist[iBugs].idxlist1 >= 0 && bugslist[iBugs].idxlist2 < 0) {
// Deleted bug
list1.splice(bugslist[iBugs].idxlist1, 1);
} else if(bugslist[iBugs].idxlist1 >= 0 && bugslist[iBugs].idxlist2 >= 0) {
if(!list1[bugslist[iBugs].idxlist1].equals(list2[bugslist[iBugs].idxlist2])) {
// Updated bug
list1[bugslist[iBugs].idxlist1].updateWithBug(list2[bugslist[iBugs].idxlist2]);
}
}
}
};
$scope.getData = function() {
// $scope.loading = true;
ReportsStore.bugsList(function(data) {
$scope.listAnimation = $scope.animationFade;
console.log("Refresh data for latest bugs");
console.log(data);
mergeBugsLists($scope.bugsList, data.rows);
$scope.totalBugs = data.total_rows;
for(var row = 0; row < $scope.bugsList.length; row++) {
$scope.bugsList[row].latest = moment($scope.bugsList[row].value.latest).fromNow();
}
$scope.loading = false;
},
function(response, getResponseHeaders){
$scope.bugsList=[];
$scope.totalBugs="";
$scope.loading = false;
}
);
};
$scope.shouldBeDisplayed = function(bug) {
if($scope.hideSolvedBugs && bug.value.solved) {
return false;
} else {
return true;
}
};
$scope.filterValueSelected = function() {
// reset pagination
$scope.startKey = null;
$scope.nextKey = null;
$scope.previousStartKeys.length = 0;
$scope.getData();
};
$scope.$on(acralyzerEvents.LOGGED_IN, $scope.getData);
$scope.$on(acralyzerEvents.LOGGED_OUT, $scope.getData);
$scope.$on(acralyzerEvents.BUGS_UPDATED, $scope.getData);
$scope.getData();
}
acralyzer.controller('BugsBrowserCtrl', ["$scope", "ReportsStore", "$routeParams", BugsBrowserCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer,window.acralyzerEvents);
================================================
FILE: _attachments/script/DashboardControllers.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer,acralyzerEvents,$) {
"use strict";
function getBidimensionalArray(rows) {
var result = new Array(rows.length);
for(var i = 0; i < rows.length; i++) {
var row = rows[i];
if(row.key && row.value) {
result[i] = [row.key, row.value];
}
}
return result;
}
var formatAsPercentage = d3.format("%"),
formatAsPercentage1Dec = d3.format(".1%"),
formatAsInteger = d3.format(","),
fsec = d3.time.format("%S s"),
fmin = d3.time.format("%M m"),
fhou = d3.time.format("%H h"),
fwee = d3.time.format("%a"),
fdat = d3.time.format("%d d"),
fmon = d3.time.format("%b");
function CrashReportsCtrl($scope, ReportsStore) {
$scope.selectedReport = "";
$scope.getData = function() {
ReportsStore.recentReports(function(data) {
console.log("Refresh data for latest reports");
$scope.reports = data.rows;
$scope.totalReports = data.total_rows;
for(var row = 0; row < $scope.reports.length; row++) {
$scope.reports[row].displayDate = moment($scope.reports[row].key).fromNow();
}
},
function(response, getResponseHeaders){
$scope.reports=[];
$scope.totalReports="";
});
};
$scope.loadReport = function(report) {
$scope.selectedReport = ReportsStore.reportDetails(report.id, function(data) {
data.readableUptime = moment.duration(data.uptime, 'seconds').humanize();
data.formatedCrashDate = moment(data.USER_CRASH_DATE).format('LLL');
data.formatedTimestamp = moment(data.timestamp).format('LLL');
});
};
$scope.deleteReport = function(report) {
if($scope.selectedReport === report) {
$scope.selectedReport = "";
}
ReportsStore.deleteReport(report, function(data) {
// Success callback
});
};
$scope.$on(acralyzerEvents.LOGGED_IN, $scope.getData);
$scope.$on(acralyzerEvents.APP_CHANGED, $scope.getData);
// $scope.$on(acralyzerEvents.LOGGED_OUT, $scope.getData);
$scope.$on(acralyzerEvents.NEW_DATA, $scope.getData);
$scope.$on(acralyzerEvents.REPORTS_DELETED, $scope.getData);
if($scope.acralyzer.app) {
$scope.getData();
}
}
function BugsCtrl($scope, ReportsStore, $filter) {
$scope.selectedBug = "";
$scope.bugsLimit = 10;
$scope.hideSolvedBugs = true;
$scope.bugs = [];
var mergeBugsLists = function(list1, list2) {
var bugslist = {};
for(var i1 = 0; i1 < list1.length; i1++) {
bugslist[list1[i1].id] = {idxlist1: i1};
}
for(var i2 = 0; i2 < list2.length; i2++) {
if(!bugslist[list2[i2].id]){
// Mark bug as not found in list1
bugslist[list2[i2].id] = {idxlist1: -1};
}
bugslist[list2[i2].id].idxlist2 = i2;
}
for(var iBugs in bugslist) {
if(bugslist[iBugs].idxlist1 < 0 && bugslist[iBugs].idxlist2 >= 0) {
// New bug
list1.push(list2[bugslist[iBugs].idxlist2]);
} else if (bugslist[iBugs].idxlist1 >= 0 && bugslist[iBugs].idxlist2 < 0) {
// Deleted bug
list1.splice(bugslist[iBugs].idxlist1, 1);
} else if(bugslist[iBugs].idxlist1 >= 0 && bugslist[iBugs].idxlist2 >= 0) {
if(!list1[bugslist[iBugs].idxlist1].equals(list2[bugslist[iBugs].idxlist2])) {
// Updated bug
list1[bugslist[iBugs].idxlist1].updateWithBug(list2[bugslist[iBugs].idxlist2]);
}
}
}
};
$scope.getData = function() {
ReportsStore.bugsList(function(data) {
console.log("Refresh data for latest bugs");
mergeBugsLists($scope.bugs, data.rows);
$scope.totalBugs = data.total_rows;
for(var row = 0; row < $scope.bugs.length; row++) {
$scope.bugs[row].latest = moment($scope.bugs[row].value.latest).fromNow();
}
},
function(response, getResponseHeaders){
$scope.bugs=[];
$scope.totalBugs="";
});
};
$scope.shouldBeDisplayed = function(bug) {
if($scope.hideSolvedBugs && bug.value.solved) {
return false;
} else {
return true;
}
};
$scope.pageItems = function() {
var filtFilter = $filter("filter"); // First remove unnecessary items
var filtOrderBy = $filter("orderBy"); // Order by latest occurence
var filtLimitTo = $filter("limitTo"); // Limit to X items
return filtLimitTo(
filtOrderBy(
filtFilter(
$scope.bugs, $scope.shouldBeDisplayed
), 'value.latest', true
), $scope.bugsLimit
);
};
$scope.$on(acralyzerEvents.LOGGED_IN, $scope.getData);
$scope.$on(acralyzerEvents.APP_CHANGED, $scope.getData);
$scope.$on(acralyzerEvents.NEW_DATA, $scope.getData);
$scope.$on(acralyzerEvents.BUGS_UPDATED, $scope.getData);
if($scope.acralyzer.app) {
$scope.getData();
}
}
function ReportsPerDayCtrl($scope, ReportsStore, $user) {
$scope.periods = [
{name: "Year", value: 1},
{name: "Month", value: 2},
{name: "Day", value: 3},
{name: "Hour", value: 4},
{name: "Minute", value: 5},
{name: "Second", value: 6}
];
$scope.period = $scope.periods[2];
$scope.reportsPerDay=[];
$scope.dataDate = function(d) {
var result = new Date();
var dateArray = d[0];
if(dateArray[0]) {
result.setFullYear(dateArray[0]);
} else {
result.setFullYear(0);
}
if(dateArray[1]) {
result.setMonth(dateArray[1]);
} else {
result.setMonth(0);
}
if(dateArray[2]) {
result.setDate(dateArray[2]);
} else {
result.setDate(0);
}
if(dateArray[3]) {
result.setHours(dateArray[3]);
} else {
result.setHours(0);
}
if(dateArray[4]) {
result.setMinutes(dateArray[4]);
} else {
result.setMinutes(0);
}
if(dateArray[5]) {
result.setSeconds(dateArray[5]);
} else {
result.setSeconds(0);
}
if(dateArray[6]) {
result.setMilliseconds(dateArray[6]);
} else {
result.setMilliseconds(0);
}
return result;
};
$scope.dataValue = function(d) {
return d[1];
};
$scope.getData = function() {
if ($user.isReader()) {
ReportsStore.reportsPerDay(
$scope.period.value,
function(data) {
$scope.reportsPerDay = getBidimensionalArray(data.rows);
$scope.updateGraph();
},
function(response, getResonseHeaders){
$scope.reportsPerDay=[[]];
$scope.updateGraph();
}
);
}
};
$scope.buildGraph = function () {
var container = $("#graph-container");
$scope.metrics = {
/*
width : parseInt(container.style.width),
height : parseInt(container.style.height),
*/
width : container.width(),
height : container.height() * 0.8,
padding : container.height() * 0.15
};
// create an svg container
if(!$scope.vis) {
$scope.vis = d3.select("#graph-container")
.append("svg:svg")
.attr("width", "100%")
.attr("height", "80%")
.attr("viewBox", "0 0 " + $scope.metrics.width + " " + $scope.metrics.height)
.attr("preserveAspectRatio", "xMidYMid meet");
/*
.attr("width", $scope.metrics.width)
.attr("height", $scope.metrics.height);
*/
}
$scope.xScale = d3.time.scale()
.domain([d3.min($scope.reportsPerDay, $scope.dataDate), new Date()])
.range([$scope.metrics.padding, $scope.metrics.width - $scope.metrics.padding]); // map these the the chart width = total width minus padding at both sides
// define the y scale (vertical)
$scope.yScale = d3.scale.linear()
.domain([0, d3.max($scope.reportsPerDay, $scope.dataValue)])
.range([$scope.metrics.height - $scope.metrics.padding, $scope.metrics.padding]); // map these to the chart height, less padding.
//REMEMBER: y axis range has the bigger number first because the y value of zero is at the top of chart and increases as you go down.
// define the y axis
$scope.yAxis = d3.svg.axis()
.orient("left")
.scale($scope.yScale);
// define the y axis
$scope.xAxis = d3.svg.axis()
.orient("bottom")
.scale($scope.xScale);
// draw y axis with labels and move in from the size by the amount of padding
$scope.vis.append("g")
.attr("class", "yaxis") // give it a class so it can be used to select only xaxis labels below
.attr("transform", "translate("+$scope.metrics.padding+",0)")
.call($scope.yAxis);
// draw x axis with labels and move to the bottom of the chart area
$scope.vis.append("g")
.attr("class", "xaxis") // give it a class so it can be used to select only xaxis labels below
.attr("transform", "translate(0," + ($scope.metrics.height - $scope.metrics.padding) + ")")
.call($scope.xAxis);
};
$scope.updateGraph = function updateGraph() {
$scope.xScale.domain([d3.min($scope.reportsPerDay, $scope.dataDate), new Date()]);
$scope.yScale.domain([0, d3.max($scope.reportsPerDay, $scope.dataValue)]);
$scope.vis.select(".xaxis")
.transition().duration(750)
.call($scope.xAxis);
$scope.vis.select(".yaxis")
.transition().duration(750)
.call($scope.yAxis);
// now rotate text on x axis
// solution based on idea here: https://groups.google.com/forum/?fromgroups#!topic/d3-js/heOBPQF3sAY
// first move the text left so no longer centered on the tick
// then rotate up to get 45 degrees.
$scope.vis.selectAll(".xaxis text") // select all the text elements for the xaxis
.attr("transform", function(d) {
return "translate(" + this.getBBox().height*-2 + "," + this.getBBox().height + ")rotate(-45)";
});
// Update data
var bars = $scope.vis.selectAll("rect")
.data($scope.reportsPerDay);
bars.attr("class", "update")
.transition().duration(375)
.attr("height", 0)
.attr("y", function(d){return $scope.yScale(0);})
.transition().delay(375).duration(1)
.attr("x", function(d){return $scope.xScale($scope.dataDate(d));})
.transition().delay(376).duration(374)
.attr("y", function(d){return $scope.yScale($scope.dataValue(d));})
.attr("height", function(d) { return $scope.metrics.height - $scope.metrics.padding - $scope.yScale($scope.dataValue(d));});
bars.enter().append("rect")
.attr("class","enter")
.attr("x", function(d){return $scope.xScale($scope.dataDate(d));})
.attr("y", function(d){return $scope.yScale(0);})
.attr("height", 0)
.transition().duration(750)
.attr("x", function(d){return $scope.xScale($scope.dataDate(d));})
.attr("y", function(d){return $scope.yScale($scope.dataValue(d));})
.attr("width", 1)
.attr("height", function(d) { return $scope.metrics.height - $scope.metrics.padding - $scope.yScale($scope.dataValue(d)); });
bars.exit()
.attr("class","exit")
.transition().duration(750)
.attr("height", 0)
.attr("y", function(d){return $scope.yScale(0);})
.remove();
};
$scope.buildGraph();
$scope.$on(acralyzerEvents.LOGGED_IN, $scope.getData);
$scope.$on(acralyzerEvents.APP_CHANGED, $scope.getData);
// $scope.$on(acralyzerEvents.LOGGED_OUT, $scope.getData);
$scope.$on(acralyzerEvents.NEW_DATA, $scope.getData);
$scope.$on(acralyzerEvents.REPORTS_DELETED, $scope.getData);
if($scope.acralyzer.app) {
$scope.getData();
}
}
/* Pie charts */
function PieChartsCtrl($scope, ReportsStore, $user) {
$scope.fieldNames = [
{name: "android-version", label: "Android version"},
{name: "android-sdk-version", label: "Android SDK version"},
{name: "app-version-name", label: "Application version name"},
{name: "app-version-code", label: "Application version code"},
{name: "device", label: "Device"}
];
$scope.fieldName = $scope.fieldNames[0];
$scope.reportsPerFieldName=[];
$scope.getData = function() {
if ($user.isReader()) {
ReportsStore.reportsPerFieldName(
$scope.fieldName.name,
function(data) {
$scope.reportsPerFieldName = getBidimensionalArray(data.rows);
var totalReports = 0;
var i = 0;
// Get total number of reports before calculating the ratio for each value.
for(i = 0; i < $scope.reportsPerFieldName.length; i++) {
totalReports += $scope.reportsPerFieldName[i][1];
}
for(i = 0; i < $scope.reportsPerFieldName.length; i++) {
$scope.reportsPerFieldName[i][2] = $scope.reportsPerFieldName[i][1] / totalReports;
}
$scope.updateGraph();
},
function(response, getResonseHeaders){
$scope.reportsPerFieldName=[[]];
$scope.updateGraph();
}
);
}
};
$scope.mouseover = function() {
d3.select(this).select("path").transition()
.duration(350)
//.attr("stroke","red")
//.attr("stroke-width", 1.5)
.attr("d", $scope.arcFinal3)
;
};
$scope.mouseout = function() {
d3.select(this).select("path").transition()
.duration(350)
//.attr("stroke","blue")
//.attr("stroke-width", 1.5)
.attr("d", $scope.arcFinal)
;
};
$scope.up = function(d, i) {
/* update bar chart when user selects piece of the pie chart */
//updateBarChart(dataset[i].category);
// updateBarChart(d.data.category, color(i));
// updateLineChart(d.data.category, color(i));
};
$scope.buildGraph = function () {
var container = $("#pie-charts");
var outerRad = Math.min(container.width(), container.height()) / 2;
var innerRad = outerRad * 0.999;
$scope.metrics = {
width : container.width(),
height : container.height(),
padding : container.height() * 0.15,
outerRadius : outerRad,
outerRadiusSelected : outerRad * 1.05,
innerRadius : innerRad,
// for animation
innerRadiusFinal : outerRad * 0.2,
innerRadiusFinal3 : outerRad * 0.25,
color : d3.scale.category20() //builtin range of colors
};
// create an svg container
$scope.vis = d3.select("#pie-charts")
.append("svg:svg") //create the SVG element inside the <body>
.data([$scope.reportsPerFieldName]) //associate our data with the document
.attr("width", "95%")
.attr("height", "85%")
.attr("viewBox", "0 0 " + $scope.metrics.width + " " + $scope.metrics.height)
.attr("preserveAspectRatio", "xMidYMid meet")
.append("svg:g") //make a group to hold our pie chart
.attr("transform", "translate(" + $scope.metrics.width / 2 + "," + $scope.metrics.height / 2 + ")") //move the center of the pie chart from 0, 0 to radius, radius
;
$scope.arc = d3.svg.arc() //this will create <path> elements for us using arc data
.outerRadius($scope.metrics.outerRadius).innerRadius($scope.metrics.innerRadius);
// for animation
$scope.arcFinal = d3.svg.arc().innerRadius($scope.metrics.innerRadiusFinal).outerRadius($scope.metrics.outerRadius);
$scope.arcFinal3 = d3.svg.arc().innerRadius($scope.metrics.innerRadiusFinal3).outerRadius($scope.metrics.outerRadiusSelected);
$scope.pie = d3.layout.pie() //this will create arc data for us given a list of values
.value(function(d) {
return d[2];
}); //we must tell it how to access the value of each element in our data array
// Computes the label angle of an arc, converting from radians to degrees.
$scope.angle = function(d) {
var a = (d.startAngle + d.endAngle) * 90 / Math.PI - 90;
return a > 90 ? a - 180 : a;
}
// Pie chart title
/* $scope.chartTitle = $scope.vis.append("svg:text")
.attr("dy", ".35em")
.attr("text-anchor", "middle")
.text($scope.fieldName.label)
.attr("class","title")
*/ ;
};
$scope.updateGraph = function () {
$scope.vis.data([$scope.reportsPerFieldName]);
// $scope.chartTitle.text($scope.fieldName.label);
var arcs = $scope.vis.selectAll("g.slice").data($scope.pie);
// update
arcs.select("path").attr("d", $scope.arcFinal);
arcs.select(".pie-label").remove();
arcs.filter(function(d) { return d.endAngle - d.startAngle > 0.2; })
.append("svg:text")
.attr("class", "pie-label")
.attr("dy", ".35em")
.attr("text-anchor", "middle")
.attr("transform", function(d) { return "translate(" + $scope.arcFinal.centroid(d) + ")rotate(" + $scope.angle(d) + ")"; })
.text(function(d) { return d.data[0] + " : " + formatAsPercentage(d.value); })
;
arcs.select("title")
.text(function(d) { return d.data[0] + " : " + formatAsPercentage(d.value) + " (" + d.data[1] + " reports)"; });
arcs.exit().remove();
var newarcs = arcs.enter()
.append("svg:g")
.attr("class", "slice")
.on("mouseover", $scope.mouseover)
.on("mouseout", $scope.mouseout)
.on("click", $scope.up);
newarcs.append("svg:path")
.attr("fill", function(d, i) { return $scope.metrics.color(i); } ) //set the color for each slice to be chosen from the color function defined above
.attr("d", $scope.arcFinal) //this creates the actual SVG path using the associated data (pie) with the arc drawing function
.append("svg:title") //mouseover title showing the figures
.text(function(d) { return d.data[0] + " : " + formatAsPercentage(d.value) + " (" + d.data[1] + " reports)"; })
;
newarcs.filter(function(d) { return d.endAngle - d.startAngle > 0.2; })
.append("svg:text")
.attr("class", "pie-label")
.attr("dy", ".35em")
.attr("text-anchor", "middle")
.attr("transform", function(d) { return "translate(" + $scope.arcFinal.centroid(d) + ")rotate(" + $scope.angle(d) + ")"; })
.text(function(d) { return d.data[0] + " : " + formatAsPercentage(d.value); })
;
/* d3.selectAll("g.slice").selectAll("path").transition()
.duration(750)
.delay(10)
.attr("d", $scope.arcFinal )
;
*/
};
$scope.buildGraph();
$scope.$on(acralyzerEvents.LOGGED_IN, $scope.getData);
$scope.$on(acralyzerEvents.APP_CHANGED, $scope.getData);
// $scope.$on(acralyzerEvents.LOGGED_OUT, $scope.getData);
$scope.$on(acralyzerEvents.NEW_DATA, $scope.getData);
$scope.$on(acralyzerEvents.REPORTS_DELETED, $scope.getData);
if($scope.acralyzer.app) {
$scope.getData();
}
}
function DashboardCtrl($scope, $routeParams) {
if($routeParams.app) {
console.log("Dashboard: Direct access to app " + $routeParams.app);
$scope.acralyzer.setApp($routeParams.app);
}
}
acralyzer.controller('ReportsPerDayCtrl', [ "$scope", "ReportsStore", "$user", ReportsPerDayCtrl]);
acralyzer.controller('PieChartsCtrl', ["$scope", "ReportsStore", "$user", PieChartsCtrl]);
acralyzer.controller('DashboardCtrl', ["$scope", "$routeParams", DashboardCtrl]);
acralyzer.controller('CrashReportsCtrl', ["$scope", "ReportsStore", CrashReportsCtrl]);
acralyzer.controller('BugsCtrl', ["$scope", "ReportsStore", "$filter", BugsCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer,window.acralyzerEvents,window.jQuery);
================================================
FILE: _attachments/script/NavigationController.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer) {
"use strict";
function NavigationCtrl($scope, $route, $dialog) {
$scope.$route = $route;
}
acralyzer.controller('NavigationCtrl', ["$scope", "$route", "$dialog", NavigationCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer);
================================================
FILE: _attachments/script/ReportDetailsController.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer) {
"use strict";
function ReportDetailsCtrl($scope, $routeParams, ReportsStore) {
$scope.acralyzer.setApp($routeParams.app);
$scope.reportId = $routeParams.reportId;
$scope.loadReport = function(reportId) {
$scope.report = ReportsStore.reportDetails(reportId, function(data) {
data.readableUptime = moment.duration(data.uptime, 'seconds').humanize();
data.formatedCrashDate = moment(data.USER_CRASH_DATE).format('LLL');
data.formatedTimestamp = moment(data.timestamp).format('LLL');
});
};
$scope.loadReport($scope.reportId);
}
acralyzer.controller('ReportDetailsCtrl',["$scope", "$routeParams", "ReportsStore",ReportDetailsCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer);
================================================
FILE: _attachments/script/ReportsBrowserControllers.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzer,acralyzerEvents,Showdown) {
"use strict";
function ReportsBrowserCtrl($scope, ReportsStore, $routeParams) {
if($routeParams.app) {
console.log("ReportsBrowser: Direct access to app " + $routeParams.app);
$scope.acralyzer.setApp($routeParams.app);
} else {
console.log("ReportsBorwser: Access to default app " + acralyzerConfig.defaultApp);
$scope.acralyzer.setApp(acralyzerConfig.defaultApp);
}
console.log("Init ReportsBrowserCtrl");
$scope.paginator = {
pageSize: 15,
currentPage: 0
};
$scope.pageSizeList = [15, 30, 50, 100];
$scope.previousStartKeys = [];
$scope.selectedReport = "";
$scope.startKey = null;
$scope.nextKey = null;
$scope.startNumber = 1;
$scope.endNumber = $scope.paginator.pageSize;
$scope.fullSearch = false;
$scope.loading = true;
$scope.noFilter = { value: "false", label: "Select filter"};
$scope.noFilterValue = { value: "false", label: "All values"};
$scope.availableFilters = [
$scope.noFilter,
{value: "appver", label: "Application version"},
{value: "androidver", label: "Android version"}
];
$scope.filterName = $scope.noFilter;
$scope.filterValue = $scope.noFilterValue;
$scope.filterValues = [];
// Filtering by bugId
$scope.bugId = $routeParams.bugId;
$scope.bug = null;
// Filtering by installation_id
if($routeParams.installationId) {
$scope.selectedUser = { installationId: $routeParams.installationId };
}
$scope.incPage = function() {
$scope.previousStartKeys.push($scope.startKey);
$scope.startKey = $scope.nextKey;
$scope.getData();
};
$scope.decPage = function() {
$scope.nextKey = null;
$scope.startKey = $scope.previousStartKeys.pop();
$scope.getData();
};
$scope.isFirstPage = function() {
return $scope.previousStartKeys.length <= 0;
};
$scope.isLastPage = function() {
return $scope.nextKey === null;
};
$scope.firstPage = function() {
$scope.startKey = null;
$scope.nextKey = null;
$scope.getData();
};
$scope.$watch('paginator.pageSize', function(newValue, oldValue){
if (newValue !== oldValue) {
$scope.firstPage();
}
});
$scope.getData = function() {
$scope.loading = true;
var successHandler = function(data) {
// Success Handler
$scope.reports = data.rows;
$scope.totalReports = data.total_rows;
// If there are more rows, here is the key to the next page
$scope.nextKey =data.next_row ? data.next_row.key : null;
$scope.startNumber = ($scope.previousStartKeys.length * $scope.paginator.pageSize) + 1;
$scope.endNumber = $scope.startNumber + $scope.reports.length - 1;
$scope.loading = false;
};
var errorHandler = function(response, getResponseHeaders){
// Error Handler
$scope.reports=[];
$scope.totalReports="";
};
if(($scope.filterName === $scope.noFilter || $scope.filterValue === $scope.noFilterValue) && !$scope.bug && !$scope.selectedUser) {
ReportsStore.reportsList($scope.startKey, $scope.paginator.pageSize, $scope.fullSearch, successHandler, errorHandler);
} else if($scope.filterName !== $scope.noFilter && $scope.filterValue !== $scope.noFilterValue){
ReportsStore.filteredReportsList($scope.filterName.value, $scope.filterValue.value,$scope.startKey, $scope.paginator.pageSize, $scope.fullSearch, successHandler, errorHandler);
} else if($scope.bug) {
if($scope.selectedUser) {
// Filter by bug AND user
var filterKey = $scope.bug.key.slice(0);
filterKey.push($scope.selectedUser.installationId);
ReportsStore.filteredReportsList("bug-by-installation-id", filterKey, $scope.startKey, $scope.paginator.pageSize, $scope.fullSearch, successHandler, errorHandler);
} else {
// Filter by bug only
ReportsStore.filteredReportsList("bug", $scope.bug.key, $scope.startKey, $scope.paginator.pageSize, $scope.fullSearch, successHandler, errorHandler);
}
} else if($scope.selectedUser) {
// Filter by user only
ReportsStore.filteredReportsList("installation-id", $scope.selectedUser.installationId, $scope.startKey, $scope.paginator.pageSize, $scope.fullSearch, successHandler, errorHandler);
}
};
$scope.changeFilterValues = function() {
if($scope.filterName === $scope.noFilter) {
$scope.filterValue = $scope.noFilterValue;
$scope.filterValueSelected();
} else {
var getFilteredValues;
if($scope.filterName.value === "androidver") {
getFilteredValues = ReportsStore.androidVersionsList;
} else if ($scope.filterName.value === "appver") {
getFilteredValues = ReportsStore.appVersionsList;
}
if(getFilteredValues) {
getFilteredValues(function(data){
console.log("Update filter values");
$scope.filterValues.length = 0;
$scope.filterValues.push($scope.noFilterValue);
for(var row = 0; row < data.rows.length; row++) {
$scope.filterValues.push({value:data.rows[row].key[0], label:data.rows[row].key[0]});
}
$scope.filterValues.sort();
});
}
}
};
$scope.filterValueSelected = function() {
// reset pagination
$scope.startKey = null;
$scope.nextKey = null;
$scope.previousStartKeys.length = 0;
$scope.getData();
};
$scope.loadReport = function(report) {
$scope.selectedReport = ReportsStore.reportDetails(report.id, function(data) {
data.readableUptime = moment.duration(data.uptime, 'seconds').humanize();
data.formatedCrashDate = moment(data.USER_CRASH_DATE).format('LLL');
data.formatedTimestamp = moment(data.timestamp).format('LLL');
});
};
$scope.deleteReport = function(report) {
if($scope.selectedReport === report) {
$scope.selectedReport = "";
}
ReportsStore.deleteReport(report, function(data) {
var index = $scope.reports.indexOf(report);
$scope.reports.splice(index, 1);
});
};
if($scope.bugId) {
ReportsStore.getBugForId($scope.bugId, function(bug){
// success callback
$scope.bug = bug;
$scope.bug.editMode = false;
$scope.bug.toggleEditMode = function() {
if($scope.bug.editMode && $scope.bug.initialDescription !== $scope.bug.value.description) {
// User has modified the description and wants to save it
$scope.bug.updating = true;
ReportsStore.saveBug(bug, function() {
$scope.bug.updating = false;
$scope.bug.initialDescription = $scope.bug.value.description;
});
}
$scope.bug.editMode = !$scope.bug.editMode;
};
$scope.bug.initialDescription = $scope.bug.value.description;
$scope.bug.revertDescription = function() {
$scope.bug.value.description = $scope.bug.initialDescription;
};
$scope.getData();
});
} else {
$scope.getData();
}
var converter = new Showdown.converter({extensions:['github','table']});
// When description is updated, re-generate its rendered html version
$scope.$watch('bug.value.description', function(newValue, oldValue) {
if(newValue !== oldValue) {
$scope.bug.descriptionHtml = converter.makeHtml(newValue);
}
});
$scope.filterWithUser = function(user) {
console.log("Selected user:", user);
$scope.selectedUser = user;
$scope.firstPage();
$scope.getData();
};
$scope.$on(acralyzerEvents.LOGGED_IN, $scope.getData);
$scope.$on(acralyzerEvents.LOGGED_OUT, $scope.getData);
}
acralyzer.controller('ReportsBrowserCtrl', ["$scope", "ReportsStore", "$routeParams", ReportsBrowserCtrl]);
})(window.acralyzerConfig,window.angular,window.acralyzer,window.acralyzerEvents,window.Showdown);
================================================
FILE: _attachments/script/app.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig, angular, $, acralyzerEvents, prettyPrint) {
"use strict";
var acralyzer = window.acralyzer = angular.module('Acralyzer', ['ui.bootstrap', 'ngResource']);
acralyzer.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/dashboard/:app', {templateUrl: 'partials/dashboard.html', controller: 'DashboardCtrl', activetab: "dashboard"}).
when('/reports-browser/:app', {templateUrl: 'partials/reports-browser.html', controller: 'ReportsBrowserCtrl', activetab: "reports-browser"}).
when('/reports-browser/:app/bug/:bugId', {templateUrl: 'partials/reports-browser.html', controller: 'ReportsBrowserCtrl', activetab: "reports-browser"}).
when('/reports-browser/:app/user/:installationId', {templateUrl: 'partials/reports-browser.html', controller: 'ReportsBrowserCtrl', activetab: "reports-browser"}).
when('/bugs-browser/:app', {templateUrl: 'partials/bugs-browser.html', controller: 'BugsBrowserCtrl', activetab: "bugs-browser"}).
when('/report-details/:app/:reportId', {templateUrl: 'partials/report-details.html', controller: 'ReportDetailsCtrl', activetab: "none"}).
when('/admin/:app', {templateUrl: 'partials/admin.html', controller: 'AdminCtrl', activetab: "admin"}).
otherwise({redirectTo: '/dashboard/'});
}]);
acralyzer.directive('prettyprint',function(){
return {
restrict: 'A',
link:function($scope,$element,$attr){
// Persistent container for json output
var $json = $('<div>');
$element.prepend($json);
$attr.$observe('prettyprint',function(value){
var dopp = function (inspect){
// Replace contents of persistent json container with new json table
$json.empty();
$json.append(prettyPrint(inspect, {
// Config
// maxArray: 20, // Set max for array display (default: infinity)
expanded: false, // Expanded view (boolean) (default: true),
maxDepth: 5, // Max member depth (when displaying objects) (default: 3)
sortKeys: true,
stringsWithDoubleQuotes: false,
classes: {
'default': {
table: "none",
th: "none"
}
}
}));
};
if (value !== '') {
// Register watcher on evaluated expression
$scope.$watch(function watcher(){
return $scope.$eval(value);
},dopp,true);
} else {
// Watch entire scope
$scope.$watch(dopp);
}
});
}
};
});
acralyzer.directive('reportDetails', function() {
return {
restrict: 'E',
scope: {
report: '=',
acralyzer: '='
},
templateUrl: 'partials/report-details.html'
};
});
acralyzer.directive('bugDetails', function() {
return {
restrict: 'E',
scope: {
bug: '=',
acralyzer: '='
},
templateUrl: 'partials/bug-details.html',
controller: ['$scope', '$element', '$attrs', '$transclude', 'ReportsStore', function($scope, $element, $attrs, $transclude, ReportsStore) {
console.log("In the controller for bugDetails with scope:");
$scope.nbUsersToDisplay = 10;
$scope.selectedUser = {};
$scope.incNbUsersToDisplay = function(nb) {
$scope.nbUsersToDisplay += nb;
};
$scope.selectUser = function(user) {
if($scope.selectedUser.installationId !== user.installationId) {
$scope.selectedUser = user;
$scope.$parent.filterWithUser(user);
} else {
$scope.selectedUser = {};
$scope.$parent.filterWithUser(null);
}
};
$scope.$watch('bug', function(newValue, oldValue) {
if(newValue) {
$scope.users = ReportsStore.getUsersForBug(newValue);
}
});
}]
};
});
acralyzer.directive('notificationsSupport', [function() {
return {
restrict: 'A',
link: function(scope,elm,attrs,controller) {
if ("Notification" in window && window.Notification.permissionLevel) {
if (window.Notification.permissionLevel() === "default") {
elm.on('click', function(ev) {
window.Notification.requestPermission(function () {
elm.remove();
});
});
return;
}
}
else if (window.webkitNotifications) {
if (window.webkitNotifications.checkPermission() === 1) {
elm.on('click', function(ev) {
window.webkitNotifications.requestPermission(function () {
elm.remove();
});
});
return;
}
}
/* Not allowed or not supported */
elm.remove();
}
};
}]);
/* http://jsfiddle.net/S8TYF/ */
acralyzer.directive('sameAs', function() {
return {
require: 'ngModel',
link: function(scope, elm, attr, ctrl) {
var pwdWidget = elm.inheritedData('$formController')[attr.sameAs];
ctrl.$parsers.push(function(value) {
if (value === pwdWidget.$viewValue) {
ctrl.$setValidity('MATCH', true);
return value;
}
ctrl.$setValidity('MATCH', false);
});
pwdWidget.$parsers.push(function(value) {
ctrl.$setValidity('MATCH', value === ctrl.$viewValue);
return value;
});
}
};
});
/* http://jsfiddle.net/vojtajina/nycgX/ */
acralyzer.directive('initFocus', function() {
var timer;
return {
restrict: 'A',
link: function($scope, $element, $attr) {
if (timer) { clearTimeout(timer); }
timer = setTimeout(function() {
$element.focus();
}, 0);
}
};
});
/* http://www.frangular.com/2012/12/pagination-cote-client-directive-angularjs.html */
acralyzer.directive('paginator', function () {
var pageSizeLabel = "Page size";
return {
priority: 0,
restrict: 'A',
scope: {items: '&'},
templateUrl: 'partials/paginator.html',
replace: false,
compile: function compile(tElement, tAttrs, transclude) {
return {
pre: function preLink(scope, iElement, iAttrs, controller) {
scope.pageSizeList = [15, 30, 50, 100];
scope.paginator = {
pageSize: 15,
currentPage: 0
};
scope.isFirstPage = function () {
return scope.paginator.currentPage === 0;
};
scope.isLastPage = function () {
return scope.paginator.currentPage >= scope.items().length / scope.paginator.pageSize - 1;
};
scope.incPage = function () {
if (!scope.isLastPage()) {
scope.$parent.setNextPageAnimation();
scope.paginator.currentPage++;
}
};
scope.decPage = function () {
if (!scope.isFirstPage()) {
scope.$parent.setPreviousPageAnimation();
scope.paginator.currentPage--;
}
};
scope.firstPage = function () {
scope.paginator.currentPage = 0;
};
scope.numberOfPages = function () {
return Math.ceil(scope.items().length / scope.paginator.pageSize);
};
scope.$watch('paginator.pageSize', function(newValue, oldValue) {
if (newValue !== oldValue) {
scope.firstPage();
}
});
// ---- Functions available in parent scope -----
scope.$parent.firstPage = function () {
scope.firstPage();
};
// Function that returns the reduced items list, to use in ng-repeat
scope.$parent.pageItems = function () {
var start = scope.paginator.currentPage * scope.paginator.pageSize;
var limit = scope.paginator.pageSize;
return scope.items().slice(start, start + limit);
};
scope.$parent.firstItemIndex = function() {
return scope.paginator.currentPage * scope.paginator.pageSize + 1;
};
scope.$parent.lastItemIndex = function() {
var nbItemsInPage = scope.paginator.pageSize;
if(scope.isLastPage()) {
nbItemsInPage = scope.items().length % scope.paginator.pageSize;
}
return scope.paginator.currentPage * scope.paginator.pageSize + nbItemsInPage;
};
},
post: function postLink(scope, iElement, iAttrs, controller) {}
};
}
};
});
})(window.acralyzerConfig, window.angular, window.jQuery, window.acralyzerEvents, window.prettyPrint);
================================================
FILE: _attachments/script/clipboard.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzer, ZeroClipboard) {
"use strict";
acralyzer.directive("clipboardText", function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
var clip = new ZeroClipboard(element, {
moviePath: "vendor/zeroclipboard/ZeroClipboard.swf"
} );
}
};
});
})(window.acralyzer, window.ZeroClipboard);
================================================
FILE: _attachments/script/config.js
================================================
(function(acralyzerConfig, undefined ) {
"use strict";
// Update this variable with the name of your app:
acralyzerConfig.defaultApp = "";
acralyzerConfig.backgroundPollingOnStartup = true;
acralyzerConfig.appDBPrefix = "acra-";
// Helper functions
}( window.acralyzerConfig = window.acralyzerConfig || {} ));
================================================
FILE: _attachments/script/service.monsterid.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzer, MonsterId) {
"use strict";
acralyzer.directive("monsterid", function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
scope.element = element;
var drawMonster = function(monsterId) {
MonsterId.getAvatar(monsterId, element[0]);
};
scope.$watch('element[0].offsetWidth + element[0].offsetHeight', function(newValue, oldValue){
drawMonster(attrs.monsterid);
});
scope.$watch(function() {
return attrs.monsterid;
}, function(newValue, oldValue){
drawMonster(attrs.monsterid);
});
drawMonster(attrs.monsterid);
}
};
});
})(window.acralyzer, window.MonsterId);
================================================
FILE: _attachments/script/service.reportsstore.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,angular,acralyzerEvents,acralyzer,hex_md5,Showdown) {
"use strict";
/**
* Reports storage access module.
*
* @class ReportsStore
* @singleton
* @static
*/
acralyzer.factory('ReportsStore', ['$rootScope', '$http', '$resource', function($rootScope, $http, $resource) {
// ReportsStore service instance
var ReportsStore = {
lastseq : -1,
continuePolling : true,
dbName : "",
currentWorkerId : 0
};
// Markdown converter
var converter = new Showdown.converter({extensions:['github','table']});
/**
* Switch to another app, i.e. reports storage database.
* @param {String} newAppName The app name. The database name is determined by adding prefix set in
* acralyzerConfig.appDBPrefix
* @param {function} cb Callback to be executed after database changed.
*/
ReportsStore.setApp = function (newAppName, cb) {
ReportsStore.dbName = acralyzerConfig.appDBPrefix + newAppName;
ReportsStore.views = $resource('/' + ReportsStore.dbName + '/_design/acra-storage/_view/:view');
ReportsStore.details = $resource('/' + ReportsStore.dbName + '/:reportid');
ReportsStore.bug = $resource('/' + ReportsStore.dbName + '/:bugid', { bugid: '@_id' }, { save: {method: 'PUT'}});
ReportsStore.dbstate = $resource('/' + ReportsStore.dbName + '/');
ReportsStore.changes = $resource('/' + ReportsStore.dbName + '/_changes');
ReportsStore.lastseq = -1;
cb();
};
/**
* Gets the list of available apps for which we have crash reports databases.
* Looks for all CouchDB databases starting with
* @param {function} cb Callback which will receive an array of strings (app names) as a parameter.
* @param {function} [errorHandler] Callback to be triggered if an error occurs.
*/
ReportsStore.listApps = function(cb, errorHandler) {
var filterDbsCallback = function(data) {
var finalData = [];
for (var i in data) {
if(data[i].indexOf(acralyzerConfig.appDBPrefix) === 0) {
finalData.push(data[i].substring(acralyzerConfig.appDBPrefix.length));
}
}
cb(finalData);
};
$http.get('/_all_dbs').success(filterDbsCallback).error(errorHandler);
};
/**
* Gets the number of reports per unit of time.
* @param {Number} grouplvl Grouping level: Year = 1, Month = 2, Day = 3, Hour = 4, Minute = 5, Second = 6.
* @param {function} [cb] Callback which receives the results.
* @param {function} [errorHandler] Called in case of error while retrieving data
* @return Key: date/time, Value: quantity
*/
ReportsStore.reportsPerDay = function(grouplvl, cb, errorHandler) {
return ReportsStore.views.get({view: 'reports-per-day', group_level: grouplvl}, cb, errorHandler);
};
// 10 latest reports - Key: date/time Value: report digest
ReportsStore.recentReports = function(cb, errorHandler) {
return ReportsStore.views.get({view: 'recent-items', limit: 10, descending: true}, cb, errorHandler);
};
// Key: report ID Value: report digest
ReportsStore.reportsList = function(startKey, reportsCount, includeDocs, cb, errorHandler) {
var viewParams = {
view: 'recent-items',
descending: true,
limit: reportsCount + 1,
include_docs: includeDocs
};
if(startKey !== null) {
viewParams.startkey = '"' + startKey + '"';
}
var additionalCallback = function(data) {
if(data.rows && (data.rows.length > reportsCount)) {
data.next_row = data.rows.splice(reportsCount,1)[0];
}
for(var row = 0; row < data.rows.length; row++) {
data.rows[row].displayDate = moment(data.rows[row].key).fromNow();
}
cb(data);
};
return ReportsStore.views.get(viewParams, additionalCallback, errorHandler);
};
// Key: report ID Value: report digest
ReportsStore.filteredReportsList = function(filterName, filterValue, pageStartKey, reportsCount, includeDocs, cb, errorHandler) {
var viewParams = {
view: 'recent-items-by-' + filterName,
descending: true,
limit: reportsCount + 1,
include_docs: includeDocs,
reduce: false
};
if(filterName.indexOf("bug") === 0) {
// Bugs have composite keys, already an array.
viewParams.endkey = JSON.stringify(filterValue);
var startKeyValue = filterValue.slice(0);
startKeyValue.push({});
viewParams.startkey = JSON.stringify(startKeyValue);
} else {
viewParams.endkey = JSON.stringify([filterValue]);
viewParams.startkey = JSON.stringify([filterValue,{}]);
}
if(pageStartKey !== null) {
viewParams.startkey = JSON.stringify(pageStartKey);
}
var additionalCallback = function(data) {
if(data.rows && (data.rows.length > reportsCount)) {
data.next_row = data.rows.splice(reportsCount,1)[0];
}
for(var row = 0; row < data.rows.length; row++) {
if(filterName === "bug") {
data.rows[row].displayDate = moment(data.rows[row].key[3]).fromNow();
} else if(filterName === "bug-by-installation-id") {
data.rows[row].displayDate = moment(data.rows[row].key[4]).fromNow();
} else {
data.rows[row].displayDate = moment(data.rows[row].key[1]).fromNow();
}
}
cb(data);
};
return ReportsStore.views.get(viewParams, additionalCallback, errorHandler);
};
// 1 full report
ReportsStore.reportDetails = function(id, cb) {
return ReportsStore.details.get({reportid: id}, cb);
};
ReportsStore.reportsPerFieldName = function(fieldName, cb, errorHandler) {
return ReportsStore.views.get({view: 'reports-per-' + fieldName, group_level: 1}, cb, errorHandler);
};
ReportsStore.appVersionsList = function(cb) {
return ReportsStore.views.get({view: 'recent-items-by-appver', group_level: 1}, cb);
};
ReportsStore.appVersionCodesList = function(cb) {
return ReportsStore.views.get({view: 'recent-items-by-appvercode', group_level: 1}, cb);
};
ReportsStore.androidVersionsList = function(cb) {
return ReportsStore.views.get({view: 'recent-items-by-androidver', group_level: 1}, cb);
};
// BUGS MANAGEMENT
var computeBugId = function(bug) {
if (bug.id) {
return bug.id;
} else {
return hex_md5(bug.key[0] + "|" + bug.key[1] + "|" + bug.key[2]);
}
};
ReportsStore.bugsList = function(cb, errorHandler) {
var viewParams = {
view: 'bugs',
descending: true,
group: true
};
var bugEqualityTest = function(bug2) {
if(this.value.latest !== bug2.value.latest ||
this.value.count !== bug2.value.count ||
this.value.solved !== bug2.value.solved ||
this.value.description !== bug2.value.description) {
return false;
}
return true;
};
var bugUpdate = function(bug2) {
if(this.value.latest !== bug2.value.latest) {
this.value.latest = bug2.value.latest;
}
if(this.value.count !== bug2.value.count) {
this.value.count = bug2.value.count;
}
if(this.value.solved !== bug2.value.solved) {
this.value.solved = bug2.value.solved;
}
if(this.value.description !== bug2.value.description) {
this.value.description = bug2.value.description;
}
};
var toggleSolved = function() {
var bug = this;
this.solvedPending = true;
ReportsStore.toggleSolvedBug(bug, function(data){
bug.solvedPending = false;
});
};
var additionalCallback = function(data) {
// The bug view does not return individual documents. Unless data has been specifically updated about
// one bug, there is no bug document in a database. We add here the computed id of each 'virtual' bug.
for (var i = 0; i < data.rows.length; i++) {
data.rows[i].id = computeBugId(data.rows[i]);
data.rows[i].equals = bugEqualityTest;
data.rows[i].updateWithBug = bugUpdate;
data.rows[i].toggleSolved = toggleSolved;
data.rows[i].descriptionHtml = converter.makeHtml(data.rows[i].value.description);
}
cb(data);
};
return ReportsStore.views.get(viewParams, additionalCallback, errorHandler);
};
ReportsStore.toggleSolvedBug = function(bug, callback) {
var curBug = ReportsStore.bug.get({ bugid: bug.id}, function() {
// Success callback
curBug.solved = ! curBug.solved;
var state = curBug.solved;
curBug.$save(function(data) {
bug.value.solved = state;
console.log("bug is now:");
console.log(bug);
callback(data);
});
}, function() {
// Fail callback
curBug = new ReportsStore.bug(
{
_id: bug.id,
APP_VERSION_CODE: bug.key[0],
digest: bug.key[1],
rootCause: bug.key[2],
solved: true,
type: "solved_signature"
});
curBug.$save(function(data) {
bug.value.solved = curBug.solved;
callback(data);
});
});
};
ReportsStore.saveBug = function(bug, callback) {
var curBug = ReportsStore.bug.get({ bugid: bug.id}, function() {
curBug.description = bug.value.description;
curBug.$save(callback);
}, function() {
// Fail callback
curBug = new ReportsStore.bug(
{
_id: bug.id,
APP_VERSION_CODE: bug.key[0],
digest: bug.key[1],
rootCause: bug.key[2],
solved: bug.value.solved,
type: "solved_signature",
description: bug.value.description
});
curBug.$save(callback);
});
};
ReportsStore.deleteReport = function(report, cb) {
var reportToDelete = ReportsStore.details.get({reportid: report.id}, function() {
ReportsStore.details.remove({reportid: report.id, rev: reportToDelete._rev}, cb);
});
};
/**
* Gets a single bug from its Id.
* @param bugId
* @param cb
*/
ReportsStore.getBugForId = function(bugId, cb) {
var bug = {};
ReportsStore.bugsList(function(data) {
console.log("looking for bug with id " + bugId);
for (var i = 0; i < data.rows.length; i++) {
if (data.rows[i].id === bugId) {
bug = data.rows[i];
console.log("Bug found:");
console.log(bug);
break;
}
}
cb(bug);
});
return bug;
};
// PURGES MANAGEMENT
/**
* Purge all reports older than given year/month/day.
* @param year Year of the oldest report to keep.
* @param month Month of the oldest report to keep.
* @param day Day of the oldest report to keep.
* @param intermediateCallback function called when the number of reports to purge is received. The number of
* reports is provided as the first function parameter.
* @param finalCallback Success callback (angular $http callback).
* @param errorHandler Failure callback (angular $http callback).
* @returns {*}
*/
ReportsStore.purgeReportsOlderThan = function(year, month, day, intermediateCallback, finalCallback, errorHandler) {
var result;
// This callback purges reports that will be retrieved by the request below
var additionalCallback = function(data) {
var docsToPurge = [];
console.log(data.rows.length + " reports to purge.");
intermediateCallback(data.rows.length);
for(var i = 0; i < data.rows.length; i++) {
var doc = { _id: data.rows[i].id, _rev: data.rows[i].value };
doc._deleted = true;
docsToPurge.push(doc);
console.log(doc);
}
console.log("Deleting " + docsToPurge.length + "reports.");
$http.post("/" + ReportsStore.dbName + "/_bulk_docs", { docs: docsToPurge })
.success(finalCallback);
};
// Fetch old reports to purge them via the previously defined callback
result = ReportsStore.views.get({
view: 'reports-revision-per-day',
startkey: '[' + year + ',' + month + ',' + day + ']',
descending: true
},
additionalCallback, errorHandler);
return result;
};
/**
* Purge all reports from app older than given version code.
* @param version Application version code
* @param intermediateCallback function called when the number of reports to purge is received. The number of
* reports is provided as the first function parameter.
* @param finalCallback Success callback (angular $http callback).
* @param errorHandler Failure callback (angular $http callback).
* @returns {*}
*/
ReportsStore.purgeReportsFromAppVersionCodeAndBelow = function(version, intermediateCallback, finalCallback, errorHandler) {
var result;
// This callback purges reports that will be retrieved by the request below
var additionalCallback = function(data) {
var docsToPurge = [];
console.log(data.rows.length + " reports to purge.");
intermediateCallback(data.rows.length);
for(var i = 0; i < data.rows.length; i++) {
var doc = { _id: data.rows[i].id, _rev: data.rows[i].value };
doc._deleted = true;
docsToPurge.push(doc);
console.log(doc);
}
console.log("Deleting " + docsToPurge.length + "reports.");
$http.post("/" + ReportsStore.dbName + "/_bulk_docs", { docs: docsToPurge })
.success(finalCallback);
};
// Fetch old reports to purge them via the previously defined callback
result = ReportsStore.views.get({
view: 'reports-revision-per-app-version-code',
endkey: version
},
additionalCallback, errorHandler);
return result;
};
// BACKGROUND POLLING MANAGEMENT
/**
* Background polling worker method. If new data is received, the provided callback is executed. Otherwise,
* if polling is still ok for this worker, immediately start a new request.
* @private
* @param {Function} cb Callback to execute when new data is received.
* @param {Number} workerId The
*/
ReportsStore.pollChanges = function(cb, workerId) {
console.log("Polling changes since = " + ReportsStore.lastseq + " (worker " + workerId + ")");
// Store the current dbName on polling start
var currentlyPolledDB = ReportsStore.dbName;
ReportsStore.changes.get(
{feed:'longpoll', since: ReportsStore.lastseq, include_docs: true},
function(data){
if(data.last_seq > ReportsStore.lastseq) {
// If the user asked to stop polling or changed DataBase, don't handle the result.
if(ReportsStore.continuePolling && ReportsStore.dbName === currentlyPolledDB && workerId === ReportsStore.currentWorkerId) {
console.log("New changes (worker " + workerId + ")");
cb(data);
ReportsStore.lastseq = data.last_seq;
}
}
if(ReportsStore.continuePolling && ReportsStore.dbName === currentlyPolledDB && workerId === ReportsStore.currentWorkerId) {
console.log("worker " + workerId + " continues");
ReportsStore.pollChanges(cb, workerId);
} else {
console.log("worker " + workerId + " stops");
}
},
function() {
console.log("Error while polling changes");
if(ReportsStore.continuePolling) {
ReportsStore.pollChanges(cb);
}
}
);
};
/**
* Initiates a new background polling worker.
* @param {function} cb Callback to execute when new data is received.
*/
ReportsStore.startPolling = function(cb) {
// Just in case the app has not been initialized yet.
if (ReportsStore.dbstate) {
ReportsStore.dbstate.get(
{},
// Success
function(data) {
if(ReportsStore.lastseq === -1) {
ReportsStore.lastseq = data.update_seq;
}
console.log("DB status retrieved, last_seq = " + ReportsStore.lastseq);
ReportsStore.continuePolling = true;
ReportsStore.currentWorkerId++;
ReportsStore.pollChanges(cb, ReportsStore.currentWorkerId);
},
// Error
function() {
ReportsStore.continuePolling = false;
$rootScope.$broadcast(acralyzerEvents.POLLING_FAILED);
console.log("Polling failed");
}
);
}
};
ReportsStore.stopPolling = function() {
console.log("STOP POLLING !");
ReportsStore.continuePolling = false;
};
ReportsStore.getUsersForBug = function(bug, cb) {
var viewParams = {
view: 'users-per-bug',
reduce: true,
group_level: 4
};
viewParams.startkey = JSON.stringify([bug.key[0], bug.key[1], bug.key[2]]);
viewParams.endkey = JSON.stringify([bug.key[0], bug.key[1], bug.key[2], {}]);
var result = [];
ReportsStore.views.get(viewParams,function(data) {
for(var row = 0; row < data.rows.length; row++) {
var user = {
installationId: data.rows[row].key[3],
reportsCount: data.rows[row].value
};
result.push(user);
}
if(cb) {
cb(result);
}
});
return result;
};
return ReportsStore;
}]);
})(window.acralyzerConfig,window.angular,window.acralyzerEvents,window.acralyzer,window.hex_md5,window.Showdown);
================================================
FILE: _attachments/script/service.user.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,acralyzer,acralyzerEvents,$,location,hex_sha1) {
"use strict";
/**
* Couchdb user service
*
* @class user
* @singleton
* @static
*/
acralyzer.service('$user', ['$rootScope', '$q', '$resource', '$http', function($rootScope, $q, $resource, $http) {
var SessionResource = $resource('/_session');
var UserResource;
var acralyzerDbName = location.pathname.split("/")[1];
var PreferencesResource = $resource("/" + acralyzerDbName + "/org.couchdb.user\\::name",
{'name':'@name'},
{'save': { method: 'PUT' }}
);
var _hasAdminPath;
var _session;
/*
* Resets the user object back to the default state
* @method reset
*/
var _reset = function($user) {
/**
* Username of current logged in user
*
* @property {String} username
* @type String
* @readOnly
*/
$user.username = null;
/**
* Is current user an admin
*
* @property {Boolean} isAdmin
* @type Boolean
* @readOnly
*/
$user.isAdmin = false;
/**
* Current users roles (as object)
*
* @property {Object} roles
* @type Object
* @readOnly
*/
$user.roles = {};
};
/*
* Updates the session of the current user
*
* @private
* @method _processSession
* @param {Promise} deferred Promise to update when completed
*/
var _processSession = function(data) {
if (!data) {
return _reset($user);
}
if (!UserResource)
{
UserResource = $resource(
'/' + data.info.authentication_db + '/org.couchdb.user\\::name',
{'name':'@name'},
{'save': { method: 'PUT' } }
);
}
/* Grab user session after login */
var userCtx = data.userCtx;
$user.roles = {};
userCtx.roles.forEach(function(role) {
$user.roles[role] = 1;
});
$user.isAdmin = ($user.roles['_admin'] === 1);
$user.username = userCtx.name;
if ($user.username) {
/* Load preferences for this user on this acralyzer db instance */
PreferencesResource.get({
name: $user.username
}, function(prefs){
if(prefs.defaultApp) {
console.log("Setting default app for current user to: ", prefs.defaultApp);
acralyzerConfig.defaultApp = prefs.defaultApp;
console.log("Broadcasting LOGGED_IN");
$rootScope.$broadcast(acralyzerEvents.LOGGED_IN, $user);
}
}, function() {
// No preferences for current user, log in anyway.
console.log("Broadcasting LOGGED_IN");
$rootScope.$broadcast(acralyzerEvents.LOGGED_IN, $user);
});
} else {
$rootScope.$broadcast(acralyzerEvents.LOGGED_OUT, $user);
}
$rootScope.$broadcast(acralyzerEvents.LOGIN_CHANGE, $user);
/* Does this box support changing admin passwords */
if ($user.username && $user.isAdmin && _hasAdminPath === undefined)
{
$http.get('/_config/admins/' + $user.username)
.success(function(data, status, headers, config) {
if (data.match(/^"-hashed-/)) {
_hasAdminPath = true;
} else {
_hasAdminPath = false;
}
}).error(function(data, status, headers, config) {
_hasAdminPath = false;
});
}
};
var $user = this;
/**
* Logs in the user.
*
* @method login
* @param {String} username Username to log in with
* @param {String} password Password to log in username with
*
* @return {Promise} Promise for completion of login
*/
$user.login = function(username, password) {
var deferred = $q.defer();
var data = {
name: username,
password: password
};
/* Disabled until 1.1 is stable as older couch needs x-www-form-urlencoded
* https://github.com/angular/angular.js/issues/736
var newSession = new SessionResource(data);
*/
var _newSessionPromise = $http.post(
'/_session',
$.param(data),
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
}
);
_newSessionPromise.then(function(sess) {
/* Apparently admin user doesn't return the ctx properly, so lets fetch it */
_session = SessionResource.get({}, function(a) {
/* success */
_processSession(a);
deferred.resolve($user);
});
}, function($http) {
deferred.reject();
});
return deferred.promise;
};
/**
* Changes the password of the currently logged in user
*
* Side effect: logs out user
*
* @method changePassword
* @param {String} password New Password for the user
*
* @return {Promise} Promise for completion of change password
*/
$user.changePassword = function(password) {
var deferred = $q.defer();
if (!password) {
deferred.reject("Missing password");
return deferred.promise;
}
if ($user.isAdmin && _hasAdminPath === true) {
$http.put('/_config/admins/'+$user.username, JSON.stringify(password))
.success(function() {
$user.logout();
deferred.resolve();
})
.error(function() {
deferred.reject(/* data.reason */);
});
return deferred.promise;
}
UserResource.get({ 'name': $user.username }, function(user) {
user.password = password;
user.$save(
function() {
$rootScope.$broadcast(acralyzerEvents.USER_PASSWORD_CHANGE, $user);
$rootScope.$broadcast(acralyzerEvents.LOGIN_CHANGE, $user);
$user.logout();
deferred.resolve();
},
function() {
console.log(arguments);
deferred.reject();
}
);
});
return deferred.promise;
};
/**
* Logout the current user
*
* @method logout
* @return {Promise} Promise for completion of logout
*/
$user.logout = function() {
var deferred = $q.defer();
_session.$delete(function() {
_reset($user);
$rootScope.$broadcast(acralyzerEvents.LOGGED_OUT, $user);
$rootScope.$broadcast(acralyzerEvents.LOGIN_CHANGE, $user);
deferred.resolve($user);
}, function() {
deferred.reject();
});
return deferred.promise;
};
/**
* Does this install support changing passwords?
*
* @method canChangePassword
* @return {Boolean} True if system can support changing password
*/
$user.canChangePassword = function() {
if ($user.isAdmin && !_hasAdminPath) {
return false;
}
return true;
};
/**
* Is the current logged in user a 'reader'
*
* @method isReader
* @return {Boolean} True if user is allowed to read data
*/
$user.isReader = function() {
if ($user.isAdmin || $user.roles.reader) {
return true;
}
return false;
};
$user.updatePreferences = function(prefs, callback, errorcallback) {
console.log("Store preferences ", prefs, " for user ", $user, " in database " + acralyzerDbName);
var curPrefs = PreferencesResource.get({ name: $user.username}, function() {
for(var pref in prefs) {
curPrefs[pref] = prefs[pref];
}
curPrefs.$save(callback, errorcallback);
}, function() {
// Fail callback
curPrefs = new PreferencesResource(
{
name: $user.username
}
);
for(var pref in prefs) {
curPrefs[pref] = prefs[pref];
}
curPrefs.$save(callback, errorcallback);
});
};
/**
* Try to login using current cookies.
*/
$user.init = function() {
/* Initialize all the variables */
_reset($user);
/* First time we grab our session from couchdb */
_session = SessionResource.get({}, function(a) {
/* success */
_processSession(a);
}, function() {
alert('Unable to connect to couchdb');
/* failure */
});
};
/**
* Create a new Reporter user (with roles "reader" and "reporter"), with support for all CouchDB versions.
* @param login
* @param password
* @param successCallback
* @param errorCallback
*/
$user.addReporterUser = function(login, password, successCallback, errorCallback) {
console.log("Create user " , login, password);
var userData = {
name: login,
roles: [ 'reporter', 'reader' ],
type: 'user'
};
if(acralyzer.createUsersWithHash) {
userData.salt = Math.random().toString(36).substring(2);
userData.password_sha = hex_sha1(password + userData.salt);
} else {
userData.password = password;
}
$http(
{
method: 'PUT',
url: '/_users/org.couchdb.user:' + login,
data: userData
}
).success(
function(data, status, headers, config) {
if(successCallback){
successCallback();
}
}
).error(
function(data, status, headers, config) {
if(errorCallback) {
errorCallback();
}
}
);
};
return $user;
}]);
})(window.acralyzerConfig, window.acralyzer, window.acralyzerEvents, window.jQuery, window.location, window.hex_sha1);
================================================
FILE: _attachments/script/services.js
================================================
/*
Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)
This file is part of Acralyzer.
Acralyzer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Acralyzer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Acralyzer. If not, see <http://www.gnu.org/licenses/>.
*/
(function(acralyzerConfig,acralyzer,$) {
"use strict";
acralyzer.factory('$notify', ['$timeout', function($timeout) {
var ret = {};
ret._alerts = [
];
var desktopNotifyAllowed, desktopNotifyObject;
/* data is an object with 'title', 'body' and optional 'icon' keys */
if ("Notification" in window && window.Notification.permissionLevel) {
desktopNotifyAllowed = function() { return window.Notification.permissionLevel() === "granted"; };
desktopNotifyObject = function(data) { return new window.Notification(data.title, data); };
}
else if (window.webkitNotifications) {
/* 0 = allowed, 1 = not allowed, 2 = denied */
desktopNotifyAllowed = function() { return window.webkitNotifications.checkPermission() === 0; };
desktopNotifyObject = function(data) { return new window.Notification(data.title, data); };
}
ret.desktop = function(data) {
if (!desktopNotifyAllowed()) { return; }
var timeout = data.timeout;
var notif = desktopNotifyObject(data);
/* undefined == not passed in */
if (timeout === undefined) { timeout = 10000; }
if (timeout > 0) {
notif.onshow = function() {
setTimeout(function(){
notif.close();
}, timeout);
};
}
notif.show();
};
['fatal','info','error','success','warning'].forEach(function(key) {
ret[key] = function(data) {
if (data.desktop) {
ret.desktop(data);
}
var alert = { type: key, msg: data.body };
ret._alerts.push(alert);
if (data.timeout > 0) {
$timeout(function() {
var index = ret._alerts.indexOf(alert);
ret._alerts.splice(index,1);
},data.timeout);
}
};
});
ret.remove = function(index) {
ret._alerts.splice(index,1);
};
return ret;
}]);
})(window.acralyzerConfig,window.acralyzer, window.jQuery);
================================================
FILE: _attachments/style/animations.css
================================================
/* Fade in/out */
.fade-enter-setup,
.fade-leave-setup {
-webkit-transition:all linear 0.5s;
-moz-transition:all linear 0.5s;
-ms-transition:all linear 0.5s;
-o-transition:all linear 0.5s;
transition:all linear 0.5s;
}
.fade-enter-setup {
opacity:0;
}
.fade-enter-start {
opacity:1;
}
.fade-enter-setup.fade-enter-start { }
.fade-leave-setup {
opacity:1;
}
.fade-leave-start {
opacity:0;
}
.fade-leave-setup.fade-leave-start { }
/* Next page */
.nextpage-enter-setup,
.nextpage-leave-setup {
-webkit-transition:all linear 0.5s;
-moz-transition:all linear 0.5s;
-ms-transition:all linear 0.5s;
-o-transition:all linear 0.5s;
transition:all linear 0.5s;
}
.nextpage-enter-setup {
opacity:0;
-webkit-transform: translateX(300px);
}
.nextpage-enter-start {
opacity:1;
-webkit-transform: translateX(0);
}
.nextpage-enter-setup.nextpage-enter-start { }
.nextpage-leave-setup {
opacity:1;
-webkit-transform: translateX(0);
}
.nextpage-leave-s
gitextract_3rawgk_a/
├── .bowerrc
├── .couchappignore
├── .couchapprc
├── .editorconfig
├── .ericaignore
├── .gitignore
├── .jshintignore
├── .jshintrc
├── .travis.yml
├── Gruntfile.js
├── LICENSE
├── README.md
├── _attachments/
│ ├── banner
│ ├── index.html
│ ├── partials/
│ │ ├── admin.html
│ │ ├── bug-details.html
│ │ ├── bugs-browser.html
│ │ ├── bugs-table.html
│ │ ├── change-password.html
│ │ ├── dashboard.html
│ │ ├── login-dialog.html
│ │ ├── paginator.html
│ │ ├── report-details.html
│ │ ├── reports-browser.html
│ │ └── reports-table.html
│ ├── script/
│ │ ├── AccountControllers.js
│ │ ├── AcralyzerControllers.js
│ │ ├── AcralyzerEvents.js
│ │ ├── AdminControllers.js
│ │ ├── AlertController.js
│ │ ├── BugsBrowserControllers.js
│ │ ├── DashboardControllers.js
│ │ ├── NavigationController.js
│ │ ├── ReportDetailsController.js
│ │ ├── ReportsBrowserControllers.js
│ │ ├── app.js
│ │ ├── clipboard.js
│ │ ├── config.js
│ │ ├── service.monsterid.js
│ │ ├── service.reportsstore.js
│ │ ├── service.user.js
│ │ └── services.js
│ ├── style/
│ │ ├── animations.css
│ │ ├── graph.css
│ │ └── main.css
│ └── vendor/
│ ├── bootstrap/
│ │ ├── css/
│ │ │ ├── bootstrap-responsive.css
│ │ │ └── bootstrap.css
│ │ └── js/
│ │ └── bootstrap.js
│ ├── jshash/
│ │ ├── md5-min.js
│ │ └── sha1.js
│ ├── padolsey/
│ │ └── prettyprint.js
│ ├── showdown/
│ │ ├── extensions/
│ │ │ ├── github.js
│ │ │ ├── prettify.js
│ │ │ ├── table.js
│ │ │ └── twitter.js
│ │ └── showdown.js
│ └── zeroclipboard/
│ └── ZeroClipboard.swf
├── _id
├── component.json
├── couchapp.json
├── imgsrc/
│ ├── bug.psd
│ └── bugdroid-wait.psd
├── language
├── package.json
└── usertemplates/
├── reader.json
└── reporter.json
SYMBOL INDEX (62 symbols across 13 files)
FILE: _attachments/script/AccountControllers.js
function AccountCtrl (line 22) | function AccountCtrl($scope, $user, $dialog) {
function LoginDialogCtrl (line 54) | function LoginDialogCtrl($scope, $user, dialog) {
function ChangePasswordDialogCtrl (line 78) | function ChangePasswordDialogCtrl($scope, $user, dialog) {
FILE: _attachments/script/AcralyzerControllers.js
function AcralyzerCtrl (line 27) | function AcralyzerCtrl($user, $scope, ReportsStore, $rootScope, $notify,...
FILE: _attachments/script/AdminControllers.js
function AdminCtrl (line 23) | function AdminCtrl($scope, ReportsStore, $routeParams, $notify, $user, $...
FILE: _attachments/script/AlertController.js
function AlertCtrl (line 22) | function AlertCtrl($scope, $notify) {
FILE: _attachments/script/BugsBrowserControllers.js
function BugsBrowserCtrl (line 22) | function BugsBrowserCtrl($scope, ReportsStore, $routeParams) {
FILE: _attachments/script/DashboardControllers.js
function getBidimensionalArray (line 22) | function getBidimensionalArray(rows) {
function CrashReportsCtrl (line 43) | function CrashReportsCtrl($scope, ReportsStore) {
function BugsCtrl (line 89) | function BugsCtrl($scope, ReportsStore, $filter) {
function ReportsPerDayCtrl (line 170) | function ReportsPerDayCtrl($scope, ReportsStore, $user) {
function PieChartsCtrl (line 374) | function PieChartsCtrl($scope, ReportsStore, $user) {
function DashboardCtrl (line 564) | function DashboardCtrl($scope, $routeParams) {
FILE: _attachments/script/NavigationController.js
function NavigationCtrl (line 22) | function NavigationCtrl($scope, $route, $dialog) {
FILE: _attachments/script/ReportDetailsController.js
function ReportDetailsCtrl (line 22) | function ReportDetailsCtrl($scope, $routeParams, ReportsStore) {
FILE: _attachments/script/ReportsBrowserControllers.js
function ReportsBrowserCtrl (line 22) | function ReportsBrowserCtrl($scope, ReportsStore, $routeParams) {
FILE: _attachments/vendor/bootstrap/js/bootstrap.js
function removeElement (line 115) | function removeElement() {
function clearMenus (line 739) | function clearMenus() {
function getParent (line 745) | function getParent($this) {
function removeWithAnimation (line 1278) | function removeWithAnimation() {
function ScrollSpy (line 1549) | function ScrollSpy(element, options) {
function next (line 1760) | function next() {
FILE: _attachments/vendor/jshash/md5-min.js
function hex_md5 (line 9) | function hex_md5(a){return rstr2hex(rstr_md5(str2rstr_utf8(a)))}
function hex_hmac_md5 (line 9) | function hex_hmac_md5(a,b){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(a...
function md5_vm_test (line 9) | function md5_vm_test(){return hex_md5("abc").toLowerCase()=="900150983cd...
function rstr_md5 (line 9) | function rstr_md5(a){return binl2rstr(binl_md5(rstr2binl(a),a.length*8))}
function rstr_hmac_md5 (line 9) | function rstr_hmac_md5(c,f){var e=rstr2binl(c);if(e.length>16){e=binl_md...
function rstr2hex (line 9) | function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"01234...
function str2rstr_utf8 (line 9) | function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d<c.length){...
function rstr2binl (line 9) | function rstr2binl(b){var a=Array(b.length>>2);for(var c=0;c<a.length;c+...
function binl2rstr (line 9) | function binl2rstr(b){var a="";for(var c=0;c<b.length*32;c+=8){a+=String...
function binl_md5 (line 9) | function binl_md5(p,k){p[k>>5]|=128<<((k)%32);p[(((k+64)>>>9)<<4)+14]=k;...
function md5_cmn (line 9) | function md5_cmn(h,e,d,c,g,f){return safe_add(bit_rol(safe_add(safe_add(...
function md5_ff (line 9) | function md5_ff(g,f,k,j,e,i,h){return md5_cmn((f&k)|((~f)&j),g,f,e,i,h)}
function md5_gg (line 9) | function md5_gg(g,f,k,j,e,i,h){return md5_cmn((f&j)|(k&(~j)),g,f,e,i,h)}
function md5_hh (line 9) | function md5_hh(g,f,k,j,e,i,h){return md5_cmn(f^k^j,g,f,e,i,h)}
function md5_ii (line 9) | function md5_ii(g,f,k,j,e,i,h){return md5_cmn(k^(f|(~j)),g,f,e,i,h)}
function safe_add (line 9) | function safe_add(a,d){var c=(a&65535)+(d&65535);var b=(a>>16)+(d>>16)+(...
function bit_rol (line 9) | function bit_rol(a,b){return(a<<b)|(a>>>(32-b))}
FILE: _attachments/vendor/jshash/sha1.js
function hex_sha1 (line 21) | function hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }
function b64_sha1 (line 22) | function b64_sha1(s) { return rstr2b64(rstr_sha1(str2rstr_utf8(s))); }
function any_sha1 (line 23) | function any_sha1(s, e) { return rstr2any(rstr_sha1(str2rstr_utf8(s)), e...
function hex_hmac_sha1 (line 24) | function hex_hmac_sha1(k, d)
function b64_hmac_sha1 (line 26) | function b64_hmac_sha1(k, d)
function any_hmac_sha1 (line 28) | function any_hmac_sha1(k, d, e)
function sha1_vm_test (line 34) | function sha1_vm_test()
function rstr_sha1 (line 42) | function rstr_sha1(s)
function rstr_hmac_sha1 (line 50) | function rstr_hmac_sha1(key, data)
function rstr2hex (line 69) | function rstr2hex(input)
function rstr2b64 (line 87) | function rstr2b64(input)
function rstr2any (line 110) | function rstr2any(input, encoding)
function str2rstr_utf8 (line 163) | function str2rstr_utf8(input)
function str2rstr_utf16le (line 202) | function str2rstr_utf16le(input)
function str2rstr_utf16be (line 211) | function str2rstr_utf16be(input)
function rstr2binb (line 224) | function rstr2binb(input)
function binb2rstr (line 237) | function binb2rstr(input)
function binb_sha1 (line 248) | function binb_sha1(x, len)
function sha1_ft (line 296) | function sha1_ft(t, b, c, d)
function sha1_kt (line 307) | function sha1_kt(t)
function safe_add (line 317) | function safe_add(x, y)
function bit_rol (line 327) | function bit_rol(num, cnt)
FILE: _attachments/vendor/showdown/showdown.js
function b (line 62) | function b(a){return a.replace(/[^\w]/g,"").toLowerCase()}
Condensed preview — 66 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (494K chars).
[
{
"path": ".bowerrc",
"chars": 38,
"preview": "{\n \"directory\": \"app/components\"\n}\n"
},
{
"path": ".couchappignore",
"chars": 309,
"preview": "[\n \"^dist$\",\n \"^node_modules$\",\n \".couchapp_deploy\",\n \"testacular.conf\",\n \"component.json\",\n \"Gruntfile.js\",\n \"pa"
},
{
"path": ".couchapprc",
"chars": 2,
"preview": "{}"
},
{
"path": ".editorconfig",
"chars": 425,
"preview": "; EditorConfig is awesome: http://EditorConfig.org\nroot = true ; top-most EditorConfig file\n\n; Unix-style newlines with"
},
{
"path": ".ericaignore",
"chars": 312,
"preview": "[\n \"^dist$\",\n \"^node_modules$\",\n \".couchapp_deploy\",\n \"testacular.conf\",\n \"component.json\",\n \"Gruntfile.js\",\n \"pa"
},
{
"path": ".gitignore",
"chars": 42,
"preview": ".idea\nnode_modules/\ndist\n.couchapp_deploy\n"
},
{
"path": ".jshintignore",
"chars": 20,
"preview": "_attachments/vendor\n"
},
{
"path": ".jshintrc",
"chars": 412,
"preview": "{\n \"predef\": [\n \"angular\",\n \"moment\",\n\n \"d3\",\n \"prettyPrint\"\n ],\n \"indent\": 4,\n "
},
{
"path": ".travis.yml",
"chars": 120,
"preview": "language: node_js\nnode_js:\n - 0.8\nbefore_script:\n - npm install -g grunt-cli\n - npm install\nscript:\n - grunt jshint\n"
},
{
"path": "Gruntfile.js",
"chars": 6492,
"preview": "/*jshint node:true*/\n'use strict';\nvar url = require('url');\nvar util = require('util');\n\n// # Globbing\n// for performan"
},
{
"path": "LICENSE",
"chars": 35146,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "README.md",
"chars": 2028,
"preview": "[](https://flattr.com/submit/auto?user_id=kev"
},
{
"path": "_attachments/banner",
"chars": 709,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/index.html",
"chars": 8775,
"preview": "<!DOCTYPE html>\n<html ng-app=\"Acralyzer\" ng-controller=\"AcralyzerCtrl\">\n <head>\n <!--\n Copyright 2013 Kevin Gaudi"
},
{
"path": "_attachments/partials/admin.html",
"chars": 4214,
"preview": "<div class=\"container-fluid\">\n <h2>\n Administration\n </h2>\n <div id=\"content\">\n <tabs>\n "
},
{
"path": "_attachments/partials/bug-details.html",
"chars": 2966,
"preview": "<div ng-show=\"bug.id\">\n <div class=\"bug-details-header\">\n <div class=\"direct-link\"><a href=\"#/reports-browser/"
},
{
"path": "_attachments/partials/bugs-browser.html",
"chars": 1177,
"preview": "<div class=\"container-fluid\">\n <h2>Browse bugs</h2>\n <div id=\"content\">\n <div id=\"filters\" class=\"row-fluid"
},
{
"path": "_attachments/partials/bugs-table.html",
"chars": 3199,
"preview": "<div ng-hide=\"loading\" class=\"div-table table table-condensed bugs\">\n <div class=\"div-table-row header\">\n <div"
},
{
"path": "_attachments/partials/change-password.html",
"chars": 1827,
"preview": "<form name=\"changePasswordForm\" class=\"form-horizontal\">\n <div class=\"modal-header\">\n <h3>Change Password</h3>"
},
{
"path": "_attachments/partials/dashboard.html",
"chars": 2142,
"preview": "<div class=\"container-fluid\">\n <div id=\"charts\" class=\"row-fluid\">\n <div id=\"graph-container\" ng-controller=\"R"
},
{
"path": "_attachments/partials/login-dialog.html",
"chars": 1436,
"preview": "<form name=\"loginForm\" class=\"form-horizontal\">\n <div class=\"modal-header\">\n <h3>Login</h3>\n </div>\n <di"
},
{
"path": "_attachments/partials/paginator.html",
"chars": 450,
"preview": "<div class=\"form-inline paginator\">\n <button ng-disabled=\"isFirstPage()\" ng-click=\"decPage()\" class=\"btn\"><i class=\"i"
},
{
"path": "_attachments/partials/report-details.html",
"chars": 2337,
"preview": "<div ng-show=\"report._id\">\n <hr/>\n <div class=\"report-details-header\">\n <div class=\"direct-link\"><a href=\"#"
},
{
"path": "_attachments/partials/reports-browser.html",
"chars": 2052,
"preview": "<div class=\"container-fluid\">\n <h2>Browse reports</h2>\n <div id=\"content\">\n <bug-details bug=\"bug\" acralyze"
},
{
"path": "_attachments/partials/reports-table.html",
"chars": 2167,
"preview": "<div class=\"div-table reports-table\" ng-hide=\"loading\">\n <div class=\"div-table-row\">\n <div class=\"div-table-ce"
},
{
"path": "_attachments/script/AccountControllers.js",
"chars": 3779,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/AcralyzerControllers.js",
"chars": 6620,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/AcralyzerEvents.js",
"chars": 1278,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/AdminControllers.js",
"chars": 6306,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/AlertController.js",
"chars": 1064,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/BugsBrowserControllers.js",
"chars": 6499,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/DashboardControllers.js",
"chars": 23728,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/NavigationController.js",
"chars": 1023,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/ReportDetailsController.js",
"chars": 1576,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/ReportsBrowserControllers.js",
"chars": 10138,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/app.js",
"chars": 11959,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/clipboard.js",
"chars": 1142,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/config.js",
"chars": 337,
"preview": "(function(acralyzerConfig, undefined ) {\n \"use strict\";\n // Update this variable with the name of your app:\n ac"
},
{
"path": "_attachments/script/service.monsterid.js",
"chars": 1594,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/service.reportsstore.js",
"chars": 21868,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/service.user.js",
"chars": 12398,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/script/services.js",
"chars": 2986,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/style/animations.css",
"chars": 3061,
"preview": "\n/* Fade in/out */\n.fade-enter-setup,\n.fade-leave-setup {\n -webkit-transition:all linear 0.5s;\n -moz-transition:al"
},
{
"path": "_attachments/style/graph.css",
"chars": 1422,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/style/main.css",
"chars": 5279,
"preview": "/*\n Copyright 2013 Kevin Gaudin (kevin.gaudin@gmail.com)\n\n This file is part of Acralyzer.\n\n Acralyzer is free software:"
},
{
"path": "_attachments/vendor/bootstrap/css/bootstrap-responsive.css",
"chars": 22111,
"preview": "/*!\n * Bootstrap Responsive v2.3.1\n *\n * Copyright 2012 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http:/"
},
{
"path": "_attachments/vendor/bootstrap/css/bootstrap.css",
"chars": 127247,
"preview": "/*!\n * Bootstrap v2.3.1\n *\n * Copyright 2012 Twitter, Inc\n * Licensed under the Apache License v2.0\n * http://www.apache"
},
{
"path": "_attachments/vendor/bootstrap/js/bootstrap.js",
"chars": 61752,
"preview": "/* ===================================================\n * bootstrap-transition.js v2.3.1\n * http://twitter.github.com/bo"
},
{
"path": "_attachments/vendor/jshash/md5-min.js",
"chars": 5275,
"preview": "/*\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321"
},
{
"path": "_attachments/vendor/jshash/sha1.js",
"chars": 9317,
"preview": "/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS 180-1\n * Version 2.2 Copyri"
},
{
"path": "_attachments/vendor/padolsey/prettyprint.js",
"chars": 22209,
"preview": "/*\nCopyright (c) 2009 James Padolsey. All rights reserved.\n\nRedistribution and use in source and binary forms, with or "
},
{
"path": "_attachments/vendor/showdown/extensions/github.js",
"chars": 385,
"preview": "//\n// Github Extension (WIP)\n// ~~strike-through~~ -> <del>strike-through</del>\n//\n(function(){var a=function(a){re"
},
{
"path": "_attachments/vendor/showdown/extensions/prettify.js",
"chars": 560,
"preview": "//\n// Google Prettify\n// A showdown extension to add Google Prettify (http://code.google.com/p/google-code-prettify/)\n"
},
{
"path": "_attachments/vendor/showdown/extensions/table.js",
"chars": 1896,
"preview": "/*global module:true*//*\n * Basic table support with re-entrant parsing, where cell content\n * can also specify markdown"
},
{
"path": "_attachments/vendor/showdown/extensions/twitter.js",
"chars": 704,
"preview": "//\n// Twitter Extension\n// @username -> <a href=\"http://twitter.com/username\">@username</a>\n// #hashtag -> <a "
},
{
"path": "_attachments/vendor/showdown/showdown.js",
"chars": 11304,
"preview": "//\n// showdown.js -- A javascript port of Markdown.\n//\n// Copyright (c) 2007 John Fraser.\n//\n// Original Markdown Copyri"
},
{
"path": "_id",
"chars": 17,
"preview": "_design/acralyzer"
},
{
"path": "component.json",
"chars": 329,
"preview": "{\n \"name\": \"a2\",\n \"version\": \"0.0.0\",\n \"dependencies\": {\n \"modernizr\": \"~2.6.2\",\n \"jquery\": \"~1.9.1\",\n \"boot"
},
{
"path": "couchapp.json",
"chars": 89,
"preview": "{\n \"name\": \"Acralyzer\",\n \"description\": \"CouchDB backend for ACRA crash reports.\"\n}"
},
{
"path": "language",
"chars": 10,
"preview": "javascript"
},
{
"path": "package.json",
"chars": 1355,
"preview": "{\n \"name\": \"acralyzer\",\n \"version\": \"0.0.0\",\n \"description\": \"Open source backend for ACRA reports.\",\n \"main\": \"Grun"
},
{
"path": "usertemplates/reader.json",
"chars": 149,
"preview": "{\n \"_id\": \"org.couchdb.user:readeruser\",\n \"name\": \"readeruser\",\n \"roles\": [\"reader\"],\n \"type\": \"user\",\n \""
},
{
"path": "usertemplates/reporter.json",
"chars": 157,
"preview": "{\n \"_id\": \"org.couchdb.user:reporteruser\",\n \"name\": \"reporteruser\",\n \"roles\": [\"reporter\"],\n \"type\": \"user\","
}
]
// ... and 3 more files (download for full content)
About this extraction
This page contains the full source code of the ACRA/acralyzer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 66 files (456.8 KB), approximately 127.2k tokens, and a symbol index with 62 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.