feat: failover SuperAdmin domains for get_user/get_version
Replace nerkh.gold with adm.montzar/montech/montest and prefer last successful URL. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+28
-6
@@ -325,28 +325,50 @@
|
||||
return window.location.protocol === 'https:' ? 'https:' : 'http:'
|
||||
}
|
||||
|
||||
function resolveTenantDomain() {
|
||||
var host = String(window.location.hostname || '').trim()
|
||||
if (!host || host === 'localhost' || host === '127.0.0.1') {
|
||||
return 'k.montzar.ir'
|
||||
}
|
||||
return host
|
||||
}
|
||||
|
||||
function getSuperAdminBases() {
|
||||
return [
|
||||
'https://adm.montzar.ir',
|
||||
'https://adm.montech.ir',
|
||||
'https://adm.montest.ir'
|
||||
]
|
||||
}
|
||||
|
||||
function getVersionUrls() {
|
||||
var protocol = getProtocol()
|
||||
var domain = encodeURIComponent(resolveTenantDomain())
|
||||
var urls = getSuperAdminBases().map(function (base) {
|
||||
return base + '/get_version?domain=' + domain
|
||||
})
|
||||
|
||||
return [
|
||||
'https://nerkh.gold/get_version',
|
||||
return urls.concat([
|
||||
'https://tablo.talasevin.ir/get_version',
|
||||
'https://abshode-service.montgit.ir/server/get_version',
|
||||
protocol + '//212.23.201.173:8381/get_version',
|
||||
protocol + '//91.212.174.137:4040/server/get_version'
|
||||
]
|
||||
])
|
||||
}
|
||||
|
||||
function getConfigUrls() {
|
||||
var protocol = getProtocol()
|
||||
var domain = encodeURIComponent(resolveTenantDomain())
|
||||
var urls = getSuperAdminBases().map(function (base) {
|
||||
return base + '/get_user?domain=' + domain
|
||||
})
|
||||
|
||||
return [
|
||||
protocol + '//nerkh.gold/get_user',
|
||||
return urls.concat([
|
||||
protocol + '//tablo.talasevin.ir/get_user',
|
||||
protocol + '//abshode-service.montgit.ir/server/get_user',
|
||||
protocol + '//212.23.201.173:8381/get_user',
|
||||
protocol + '//91.212.174.137:4040/server/get_user'
|
||||
]
|
||||
])
|
||||
}
|
||||
|
||||
function sortVersionUrls(urls) {
|
||||
|
||||
Reference in New Issue
Block a user