Skip to content

Commit

Permalink
v0.8.2
Browse files Browse the repository at this point in the history
* code reorganize
* removed comments
  • Loading branch information
countnazgul committed Nov 24, 2015
1 parent a012784 commit 6c9de63
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 26 deletions.
4 changes: 2 additions & 2 deletions backup-and-restore.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="../../resources/autogenerated/qlikui.css"> -->
<!-- <link rel="stylesheet" href="../../resources/assets/client/client.css" media="all"> -->
<link rel="stylesheet" href="backup-and-restore.css">
<link rel="stylesheet" href="jquery.dataTables.min.css">
<link rel="stylesheet" href="css/backup-and-restore.css">
<link rel="stylesheet" href="css/jquery.dataTables.min.css">
<script src="../../resources/assets/external/requirejs/require.js"></script>
</head>

Expand Down
31 changes: 10 additions & 21 deletions backup-and-restore.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ var me = {
require.config({
baseUrl: me.baseurl,
paths: {
qsocks: 'qsocks.bundle',
serializeApp: 'serialize.bundle',
dataTables: 'jquery.dataTables'
qsocks: 'js/qsocks.bundle',
serializeApp: 'js/serialize.bundle',
dataTables: 'js/jquery.dataTables'
}
});

Expand All @@ -28,10 +28,8 @@ require(['jquery', 'qsocks', 'serializeApp', 'dataTables'], function ($, qsocks,
var appInfos = [];
var backupInfos = [];

var backupContent;
var loadScript, properties;
var backupContent, loadScript, properties;

var selectedApp;
var status = {
forUpdate: [],
forDelete: [],
Expand Down Expand Up @@ -61,21 +59,16 @@ require(['jquery', 'qsocks', 'serializeApp', 'dataTables'], function ($, qsocks,
return main.app.getAllInfos()
})
.then(function (info) {
// console.log( info )
// for( var i = 0; i < info.qInfos.length; i++ ) {
// console.log( info.qInfos[i].qType )
// }

appInfos = info;
main.app.getConnections().then(function (connections) {
// console.log(appInfos)
for (var i = 0; i < connections.length; i++) {
appInfos.qInfos.push({
qId: connections[i].qId,
qType: connections[i].qType
})
}
// console.log(appInfos);

$('#json').prop('disabled', false);
$('#loadingImg').css('visibility', 'hidden');
$('#serialize').prop('disabled', false);
Expand Down Expand Up @@ -151,7 +144,10 @@ require(['jquery', 'qsocks', 'serializeApp', 'dataTables'], function ($, qsocks,
if (present == true) {
status.forUpdate.push(d)
} else {
status.forDelete.push(appInfos.qInfos[i])

if( appInfos.qInfos[i].qType != 'folder' && appInfos.qInfos[i].qType != 'internet' && appInfos.qInfos[i].qType != 'ODBC' && appInfos.qInfos[i].qType != 'OLEDB' ) {
status.forDelete.push(appInfos.qInfos[i])
}
}
}

Expand Down Expand Up @@ -276,7 +272,7 @@ require(['jquery', 'qsocks', 'serializeApp', 'dataTables'], function ($, qsocks,
// return console.log(error)
// });
// }
else if (d.data.qProperty || d.info.qType != 'folder' || d.info.qType != 'internet' || d.info.qType != 'ODBC' || d.info.qType != 'OLEDB') {
else if (d.data.qProperty && d.info.qType != 'folder' && d.info.qType != 'internet' && d.info.qType != 'ODBC' && d.info.qType != 'OLEDB') {
return main.app.getObject(d.info.qId).then(function (obj) {
return obj.setFullPropertyTree(d.data).then(function (msg) {
return importData.push([d.info.qType, d.data.qProperty.qMetaDef.title, d.info.qId, 'modify']);
Expand Down Expand Up @@ -334,17 +330,11 @@ require(['jquery', 'qsocks', 'serializeApp', 'dataTables'], function ($, qsocks,


deleteObjects().then(function () {
// console.log('all deleted')
insertObjects().then(function () {
// console.log('all inserted')
updateObjects().then(function () {
// console.log('all updated')
setScript().then(function () {
// console.log('Load Script altered');
setAppProperties().then(function () {
// console.log('App properties updated');
main.app.doSave().then(function () {
// console.log('Saved');
GenerateTable();
$('#loadingImg').css('visibility', 'hidden');
})
Expand Down Expand Up @@ -376,7 +366,6 @@ require(['jquery', 'qsocks', 'serializeApp', 'dataTables'], function ($, qsocks,
$('#loadingImg').css('visibility', 'hidden');
$('#open').prop('disabled', false);
})
// }

function GenerateTable() {
var t = $('#resultTable').DataTable();
Expand Down
4 changes: 2 additions & 2 deletions backup-and-restore.qext
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"type": "mashup",
"name": "Backup and Restore",
"version": "0.8.1",
"version": "0.8.2",
"description": "Bachup and restore QS app",
"preview": "preview.png",
"preview": "images/preview.png",
"homepage": "https://github.com/countnazgul/QS-backup-and-restore-app",
"author": "[email protected]",
"keywords": "qlik-sense, mashup",
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions css/jquery.dataTables.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes
Loading

0 comments on commit 6c9de63

Please sign in to comment.