select correct channel on user page, show only filename, fix naming
This commit is contained in:
parent
c4a358a753
commit
414cdbe168
@ -127,6 +127,7 @@ async function addUpdateChannel() {
|
||||
indexStore.msgAlert('success', t('config.updateChannelSuccess'), 2)
|
||||
|
||||
await configStore.getPlayoutConfig()
|
||||
await configStore.getUserConfig()
|
||||
|
||||
} else {
|
||||
indexStore.msgAlert('error', t('config.updateChannelFailed'), 2)
|
||||
@ -152,6 +153,7 @@ async function deleteChannel() {
|
||||
i.value = configStore.i - 1
|
||||
await configStore.getChannelConfig()
|
||||
await configStore.getPlayoutConfig()
|
||||
await configStore.getUserConfig()
|
||||
|
||||
if (response.status === 200) {
|
||||
indexStore.msgAlert('success', t('config.errorChannelDelete'), 2)
|
||||
|
@ -144,7 +144,7 @@ const user = ref({
|
||||
password: '',
|
||||
confirm: '',
|
||||
admin: false,
|
||||
channel_ids: [1],
|
||||
channel_ids: [configStore.channels[configStore.i]?.id ?? 1],
|
||||
role_id: 3,
|
||||
} as User)
|
||||
|
||||
|
@ -39,12 +39,12 @@ export const stringFormatter = () => {
|
||||
.replace(/\[Validator\]/g, '<span class="log-server">[Validator]</span>')
|
||||
}
|
||||
|
||||
function timeToSeconds(time: string) {
|
||||
function timeToSeconds(time: string): number {
|
||||
const t = time.split(':')
|
||||
return parseInt(t[0]) * 3600 + parseInt(t[1]) * 60 + parseInt(t[2])
|
||||
}
|
||||
|
||||
function secToHMS(sec: number) {
|
||||
function secToHMS(sec: number): string {
|
||||
const sign = Math.sign(sec)
|
||||
sec = Math.abs(sec)
|
||||
|
||||
@ -62,7 +62,7 @@ export const stringFormatter = () => {
|
||||
return `${hString}:${m}:${s}`
|
||||
}
|
||||
|
||||
function numberToHex(num: number) {
|
||||
function numberToHex(num: number): string {
|
||||
return '0x' + Math.round(num * 255).toString(16)
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ export const stringFormatter = () => {
|
||||
return parseFloat((parseFloat(parseInt(num, 16).toString()) / 255).toFixed(2))
|
||||
}
|
||||
|
||||
function filename(path: string) {
|
||||
function filename(path: string): string {
|
||||
if (path) {
|
||||
const pathArr = path.split('/')
|
||||
const name = pathArr[pathArr.length - 1]
|
||||
@ -85,7 +85,7 @@ export const stringFormatter = () => {
|
||||
}
|
||||
}
|
||||
|
||||
function parent(path: string) {
|
||||
function parent(path: string): string {
|
||||
if (path) {
|
||||
const pathArr = path.split('/')
|
||||
pathArr.pop()
|
||||
@ -100,7 +100,7 @@ export const stringFormatter = () => {
|
||||
}
|
||||
}
|
||||
|
||||
function toMin(sec: number) {
|
||||
function toMin(sec: number): string {
|
||||
if (sec) {
|
||||
const minutes = Math.floor(sec / 60)
|
||||
const seconds = Math.round(sec - minutes * 60)
|
||||
@ -167,6 +167,14 @@ export const stringFormatter = () => {
|
||||
return null
|
||||
}
|
||||
|
||||
function dir_file(path: string): {dir: string, file: string} {
|
||||
const index = path.lastIndexOf('/')
|
||||
const dir = path.substring(0, index + 1) || '/'
|
||||
const file = path.substring(index + 1)
|
||||
|
||||
return {dir, file}
|
||||
}
|
||||
|
||||
return {
|
||||
fileSize,
|
||||
formatLog,
|
||||
@ -179,6 +187,7 @@ export const stringFormatter = () => {
|
||||
toMin,
|
||||
secondsToTime,
|
||||
mediaType,
|
||||
dir_file,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,9 @@ export default {
|
||||
notExists: 'Speicher existiert nicht!',
|
||||
create: 'Ordner erstellen',
|
||||
upload: 'Dateien hochladen',
|
||||
deleteTitle: 'Datei/Ordner löschen',
|
||||
delete: 'Lösche',
|
||||
file: 'Datei',
|
||||
folder: 'Ordner',
|
||||
deleteQuestion: 'Sind Sie sicher, dass Sie löschen möchten',
|
||||
preview: 'Vorschau',
|
||||
rename: 'Datei umbenennen',
|
||||
|
@ -93,7 +93,9 @@ export default {
|
||||
notExists: 'Storage not exist!',
|
||||
create: 'Create Folder',
|
||||
upload: 'Upload Files',
|
||||
deleteTitle: 'Delete File/Folder',
|
||||
delete: 'Delete',
|
||||
file: 'File',
|
||||
folder: 'Folder',
|
||||
deleteQuestion: 'Are you sure that you want to delete',
|
||||
preview: 'Preview',
|
||||
rename: 'Rename File',
|
||||
|
@ -93,7 +93,9 @@ export default {
|
||||
notExists: 'O armazenamento não existe!',
|
||||
create: 'Criar Pasta',
|
||||
upload: 'Enviar Arquivos',
|
||||
deleteTitle: 'Deletar Arquivo/Pasta',
|
||||
delete: 'Deletar',
|
||||
file: 'Arquivo',
|
||||
folder: 'Pasta',
|
||||
deleteQuestion: 'Tem certeza que deseja deletar?',
|
||||
preview: 'Visualizar',
|
||||
rename: 'Renomear Arquivo',
|
||||
|
@ -93,7 +93,9 @@ export default {
|
||||
notExists: 'Папки не существует!',
|
||||
create: 'Сделать папку',
|
||||
upload: 'Загрузить файлы',
|
||||
deleteTitle: 'Удалить Файл/Папку',
|
||||
delete: 'Удалить',
|
||||
file: 'Файл',
|
||||
folder: 'Папку',
|
||||
deleteQuestion: 'Вы уверены что хотите это удалить',
|
||||
preview: 'Просмотр',
|
||||
rename: 'Переименовать файл',
|
||||
|
@ -230,12 +230,12 @@
|
||||
|
||||
<GenericModal
|
||||
:show="showDeleteModal"
|
||||
:title="t('media.deleteTitle')"
|
||||
:title="`${t('media.delete')} ${extensionsArr.some(suffix => deleteName.endsWith(suffix)) ? t('media.file') : t('media.folder')}`"
|
||||
:text="`${t('media.deleteQuestion')}:<br /><strong>${deleteName}</strong>`"
|
||||
:modal-action="deleteFileOrFolder"
|
||||
>
|
||||
<div>
|
||||
<input class="input input-sm w-full" type="text" :value="deleteName" disabled />
|
||||
<input class="input input-sm w-full" type="text" :value="dir_file(deleteName).file" disabled />
|
||||
<div v-if="!extensionsArr.some(suffix => deleteName.endsWith(suffix))" class="form-control mt-3">
|
||||
<label class="label cursor-pointer w-1/4">
|
||||
<input v-model="recursive" type="checkbox" class="checkbox checkbox-sm checkbox-warning" />
|
||||
@ -321,7 +321,7 @@ const authStore = useAuth()
|
||||
const configStore = useConfig()
|
||||
const indexStore = useIndex()
|
||||
const mediaStore = useMedia()
|
||||
const { toMin, mediaType, filename, parent } = stringFormatter()
|
||||
const { toMin, mediaType, filename, parent, dir_file } = stringFormatter()
|
||||
const { i } = storeToRefs(useConfig())
|
||||
|
||||
useHead({
|
||||
@ -528,13 +528,11 @@ async function deleteFileOrFolder(del: boolean) {
|
||||
}
|
||||
|
||||
function setRenameValues(path: string) {
|
||||
const index = path.lastIndexOf('/')
|
||||
const dir = path.substring(0, index + 1) || '/'
|
||||
const file = path.substring(index + 1)
|
||||
const filepath = dir_file(path)
|
||||
|
||||
renameOldName.value = file
|
||||
renameOldPath.value = dir
|
||||
renameNewName.value = file
|
||||
renameOldName.value = filepath.file
|
||||
renameOldPath.value = filepath.dir
|
||||
renameNewName.value = filepath.file
|
||||
}
|
||||
|
||||
async function renameFile(ren: boolean) {
|
||||
|
Loading…
Reference in New Issue
Block a user