fix(git): manual merging commit
This commit is contained in:
commit
a5785dcbe8
22 changed files with 844 additions and 40 deletions
|
@ -16,13 +16,13 @@ export function archive_page() {
|
|||
|
||||
const headers = [
|
||||
// {title: '', key: 'artwork'},
|
||||
{title: 'Track title', value: 'track_title'},
|
||||
{title: 'Artist', value: 'artist_name'},
|
||||
{title: 'Genre', value: 'genre'},
|
||||
{title: 'Track Type', value: 'track_type'},
|
||||
{title: 'Length', value: 'length'},
|
||||
{title: 'Uploaded', value: 'mtime'},
|
||||
{title: 'Actions', key: 'actions'}
|
||||
{title: 'Titolo', value: 'track_title'},
|
||||
{title: 'Artista', value: 'artist_name'},
|
||||
{title: 'Genere', value: 'genre'},
|
||||
{title: 'Tipologia', value: 'track_type'},
|
||||
{title: 'Durata', value: 'length'},
|
||||
{title: 'Caricato il', value: 'mtime'},
|
||||
{title: 'Azioni', value: 'actions'}
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ export function archive_page() {
|
|||
all: search.value
|
||||
}
|
||||
}).then((response) => {
|
||||
console.log(response)
|
||||
//console.log(response)
|
||||
listData.itemsPerPage = response.data.per_page;
|
||||
listData.first_page = response.data.from;
|
||||
listData.last_page = response.data.last_page;
|
||||
|
|
17
resources/js/composables/content/dashboard_page.ts
Normal file
17
resources/js/composables/content/dashboard_page.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import {ref, reactive} from "vue";
|
||||
|
||||
export function archive_page() {
|
||||
const items = ref([])
|
||||
const selected = ref([])
|
||||
const loading = ref(false)
|
||||
const search = ref('')
|
||||
const listData = reactive({
|
||||
'itemsPerPage': 5,
|
||||
'first_page': null,
|
||||
'last_page': null,
|
||||
'total_items': 0,
|
||||
'page': 1,
|
||||
})
|
||||
|
||||
return { items, listData, selected, loading, search }
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
import type {ContextMenu} from "@models/misc/contextMenu"
|
||||
|
||||
export interface calendarShowEvent {
|
||||
showInstanceId: Number,
|
||||
title: string,
|
||||
color: string,
|
||||
start: Date,
|
||||
end: Date
|
||||
timed: boolean,
|
||||
}
|
||||
|
||||
export const calendarShowEventMenu: ContextMenu = {
|
||||
entries: [
|
||||
{
|
||||
expanded: false,
|
||||
menuText: 'Edit',
|
||||
children: [
|
||||
{
|
||||
menuText: 'Edit instance',
|
||||
actionTrigger: 'contextMenuEditInstance'
|
||||
},
|
||||
{
|
||||
menuText: 'Edit show',
|
||||
actionTrigger: 'contextMenuEditShow'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
expanded: false,
|
||||
menuText: 'Delete',
|
||||
children: [
|
||||
{
|
||||
menuText: 'Delete instance',
|
||||
actionTrigger: 'contextMenuDeleteInstance'
|
||||
},
|
||||
{
|
||||
menuText: 'Delete show',
|
||||
actionTrigger: 'contextMenuDeleteShow'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
34
resources/js/composables/content/models/misc/contextMenu.ts
Normal file
34
resources/js/composables/content/models/misc/contextMenu.ts
Normal file
|
@ -0,0 +1,34 @@
|
|||
export interface ContextMenuType {
|
||||
visible: boolean;
|
||||
position: {
|
||||
top: number;
|
||||
left: number;
|
||||
};
|
||||
menu: ContextMenu
|
||||
}
|
||||
|
||||
export interface ContextMenu {
|
||||
entries: ContextMenuEntry[];
|
||||
}
|
||||
|
||||
interface ContextMenuEntryWithAction {
|
||||
menuText: string;
|
||||
actionTrigger: string;
|
||||
}
|
||||
|
||||
interface ContextMenuEntryWithChildren {
|
||||
expanded: boolean;
|
||||
menuText: string;
|
||||
children: ContextMenuEntry[];
|
||||
}
|
||||
|
||||
type ContextMenuEntry = ContextMenuEntryWithAction | ContextMenuEntryWithChildren;
|
||||
|
||||
export function menuEntryWithAction(entry: ContextMenuEntry): entry is ContextMenuEntryWithAction {
|
||||
return 'actionTrigger' in entry;
|
||||
}
|
||||
|
||||
export function menuEntryWithChildren(entry: ContextMenuEntry): entry is ContextMenuEntryWithChildren {
|
||||
return 'children' in entry;
|
||||
}
|
||||
|
82
resources/js/composables/content/models/show/schedule.ts
Normal file
82
resources/js/composables/content/models/show/schedule.ts
Normal file
|
@ -0,0 +1,82 @@
|
|||
import { VSelect, VTextField } from "vuetify/components";
|
||||
|
||||
interface Schedule {
|
||||
id?: number;
|
||||
starts: string; // ISO datetime string
|
||||
ends: string; // ISO datetime string
|
||||
clipLength: number; // Length in seconds or appropriate unit
|
||||
fadeIn: number; // Fade-in duration in seconds
|
||||
fadeOut: number; // Fade-out duration in seconds
|
||||
cueIn: string; // Cue-in point (HH:MM:SS or similar format)
|
||||
cueOut: string; // Cue-out point (HH:MM:SS or similar format)
|
||||
mediaItemPlayed: boolean; // Indicates if media item has been played
|
||||
playoutStatus: string; // Status of the playout (e.g., 'pending', 'completed')
|
||||
broadcasted: boolean; // Indicates if it has been broadcasted
|
||||
position: number; // Position in the schedule
|
||||
fileId: number; // Reference to File ID
|
||||
instanceId: number; // Reference to ShowInstances ID
|
||||
|
||||
// Relationships
|
||||
file?: File; // Reference to File interface
|
||||
showInstance?: ShowInstances; // Reference to ShowInstances interface
|
||||
}
|
||||
|
||||
export function scheduleForm(item: Schedule) {
|
||||
const visibleFields = {
|
||||
starts: 'Inizio',
|
||||
ends: 'Fine',
|
||||
clipLength: 'Lunghezza clip (s)',
|
||||
fadeIn: 'Fade-in (s)',
|
||||
fadeOut: 'Fade-out (s)',
|
||||
cueIn: 'Cue in',
|
||||
cueOut: 'Cue out',
|
||||
mediaItemPlayed: 'Media riprodotto',
|
||||
playoutStatus: 'Stato playout',
|
||||
broadcasted: 'Trasmissione completata',
|
||||
position: 'Posizione',
|
||||
fileId: 'File',
|
||||
instanceId: 'Istanza programma'
|
||||
};
|
||||
|
||||
return () => {
|
||||
const fields = {};
|
||||
Object.keys(visibleFields).forEach((key) => {
|
||||
fields[key] = {
|
||||
label: visibleFields[key],
|
||||
value: item[key as keyof Schedule],
|
||||
component: VTextField,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
switch (key) {
|
||||
case 'starts':
|
||||
case 'ends':
|
||||
fields[key].props = {
|
||||
type: 'datetime-local',
|
||||
step: 300 // 5-minute increments for practical scheduling
|
||||
};
|
||||
break;
|
||||
case 'mediaItemPlayed':
|
||||
case 'broadcasted':
|
||||
fields[key].component = VSelect;
|
||||
fields[key].props = {
|
||||
items: [
|
||||
{ text: 'Sì', value: true },
|
||||
{ text: 'No', value: false }
|
||||
]
|
||||
};
|
||||
break;
|
||||
case 'fileId':
|
||||
fields[key].value = item.file?.name || '';
|
||||
fields[key].disabled = true;
|
||||
break;
|
||||
case 'instanceId':
|
||||
fields[key].value = item.showInstance?.id || ''; // Assuming you want to show instance ID or name
|
||||
fields[key].disabled = true;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return fields;
|
||||
};
|
||||
}
|
117
resources/js/composables/content/models/show/show.ts
Normal file
117
resources/js/composables/content/models/show/show.ts
Normal file
|
@ -0,0 +1,117 @@
|
|||
import { VSelect, VTextarea, VTextField } from "vuetify/components";
|
||||
import type {ShowInstances} from "@models/show/showInstances";
|
||||
import type {ShowDays} from "@models/show/showDays.ts";
|
||||
import type {ShowDjs} from "@models/show/showDjs.ts";
|
||||
import axios, {type AxiosResponse} from "axios";
|
||||
|
||||
|
||||
export interface Show {
|
||||
id?: number;
|
||||
name: string;
|
||||
url: string;
|
||||
genre: string;
|
||||
description: string;
|
||||
color: string;
|
||||
backgroundColor: string;
|
||||
liveStreamUsingAirtimeAuth: boolean;
|
||||
liveStreamUsingCustomAuth: boolean;
|
||||
liveStreamUser?: string;
|
||||
liveStreamPass?: string;
|
||||
imagePath?: string;
|
||||
hasAutoplaylist: boolean;
|
||||
autoplaylistId?: number;
|
||||
autoplaylistRepeat: boolean;
|
||||
|
||||
// Relationships
|
||||
block?: any;
|
||||
showDays?: ShowDays[];
|
||||
showDjs?: ShowDjs[];
|
||||
showInstances?: ShowInstances[];
|
||||
playlist?: any;
|
||||
}
|
||||
|
||||
export function showForm(item: Show) {
|
||||
const visibleFields = {
|
||||
name: 'Nome',
|
||||
url: 'URL',
|
||||
genre: 'Genere',
|
||||
description: 'Descrizione',
|
||||
color: 'Colore',
|
||||
backgroundColor: 'Colore di sfondo',
|
||||
liveStreamUsingAirtimeAuth: 'Autenticazione Airtime',
|
||||
liveStreamUsingCustomAuth: 'Autenticazione personalizzata',
|
||||
liveStreamUser: 'Utente di streaming',
|
||||
liveStreamPass: 'Password di streaming',
|
||||
linked: 'Collegato',
|
||||
isLinkable: 'Collegabile',
|
||||
imagePath: 'Percorso immagine',
|
||||
hasAutoplaylist: 'Ha playlist automatica',
|
||||
autoplaylistId: 'ID Playlist automatica',
|
||||
autoplaylistRepeat: 'Ripeti playlist automatica'
|
||||
};
|
||||
|
||||
return () => {
|
||||
const fields = {};
|
||||
Object.keys(visibleFields).forEach((key) => {
|
||||
fields[key] = {
|
||||
label: visibleFields[key],
|
||||
value: item[key as keyof Show],
|
||||
component: VTextField,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
switch (key) {
|
||||
case 'liveStreamUsingAirtimeAuth':
|
||||
case 'liveStreamUsingCustomAuth':
|
||||
case 'linked':
|
||||
case 'isLinkable':
|
||||
case 'hasAutoplaylist':
|
||||
fields[key].component = VSelect;
|
||||
fields[key].props = {
|
||||
items: [
|
||||
{ text: 'Sì', value: true },
|
||||
{ text: 'No', value: false }
|
||||
]
|
||||
};
|
||||
break;
|
||||
|
||||
case 'description':
|
||||
fields[key].component = VTextarea;
|
||||
break;
|
||||
|
||||
case 'autoplaylistId':
|
||||
// Optional handling if you have a way to fetch or display playlist names
|
||||
fields[key].props = {
|
||||
items: [], // Populate this with actual playlist options if available
|
||||
labelKey: 'name', // Assuming playlists have a name property
|
||||
valueKey: 'id'
|
||||
};
|
||||
break;
|
||||
|
||||
case 'imagePath':
|
||||
fields[key].props = { type: 'file' }; // If you want to upload an image file
|
||||
break;
|
||||
|
||||
default:
|
||||
// For other fields, keep as text field by default
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return fields;
|
||||
};
|
||||
}
|
||||
|
||||
export async function getShows(scheduled = null , dateRangeScheduledStart = "", dateRangeScheduledEnd = "") {
|
||||
return await axios.get(`/show`, {
|
||||
params: {
|
||||
scheduled: scheduled,
|
||||
dateRangeScheduledStart: dateRangeScheduledStart,
|
||||
dateRangeScheduledEnd: dateRangeScheduledEnd,
|
||||
}
|
||||
}).then((response: AxiosResponse) => {
|
||||
return response.data
|
||||
}).catch((error: Error) => {
|
||||
console.log("Error: "+ error);
|
||||
})
|
||||
}
|
68
resources/js/composables/content/models/show/showDays.ts
Normal file
68
resources/js/composables/content/models/show/showDays.ts
Normal file
|
@ -0,0 +1,68 @@
|
|||
import { VSelect, VTextField } from "vuetify/components";
|
||||
import type {Show} from "@models/show/show";
|
||||
|
||||
export interface ShowDays {
|
||||
id?: number;
|
||||
firstShow: string; // Date string (ISO format)
|
||||
lastShow: string; // Date string (ISO format)
|
||||
startTime: string; // DateTime string (ISO format)
|
||||
timezone: string;
|
||||
duration: string; // Stored as string but could represent time
|
||||
day: number; // Assuming 0-6 for days of week
|
||||
repeatType: number; // Numerical representation of repeat type
|
||||
nextPopDate: string; // Date string (ISO format)
|
||||
showId: number;
|
||||
record: number; // 0 or 1 for boolean-like values
|
||||
|
||||
// Relationships
|
||||
show?: Show; // Reference to parent Show
|
||||
}
|
||||
|
||||
export function showDaysForm(item: ShowDays) {
|
||||
const visibleFields = {
|
||||
firstShow: 'Prima data',
|
||||
lastShow: 'Ultima data',
|
||||
startTime: 'Ora inizio',
|
||||
timezone: 'Fuso orario',
|
||||
duration: 'Durata',
|
||||
day: 'Giorno',
|
||||
repeatType: 'Tipo ripetizione',
|
||||
nextPopDate: 'Prossima data',
|
||||
record: 'Registrazione'
|
||||
};
|
||||
|
||||
return () => {
|
||||
const fields = {};
|
||||
Object.keys(visibleFields).forEach((key) => {
|
||||
fields[key] = {
|
||||
label: visibleFields[key],
|
||||
value: item[key as keyof ShowDays],
|
||||
component: VTextField,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
switch (key) {
|
||||
case 'day':
|
||||
case 'repeatType':
|
||||
case 'record':
|
||||
fields[key].component = VSelect;
|
||||
// Add options if you have predefined values
|
||||
// fields[key].props = { items: daysOfWeekOptions };
|
||||
break;
|
||||
case 'startTime':
|
||||
// Optional: Add time picker props
|
||||
fields[key].props = { type: 'time' };
|
||||
break;
|
||||
case 'firstShow':
|
||||
case 'lastShow':
|
||||
case 'nextPopDate':
|
||||
// Optional: Add date picker props
|
||||
fields[key].props = { type: 'date' };
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return fields;
|
||||
};
|
||||
}
|
||||
|
44
resources/js/composables/content/models/show/showDjs.ts
Normal file
44
resources/js/composables/content/models/show/showDjs.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
import { VTextField } from "vuetify/components";
|
||||
|
||||
export interface ShowDjs {
|
||||
id?: number;
|
||||
subjsId: number;
|
||||
showId: number;
|
||||
|
||||
dj?: User;
|
||||
}
|
||||
|
||||
// Assuming User interface exists
|
||||
export interface User {
|
||||
id: number;
|
||||
login: string;
|
||||
}
|
||||
|
||||
export function showDjsForm(item: ShowDjs) {
|
||||
const visibleFields = {
|
||||
subjsId: 'Presentatore',
|
||||
showId: 'Programma'
|
||||
};
|
||||
|
||||
return () => {
|
||||
const fields = {};
|
||||
Object.keys(visibleFields).forEach((key) => {
|
||||
fields[key] = {
|
||||
label: visibleFields[key],
|
||||
value: item[key as keyof ShowDjs],
|
||||
component: VTextField,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
switch (key) {
|
||||
case 'subjsId':
|
||||
fields[key].disabled = true;
|
||||
break;
|
||||
case 'showId':
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return fields;
|
||||
};
|
||||
}
|
101
resources/js/composables/content/models/show/showInstances.ts
Normal file
101
resources/js/composables/content/models/show/showInstances.ts
Normal file
|
@ -0,0 +1,101 @@
|
|||
import {VSelect, VTextField} from "vuetify/components";
|
||||
import type {Show} from "@models/show/show";
|
||||
import axios, {type AxiosResponse} from "axios";
|
||||
|
||||
export interface ShowInstances {
|
||||
id?: number;
|
||||
starts: string; // ISO datetime string
|
||||
ends: string; // ISO datetime string
|
||||
showId: number;
|
||||
record: number; // 0|1 or similar
|
||||
rebroadcast: number; // 0|1 or similar
|
||||
timeFilled: string; // Duration format (HH:MM:SS)
|
||||
created?: string; // ISO datetime string (optional)
|
||||
modifiedInstance: boolean;
|
||||
autoplaylistBuilt: boolean;
|
||||
|
||||
// Relationships
|
||||
Playlist?: any; // Assuming File interface exists
|
||||
show?: Show; // Reference to Show interface
|
||||
}
|
||||
|
||||
export function showInstancesForm(item: ShowInstances) {
|
||||
const visibleFields = {
|
||||
starts: 'Inizio',
|
||||
ends: 'Fine',
|
||||
showId: 'Programma',
|
||||
record: 'Registrazione',
|
||||
rebroadcast: 'Ritrasmissione',
|
||||
timeFilled: 'Durata riempita',
|
||||
modifiedInstance: 'Istanza modificata',
|
||||
autoplaylistBuilt: 'Autoplaylist generata'
|
||||
};
|
||||
|
||||
return () => {
|
||||
const fields = {};
|
||||
Object.keys(visibleFields).forEach((key) => {
|
||||
fields[key] = {
|
||||
label: visibleFields[key],
|
||||
value: item[key as keyof ShowInstances],
|
||||
component: VTextField,
|
||||
disabled: false
|
||||
};
|
||||
|
||||
switch (key) {
|
||||
case 'starts':
|
||||
case 'ends':
|
||||
fields[key].props = {
|
||||
type: 'datetime-local',
|
||||
step: 300 // 5-minute increments
|
||||
};
|
||||
break;
|
||||
case 'modifiedInstance':
|
||||
case 'autoplaylistBuilt':
|
||||
fields[key].component = VSelect;
|
||||
fields[key].props = {
|
||||
items: [
|
||||
{text: 'Sì', value: true},
|
||||
{text: 'No', value: false}
|
||||
]
|
||||
};
|
||||
break;
|
||||
case 'record':
|
||||
case 'rebroadcast':
|
||||
fields[key].component = VSelect;
|
||||
fields[key].props = {
|
||||
items: [
|
||||
{text: 'Sì', value: 1},
|
||||
{text: 'No', value: 0}
|
||||
]
|
||||
};
|
||||
break;
|
||||
case 'showId':
|
||||
fields[key].value = item.show?.name || '';
|
||||
fields[key].disabled = true;
|
||||
break;
|
||||
case 'timeFilled':
|
||||
fields[key].props = {type: 'time'};
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
return fields;
|
||||
};
|
||||
}
|
||||
|
||||
export async function getShowInstances(options: {
|
||||
showId?: number | null;
|
||||
starts?: string | null;
|
||||
ends?: string | null;
|
||||
withShow?: boolean | null;
|
||||
}): Promise<ShowInstances[]> {
|
||||
const filteredParams = Object.fromEntries(
|
||||
Object.entries(options).filter(([_, value]) => value !== undefined && value !== null)
|
||||
);
|
||||
|
||||
return await axios.get(`/showInstances`, { params: filteredParams }).then((response: AxiosResponse) => {
|
||||
return response.data
|
||||
}).catch((error: Error) => {
|
||||
console.log("Error: " + error);
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue