diff --git a/src/lib/licenses.js b/src/lib/licenses.js index 75c4e71f..e500a685 100644 --- a/src/lib/licenses.js +++ b/src/lib/licenses.js @@ -1,5 +1,8 @@ export default { - getLicenses: () => { - return process.env.LICENSES || []; + getLicense: () => { + return process.env.LICENSE; + }, + getThirdPartyLicenses: () => { + return process.env.THIRD_PARTY_LICENSES || []; } }; diff --git a/src/mobile-main.js b/src/mobile-main.js index 49926c0c..3cb9bcfa 100644 --- a/src/mobile-main.js +++ b/src/mobile-main.js @@ -172,7 +172,11 @@ const i18n = new VueI18n(getI18nOptions()); Vue.prototype.$version = version.getVersion(); Vue.prototype.$buildTime = version.getBuildTime(); -Vue.prototype.$licenses = licenses.getLicenses(); + +Vue.prototype.$licenses = { + license: licenses.getLicense(), + thirdPartyLicenses: licenses.getThirdPartyLicenses() +}; Vue.prototype.$constants = { api: api, diff --git a/src/views/mobile/About.vue b/src/views/mobile/About.vue index dde4f30d..da3d23dc 100644 --- a/src/views/mobile/About.vue +++ b/src/views/mobile/About.vue @@ -23,35 +23,19 @@ -

MIT License

-

-

Copyright (c) 2020 MaysWind (i@mayswind.net)

-

-

Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions:

-

-

The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software.

-

-

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE.

-

+

+ + {{ line }} + +


lab also contains additional third party software.
All the third party software included or linked is redistributed under the terms and conditions of their original licenses.

-

+

{{ license.name }}
{{ license.copyright }}
{{ license.url }} @@ -72,8 +56,11 @@ export default { buildTime() { return this.$buildTime; }, - licenses() { - return this.$licenses; + licenseLines() { + return this.$licenses.license.replaceAll(/\r/g, '').split('\n'); + }, + thirdPartyLicenses() { + return this.$licenses.thirdPartyLicenses; } } } diff --git a/vue.config.js b/vue.config.js index 5a88c34a..2b5932a1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,8 +1,12 @@ +const fs = require('fs'); + const GitRevisionPlugin = require('git-revision-webpack-plugin'); const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); const pkgFile = require('./package.json'); -const licenseFile = require('./third-patry-licenses.json'); +const thirdPartyLicenseFile = require('./third-patry-licenses.json'); + +const licenseFile = fs.readFileSync('./LICENSE', 'UTF-8'); module.exports = { pages: { @@ -60,7 +64,8 @@ module.exports = { definitions[0]['process.env']['VERSION'] = JSON.stringify(pkgFile.version); definitions[0]['process.env']['COMMIT_HASH'] = JSON.stringify(gitRevisionPlugin.commithash()); definitions[0]['process.env']['BUILD_UNIXTIME'] = JSON.stringify(parseInt((new Date().getTime() / 1000).toString())); - definitions[0]['process.env']['LICENSES'] = JSON.stringify(licenseFile); + definitions[0]['process.env']['LICENSE'] = JSON.stringify(licenseFile.trim()); + definitions[0]['process.env']['THIRD_PARTY_LICENSES'] = JSON.stringify(thirdPartyLicenseFile); return definitions; });