Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
chore: add OBS Status icon, i18n notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
sircharlo committed Jun 12, 2024
1 parent 4390705 commit 8fe9069
Show file tree
Hide file tree
Showing 29 changed files with 710 additions and 543 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 80
8 changes: 4 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ module.exports = {

// https://github.com/prettier/eslint-config-prettier#installation
// usage with Prettier, provided by 'eslint-config-prettier'.
'plugin:perfectionist/recommended-natural',
'prettier',
"plugin:perfectionist/recommended-natural",
],

plugins: [
// required to apply rules which need type information
'@typescript-eslint',
'perfectionist',

// https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
// required to lint *.vue files
Expand All @@ -52,6 +50,8 @@ module.exports = {
// https://github.com/typescript-eslint/typescript-eslint/issues/389#issuecomment-509292674
// Prettier has not been included as plugin to avoid performance impact
// add it as an extension for your IDE
'perfectionist',
'@typescript-eslint',
],

globals: {
Expand Down Expand Up @@ -85,6 +85,6 @@ module.exports = {

// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
"perfectionist/sort-interfaces": "error",
'perfectionist/sort-interfaces': 'error',
},
};
14 changes: 13 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"icns",
"iscoweek",
"jwlplaylist",
"jwpub",
"Jwpub",
"klaw",
"langwritten",
Expand All @@ -31,5 +32,16 @@
],
"i18n-ally.localesPaths": ["src/i18n"],
"i18n-ally.sourceLanguage": "en-US",
"i18n-ally.keystyle": "flat"
"i18n-ally.keystyle": "flat",

"prettier.useEditorConfig": false,
"prettier.useTabs": false,
"prettier.configPath": ".prettierrc",

"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"notebook.formatOnSave.enabled": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"electron-builder": "^24.3.0",
"electron-rebuild": "^3.2.9",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-perfectionist": "^2.10.0",
"eslint-plugin-vue": "^9.0.0",
"node-polyfill-webpack-plugin": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src-electron/electron-preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const isWritable = (filePath: fs.PathLike) => {
fs.closeSync(fs.openSync(filePath, 'r+'));
fileAccess = true;
} catch (err) {
console.log('can not open file:' + filePath, 'error:' + err);
console.error('can not open file:' + filePath, 'error:' + err);
}
return fileAccess;
};
Expand Down
5 changes: 1 addition & 4 deletions src/boot/axios.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { boot } from 'quasar/wrappers';
console.log('axios start');
import axios, { AxiosRequestConfig } from 'axios';
import { boot } from 'quasar/wrappers';
export default boot(({ app }) => {
app.config.globalProperties.$axios = axios;
});
Expand Down Expand Up @@ -40,6 +39,4 @@ const getYeartext = async (lang: string, year?: number) => {
return await get(urlWithParamsToString(url, params));
};

console.log('axios end');

export { get, getLanguages, getYeartext, urlWithParamsToString };
11 changes: 0 additions & 11 deletions src/boot/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
console.log('i18n start');
import { boot } from 'quasar/wrappers';
import messages from 'src/i18n';
import { createI18n } from 'vue-i18n';

export type MessageLanguages = keyof typeof messages;
// Type-define 'en-US' as the master schema for the resource
export type MessageSchema = (typeof messages)['en-US'];

// See https://vue-i18n.intlify.dev/guide/advanced/typescript.html#global-resource-schema-type-definition
/* eslint-disable @typescript-eslint/no-empty-interface */
declare module 'vue-i18n' {
// define the locale messages schema
export interface DefineLocaleMessage extends MessageSchema {}

// define the datetime format schema
export interface DefineDateTimeFormat {}

// define the number format schema
export interface DefineNumberFormat {}
}
/* eslint-enable @typescript-eslint/no-empty-interface */
Expand All @@ -30,10 +22,7 @@ export default boot(({ app }) => {
locale: 'en-US',
messages,
});

