Saltychat Remove and PMA install
This commit is contained in:
parent
0bff8ae174
commit
2fd3c1fe70
94 changed files with 8799 additions and 5199 deletions
3
resources/[voice]/pma-voice/voice-ui/.browserslistrc
Normal file
3
resources/[voice]/pma-voice/voice-ui/.browserslistrc
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
23
resources/[voice]/pma-voice/voice-ui/.gitignore
vendored
Normal file
23
resources/[voice]/pma-voice/voice-ui/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
24
resources/[voice]/pma-voice/voice-ui/README.md
Normal file
24
resources/[voice]/pma-voice/voice-ui/README.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# voice-ui
|
||||
|
||||
## Project setup
|
||||
```
|
||||
yarn install
|
||||
```
|
||||
|
||||
### Compiles and hot-reloads for development
|
||||
```
|
||||
yarn serve
|
||||
```
|
||||
|
||||
### Compiles and minifies for production
|
||||
```
|
||||
yarn build
|
||||
```
|
||||
|
||||
### Lints and fixes files
|
||||
```
|
||||
yarn lint
|
||||
```
|
||||
|
||||
### Customize configuration
|
||||
See [Configuration Reference](https://cli.vuejs.org/config/).
|
||||
5
resources/[voice]/pma-voice/voice-ui/babel.config.js
Normal file
5
resources/[voice]/pma-voice/voice-ui/babel.config.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
module.exports = {
|
||||
presets: [
|
||||
'@vue/cli-plugin-babel/preset'
|
||||
]
|
||||
}
|
||||
18
resources/[voice]/pma-voice/voice-ui/package.json
Normal file
18
resources/[voice]/pma-voice/voice-ui/package.json
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "voice-ui",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"core-js": "^3.6.5",
|
||||
"vue": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0"
|
||||
}
|
||||
}
|
||||
6692
resources/[voice]/pma-voice/voice-ui/pnpm-lock.yaml
generated
Normal file
6692
resources/[voice]/pma-voice/voice-ui/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
17
resources/[voice]/pma-voice/voice-ui/public/index.html
Normal file
17
resources/[voice]/pma-voice/voice-ui/public/index.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
</body>
|
||||
</html>
|
||||
BIN
resources/[voice]/pma-voice/voice-ui/public/mic_click_off.ogg
Normal file
BIN
resources/[voice]/pma-voice/voice-ui/public/mic_click_off.ogg
Normal file
Binary file not shown.
BIN
resources/[voice]/pma-voice/voice-ui/public/mic_click_on.ogg
Normal file
BIN
resources/[voice]/pma-voice/voice-ui/public/mic_click_on.ogg
Normal file
Binary file not shown.
112
resources/[voice]/pma-voice/voice-ui/src/App.vue
Normal file
112
resources/[voice]/pma-voice/voice-ui/src/App.vue
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
<template>
|
||||
<body>
|
||||
<audio id="audio_on" src="mic_click_on.ogg"></audio>
|
||||
<audio id="audio_off" src="mic_click_off.ogg"></audio>
|
||||
<div v-if="voice.uiEnabled" class="voiceInfo">
|
||||
<p v-if="voice.callInfo !== 0" :class="{ talking: voice.talking }">
|
||||
[Call]
|
||||
</p>
|
||||
<p v-if="voice.radioEnabled && voice.radioChannel !== 0" :class="{ talking: voice.usingRadio }">
|
||||
{{ voice.radioChannel }} Mhz [Radio]
|
||||
</p>
|
||||
<p v-if="voice.voiceModes.length" :class="{ talking: voice.talking }">
|
||||
{{ voice.voiceModes[voice.voiceMode][1] }} [Range]
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { reactive } from "vue";
|
||||
export default {
|
||||
name: "App",
|
||||
setup() {
|
||||
const voice = reactive({
|
||||
uiEnabled: true,
|
||||
voiceModes: [],
|
||||
voiceMode: 0,
|
||||
radioChannel: 0,
|
||||
radioEnabled: true,
|
||||
usingRadio: false,
|
||||
callInfo: 0,
|
||||
talking: false,
|
||||
});
|
||||
|
||||
// stops from toggling voice at the end of talking
|
||||
window.addEventListener("message", function(event) {
|
||||
const data = event.data;
|
||||
|
||||
if (data.uiEnabled !== undefined) {
|
||||
voice.uiEnabled = data.uiEnabled
|
||||
}
|
||||
|
||||
if (data.voiceModes !== undefined) {
|
||||
voice.voiceModes = JSON.parse(data.voiceModes);
|
||||
// Push our own custom type for modes that have their range changed
|
||||
let voiceModes = [...voice.voiceModes]
|
||||
voiceModes.push([0.0, "Custom"])
|
||||
voice.voiceModes = voiceModes
|
||||
}
|
||||
|
||||
if (data.voiceMode !== undefined) {
|
||||
voice.voiceMode = data.voiceMode;
|
||||
}
|
||||
|
||||
if (data.radioChannel !== undefined) {
|
||||
voice.radioChannel = data.radioChannel;
|
||||
}
|
||||
|
||||
if (data.radioEnabled !== undefined) {
|
||||
voice.radioEnabled = data.radioEnabled;
|
||||
}
|
||||
|
||||
if (data.callInfo !== undefined) {
|
||||
voice.callInfo = data.callInfo;
|
||||
}
|
||||
|
||||
if (data.usingRadio !== undefined && data.usingRadio !== voice.usingRadio) {
|
||||
voice.usingRadio = data.usingRadio;
|
||||
}
|
||||
|
||||
if ((data.talking !== undefined) && !voice.usingRadio) {
|
||||
voice.talking = data.talking;
|
||||
}
|
||||
|
||||
if (data.sound && voice.radioEnabled && voice.radioChannel !== 0) {
|
||||
let click = document.getElementById(data.sound);
|
||||
// discard these errors as its usually just a 'uncaught promise' from two clicks happening too fast.
|
||||
click.load();
|
||||
click.volume = data.volume;
|
||||
click.play().catch((e) => {});
|
||||
}
|
||||
});
|
||||
|
||||
fetch(`https://${GetParentResourceName()}/uiReady`, { method: 'POST' });
|
||||
|
||||
return { voice };
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.voiceInfo {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
position: fixed;
|
||||
text-align: right;
|
||||
bottom: 5px;
|
||||
padding: 0;
|
||||
right: 5px;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: rgb(148, 150, 151);
|
||||
/* https://stackoverflow.com/questions/4772906/css-is-it-possible-to-add-a-black-outline-around-each-character-in-text */
|
||||
text-shadow: 1.25px 0 0 #000, 0 -1.25px 0 #000, 0 1.25px 0 #000,
|
||||
-1.25px 0 0 #000;
|
||||
}
|
||||
.talking {
|
||||
color: rgba(255, 255, 255, 0.822);
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
4
resources/[voice]/pma-voice/voice-ui/src/main.js
Normal file
4
resources/[voice]/pma-voice/voice-ui/src/main.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
7
resources/[voice]/pma-voice/voice-ui/vue.config.js
Normal file
7
resources/[voice]/pma-voice/voice-ui/vue.config.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
publicPath: './',
|
||||
productionSourceMap: true,
|
||||
filenameHashing: false,
|
||||
outputDir: "../ui",
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue