- closes #154
- add uptime for piped instances
- update readme
This commit is contained in:
Shiny Nematoda 2024-01-01 12:01:32 +00:00
parent b47b71476c
commit e87f55dffc
8 changed files with 373 additions and 327 deletions

View file

@ -657,4 +657,4 @@ the specific requirements.
You should also get your employer (if you work as a programmer) or 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 school, if any, to sign a "copyright disclaimer" for the program, if
necessary. For more information on this, and how to apply and follow necessary. For more information on this, and how to apply and follow
the GNU AGPL, see <https://www.gnu.org/licenses/>. the GNU AGPL, see <https://www.gnu.org/licenses/>.

View file

@ -91,7 +91,7 @@ You can use the [Redirector](https://github.com/einaregilsson/Redirector) extens
Hyperpipe Hyperpipe
Copyright (C) 2022-23 Shiny Nematoda Copyright (C) 2022-24 Shiny Nematoda
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@ -137,7 +137,7 @@ You can reach out to me personally on:
- [Beatbump](https://github.com/snuffyDev/Beatbump) -> Alternative YouTube Music frontend built with Svelte/SvelteKit - [Beatbump](https://github.com/snuffyDev/Beatbump) -> Alternative YouTube Music frontend built with Svelte/SvelteKit
- [MellowMusic](https://github.com/you-apps/MellowMusic) -> Music player app using Piped API to fetch music - [VibeYou](https://github.com/you-apps/VibeYou) -> Privacy focused music player built with MD3
--- ---

640
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -19,9 +19,9 @@
"vue": "^3.2.38" "vue": "^3.2.38"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^4.5.2", "@vitejs/plugin-vue": "^4.6.2",
"prettier": "^3.1.1", "prettier": "^3.1.1",
"vite": "^5.0.7", "vite": "^5.0.10",
"vite-plugin-pwa": "^0.17.4" "vite-plugin-pwa": "^0.17.4"
} }
} }

View file

@ -1,3 +1,3 @@
{ {
"date": "2023-12-12" "date": "2024-01-01"
} }

View file

@ -86,10 +86,10 @@ onMounted(() => {
</span> </span>
<div v-else-if="plurl.thumbnails" class="pl-img"> <div v-else-if="plurl.thumbnails" class="pl-img">
<img <img
loading="lazy"
:src="plurl.thumbnails[0].url" :src="plurl.thumbnails[0].url"
:height="plurl.thumbnails[0].height" :height="plurl.thumbnails[0].height"
:width="plurl.thumbnails[0].width" :width="plurl.thumbnails[0].width" />
loading="lazy" />
</div> </div>
<span class="pl-main caps">{{ plurl.title }}</span> <span class="pl-main caps">{{ plurl.title }}</span>
<span class="bi bi-grip-horizontal pl-handle clickable"></span> <span class="bi bi-grip-horizontal pl-handle clickable"></span>

View file

@ -25,8 +25,7 @@ const { t, setupLocale } = useI18n(),
compact = ref(false), compact = ref(false),
prm = ref(false), prm = ref(false),
cc = ref(false), cc = ref(false),
restoreUrl = ref(''), restoreUrl = ref('');
prompt = txt => window.prompt(txt);
getJson('https://piped-instances.kavin.rocks').then(i => (instances.value = i)); getJson('https://piped-instances.kavin.rocks').then(i => (instances.value = i));
@ -86,7 +85,18 @@ function getStoreBool(key, ele, def) {
ele.value = getStore(key) || def; ele.value = getStore(key) || def;
} }
async function setAuth(key) { function toPerc(n) {
return n.toFixed(0) + '%'
}
function setCustom(key, e) {
let v = e.target.value;
v = v == 'x' ? prompt('instance') : v
v && setStore(key, v);
}
async function setAuth(e) {
if (getStore('authapi')) { if (getStore('authapi')) {
if (!confirm('This requires a logout. Confirm logout?')) return; if (!confirm('This requires a logout. Confirm logout?')) return;
@ -98,7 +108,7 @@ async function setAuth(key) {
} }
store.removeItem('auth'); store.removeItem('auth');
setStore('authapi', key); setCustom('authapi', e);
} }
const verifyApi = computed(() => const verifyApi = computed(() =>
@ -264,7 +274,7 @@ onMounted(() => {
v-if="hypInstances" v-if="hypInstances"
class="input" class="input"
:value="getStore('api') || HYPERPIPE_INSTANCE" :value="getStore('api') || HYPERPIPE_INSTANCE"
@change="setStore('api', $event.target.value)"> @change="setCustom('api', $event)">
<option <option
v-for="i in hypInstances" v-for="i in hypInstances"
:key="i.name" :key="i.name"
@ -275,6 +285,8 @@ onMounted(() => {
<option v-if="!verifyApi"> <option v-if="!verifyApi">
{{ getStore('api') || HYPERPIPE_INSTANCE }} {{ getStore('api') || HYPERPIPE_INSTANCE }}
</option> </option>
<option value="x">Custom</option>
</select> </select>
<div class="table-wrap"> <div class="table-wrap">
@ -310,12 +322,7 @@ onMounted(() => {
v-if="instances" v-if="instances"
class="input" class="input"
:value="getStore('pipedapi') || PIPED_INSTANCE" :value="getStore('pipedapi') || PIPED_INSTANCE"
@change=" @change="setCustom('pipedapi', $event)">
e => {
const v = e.target.value;
setStore('pipedapi', v == 'x' ? prompt('instance') : v);
}
">
<option <option
v-for="i in instances" v-for="i in instances"
:key="i.name" :key="i.name"
@ -336,7 +343,7 @@ onMounted(() => {
v-if="instances" v-if="instances"
class="input" class="input"
:value="getStore('authapi') || PIPED_INSTANCE" :value="getStore('authapi') || PIPED_INSTANCE"
@change="setAuth($event.target.value)"> @change="setAuth">
<option <option
v-for="i in instances" v-for="i in instances"
:key="i.name" :key="i.name"
@ -347,6 +354,8 @@ onMounted(() => {
<option v-if="!verifyAuthApi"> <option v-if="!verifyAuthApi">
{{ getStore('authapi') || PIPED_INSTANCE }} {{ getStore('authapi') || PIPED_INSTANCE }}
</option> </option>
<option value="x">Custom</option>
</select> </select>
<div class="table-wrap"> <div class="table-wrap">
@ -358,6 +367,9 @@ onMounted(() => {
<th>{{ t('instances.cdn') }}</th> <th>{{ t('instances.cdn') }}</th>
<th>{{ t('instances.up_to_date') }}</th> <th>{{ t('instances.up_to_date') }}</th>
<th>{{ t('instances.version') }}</th> <th>{{ t('instances.version') }}</th>
<th>{{ t('instances.uptime_24h') }}</th>
<th>{{ t('instances.uptime_7d') }}</th>
<th>{{ t('instances.uptime_30d') }}</th>
</tr> </tr>
</thead> </thead>
<tbody v-for="i in instances" :key="i.name"> <tbody v-for="i in instances" :key="i.name">
@ -373,6 +385,9 @@ onMounted(() => {
<td> <td>
{{ i.version }} {{ i.version }}
</td> </td>
<td>{{ toPerc(i.uptime_24h) }}</td>
<td>{{ toPerc(i.uptime_7d) }}</td>
<td>{{ toPerc(i.uptime_30d) }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -90,7 +90,10 @@
"cdn": "CDN", "cdn": "CDN",
"up_to_date": "Up to Date", "up_to_date": "Up to Date",
"version": "Version", "version": "Version",
"default": "Default" "default": "Default",
"uptime_7d": "Uptime (7d)",
"uptime_24h": "Uptime (24h)",
"uptime_30d": "Uptime (30d)"
}, },
"lyrics": { "lyrics": {
"load": "Fetching Lyrics", "load": "Fetching Lyrics",