-
Notifications
You must be signed in to change notification settings - Fork 691
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
335 additions
and
3 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -15,4 +15,5 @@ | |
from .logs import * | ||
from .dir import * | ||
from .redirect import * | ||
from .proxy import * | ||
from .ssl import * |
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,69 @@ | ||
# coding:utf-8 | ||
|
||
# --------------------------------------------------------------------------------- | ||
# MW-Linux面板 | ||
# --------------------------------------------------------------------------------- | ||
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved. | ||
# --------------------------------------------------------------------------------- | ||
# Author: midoks <[email protected]> | ||
# --------------------------------------------------------------------------------- | ||
|
||
import os | ||
import json | ||
|
||
from flask import Blueprint, render_template | ||
from flask import request | ||
|
||
from admin.user_login_check import panel_login_required | ||
|
||
from utils.plugin import plugin as MwPlugin | ||
from utils.site import sites as MwSites | ||
import utils.site as site | ||
import core.mw as mw | ||
import thisdb | ||
|
||
from .site import blueprint | ||
|
||
|
||
# 获取代理列表 | ||
@blueprint.route('/get_proxy_list', endpoint='get_proxy_list', methods=['POST']) | ||
@panel_login_required | ||
def get_proxy_list(): | ||
site_name = request.form.get("siteName", '') | ||
return MwSites.instance().getProxyList(site_name) | ||
|
||
# 获取代理列表 | ||
@blueprint.route('/set_proxy', endpoint='set_proxy', methods=['POST']) | ||
@panel_login_required | ||
def set_proxy(): | ||
site_name = request.form.get('siteName', '') | ||
site_from = request.form.get('from', '') | ||
to = request.form.get('to', '') | ||
host = request.form.get('host', '') | ||
name = request.form.get('name', '') | ||
open_proxy = request.form.get('open_proxy', '') | ||
open_cache = request.form.get('open_cache', '') | ||
cache_time = request.form.get('cache_time', '') | ||
pid = request.form.get('id', '') | ||
return MwSites.instance().setProxy(site_name,site_from,to,host,name,open_proxy, open_cache,cache_time, pid) | ||
|
||
# 获取代理配置 | ||
@blueprint.route('/get_proxy_conf', endpoint='get_proxy_conf', methods=['POST']) | ||
@panel_login_required | ||
def get_proxy_conf(): | ||
site_name = request.form.get("siteName", '') | ||
rid = request.form.get("id", '') | ||
return MwSites.instance().getProxyConf(site_name, rid) | ||
|
||
|
||
# 删除代理配置 | ||
@blueprint.route('/del_proxy', endpoint='del_proxy', methods=['POST']) | ||
@panel_login_required | ||
def del_proxy(): | ||
site_name = request.form.get("siteName", '') | ||
rid = request.form.get("id", '') | ||
return MwSites.instance().delProxy(site_name, rid) | ||
|
||
|
||
|
||
|
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