|
|
|
@ -43,7 +43,8 @@
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<SiteSettings ref="site_settings" |
|
|
|
|
@save="saveSite()" @change="site_rec = $event" @change-constructor="constructor_params = $event" |
|
|
|
|
@save="saveSite()" @save-constructor="saveSiteConstr()" |
|
|
|
|
@change="site_rec = $event" @change-constructor="constructor_params = $event" |
|
|
|
|
:site-changed="siteChanged" :signing-site="signingSite"/> |
|
|
|
|
</div> |
|
|
|
|
<div v-else> |
|
|
|
@ -63,10 +64,10 @@
|
|
|
|
|
import DarkLayout from "../components/DarkLayout.vue"; |
|
|
|
|
import DomainBar from "../components/DomainBar.vue"; |
|
|
|
|
import RotateSquare2 from "../components/RotateSquare2.vue"; |
|
|
|
|
import {get_domain_result, get_records, SiteConstructorParams} from "../result"; |
|
|
|
|
import {get_constr_params, get_domain_result, get_records, SiteConstructorParams} from "../result"; |
|
|
|
|
import {convertAddress} from "../utils"; |
|
|
|
|
import contenteditable from 'vue-contenteditable'; |
|
|
|
|
import {call_api} from "../api"; |
|
|
|
|
import {call_api, call_api_post, config} from "../api"; |
|
|
|
|
import Socket from "../components/Socket.vue"; |
|
|
|
|
import SiteSettings from "../components/SiteSettings.vue"; |
|
|
|
|
|
|
|
|
@ -96,12 +97,18 @@ export default {
|
|
|
|
|
setInterval(() => get_domain_result(this.domain, this.$store.getters.address).then(r => { |
|
|
|
|
this.result = Object.assign({}, r); |
|
|
|
|
if (this.isMine) { |
|
|
|
|
get_constr_params(this.domain).then(r => { |
|
|
|
|
this.constructor_params = r; |
|
|
|
|
this.saved_constructor_params = r; |
|
|
|
|
this.updSettingsComponent(); |
|
|
|
|
}); |
|
|
|
|
get_records(r.nft_info.address).then(r => { |
|
|
|
|
this.records = r; |
|
|
|
|
// this.timer = setTimeout(this.updRecords, 10000); |
|
|
|
|
this.updSettingsComponent() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}), 7000); |
|
|
|
|
}), 10000); |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
core_domain() { |
|
|
|
@ -128,7 +135,11 @@ export default {
|
|
|
|
|
return this.records && this.wallet_rec !== this.records.wallet; |
|
|
|
|
}, |
|
|
|
|
siteChanged() { |
|
|
|
|
return this.records && this.site_rec !== this.records.site; |
|
|
|
|
let constr_change = false; |
|
|
|
|
if (this.site_rec === config.agorata_adnl) { |
|
|
|
|
constr_change = this.constructor_params.title !== this.saved_constructor_params.title; |
|
|
|
|
} |
|
|
|
|
return this.records && (this.site_rec !== this.records.site || constr_change); |
|
|
|
|
}, |
|
|
|
|
settingsCompLoaded() { |
|
|
|
|
return this.$refs.site_settings !== undefined; |
|
|
|
@ -190,6 +201,12 @@ export default {
|
|
|
|
|
} |
|
|
|
|
this.records.site = this.site_rec; |
|
|
|
|
}, |
|
|
|
|
async saveSiteConstr() { |
|
|
|
|
await this.saveSite(); |
|
|
|
|
await call_api_post('set-site-data', this.constructor_params); |
|
|
|
|
this.saved_constructor_params = this.constructor_params; |
|
|
|
|
this.updSettingsComponent(); |
|
|
|
|
}, |
|
|
|
|
updRecords() { |
|
|
|
|
get_records(this.result.nft_info.address).then(r => { |
|
|
|
|
if (this.records.wallet !== r.wallet || this.records.site !== r.site) { |
|
|
|
@ -219,6 +236,11 @@ export default {
|
|
|
|
|
if (!this.loading && this.settingsCompLoaded) { |
|
|
|
|
this.updSettingsComponent(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
loading () { |
|
|
|
|
if (!this.loading && this.settingsCompLoaded) { |
|
|
|
|
this.updSettingsComponent(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|