Skip to content

Commit

Permalink
Deploying to gh-pages from @ 09f0fca 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
foorschtbar committed Oct 5, 2024
1 parent 4264e0b commit ec8ba7f
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 7,820 deletions.
7,817 changes: 4 additions & 7,813 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@babel/polyfill": "^7.11.5",
"@types/prismjs": "^1.26.2",
"apexcharts": "^3.44.0",
"core-js": "^3.32.2",
"core-js": "^3.38.1",
"leaflet": "^1.9.4",
"mutationobserver-shim": "^0.3.7",
"popper.js": "^1.16.1",
Expand Down
76 changes: 71 additions & 5 deletions src/views/Update.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,28 @@
<DownloadStats :items="gitReleases" />
</v-card>
</v-col>
</v-row>
</v-row>
<v-dialog v-model="popupIsActive" max-width="500">
<v-card>
<v-card-title class="headline orange--text">Warning, please note!</v-card-title>
<v-card-text>
<div v-for="restoreWarning in restoreWarnings" :key="restoreWarning">
{{ restoreWarning }}
</div>
<br>
Should the configuration backup still be restored on this PixelIt?
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="orange" text @click="uploadConfigWithWarnings">Ignore and Restore</v-btn>
<v-btn color="green" text @click="popupIsActive = false">Cancel</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-container>
</template>


<script>
import DownloadStats from '../components/DownloadStats';
import ButtonCondition from '../components/ButtonCondition';
Expand All @@ -91,6 +109,9 @@ export default {
firmwareFile: null,
filesystemFile: null,
configFile: null,
popupIsActive: false,
ignoreRestoreWarnings: false,
restoreWarnings: []
};
},
computed: {
Expand Down Expand Up @@ -153,8 +174,13 @@ export default {
e;
}
},
uploadConfigWithWarnings() {
this.popupIsActive=false;
this.ignoreRestoreWarnings= true;
this.uploadConfig();
},
uploadConfig() {
let reader = new FileReader();
const reader = new FileReader();
reader.onload = e => {
const config = JSON.parse(e.target.result);
// Clean Config
Expand All @@ -165,19 +191,59 @@ export default {
this.$socket.close();
}, 3000);
};
reader.readAsText(this.configFile);
const version = this.$store.state.version;
const buildSection = JSON.parse(this.$store.state.telemetryData).buildSection;
const [, fileVersion, ...buildSectionParts] = this.configFile.name.replace(/\(\d+\)/g, '()').replace(/[\s()]+/g, '').replace('.json', '').split('_');
const fileBuildSection = buildSectionParts.join('_');
this.restoreWarnings = [];
if (this.ignoreRestoreWarnings == false){
if (fileVersion == ''){
this.restoreWarnings.push("It could not be determined with which firmware version this backup was created.");
}
else if (version != fileVersion){
this.restoreWarnings.push("Backup firmware version does not match the version of this PixelIt!");
this.restoreWarnings.push(`Backup: ${fileVersion} <--> PixelIt: ${version}`);
}
if (this.restoreWarnings.length > 0){
this.restoreWarnings.push(`---`);
}
if (fileBuildSection == ''){
this.restoreWarnings.push("It could not be determined with which hardware version this backup was created.");
}
else if (buildSection != fileBuildSection){
this.restoreWarnings.push("Backup hardware version does not match the version of this PixelIt!");
this.restoreWarnings.push(`Backup: ${fileBuildSection} <--> PixelIt: ${buildSection}`);
}
if (this.restoreWarnings.length > 0){
this.popupIsActive = true;
return;
}
}
this.ignoreRestoreWarnings = false;
reader.readAsText(this.configFile);
},
async downloadConfig(){
try {
//const jsonData = JSON.stringify(await (await fetch(`http://${this.$pixelitHost}/api/config`)).json());
const jsonData = JSON.stringify(this.$store.state.configData);
const blob = new Blob([jsonData], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = `pixlitConfig_${this.$store.state.version}.json`;
const version = this.$store.state.version;
const buildSection = JSON.parse(this.$store.state.telemetryData).buildSection;
link.download = `pixlitConfig_${version}_${buildSection}.json`;
link.click();
URL.revokeObjectURL(url);
Expand Down
2 changes: 1 addition & 1 deletion webui/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><link rel="icon" href="https://pixelit-project.github.io/PixelIt/webui/favicon.ico"><title>PixelIt WebUI</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link href="https://pixelit-project.github.io/PixelIt/webui/css/app.06728995.css" rel="preload" as="style"><link href="https://pixelit-project.github.io/PixelIt/webui/css/chunk-vendors.11634a2a.css" rel="preload" as="style"><link href="https://pixelit-project.github.io/PixelIt/webui/js/app.9f7a6ed5.js" rel="preload" as="script"><link href="https://pixelit-project.github.io/PixelIt/webui/js/chunk-vendors.97bf3686.js" rel="preload" as="script"><link href="https://pixelit-project.github.io/PixelIt/webui/css/chunk-vendors.11634a2a.css" rel="stylesheet"><link href="https://pixelit-project.github.io/PixelIt/webui/css/app.06728995.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Pixel It the Matrix Display doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="https://pixelit-project.github.io/PixelIt/webui/js/chunk-vendors.97bf3686.js"></script><script src="https://pixelit-project.github.io/PixelIt/webui/js/app.9f7a6ed5.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="mobile-web-app-capable" content="yes"><link rel="icon" href="https://pixelit-project.github.io/PixelIt/webui/favicon.ico"><title>PixelIt WebUI</title><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"><link href="https://pixelit-project.github.io/PixelIt/webui/css/app.06728995.css" rel="preload" as="style"><link href="https://pixelit-project.github.io/PixelIt/webui/css/chunk-vendors.11634a2a.css" rel="preload" as="style"><link href="https://pixelit-project.github.io/PixelIt/webui/js/app.a4f05584.js" rel="preload" as="script"><link href="https://pixelit-project.github.io/PixelIt/webui/js/chunk-vendors.09d0b722.js" rel="preload" as="script"><link href="https://pixelit-project.github.io/PixelIt/webui/css/chunk-vendors.11634a2a.css" rel="stylesheet"><link href="https://pixelit-project.github.io/PixelIt/webui/css/app.06728995.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Pixel It the Matrix Display doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="https://pixelit-project.github.io/PixelIt/webui/js/chunk-vendors.09d0b722.js"></script><script src="https://pixelit-project.github.io/PixelIt/webui/js/app.a4f05584.js"></script></body></html>
2 changes: 2 additions & 0 deletions webui/js/app.a4f05584.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/js/app.a4f05584.js.map

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions webui/js/chunk-vendors.09d0b722.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions webui/js/chunk-vendors.09d0b722.js.map

Large diffs are not rendered by default.

0 comments on commit ec8ba7f

Please sign in to comment.