Skip to content

Commit

Permalink
feat: show tb version, remove sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
reisxd committed Sep 8, 2024
1 parent 34eb235 commit b85cea7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 191 deletions.
2 changes: 1 addition & 1 deletion tizenbrew-app/TizenBrew/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="https://tizentube.vercel.app" version="1.3.5" viewmodes="maximized">
<widget xmlns:tizen="http://tizen.org/ns/widgets" xmlns="http://www.w3.org/ns/widgets" id="https://tizentube.vercel.app" version="1.3.6" viewmodes="maximized">
<access origin="*" subdomains="true"></access>
<tizen:app-control>
<tizen:src name="index.html" reload="disable"/>
Expand Down
1 change: 1 addition & 0 deletions tizenbrew-app/TizenBrew/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ body {
.status {
font-size: 1.5vw;
padding: 0.5rem;
margin-top: 1rem;
border: 0.5px solid #aaa;
color: snow;
border-radius: 16px;
Expand Down
12 changes: 4 additions & 8 deletions tizenbrew-app/TizenBrew/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

<html>
<head>
<script src="https://browser.sentry-cdn.com/6.0.0/bundle.min.js" crossorigin="anonymous"></script>
<script>
Sentry.init({
dsn: "https://[email protected]/gt/2",
tracesSampleRate: 0.01,
});
</script>
<title>TizenBrew</title>

<script type="text/javascript" src="$WEBAPIS/webapis/webapis.js"></script>
Expand All @@ -34,7 +27,10 @@
</div>
</div>

<p class="status" id="wsText">Status</p>
<div>
<p class="status" id="wsText">Status</p>
<p class="status" id="version">Version</p>
</div>
</div>

<div class="error-card">
Expand Down
7 changes: 7 additions & 0 deletions tizenbrew-app/TizenBrew/js/wsClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ function onMessage(msg) {
send({ type: 'startService', package: JSON.parse(localStorage.getItem('autoLaunchService')) });
}
send({ type: 'getServiceStatuses' });

fetch('config.xml').then(res => res.text()).then(xml => {
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(xml, 'text/xml');
const version = xmlDoc.getElementsByTagName('widget')[0].attributes.version.nodeValue
document.getElementById('version').innerText = `v${version}`;
});
} else {
send({ type: 'canLaunchInDebug' });
}
Expand Down
168 changes: 0 additions & 168 deletions tizenbrew-app/TizenBrew/service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tizenbrew-app/TizenBrew/service/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"dependencies": {
"@sentry/node": "^4.6.6",
"adbhost": "^0.0.2",
"express": "^4.19.2",
"node-fetch": "^2.7.0",
Expand Down
11 changes: 0 additions & 11 deletions tizenbrew-app/TizenBrew/service/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@
// TizenBrew Standalone Service
// I wish I've seen running Node.JS on Tizen way before...

const Sentry = require('@sentry/node');

Sentry.init({ dsn: 'https://[email protected]:8001/1' });

Sentry.configureScope(scope => {
scope.setTag('platformVersion', tizen.systeminfo.getCapability("http://tizen.org/feature/platform.version"));
scope.setTag('nodeVersion', process.version);
});

global.Sentry = Sentry;

module.exports.onStart = function () {
console.log('Service started.');
const adbhost = require('adbhost');
Expand Down
3 changes: 1 addition & 2 deletions tizenbrew-app/TizenBrew/service/serviceLauncher.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function startService(module, pkg) {
let sandbox = {};

Object.getOwnPropertyNames(global).forEach(prop => {
const disAllowed = ['services', 'module', 'global', 'inDebug', 'currentClient', 'currentModule', 'Sentry'];
const disAllowed = ['services', 'module', 'global', 'inDebug', 'currentClient', 'currentModule'];
// Node.js v4.4.3 does not have Array.prototype.includes...
if (disAllowed.indexOf(prop) >= 0) return;
sandbox[prop] = global[prop];
Expand All @@ -29,7 +29,6 @@ function startService(module, pkg) {
try {
vm.runInContext(script, global.services.get(pkg).context);
} catch (e) {
global.Sentry.captureException(e);
global.services.get(pkg).hasCrashed = true;
global.services.get(pkg).error = e;
}
Expand Down

0 comments on commit b85cea7

Please sign in to comment.