-
-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(replicate): impl replicate_auth page
- Loading branch information
Showing
13 changed files
with
731 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import store from '@/store' | ||
import request from '@/utils/request' | ||
import axios from 'axios' | ||
|
||
/** | ||
* Get replicated auths | ||
* @returns | ||
*/ | ||
export function getReplicateAuths() { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/replicate/replicate_auth`, | ||
method: 'get' | ||
}) | ||
} | ||
|
||
/** | ||
* Create a replicated auth | ||
* | ||
* @returns | ||
*/ | ||
export function createReplicateAuth(target_appid) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/replicate/replicate_auth`, | ||
method: 'put', | ||
data: { | ||
target_appid | ||
} | ||
}) | ||
} | ||
|
||
/** | ||
* Update a replicated auth | ||
* @returns | ||
*/ | ||
export function updateReplicateAuth(auth_id, status) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/replicate/replicate_auth/${auth_id}`, | ||
method: 'post', | ||
data: { | ||
status | ||
} | ||
}) | ||
} | ||
|
||
/** | ||
* Remove a replicated auth | ||
* @param {string} auth_id | ||
* @returns | ||
*/ | ||
export function deleteReplicateAuth(auth_id) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/replicate/replicate_auth/${auth_id}`, | ||
method: 'delete' | ||
}) | ||
} | ||
|
||
/** | ||
* apply a replicated auth | ||
* @param {string} target_appid | ||
* @param {object} functions | ||
* @param {object} policies | ||
* @returns | ||
*/ | ||
export function applyReplicateAuth({ target_appid, functions, policies }) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/replicate/replicas`, | ||
method: 'put', | ||
data: { | ||
target_appid, | ||
functions, | ||
policies | ||
} | ||
}) | ||
} | ||
|
||
/** | ||
* accept a replicated auth | ||
* @param {string} auth_id | ||
* @returns | ||
*/ | ||
export function acceptReplicateAuth(auth_id) { | ||
const appid = store.state.app.appid | ||
return request({ | ||
url: `/apps/${appid}/replicate/replicas/${auth_id}`, | ||
method: 'put' | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.