mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
Update the ui-updater code to download from invoiceshelf's site
This commit is contained in:
@@ -16,11 +16,7 @@ class Updater
|
||||
public static function checkForUpdate($installed_version)
|
||||
{
|
||||
$data = null;
|
||||
if (env('APP_ENV') === 'development' || env('APP_ENV') === 'local') {
|
||||
$url = 'downloads/check/latest/'.$installed_version.'?type=update&is_dev=1';
|
||||
} else {
|
||||
$url = 'downloads/check/latest/'.$installed_version.'?type=update';
|
||||
}
|
||||
$url = 'releases/update-check/'.$installed_version;
|
||||
|
||||
$response = static::getRemote($url, ['timeout' => 100, 'track_redirects' => true]);
|
||||
|
||||
@@ -30,14 +26,13 @@ class Updater
|
||||
|
||||
$data = json_decode($data);
|
||||
|
||||
if ($data->success && $data->version && property_exists($data->version, 'extensions')) {
|
||||
$extensions = $data->version->extensions;
|
||||
$extensionData = [];
|
||||
foreach (json_decode($extensions) as $extension) {
|
||||
$extensionData[$extension] = phpversion($extension) ? true : false;
|
||||
if ($data->success && $data->release && property_exists($data->release, 'extensions')) {
|
||||
$extensions = [];
|
||||
foreach($data->release->extensions as $extension) {
|
||||
$extensions[$extension] = phpversion($extension) !== false;
|
||||
}
|
||||
$extensionData['php'.'('.$data->version->minimum_php_version.')'] = version_compare(phpversion(), $data->version->minimum_php_version, '>=');
|
||||
$data->version->extensions = $extensionData;
|
||||
$extensions['php'.'('.$data->release->min_php_version.')'] = version_compare(phpversion(), $data->release->min_php_version, '>=');
|
||||
$data->release->extensions = $extensions;
|
||||
}
|
||||
|
||||
return $data;
|
||||
@@ -48,12 +43,7 @@ class Updater
|
||||
$data = null;
|
||||
$path = null;
|
||||
|
||||
if (env('APP_ENV') === 'development') {
|
||||
$url = 'downloads/file/'.$new_version.'?type=update&is_dev=1&is_cmd='.$is_cmd;
|
||||
} else {
|
||||
$url = 'downloads/file/'.$new_version.'?type=update&is_cmd='.$is_cmd;
|
||||
}
|
||||
|
||||
$url = 'releases/download/'.$new_version.'.zip';
|
||||
$response = static::getRemote($url, ['timeout' => 100, 'track_redirects' => true]);
|
||||
|
||||
// Exception
|
||||
|
||||
@@ -17,7 +17,7 @@ return [
|
||||
/*
|
||||
* Minimum php version.
|
||||
*/
|
||||
'min_php_version' => '7.4.0',
|
||||
'min_php_version' => '8.1.0',
|
||||
|
||||
/*
|
||||
* Minimum mysql version.
|
||||
|
||||
@@ -89,16 +89,32 @@
|
||||
class="
|
||||
pl-5
|
||||
mt-4
|
||||
mb-8
|
||||
mb-2
|
||||
text-sm
|
||||
leading-snug
|
||||
text-gray-500
|
||||
update-description
|
||||
"
|
||||
style="white-space: pre-wrap; max-width: 480px"
|
||||
v-if="description"
|
||||
v-html="description"
|
||||
></div>
|
||||
|
||||
<div
|
||||
class="
|
||||
pl-5
|
||||
mt-2
|
||||
mb-8
|
||||
text-sm
|
||||
leading-snug
|
||||
text-gray-500
|
||||
update-changelog
|
||||
"
|
||||
style="white-space: pre-wrap; max-width: 480px"
|
||||
v-if="changelog"
|
||||
v-html="changelog"
|
||||
></div>
|
||||
|
||||
<label class="text-sm not-italic font-medium input-label">
|
||||
{{ $t('settings.update_app.requirements') }}
|
||||
</label>
|
||||
@@ -198,6 +214,7 @@ const exchangeRateStore = useExchangeRateStore()
|
||||
let isUpdateAvailable = ref(false)
|
||||
let isCheckingforUpdate = ref(false)
|
||||
let description = ref('')
|
||||
let changelog = ref('');
|
||||
let currentVersion = ref('')
|
||||
let requiredExtentions = ref(null)
|
||||
let deletedFiles = ref(null)
|
||||
@@ -321,6 +338,7 @@ async function checkUpdate() {
|
||||
updateData.isMinor = response.data.is_minor
|
||||
updateData.version = response.data.release.version
|
||||
description.value = response.data.release.description
|
||||
changelog.value = response.data.release.changelog
|
||||
requiredExtentions.value = response.data.release.extensions
|
||||
isUpdateAvailable.value = true
|
||||
minPhpVesrion.value = response.data.release.min_php_version
|
||||
@@ -421,11 +439,12 @@ function getStatus(step) {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.update-description ul {
|
||||
list-style: disc !important;
|
||||
.update-changelog ul {
|
||||
list-style: disc!important;
|
||||
margin-left: 30px;
|
||||
}
|
||||
|
||||
.update-description li {
|
||||
.update-changelog li {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user