def id_settings(id): form = AddForm() account = get_accounts(id) if form.validate_on_submit(): if form.delete.data: if account_del(id): message = u'删除账号%s :成功!' % account[0]['name'] flash(message, 'success') return redirect(url_for('dial.index')) if form.save.data: if account_update(form, id): flash(u'修改账号配置成功!', 'success') return redirect(url_for('dial.id_settings', id=id)) return render_template('dial/view.html', account=account[0], form=form)
def index(): accounts = get_accounts(status=True) if not accounts: flash(u'目前没有任何VPN 配置,如有需要请添加。', 'info') return render_template('dial/index.html', accounts=accounts)