diff --git a/src/masks/email_conf.html b/lib/masks/email_conf.html similarity index 100% rename from src/masks/email_conf.html rename to lib/masks/email_conf.html diff --git a/src/masks/email_update.html b/lib/masks/email_update.html similarity index 100% rename from src/masks/email_update.html rename to lib/masks/email_update.html diff --git a/src/Spot.vue b/src/Spot.vue new file mode 100644 index 0000000..9abc790 --- /dev/null +++ b/src/Spot.vue @@ -0,0 +1,67 @@ + + \ No newline at end of file diff --git a/src/components/admin.vue b/src/components/admin.vue new file mode 100644 index 0000000..067ebfe --- /dev/null +++ b/src/components/admin.vue @@ -0,0 +1,231 @@ + + \ No newline at end of file diff --git a/src/components/adminInput.vue b/src/components/adminInput.vue new file mode 100644 index 0000000..cd8e3eb --- /dev/null +++ b/src/components/adminInput.vue @@ -0,0 +1,17 @@ + + \ No newline at end of file diff --git a/src/components/project.vue b/src/components/project.vue new file mode 100644 index 0000000..c3c1ef4 --- /dev/null +++ b/src/components/project.vue @@ -0,0 +1,44 @@ + + + \ No newline at end of file diff --git a/src/components/spotButton.vue b/src/components/spotButton.vue new file mode 100644 index 0000000..987c603 --- /dev/null +++ b/src/components/spotButton.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/src/components/spotIcon.vue b/src/components/spotIcon.vue new file mode 100644 index 0000000..4df4f11 --- /dev/null +++ b/src/components/spotIcon.vue @@ -0,0 +1,17 @@ + + \ No newline at end of file diff --git a/src/masks/admin.html b/src/masks/admin.html deleted file mode 100644 index 38201a3..0000000 --- a/src/masks/admin.html +++ /dev/null @@ -1,71 +0,0 @@ -
- [#]lang:nav_back[#] -

[#]lang:projects[#]

-
- - - - - - - - - - - - - -
[#]lang:id_project[#][#]lang:project[#][#]lang:mode[#][#]lang:code_name[#][#]lang:start[#][#]lang:end[#][#]lang:delete[#]
-
-
-

[#]lang:feeds[#]

-
- - - - - - - - - - - - - - -
[#]lang:id_feed[#][#]lang:ref_feed_id[#][#]lang:id_spot[#][#]lang:id_project[#][#]lang:name[#][#]lang:status[#][#]lang:last_update[#][#]lang:delete[#]
-
-

Spots

-
- - - - - - - - - - -
[#]lang:id_spot[#][#]lang:ref_spot_id[#][#]lang:name[#][#]lang:model[#]
-
-

[#]lang:active_users[#]

-
- - - - - - - - - - - -
[#]lang:id_user[#][#]lang:user_name[#][#]lang:language[#][#]lang:time_zone[#][#]lang:clearance[#]
-
-

[#]lang:toolbox[#]

-
-
-
\ No newline at end of file diff --git a/src/masks/index.html b/src/masks/index.html index e87f33c..d3a757b 100755 --- a/src/masks/index.html +++ b/src/masks/index.html @@ -20,12 +20,12 @@ - Spotty
+ \ No newline at end of file diff --git a/src/scripts/app.js b/src/scripts/app.js index adca7fb..cf16312 100644 --- a/src/scripts/app.js +++ b/src/scripts/app.js @@ -16,21 +16,26 @@ console.log(Logo); //Masks import Spot from './spot.js'; -import Project from './page.project.js'; -import Upload from './page.upload.js'; -import Admin from './page.admin.js'; +//import Project from './page.project.js'; +//import Upload from './page.upload.js'; +//import Admin from './page.admin.js'; -//const Upload = () => import('@scripts/page.upload.js'); +window.oSpot = new Spot(params); -let oSpot = new Spot(params); +//let oProject = new Project(oSpot); +//oSpot.addPage('project', oProject); -let oProject = new Project(oSpot); -oSpot.addPage('project', oProject); +//let oUpload = new Upload(oSpot); +//oSpot.addPage('upload', oUpload); -let oUpload = new Upload(oSpot); -oSpot.addPage('upload', oUpload); +//let oAdmin = new Admin(oSpot); +//oSpot.addPage('admin', oAdmin); -let oAdmin = new Admin(oSpot); -oSpot.addPage('admin', oAdmin); +//$(() => {oSpot.init();}); -$(() => {oSpot.init();}); \ No newline at end of file +import { createApp } from 'vue'; +import SpotVue from '../Spot.vue'; + +const oSpotVue = createApp(SpotVue); +oSpotVue.provide('spot', window.oSpot); +oSpotVue.mount('#main'); \ No newline at end of file diff --git a/src/scripts/spot.js b/src/scripts/spot.js index 4812d83..840c2a8 100755 --- a/src/scripts/spot.js +++ b/src/scripts/spot.js @@ -75,7 +75,7 @@ export default class Spot { if(oData.desc.substr(0, this.consts.lang_prefix.length)==this.consts.lang_prefix) oData.desc = this.lang(oData.desc.substr(5)); if(oData.result==this.consts.error) fOnError(oData.desc); - else fOnSuccess(oData.data, oData.desc); + else if(fOnSuccess) fOnSuccess(oData.data, oData.desc); }) .fail((jqXHR, textStatus, errorThrown) => { fonProgress('fail'); @@ -83,6 +83,32 @@ export default class Spot { }); } + async get2(sAction, oVars) { + oVars = oVars || {}; + oVars['a'] = sAction; + oVars['t'] = this.consts.timezone; + + let oUrl = new URL(this.consts.server+this.consts.process_page); + oUrl.search = new URLSearchParams(oVars).toString(); + + try { + let oUrl = new URL(this.consts.server+this.consts.process_page); + oUrl.search = new URLSearchParams(oVars).toString(); + const oRequest = await fetch(oUrl, {method: 'GET', /*body: JSON.stringify(oVars),*/ headers: {"Content-Type": "application/json"}}); + if(!oRequest.ok) throw new Error('Error HTTP '+oRequest.status+': '+oRequest.statusText); + else { + let oResponse = await oRequest.json(); + if(oResponse.desc.substr(0, this.consts.lang_prefix.length)==this.consts.lang_prefix) oResponse.desc = this.lang(oData.desc.substr(this.consts.lang_prefix.length)); + + if(oResponse.result == this.consts.error) return Promise.reject(oResponse.desc); + else return Promise.resolve(oResponse.data, oResponse.desc); + } + } + catch(oError) { + throw oError; + } + } + lang(sKey, asParams) { asParams = asParams || []; if(typeof asParams == 'string') asParams = [asParams]; @@ -176,6 +202,7 @@ export default class Spot { asContext = asContext || {}; let sPage = this.vars('page'); if(this.pages[sPage].onFeedback) this.pages[sPage].onFeedback(sType, sMsg, asContext); + else console.log({type:sType, msg:sMsg, context:asContext}); } onKeydown(oEvent) {