// Set i18n instance on app
app.use(i18n);
});
console.log('i18n end');

export { i18n };
13 changes: 1 addition & 12 deletions src/boot/obs.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
console.log('obs start');
import OBSWebSocket from 'obs-websocket-js';
import { QNotifyCreateOptions, QNotifyUpdateOptions } from 'quasar';
import { Ref, ref } from 'vue';
const obsWebSocket = new OBSWebSocket();
const obsNotification: Ref<
| ((
opts: QNotifyCreateOptions | string,
) => (props?: QNotifyUpdateOptions | undefined) => void)
| null
> = ref(null);

console.log('obs end');
export { obsNotification, obsWebSocket };
export { obsWebSocket };
1 change: 1 addition & 0 deletions src/components/form-inputs/SelectInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
map-options
v-model="localValue"
v-bind="{ label: label || undefined }"
spellcheck=false
>
</q-select>
</template>
Expand Down
41 changes: 32 additions & 9 deletions src/components/form-inputs/TimeInput.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
<template>
<q-input :rules="getRules(rules)" class="q-pb-none" dense filled mask="time" readonly v-model="localValue"
v-bind="{ label: label || undefined }">
<q-popup-proxy breakpoint="1000" transition-hide="scale" transition-show="scale">
<q-time :options="getTimeOptions(options)" class="non-selectable" format24h v-model="localValue">
<q-input
:rules="getRules(rules)"
class="q-pb-none"
dense
filled
mask="time"
readonly
v-model="localValue"
v-bind="{ label: label || undefined }"
>
<q-popup-proxy
breakpoint="1000"
transition-hide="scale"
transition-show="scale"
>
<q-time
:options="getTimeOptions(options)"
class="non-selectable"
format24h
v-model="localValue"
>
<div class="row items-center justify-end">
<q-btn @click="clearTime" color="negative" flat icon="mdi-close" v-close-popup />
<q-btn
@click="clearTime"
color="negative"
flat
icon="mdi-close"
v-close-popup
/>
<q-btn color="positive" flat icon="mdi-check" v-close-popup />
</div>
</q-time>
Expand All @@ -17,10 +40,10 @@ import { getRules, getTimeOptions } from 'src/helpers/settings';
import { ref, watch } from 'vue';
const props = defineProps<{
label?: string,
modelValue: string,
options: string[] | undefined,
rules?: string[] | undefined,
label?: string;
modelValue: string;
options: string[] | undefined;
rules?: string[] | undefined;
}>();
const emit = defineEmits(['update:modelValue']);
Expand Down
2 changes: 1 addition & 1 deletion src/components/form-inputs/ToggleInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<script setup lang="ts">
import { getActions } from 'src/helpers/settings';
import { defineEmits, defineProps, ref, watch } from 'vue';
import { ref, watch } from 'vue';
// Define props and emits
const props = defineProps<{
Expand Down
6 changes: 5 additions & 1 deletion src/components/media/DownloadStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
dense
separator
>
<!-- <q-slide-transition> -->
<q-item
style="align-items: center"
v-if="Object.values(downloadProgress).length === 0"
Expand All @@ -45,12 +46,13 @@
v-for="statusObject in statusConfig"
>
<q-item-label
class="q-pt-md text-weight-bold text-uppercase"
class="q-pt-md q-pl-md text-weight-bold text-uppercase"
overline
v-if="hasStatus(downloadProgress, statusObject.status)"
>
{{ $t(statusObject.label) }}
</q-item-label>
<!-- <q-slide-transition> -->
<q-item
:key="url"
style="align-items: center"
Expand Down Expand Up @@ -79,7 +81,9 @@
/>
</q-item-section>
</q-item>
<!-- </q-slide-transition> -->
</template>
<!-- </q-slide-transition> -->
</q-list>
</div>
</q-popup-proxy>
Expand Down
Loading

0 comments on commit 8fe9069

Please sign in to comment.