Add wellknown dialog
This commit is contained in:
@@ -130,24 +130,6 @@ async function onSubmit() {
|
||||
client_email: gcdnsClientEmail.value,
|
||||
private_key: gcdnsPrivateKey.value
|
||||
};
|
||||
|
||||
// TODO
|
||||
// try {
|
||||
// var serviceAccountKey = JSON.parse($scope.domainConfigure.gcdnsKey.content);
|
||||
// config.projectId = serviceAccountKey.project_id;
|
||||
// config.credentials = {
|
||||
// client_email: serviceAccountKey.client_email,
|
||||
// private_key: serviceAccountKey.private_key
|
||||
// };
|
||||
|
||||
// if (!config.projectId || !config.credentials || !config.credentials.client_email || !config.credentials.private_key) {
|
||||
// throw new Error('One or more fields are missing in the JSON');
|
||||
// }
|
||||
// } catch (e) {
|
||||
// $scope.domainConfigure.error = 'Cannot parse Google Service Account Key: ' + e.message;
|
||||
// $scope.domainConfigure.busy = false;
|
||||
// return;
|
||||
// }
|
||||
} else if (provider.value === 'digitalocean') {
|
||||
config.token = digitalOceanToken.value;
|
||||
} else if (provider.value === 'linode') {
|
||||
@@ -217,16 +199,13 @@ async function onSubmit() {
|
||||
|
||||
emit('success');
|
||||
dialog.value.close();
|
||||
busy.value = false;
|
||||
}
|
||||
|
||||
function onGcdnsFileInputChange(event) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = function (result) {
|
||||
if (!result.target || !result.target.result) return console.error('Unable to read local file');
|
||||
console.log(result.target.result);
|
||||
const serviceAccount = JSON.parse(result.target.result);
|
||||
console.log(serviceAccount)
|
||||
gcdnsProjectId.value = serviceAccount.project_id;
|
||||
gcdnsClientEmail.value = serviceAccount.client_email;
|
||||
gcdnsPrivateKey.value = serviceAccount.private_key;
|
||||
@@ -236,8 +215,6 @@ function onGcdnsFileInputChange(event) {
|
||||
|
||||
defineExpose({
|
||||
open(d) {
|
||||
console.log(d);
|
||||
|
||||
d = d || { config: {}, tlsConfig: {}};
|
||||
|
||||
busy.value = false;
|
||||
@@ -253,19 +230,6 @@ defineExpose({
|
||||
gcdnsClientEmail.value = (d.provider === 'gcdns' && d.config?.credentials.client_email) || '';
|
||||
gcdnsPrivateKey.value = (d.provider === 'gcdns' && d.config?.credentials.private_key) || '';
|
||||
|
||||
// TODO
|
||||
// $scope.domainConfigure.gcdnsKey.keyFileName = '';
|
||||
// $scope.domainConfigure.gcdnsKey.content = '';
|
||||
// if (domain.provider === 'gcdns') {
|
||||
// $scope.domainConfigure.gcdnsKey.keyFileName = domain.config.credentials && domain.config.credentials.client_email;
|
||||
|
||||
// $scope.domainConfigure.gcdnsKey.content = JSON.stringify({
|
||||
// project_id: domain.config.projectId,
|
||||
// client_email: domain.config.credentials.client_email,
|
||||
// private_key: domain.config.credentials.private_key
|
||||
// });
|
||||
// }
|
||||
|
||||
accessKeyId.value = (d.provider === 'route53' && d.config.accessKeyId) || '';
|
||||
secretAccessKey.value = (d.provider === 'route53' && d.config.secretAccessKey) || '';
|
||||
digitalOceanToken.value = (d.provider === 'digitalocean' && d.config.token) || '';
|
||||
|
||||
Reference in New Issue
Block a user