Display thirdparty licenses
This commit is contained in:
parent
350246bf76
commit
6722b69cbf
|
@ -34,7 +34,8 @@
|
|||
"jump_to": "Jump to"
|
||||
},
|
||||
"help": {
|
||||
"name": "Help"
|
||||
"name": "Help",
|
||||
"thirdparty": "Thirdparty licenses"
|
||||
}
|
||||
},
|
||||
"global_header": {
|
||||
|
@ -303,6 +304,9 @@
|
|||
"comment": "Additional comments",
|
||||
"cancel": "Cancel",
|
||||
"ok": "Report"
|
||||
},
|
||||
"thirdparty": {
|
||||
"title": "Thirdparty licenses"
|
||||
}
|
||||
},
|
||||
"cards": {
|
||||
|
|
|
@ -790,22 +790,16 @@ ipcMain.handle('list-fonts', async (_: IpcMainInvokeEvent) => {
|
|||
})
|
||||
|
||||
// Settings
|
||||
ipcMain.handle(
|
||||
'get-account-setting',
|
||||
async (_: IpcMainInvokeEvent, accountId: number): Promise<Setting> => {
|
||||
ipcMain.handle('get-account-setting', async (_: IpcMainInvokeEvent, accountId: number): Promise<Setting> => {
|
||||
const setting = await getSetting(db, accountId)
|
||||
return setting
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
ipcMain.handle(
|
||||
'update-account-setting',
|
||||
async (_: IpcMainInvokeEvent, setting: Setting): Promise<Setting> => {
|
||||
ipcMain.handle('update-account-setting', async (_: IpcMainInvokeEvent, setting: Setting): Promise<Setting> => {
|
||||
console.log(setting)
|
||||
const res = await createOrUpdateSetting(db, setting)
|
||||
return res
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
// Cache
|
||||
ipcMain.handle('get-cache-hashtags', async (_: IpcMainInvokeEvent) => {
|
||||
|
@ -1047,6 +1041,12 @@ const ApplicationMenu = (accountsChange: Array<MenuItemConstructorOptions>, menu
|
|||
click: () => {
|
||||
mainWindow!.webContents.send('open-shortcuts-list')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: i18n.t<string>('main_menu.help.thirdparty'),
|
||||
click: () => {
|
||||
mainWindow!.webContents.send('open-thirdparty-modal')
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<mute-confirm v-if="muteConfirmModal"></mute-confirm>
|
||||
<shortcut></shortcut>
|
||||
<report v-if="reportModal"></report>
|
||||
<thirdparty />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -20,6 +21,7 @@ import AddListMember from './Modals/AddListMember.vue'
|
|||
import MuteConfirm from './Modals/MuteConfirm.vue'
|
||||
import Shortcut from './Modals/Shortcut.vue'
|
||||
import Report from './Modals/Report.vue'
|
||||
import Thirdparty from './Modals/Thirdparty.vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'modals',
|
||||
|
@ -30,7 +32,8 @@ export default defineComponent({
|
|||
AddListMember,
|
||||
MuteConfirm,
|
||||
Shortcut,
|
||||
Report
|
||||
Report,
|
||||
Thirdparty
|
||||
},
|
||||
setup() {
|
||||
const store = useStore()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="shortcut">
|
||||
<el-dialog :title="$t('modals.shortcut.title')" v-model="shortcutModal" width="500px" custom-class="shortcut-modal">
|
||||
<el-dialog :title="$t('modals.shortcut.title')" v-model="shortcutModal" width="500px">
|
||||
<table class="shortcuts">
|
||||
<tbody>
|
||||
<tr>
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
<template>
|
||||
<div class="thirdparty">
|
||||
<el-dialog :title="$t('modals.thirdparty.title')" v-model="modalOpen" width="500px" class="thirdparty-modal">
|
||||
<table class="licenses">
|
||||
<tbody>
|
||||
<template v-for="lib in thirdparty">
|
||||
<tr>
|
||||
<td>{{ lib.package_name }}</td>
|
||||
<td>{{ lib.license }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
</tbody>
|
||||
</table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref } from 'vue'
|
||||
import { MyWindow } from '~/src/types/global'
|
||||
import thirdparty from '~/src/config/thirdparty.json'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'thirdparty',
|
||||
setup() {
|
||||
const win = window as any as MyWindow
|
||||
const modalOpen = ref(false)
|
||||
|
||||
onMounted(() => {
|
||||
win.ipcRenderer.on('open-thirdparty-modal', () => {
|
||||
modalOpen.value = true
|
||||
})
|
||||
})
|
||||
|
||||
return {
|
||||
modalOpen,
|
||||
thirdparty
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.thirdparty :deep() {
|
||||
.el-dialog__header {
|
||||
background-color: #4a5664;
|
||||
margin-right: 0;
|
||||
|
||||
.el-dialog__title {
|
||||
color: #ebeef5;
|
||||
}
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
max-height: 400px;
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.thirdparty-modal {
|
||||
max-height: 70%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.thirdparty {
|
||||
.licenses {
|
||||
text-align: left;
|
||||
border-collapse: collapse;
|
||||
line-height: 28px;
|
||||
width: 100%;
|
||||
|
||||
tr {
|
||||
border: none;
|
||||
|
||||
&:nth-child(even) {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #f2f6fc;
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 4px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
kbd {
|
||||
display: inline-block;
|
||||
padding: 3px 5px;
|
||||
font-size: 11px;
|
||||
line-height: 10px;
|
||||
color: #444d56;
|
||||
vertical-align: middle;
|
||||
background-color: #fafbfc;
|
||||
border: solid 1px #c6cbd1;
|
||||
border-bottom-color: #959da5;
|
||||
border-radius: 3px;
|
||||
box-shadow: inset 0 -1px 0 #959da5;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue