2019-01-02 20:36:00 +01:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<div class="row">
|
|
|
|
<span class="label">Ultrawidify version:</span><br/> {{addonVersion}}
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
2020-01-16 01:01:04 +01:00
|
|
|
<span class="label">Having an issue?</span><br/> Report <strike>undocumented features</strike> bugs using one of the following options (in order of preference):
|
2019-01-02 20:36:00 +01:00
|
|
|
<ul>
|
2019-06-14 22:05:29 +02:00
|
|
|
<li> <a target="_blank" href="https://github.com/xternal7/ultrawidify/issues"><b>Github (preferred)</b></a><br/></li>
|
2019-11-02 21:58:55 +01:00
|
|
|
<li>Email: <a target="_blank" :href="mailtoLink">tamius.han@gmail.com</a></li>
|
|
|
|
<li>PM me on <a target="_blank" :href="redditLink">reddit</a><br/></li>
|
2019-01-02 20:36:00 +01:00
|
|
|
</ul>
|
2020-01-16 01:01:04 +01:00
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<span class="label">Swatter mode (logging)</span><br/>
|
|
|
|
<span class="info">
|
|
|
|
<small>
|
|
|
|
This requires 'download' permission. You will be prompted when saving file. Logger configuration may
|
|
|
|
attempt to automatically download the log after collecting relevant data. Logging will reload the tab
|
|
|
|
you're currently using. <b>Performance may be severely reduced while logging is active. Turn it on when
|
|
|
|
asked and then turn it off when you're done.</b>
|
|
|
|
</small>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<b>Logger configuration:</b> <span v-if="loggerEnabled">ACTIVE!</span><br/>
|
|
|
|
<small v-if="loggerSettingsError"><b>Parsing settings failed — there is a problem with settings!</b></small>
|
|
|
|
<input type="textarea" v-model="loggerSettings"/>
|
|
|
|
</div>
|
|
|
|
<div class="flex flex-row">
|
|
|
|
<ShortcutButton class="flex flex-grow button"
|
|
|
|
label="Save settings & start logging"
|
|
|
|
:active="loggingEnabled"
|
|
|
|
@click.native="startLogging()"
|
|
|
|
></ShortcutButton>
|
|
|
|
<ShortcutButton class="flex flex-grow button"
|
|
|
|
label="Make a mark"
|
|
|
|
@click.native="sendMark()"
|
|
|
|
></ShortcutButton>
|
|
|
|
<ShortcutButton class="flex flex-grow button"
|
|
|
|
label="Stop logging"
|
|
|
|
@click.native="stopLogging()"
|
|
|
|
></ShortcutButton>
|
2019-01-02 20:36:00 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
2020-01-16 01:01:04 +01:00
|
|
|
|
2019-01-02 20:36:00 +01:00
|
|
|
<script>
|
2020-01-16 01:01:04 +01:00
|
|
|
import ShortcutButton from '../../common/components/ShortcutButton';
|
2019-11-02 21:58:55 +01:00
|
|
|
import BrowserDetect from '../../ext/conf/BrowserDetect';
|
2020-01-16 01:01:04 +01:00
|
|
|
import Logger from '../../ext/lib/Logger';
|
|
|
|
|
2019-01-02 20:36:00 +01:00
|
|
|
export default {
|
2020-01-16 01:01:04 +01:00
|
|
|
components: {
|
|
|
|
ShortcutButton,
|
|
|
|
},
|
2019-04-12 23:23:35 +02:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
addonVersion: browser.runtime.getManifest().version || chrome.runtime.getManifest().version,
|
2019-11-02 21:58:55 +01:00
|
|
|
mailtoLink: 'mailto:tamius.han@gmail.com',
|
|
|
|
redditLink: '',
|
2019-04-12 23:23:35 +02:00
|
|
|
}
|
2019-11-02 21:58:55 +01:00
|
|
|
},
|
2020-01-16 01:01:04 +01:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
loggingEnabled: undefined,
|
|
|
|
loggerSettings: '',
|
|
|
|
loggerSettingsError: false,
|
|
|
|
lastLoadedLoggerSettings: undefined,
|
|
|
|
mailtoLink: '',
|
|
|
|
redditLink: '',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
async created() {
|
2019-11-02 21:58:55 +01:00
|
|
|
const messageTemplate = encodeURIComponent(
|
|
|
|
`Describe your issue in more detail. In case of misaligned videos, please provide screenshots. When reporting\
|
|
|
|
issues with autodetection not detecting aspect ratio correctly, please provide a link with timestamp to the\
|
|
|
|
problematic video at the time where the problem happens. You may delete this paragraph, as it's only a template.
|
|
|
|
|
|
|
|
|
2020-01-15 23:37:34 +01:00
|
|
|
Extension info (AUTOGENERATED — DO NOT CHANGE OR REMOVE):
|
|
|
|
* Build: ${BrowserDetect.processEnvBrowser}-${this.addonVersion}-stable
|
2019-11-02 21:58:55 +01:00
|
|
|
|
|
|
|
Browser-related stuff (please ensure this section is correct):
|
|
|
|
* User Agent string: ${window.navigator.userAgent}
|
|
|
|
* vendor: ${window.navigator.vendor}
|
|
|
|
* Operating system: ${window.navigator.platform}
|
|
|
|
`
|
|
|
|
);
|
|
|
|
this.mailtoLink = `mailto:tamius.han@gmail.com?subject=%5BUltrawidify%5D%20ENTER%20SUMMARY%20OF%20YOUR%20ISSUE%20HERE&body=${messageTemplate}`;
|
|
|
|
this.redditLink = `https://www.reddit.com/message/compose?to=xternal7&subject=[Ultrawidify]%20ENTER%20SUMMARY%20OF%20YOUR%20PROBLEM%20HERE&message=${messageTemplate}`;
|
2020-01-16 01:01:04 +01:00
|
|
|
|
|
|
|
const loggerSettingsAll = await Logger.getConfig();
|
|
|
|
|
|
|
|
this.loadLoggerSettings(loggerSettingsAll);
|
|
|
|
|
|
|
|
// ensure that logger conf gets updated (in case of timed logger)
|
|
|
|
Logger.syncConfig(x => this.loadLoggerSettings(x));
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
loadLoggerSettings(conf) {
|
|
|
|
this.loggingEnabled = conf.allowLogging;
|
|
|
|
this.lastLoadedLoggerSettings = {
|
|
|
|
logToFile: conf.logToFile,
|
|
|
|
logToConsole: conf.logToConsole,
|
|
|
|
fileOptions: conf.fileOptions,
|
|
|
|
consoleOptions: conf.consoleOptions
|
|
|
|
};
|
|
|
|
this.loggerSettings = JSON.stringify(lastLoadedSettings, null, 2);
|
|
|
|
},
|
|
|
|
async updateLoggerSettings(allowLogging) {
|
|
|
|
this.loggingEnabled = allowLogging;
|
|
|
|
if (allowLogging) {
|
|
|
|
const parsedSettings = JSON.parse(this.loggerSettings);
|
|
|
|
Logger.saveConfig({
|
|
|
|
allowLogging: allowLogging,
|
|
|
|
logToFile: parsedSettings.logToFile || false,
|
|
|
|
logToConsole: parsedSettings.logToConsole || false,
|
|
|
|
fileOptions: parsedSettings.fileOptions || {},
|
|
|
|
consoleOptions: parsedSettings.consoleOptions || {},
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
// we need to save logger settings because logging is triggered by allow logging
|
|
|
|
Logger.saveConfig({allowLogging: allowLogging, ...lastLoadedLoggerSettings});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
startLogging() {
|
|
|
|
try {
|
|
|
|
JSON.parse(this.loggerSettings);
|
|
|
|
this.loggerSettingsError = false;
|
|
|
|
this.updateLoggerSettings(true);
|
|
|
|
} catch (e) {
|
|
|
|
console.error("Cannot parse logger config json!");
|
|
|
|
this.loggerSettingsError = true;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
sendMark() {
|
|
|
|
|
|
|
|
},
|
|
|
|
endLogging() {
|
|
|
|
updateLoggerSettings(false);
|
|
|
|
}
|
2019-01-02 20:36:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|